I was looking at PHPUnit
- which is a unit testing framework.
Taking a look at some tutorials, I came across a term called TDD
.
What is TDD
? And what is his use in the day-to-day programming?
I was looking at PHPUnit
- which is a unit testing framework.
Taking a look at some tutorials, I came across a term called TDD
.
What is TDD
? And what is his use in the day-to-day programming?
TDD stands for Test Driven Development, it is a methodology in which test codes are written first even before any 'production code' exists, this includes defining a class or method.
Over the years it has been realized that the tests were neglected were left only at the end of the development cycle, which caused injury and much rework, the idea of TDD is that your code fails as quickly as possible because it is easier of correcting and its cost is low.
TDD comes from "Test Driven Development" which in Portuguese means "Development Guided by Tests".
It requires the creation of an automatic test, before making the code, so when it is ready, you make sure it works.
Some benefits of developing with the methodology:
The opposite argument is development time and cost since you would have to do the tests. Anyway this part is controversial because it is not so easy to prove both sides and TDD advocates say that the total development time ends up being less.