Test driven development

Test driven development (TDD) is a popular approach for writing unit tests.

With this approach, we write a test first, see it fail, then write production code to make the test pass.

Typically, we repeat the steps below in that order

  1. take a small requirement
  2. write failing test for the requirement
  3. write production code to make test pass
  4. refactor

It is claimed that TDD helps to write code that simple, flexible and just enough to satisfy the requirement.

comments powered by Disqus