|
|
|
|
|
by grosjona
2869 days ago
|
|
I would only write unit tests for very complex classes whose logic cannot be simplified into something readable.
Personally, I rarely introduce bugs at the unit level, almost 100% of my bugs are related to how classes/functions interact with each other - I find that bugs at the unit level are easy to track down (and often they will be caught by integration tests anyway).
I prefer integration tests because they traverse more code paths and don't need to be updated so often.
The main complaints I hear about integration tests is that they're slow and brittle but this is only the case if they rely on external microservices (or external data stores) and if test cases aren't properly isolated from each other. I use integration test cases as part of my development flow. |
|