What is TDD and what is it for? [duplicate]

this question already has answers here : Tests, TDD, Unit Test, QA and similar. What is the difference from the concepts about testing? (2 responses) Closed for 4 years.

Was taking a look at PHPUnit - which is a unit testing framework .

Taking a look at some tutorials, I came across a term called TDD.

What becomes TDD? And what is its usefulness in day-to-day programming?

Author: Wallace Maxters, 2016-02-24

2 answers

TDD stands for Test Driven Development, is a methodology in which test codes are written first before any 'production code' even exists this includes defining a class or method.

Over the years it was noticed that the tests were neglected were left only at the end of the development cycle which generated damage and a lot of rework, the idea of TDD is that its code fails as soon as possible because this is easier to fix and its cost is low.

 3
Author: rray, 2016-02-24 18:52:41

TDD comes from" Test Driven Development "which in English means"Test Driven Development".

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:

  • developers force themselves to understand the need before starting programming.
  • a large number of tests help ensure that all code works well at the end.

The opposite argument is development time and cost, since you would have to do the tests. In any case this part is controversial because it is not so easy to prove both one side and the other and those who defend TDD say that the total development time turns out to be less.

 2
Author: Rodrigo Guiotti, 2016-02-24 19:42:21