38 ms·
The issue is that too often they fail not because the code was incorrect, but because it changed and the test/mocks are incorrect. Higher level tests stay valid
by astrange 4y ago
The issue is that too often they fail not because the code was incorrect, but because it changed and the test/mocks are incorrect. Higher level tests stay valid because they’re things like “none of the command line args should crash”.
Besides that, sometimes code just doesn’t change (say a basic math library). Then you’re mostly testing your compiler, which is useful but an intentional approach would be better.
- gherkinnn 4y agoI agree with your first point. But there’s somebody out there telling us that a true unit test has no mocks. Or something. Unit tests do come in handy when building a maths library.l or similar. Not in terms of catching a regression, but to help build it in the first place. One of the few places where TDD might actually be helpful.