Practice: Test Driven Development
This practice describes an approach to development in which test cases are defined first, then code is developed to pass the tests.
Why adopt this practice

The test driven development practice reduces time to market by reducing the amount of time needed to integrate and stabilize builds. It improves productivity by finding and fixing errors close to the time that they are introduced. And it increases the overall quality of the software by guaranteeing that all new code has been tested, and all existing code has been regression tested, prior to check-in.

Developers use TDD to create the Implementation and the Developer Tests.

See the How to Adopt the Test Driven Development Practice for information on navigating the TDD Practice.

Application
Additional Information

If you are just getting started with TDD or developer testing in general, you will need to know why developer testing is a good idea, and the basics of what makes good developer tests. A good starting place is this Kent Beck presentation. Kent Beck is the creator of Extreme Programming, which is where TDD was originally defined.

Here are some useful links to expand your understanding of TDD. Make use of these as you learn to enact TDD. Some of these links are also good resources for on-going support and information.

Once you are familiar with the basics of TDD, select various tasks to view more detail about what needs to be done to perform the task. If you will be creating a capability pattern or delivery process that includes TDD, see Using TDD in context. This shows one example of how TDD can be used in conjunction with other activities and capability patterns to create a pattern for developing software. This is only one possible example: there are many was to use TDD with other development practices.

For more information on this practice,  see the practice resource page on IBM® DeveloperWorks®.