Main Page | See live article | Alphabetical index

Test driven development

Acronym - TDD A programming technique heavily emphasized in Extreme Programming. Essentially the technique involves writing your tests first then implementing the code to make them pass. The goal of TDD is to achieve rapid feedback and implements the "illustrate the main line" approach to constructing a program.

In order for TDD to work in practice, the system must be flexible enough to allow for automated unit-testing of code. These tests must also be simple enough to return a simple true or false evaluation of correctness. These properties allow for rapid feedback.

TDD offers more than just simple validation of correctness, but can also drive the design of a program. By focusing on the testcases first, one must imagine how the functionality will be used by clients (in this case, the testcases). Therefore, the programmer is only concerned with the interface and not the implementation.

The power of TDD offers is the ability to take small steps when required. It allows a programmer to focus on the task at hand and often the first goal is to make the test pass. Exceptional cases and error handling are not considered initially. These extraneous circumstances are implemented after the main functionality has been achieved.

Test-driven Development using NUnit tutorial