Module 2 · Daily workflows
Test first, and watch it fail for the right reason
In short
Write the test first, run it and make sure it fails because the behaviour is missing, not because of a typo. Then write the code until it passes. Old tests are never weakened to go green.
After this lesson you can
- Apply the test-first order when working with a coding assistant: test, fail, code, pass
- Tell a correct test failure from one caused by a wrong import, wrong setup or wrong file
- Reject changes that weaken old tests so new code passes
Sign in to read this lesson
The title and summary are open to everyone. The full lesson is for signed-in learners.
