Adaption SoftwareThere is a revolution going on.
 . Home . Contact .   
Test-Driven Development: Fewer Bugs, Cleaner Code

TDD is a best practice that involves producing automated unit tests for production code, before you write that production code. TDD is not debugging, it's pre-bugging. You find and eliminate bugs at inception. TDD is the partner practice of refactoring; the two of them go together, providing benefits together.

Benefits

The clearest benefit is verification: you get an exhaustive suite of automated unit tests that constantly protect your system from defects, no matter what changes are made. You get drastically fewer defects throughout the system lifecycle, because your tests enable you to find and kill most bugs as soon as they are born. It's a beautiful thing.

But the other benefits are perhaps even more drastic. Because TDD drives the entire design process, you also get simpler, clearer, more extensible system design. This increased extensibility enables you to handle changing requirements faster, and gives you longer healthy system lifespans. Finally, the test code provides cogent, complete design documentation that is always in-synch with production code. You can spend more time programming, and less time on design documents.

How Does TDD Work?

TDD turns programming as usual on its head. Instead of writing tests afterward (if at all), you always begin with the tests. For every small chunk of functionality in the production code, you first build and run a test that specifies and validates what the code will do. You then produce exactly as much code as will enable that test to pass. Finally you refactor (simplify and clarify) the production code and the test code.

(To learn more about why TDD is worth learning, click here. To learn more about the mechanics of TDD, click here.)

Adaption TDD Training and Consulting

At Adaption we offer TDD training and coaching services to help you learn this vital new practice as quickly and easily as possible.

Brought to You by Extreme Programming

TDD is a core programming practice of Extreme Programming (XP). In some ways, TDD is the cutting edge of XP. But TDD is rapidly emerging as a way to produce better code faster, and to have more fun doing it, no matter how and where you program. TDD is now being practiced in many different programming languages, spreading far beyond the bounds of XP.


ADAPTION NEWS