3 ms·
Doing both is good. Integration tests tells you that something is broken. Unit tests tells you where it broke.
by ahofmann 3y ago
Doing both is good. Integration tests tells you that something is broken. Unit tests tells you where it broke.
- The_Colonel 3y agoUnit tests (which have to mock dependencies) have a very bad signal-to-noise ratio. Most of their breakages are caused by forgetting to reflect the latest implementation details in the test code (like mocking new dependencies). I write unit tests only if the logic is completely encapsulated by the "unit". The less you need to mock, the higher value the tests bring. That's one of the reasons I prefer to work on monoliths, it's much easier to test almost-end-to-end.