Test-Driven Development (TDD)#

What is TDD?#

Test-Driven Development (TDD) is a software development approach in which test cases are developed to specify and validate what the code will do. In simple terms, test cases for each functionality are created and tested first and if the test fails then the new code is written in order to pass the test and make the code simple and bug-free.

TDD starts with designing and developing tests for every small functionality of an application. TDD framework instructs developers to write new code only if an automated test has failed. This avoids duplication of code. See see this.

Why are we adopting it?#

In addition to the well-known benefits of TDD (see this), it can help us to reduce the negative impacts of having a diverse team. Moreover, there is a trend in the industry to adopt TDD; by following this trend, we are aiming for industry standards and preparing our student programmers for a better career path in the future.

How are we going to practice it?#

We will adopt TDD only when we have implemented a good amount of unit tests and programmers are familiar with writing test cases. Then, we need to make sure everyone knows how TDD works. After which, we will enforce TDD by emphasizing on it in meetings and reports; as well as rejecting any pull request which does not reflect TDD.