Test Driven Development – TDD

Test Driven Development is a development practice that is also part of XP (eXtreme Programming). At its core, TDD is describes a very short development cycle:

  1. Red: Write a test case that specifies a new requirement (this test will fail until the requirement is implemented)
  2. Green: Write code to implement the requirement and make the test pass
  3. Refactor: Improve the design of the existing code without changing its behavior or fulfilling further requirements (keeping all existing tests green)

This cycle is repeated over and over again to build a system that grows in small increments and can be used for continuous feedback.

TDD can be applied at different levels, such as system units (specifying and testing the design of the system) or higher. Acceptance Test Driven Development is a form of TDD where the test case (step 1) describes an acceptance criteria required by the business. Teams often apply a combination of TDD and ATDD.