DEV Community

freecoderzhaoshuai
freecoderzhaoshuai

Posted on

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

Top comments (3)

Collapse
 
itsjzt profile image
Saurabh Sharma • Edited
  • keep atleast some integration test
  • have manual testing in staging
  • have unit test for exported and re-used functions
  • you can always have unit test for only the most used functions if you don't want to spend most of your time in writing time
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.

Collapse
 
galoisgirl profile image
Anna

It's not 2 people. You, you 3 months ago and you 6 months ago are 3 different people. Different coding styles, no memory of what the others have written...