The benefits of Test Driven Development (TDD)

The objective of Test Driven Development is to guide the writing of the code by the tests.

After discussions with several developers, i had negative feedback about unit tests. So i decided to write this article to shed light on the benefit of unit tests and talk about unit tests in better: Test Driven Development (TDD).

Feedback about unit tests

  • Unit tests take a lot of time (delay constraints)
  • Unit tests are very heavy and difficult
  • Unit tests are very expensive (budget constraints)
  • Unit tests have no value for customer. They are only for developers

Benefits of doing unit tests

The benefits of unit tests are numerous:

  • They allow developers to get a quick feedback on the status of the application before pushing a code into production
  • They allow developers to prevent the regressions
  • The allow developers to maintain application serenely and confidently
  • They drastically reduce the number of bugs
  • They help reduce costs in the long run
  • They are a documentation of the code


Imagine that you consult two construction companies to build your house:

  • Company 1: proposes to build your house first then to make the plan of the house from the realization
  • Company 2: proposes to make the plan first and then follow this plan to build the house

Arguments of both companies:

  • Company 1: quickly build the house, reduce the cost of realization, the plan is difficult to do, in any case it is the house that matters to client and not the plan
  • Company 2: build the house in the strong, reliable ans sustainable way with a solid foundation that can facilitate future changes

Which of these two companies will you choose?

Unit tests done in Test Driven Development are for the application that is the plan for the house.

Unit tests done in Test Driven Development represent the plan to follow for the realization of an application.

Benefits of Test Driven Development

When we do ordinary unit tests, we write our code and then the tests to secure this code.
So if this code is poorly done then naturally the unit tests will not be reliable.

By reversing the concept:

By doing Test Driven Development, the code of the application will be used to pass the test and this to make sure the tests work well and the product scenarios work well.

The Test Driven Development permit to pose the problem to be solve and then to solve the problem, contrary to ordinary unit tests which fist pose the solution and then the problem to be solve.

Others benefits to do the Test Driven Development:

  • Provides the benefits of ordinary unit tests
  • Provides maximum coverage of unit tests
  • Provides reliable unit tests
  • Ensures that the product (functional) scenarios work well
  • Facilitates the respect of the pyramid of tests
  • Allows to have a naturally testable code
  • Increases code control and facilitate the maintainability

Leave a Reply

Your email address will not be published. Required fields are marked *