Test-driven development (TDD) uses automated tests to guide implementation and speed feedback. Write a test before the code; it should fail first. Then write just enough code to pass and refactor before moving to the next test. section 1.2 section 4.1
Figure 1.1 The TDD cycle starts by writing a test and seeing it fail (Red). Then we write just enough code to have the test pass (Green). Finally, we refactor the code to improve its structure

The Red/Green/Refactor cycle shows the sequence from failing test to passing test and code cleanup. section 1.2
TDD is closely related to Behavior-Driven Development (BDD). BDD emphasizes collaboration that keeps requirements, documentation, tests, and the system connected; business-readable tests can help business representatives verify expected behavior. section 1.2






















