> Kent C. Dodds claims that integration tests provide the best balance of cost, speed and confidence. I subscribe to that claim. We don’t have empirical evidence showing that this is actually true
And
> There is the claim that making your code unit-testable will improve its quality. Many arguments and some empirical evidence in favor of that claim exist
Why rely on evidence when conjecture an opinion are so much easier?
So here's my own limited evidence to toss on the other pile. Our team has started to unit test everything, 100% coverage. We don't take this approach to testing lightly, it is a holistic approach that includes the code itself, focusing on architectures that enable testing and testability. Doing so has vastly improved code quality in measurable ways.
Code reviews are faster and easier as a starting point. It is easier for another person to understand quickly what each component does and what it is expected to do. Code is composed using small autonomous functional components that are uncompleted and easy to reason about and test. These make debugging easier because they can be isolated to simple components and tests. Bug fixes are faster to implement and test since the test infrastructure is already in place and does not need to be remediated in later.
Yes, we do also write integration tests. They tests the end-to-end scenarios we are designing the system to support. But unit testing is still the primary approach to how we design, while integration provides support by verifying complete scenarios.
However our approach admittedly doesn't have "Lean" in the name, so that's one downside I guess.