The TDD cycle is…
Options
- Design, code and test, repeated in one long cycle
- Red (failing test), green (make it pass), refactor (Correct option)
- Test only after the release, then fix whatever failed
- Write all the tests first, then write all the code
Answer
Red (failing test), green (make it pass), refactor
Why
Test-Driven Development works in tiny loops:
- Red: write one small test for the next behavior. It fails, because the code does not exist yet.
- Green: write the minimum code to make it pass.
- Refactor: clean up the code while the test protects you.
Then repeat with the next small behavior.
Remember
Red → Green → Refactor.