3 ms·
Coverage is the best example of Goodhart's Law, never focus on it. Integration tests are typically best bang for buck: https://kentcdodds.com/blog/write-tests
by hbrn 4y ago
Coverage is the best example of Goodhart's Law, never focus on it.
Integration tests are typically best bang for buck: https://kentcdodds.com/blog/write-tests https://kentcdodds.com/blog/write-tests
Once manual testing starts causing noticeable pain, you can start automating some of it. This may very well be beyond $10-100M in valuation.
A lot of people say unit tests give them confidence, but that's a delusion. Losing confidence in your code means you have outgrown your architecture. However, you can temporarily address it with more tests, because addressing architecture issues takes some time. The secret is to write as little tests as possible to bring confidence back to acceptable level.
Don't spend more than 10% time on tests.
Don't let junior engineers write tests.
- usgroup 4y agoI don’t think this is correct. I write scientific computing code in Rust at the moment for example — I write unit tests to make sure it actually works. Being confident my stuff works without unit tests would require me to write unit tests and then delete them.
- hbrn 4y agoI very much agree with James Coplien approach to unit tests: - Keep unit tests that test key algorithms for which there is a broad, formal, independent oracle of correctness, and for which there is ascribable business value. Though I'd say that for low-level code (without dependencies) there's basically no difference between unit/integration/e2e tests. They are just tests. The only difference I found is that with unit tests people will also test implementation details. So it's still better to have integration test mindset even when your only option is unit tests.