Whenever a new feature is added, follow the red-green TDD cycle:
- Red — write a failing test that describes the desired behavior. Run it and confirm it fails for the expected reason.
- Green — write the minimum production code needed to make the test pass. Run the test and confirm it passes.
- Refactor — clean up the implementation and tests while keeping the suite green.
Do not write production code for a new feature before a failing test exists for it.