TDD
Last modified: July 14, 2008
This page refers to Test-Driven Development (TDD), a computer programming technique that involves repeatedly first writing a test case and then implementing only the code necessary to pass the test. The goal of test-driven development is to achieve rapid feedback and it became famous in the early 2000s as an aspect of Extreme Programming. Practitioners emphasize that test-driven development is a method of designing software, not just a method of testing.
TDD requires that an automated unit test, that defines the requirements of the code, is written before each aspect of the code itself. These tests contain assertions that are either true or false. Running the tests gives rapid confirmation of correct behaviour as the code evolves and is refactored (read: rewrited to improve structure or readability).
Several testing frameworks exist: JUnit, NUnit, PHPUnit, CPPUnit, ..?
Test-Driven Development Cycle
1. Add a test. 2. Run all tests and see new one fail. 3. Write some code. 4. Run the automated tests and see them succeed. 5. Refactor to remove duplication.



Recent Comments