Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 1.41 KB

Benefits.md

File metadata and controls

15 lines (12 loc) · 1.41 KB

Benefits of Unit Testing

Let´s go first through what I think are the main reasons to use unit testing in your solution…

  • Improve the design of implementations. Start coding a feature without giving it a lot of thought to the design is a very common mistake among developers. Using unit testing is going to enforce to think and re-think the design, and if you are using TDD the impact is even bigger.

  • Allows refactoring. Since you already have tests that ensure you that everything is working as expected, you can easily add changes to that code with the certainty that you are not adding any bugs.

  • Add new features without breaking anything. When you are adding a new feature you can run the tests to ensure that you ain’t breaking any other part of the application. There are many more, but this three are already such a big win on any project that for me are deal sealers. but if you are not convinced yet let’s mention a couple more.

  • Tests are good documentation.

  • Tests make developers more confident about their work.

You can say that all their benefits come at a great cost: TIME, but this is completely false. All the time that using unit testing may cost you is going to be small compared to the time they are going to save you later when you are introducing new features or making any refactors. The time spent resolving bugs is going to be drastically smaller than if you are not using unit testing.