4 ms·
I’m really glad to read that. I never understood the whole religion around unit tests. Integration tests are often far easier to write and far more valuable.
by Eikon 7y ago
I’m really glad to read that.
I never understood the whole religion around unit tests. Integration tests are often far easier to write and far more valuable.
Like you said, unit tests are really nice when testing for a known, expected output.
Unit tests that are effectively testing mocks and crazy stubs because your method has side effects? Not for me.
- coliveira 7y agoIt is easy to explain: unit tests give a documented proof that you care about code robustness. It is used more for social and psychological effect than for its advantages. In fact, outside a few domains, unit tests make it harder to evolve software because the more tests you write, the harder it is to make changes that move the design in a different direction. This is, by the way, my main problem with verbose techniques of programming: the more you have to code, the harder to make needed changes.
- gbacon 7y agoIntegration tests can be easier to write, are necessary, but can also be much slower to run. Yes, it’s possible to write bad unit tests; the same is true of integration tests. You need both unit tests and integration tests.