Well, in this article I want to summarize some benefits to delivery our software with TDD. I will try to be as much as objective as possible.
Note: this list will be increased when I remember others benefit later. Please feel free to give some comment to increase or change this list as well.
- Performing TDD, force to deliver a simple, decouple, easier to extend, easier to maintain and to scale design. So, in other words, it mainly helps us to implement in the right way separation of concern and single responsibility principles.
- It reduces the fear of refactoring your code, it allows us to start working in an iterative, incremental and progressive way. So it allow us to increase our quality of the code in a really safe way.
- Keep the focus to build the minimal and fundamental part of the code needed, so in that way, it helps us to don’t have code that really doesn’t need. Because we are working in an incremental way (avoid the common example: “maybe this part of code, will help me in some moment, I will keep it”).
- It gives you instant feedback during we are coding, in a way that helps you to catch error almost immediately. So in a really early stage of our development cycle (more earlier catch error, more cheaper it’s).
- In middle-long term, you velocity to add new features or change existing ones will be faster. “If you want to delivery faster, do it right”
- One of the benefits to TDD, it’s high coverage. As a consequence of that, we will reduce from 40% to 80% fewer bugs in production.
- As much as we perform the Unit test, as a part of a traditional TDD, faster you will code. It’ has a curve, at the beginning you will spend more time in a task, but then, as we gain more experience, working in that way, will realize that you are building much faster than before (It takes years of practices to achieve that but it worth it).
- As we know, the longest part of the life of an application it’s the manteinment part. So our app will be cheaper at mid-long term than working without TDD, because will be less the effort/price to maintain that.
I just want to clarify, that TDD, is more about design way to build our software, to perform our workflow of job, the reason for our problem first. Unit test it’s not as a fundamental part of TDD methodology, it’s just a mechanism that gives us several benefits at their level.