DEV Community

Discussion on: What are your biggest problems with unit testing?

Collapse
 
alexbunardzic profile image
Alex Bunardzic

Unit testing in software engineering is the equivalent of double-entry practices in accounting. If you hire an accountant and ask them to itemize the invoice they send you, and in the invoice you notice that they are doing the double-entry practice, you are not going to deny the value of entering details twice and refuse to pay them for their work. Because that is a proven practice that works, is practices all over the world, and ensures quality of accounting. Why would building software all of a sudden be exempt from the requirements for quality?

Collapse
 
thinkdigitalsoftware profile image

See I’m not familiar with that practice either. But I think once more experience is gained , the value of testing becomes more apparent. I think it’s hard to remember what it’s like to not see value in something once you do. Thanks for your response!

Thread Thread
 
alexbunardzic profile image
Alex Bunardzic

In simpler terms, writing unit tests first is the equivalent of measuring before you cut. If you hire a contractor and they start measuring before they begin to cut (whatever the task at hand might be), you would look foolish if you start to complain about why are they wasting their time on measuring.

The same applies to software development. No one has a valid argument complaining that you writing a unit test (you measuring before you cut) is a wasted effort. Those arguments simply do not hold water under any circumstances.

Thread Thread
 
thinkdigitalsoftware profile image
ThinkDigitalSoftware

Makes sense.