The Red-Green-Refactor cycle is the fundamental rhythm of TDD: Red Phase: Write a failing test that defines the desired functionality. The test should fail because the feature doesn't exist yet. Green Phase: Write the minimal amount of code necessary to make the test pass. Focus on making it work, not on perfect design. Refactor Phase: Improve the code structure, remove duplication, and enhance readability while ensuring all tests still pass. This cycle typically takes 2-10 minutes and is repeated continuously throughout development.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.