5.3 Test-Driven Development with AI
Test-driven development (TDD) is a cyclical process that is often described as a TDD cycle. It consists of three phases: red, green, and refactor. The first step is a failed test, as it occurs before the implementation. The red color stands for the failure of the test. You then implement the program logic that ensures the test can run successfully. This turns the test into green. In the final step, you have the opportunity to optimize your code. You carry out refactoring in which the interface to the outside world remains the same and nothing changes in terms of functionality. Chapter 4 looks at how AI can help you with this and what strategies are available.
In TDD, you don’t start directly with the development. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access