3 ms·
I agree in general, but think that unit testing has a place even in small scale settings. Clearly chasing 100% coverage is dumb, but if you have tricky business
by ch4s3 4y ago
I agree in general, but think that unit testing has a place even in small scale settings. Clearly chasing 100% coverage is dumb, but if you have tricky business logic you should clearly unit test it and automate running the tests. The cost/benefit ratio seems super obvious to me on this.
- ansgri 4y agoUnit testing is an obvious choice for something like a parser or algorithm library, for common business logic integration tests provide most of the benefit, and then some. Also, unit tests slow down development as they need to be refactored alongside code, while integration tests can use a more stable interface. This is typically true at smaller scale, one smallish team; when build and test times or team isolation becomes a concern, it's time to rethink your testing strategy.
- BizarreByte 4y agoThere’s definitely a value to unit tests in the right situations. When I start a new project I don’t aim for any specific coverage percent, I just write them where I know for sure I need them. Right now I’m working on some reasonably complex reclusive logic in a personal project and unit testing that has saved an unbelievable amount of time when I inevitably mess something up.