TDD Red-Green-Refactor
Multiple Choice Medium
Question
In TDD, what do you do in the 'Green' phase?
Hint
Red = fail, Green = pass, Refactor = improve.
Explanation
The TDD cycle is Red-Green-Refactor. Red: write a test that fails (the feature doesn't exist yet). Green: write the simplest code that makes the test pass. Refactor: improve the code's structure and readability without changing its behavior (tests should still pass).
Related Resources
Related Lessons
- Test-Driven Development
The TDD workflow.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.