4 ms·
I think the focus that everything should be testable is a wrong one, but almost every codebase has functionality that can be easily unit tested without major re
by Deukhoofd 5y ago
I think the focus that everything should be testable is a wrong one, but almost every codebase has functionality that can be easily unit tested without major refactors. For everything else, integration tests can already help a lot.
- catlifeonmars 5y agoIdeally, everything should be testable or replaceable. The non testable parts of your code have network effects on the testability of other parts of the code that are dependent on those parts. This is where dependency injection (e.g via a constructor or function parameters) really shines. I totally agree that if you have to choose (and usually you do, unless you have unlimited time and funding), choose to implement end to end integration tests first.