DEV Community

Discussion on: IF a develop team's people number is only 2,is it necessary to do unit test before publish?

Collapse
 
peledzohar profile image
Zohar Peled

Is it necessary?
No. Writing tests isn't necessary.
In fact, in over 20 years of coding for a living, I've only been writing tests for the last two years. Guess what? there's least one of my software products that was written over 10 years ago still in a daily use by the customer. True, last time I've had to make a change in that code I hated every second of it, but that's just because it's an old code written in VB.Net for .Net framework 1.1.

Is it a good idea? Hell yes.
I remember at least 10 different occasions where having automated tests saved me a lot of time and effort within the last 2 years, and I can't even count the number of times that tests saved me from uploading a buggy program to the staging environment.

I'm not saying 100% coverage is a must have in every project, but you should have at least the most sensitive / error prone / likely to change parts of your code covered in automated tests.

Note I'm using the term automated tests because unit tests alone are nice but not enough. Integration tests are just as important, sometimes even more important than unit tests.