3 ms·
"Unit tests measure the quality of material used to build the application. Functional tests measure the strength of the application structure. The overall quali
by geebee 17y ago
"Unit tests measure the quality of material used to build the application. Functional tests measure the strength of the application structure. The overall quality of the application is dependent on both."
I understand what the author is getting at with the bridge analogy, but I think it's best to avoid analogies, especially in contentious arguments. Otherwise, we'll end up in a battle of dueling analogies about bridges and code - with each analogy containing the key assumption that either validates or refutes the argument.
I'm not glad that there's "negativity about unit testing" either, but I am glad that some people are starting to subject the 99% unit test coverage goal to a cost/benefit analysis - and, yes, concluding at times that it isn't worth it.
- roder 17y agoIt's interesting to think about the Cost Benefit analysis of testing. I can say from my own personal experience that test driven development actually speeds up my results and it seems that I get a test for free.
- geebee 17y agoI 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.