› Introduction

Test-Driven Development (TDD) is a software development methodology and an agile technique that requires a failing test to be written before code, and then the minimal code that would make the test passes is written, and then the code gets refactored and tested continuously.

In TDD, you will end up having at least one test for every single feature/functionality in the system which increases the reliability of the system. All these tests should be run automatically using some testing framework.

TDD forces programmers to think thoroughly about the feature they need to implement before actually implementing it. Also, it forces them to write the minimal amount of code that would implement the feature. Coding the minimal amount of code that implements the required feature results in having a code that is simple and clean and hence, easy to change and refactor.