3 ms·
I agree - when unit testing is working well for me, it feels "free". I realized I've always been "unit testing", in that my approach has usually been to write
by geebee 17y ago
I agree - when unit testing is working well for me, it feels "free". I realized I've always been "unit testing", in that my approach has usually been to write a bit of code, test it with a short main(), write a bit more, and so on. Unit testing, when it feels natural, is no different. I just keep the tests instead of throwing them out. This is more of a parallel testing approach than a TDD, but it seems to lead to good code coverage.
The part where I start to feel like the benefit isn't worth the cost is when I feel like I'm unit testing a framework rather than my own code.