Re:Unit Testing is Overrated (2020)
by Deukhoofd on Thursday April 07, 2022 @07:12AM
(#30942989)
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.
[ Parent
| on HN ]
Re:Unit Testing is Overrated (2020)
by catlifeonmars on Thursday April 07, 2022 @11:09AM
(#30945453)
Ideally, 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.