Understanding test-driven development
After all the hype in the previous paragraphs, you might be wondering what exactly test-driven development is all about, and whether it is some complex procedure that requires a lot of skill to implement. Actually, test-driven development is very simple. The flowchart below shows the three steps in the process.
Let's walk through the preceding flowchart in a little more detail.
- Red: The first step is to write a small unit test case. As we have only written the test and haven't written the implementation yet, this test will naturally fail.
- Green: Next, we write the code that implements the desired functionality. ...