Why Unit Testing is important ?
Some people think unit tests is a waste of time. For them you should spend more time developing real code instead of doing unit testing. But I disagree. I am more at ease when unit test are running every day without failure. Indeed know my code works like I want. Personally I am faster to develop code because I am testing incrementally my developement. In my experience my code tend to have less bugs too.
I find that Unit testing has many advantages:
– Gain time when reproducing a problem / testing functionality before integration. Instead of launching the entire application to test your changes, you can just test the small part you did.
– Regression testing. The code is easier to refactor when there is lot of unit tests. If there are big changes in the code the unit test should help us to avoid regression.
Unit test are great, but if they are not run daily it is like they do not exist. That’s why it is very important to have a platform that launches them every day. For example for Java projects Jenkins is a popular platform.