Test-driven development
As the name suggests, test-driven development, abbreviated as TDD, is a widely used software development practice in Agile methodologies, especially in Extreme Programming. It is widely regarded as a fundamental technique for achieving higher-quality software.
As the name itself suggests, development is driven by tests, not the other way around. The classic development cycle involves the following:
Figure 4.10 – The classic development cycle involves designing, coding, and then testing
This is flipped around. We start with the tests to arrive at defining the design; of course, writing the code in between:
Figure 4.11 – The TDD cycle starts with the tests
Attention is given to the functional aspects of the code, specifically the method signatures, before the actual implementation of the code. To start with the tests, you need to take the perspective of the “client” of your...