posted on Monday, March 20, 2006 12:28 PM by johnwood

Unit Tests != TDD

A lot of people seem to get confused between unit tests and Test Driven Development.

Unit tests are typically small pieces of code that test the functionality of units of your application. No matter what design methodology you use, unit tests have a legitimate purpose in ensuring that stuff is still functioning. This is particularly important with highly interdependent code that might be more open to inadvertently breaking.

Test driven development makes use of unit tests, but they're far from being the same thing. TDD is about writing tests upfront to dictate the requirements of the application, and then writing code that makes the tests succeed.

Just because you're creating unit tests, before or after coding, does not mean you're adopting test driven development.

My previous posts are discussing how Test Driven Development, that is developing tests up front as a means to driving the development process, is not a very efficient approach to software development. That doesn't mean that unit tests are bad. Unit tests are always necessary to ensure your code stays functional. Just wanted to clarify that.

Comments