The 5W1H of TDD

What is TDD?

  1. TDD is an acronym for Test-Driven Development

  2. It is also an approach to software development

  3. Accurate code and quality control are great side-effects of TDD, they are not the driving force behind the practice!

  4. If code coverage and metrics become the goal, then there is a risk that developers will introduce meaningless tests just to inflate the numbers!!

TDD is not about testing, it's about design

Why do we need TDD?

  1. To reduce errors and enable flexibility within the application

  2. A method for rapid, accurate, and fearless application development

  3. It is a means of letting your tests drive the design of the system!

  4. With TDD, an application will grow in functionality without introducing needless complexity

  5. It also lets us use tests as living documentation: Well-crafted tests describe the behavior in our code, and above all, serve as up-to-date documentation

Who introduced TDD?

  1. Robert C. Martin, affectionately called "Uncle Bob" by the developer community is the driving force behind several practices including TDD

  2. Kent Beck is also a leading proponent of TDD through his extreme programming methodology

    Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

    – Martin Fowler

When & Where was TDD introduced?

  1. Though it was done under various names and methods from several decades, it was first introduced formally in 1999

  2. In 2001, seventeen software developers including Uncle Bob and Kent Beck met at a resort in Snowbird, Utah to discuss lightweight development methods

  3. By 2003 it was gaining rapid popularity all over the word

How is TDD done?

The Three Laws of TDD are as follows:

  1. You are not allowed to write any production code unless it is to make a failing unit test pass

  2. You are not allowed to write any more of a unit test than is sufficient to fail, and compilation failures are failures

  3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test

There are quite a number of testing frameworks that are free and open source, used for various types of tests. The most popular of the frameworks are MSTest, NUnit, and xUnit.net for .NET world and JUnit or TestNG for the Java stack

Learn more about these TDD laws at : http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd

Last updated