Slide 15
Slide 15 text
Red, green, refactor
• “Red, green, refactor” is a common TDD mantra used to
describe the basic workflow.
• Red: Write a test, run it, watch it fail, and note why it failed.
• Green: Add just enough code to correct the specific failure.
Run the test again and address any new failures. Continue
doing this until the test passes.
• Refactor: Now that the test is passing, do any internal clean
up necessary, e.g. extracting duplication into additional
methods. Keep running the tests after each change to ensure
your changes haven’t caused a regression.