
Python for Geeks
By :

TDD is a well-known practice in software engineering. This is a software development approach in which test cases are written first before writing any code for a required feature in an application. Here are the three simple rules of TDD:
These TDD rules also drive us to follow a famous three-phase approach of software development called Red, Green, Refactor. The phases are repeated continuously for TDD. These three phases are shown in Figure 5.4 and are described next.
In this phase, the first step is to write a test without having any code to test. The test will obviously fail in this case. We will not try to write a complete test case but only write enough code to fail the test.