> For the complete documentation index, see [llms.txt](https://raviram.gitbook.io/tdd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://raviram.gitbook.io/tdd/the-5w1h-of-tdd.md).

# 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

{% embed url="<https://docs.google.com/presentation/d/1vvtgzjwfbuuyjIMkGL7AfyTQ7cCVmX9Tp4ultYg0YOw/edit?usp=sharing>" %}

## 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:&#x20;

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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://raviram.gitbook.io/tdd/the-5w1h-of-tdd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
