TDD (TEST DRIVEN DEVELOPMENT)❌✔️🔄

José Carlos
2 min readMay 4, 2021

TDD is not something new, but it is now on the rise. I have used it in many projects and I advise you to use it.
Initially our productivity is affected but over time it grows exponentially

Well then what is TDD?

The idea of TDD (Test Driven Development) is to work in cycles and these cycles follow the following order:

• First, write a test that will fail, considering that the code has not yet been implemented;

• Create the code that makes this test pass, that is: implement the functionality in question.

• When the code is implemented and the test is done, refactor the code. Then run the test again.

It is worth mentioning that TDD is not a way of writing a test: it is a methodology for developing and writing code.

TDD cycle

Notice the existence of the three cycles:

● Red: write a small automated test that, when executed, will fail;

● Green: implement code that is sufficient to pass the newly written test;

● Blue: refactor the code in order to improve it, making it more functional and cleaner.

To perform the test on each feature of your code, you will always follow these cycles

--

--