TDD, or Test-Driven Development, refers to a style of programming in which three activities are tightly interwoven: coding, testing and design. [2] It can be succinctly described by the following set of rules:
- Write a single (unit) test describing the aspect of the program
- Run the test; it should fail because the program lacks that feature
- Write “just enough” code so that the test passes
- “Refactor” the code
This approach seeks to ensure quality by emphasising and requiring testing to drive the development process.