This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/testing-vanity-metrics
I’d like to know why do you guys think that I have to have many unit tests but a few integration tests. Wouldn’t it be better to cover all scenarios with integration tests as well as unit tests?
btw, good video.
End-to-end integration tests tend to be slow and difficult to maintain. You can run hundreds of units tests per second, but a large suite of integration tests can take hours to run.
The longer your test suite takes to run, the less often you’re inclined to run it, which discourages continual refactoring and improvement.
There is a small chance that an integration test may catch a bug not covered by unit tests, but this quite rare.
Debris coverage a vanity metric?