Brett Allred

be a student, not a follower

TDD Is Design

At the recommendation of Scott Bellware in his interview with Hanselman I started using the mantra “TDD is Design” and something clicked.

The main purpose of TDD is to design your application, not to ensure that it works.

A working tested application is a by-product of TDD done right but it is not the purpose of TDD.

TDD done right results in simple designs.

If testing a particular aspect of the application becomes complicated and laborious, this is a symptom of a poor design and the medication is to refactor and learn some good design patterns that improve the testability of your code.  This results in better code.

So the next time your making YET ANOTHER ATTEMPT AT TDD try repeating over and over the simple mantra “TDD is Design.”

 

 

 

 

tech

« Lunch with Jon The Theory of Business »