Module · Codex Engineer
Testing with Codex
Tests first, failures read properly, and the loop that keeps a change honest.
TOPIC 01
Writing Tests
Get the test written first, then judge it like you would judge the implementation.
What you'll practice
- Ask for the Test First — guided · beginner
- Review the Generated Test — practice · intermediate
A command you'll meet
cat ~/codex/tests/review.mdA generated test that never fails is worse than no test. Open the task below for the full walkthrough.
Hands-On Tasks in This Topic (2)
Ask for the Test First
A test written before the implementation is a specification you can read. Write the brief that asks for one.
Review the Generated Test
A generated test proves nothing if it cannot fail. Write the review that makes sure it would.
TOPIC 02
Failing Tests
Read the failure, fix the cause, and keep the regression from coming back.
What you'll practice
- Read a Failure Before You Fix It — practice · intermediate
- Run the Red-Green Loop — challenge · advanced
A command you'll meet
cat ~/codex/tests/loop.mdThe failure message is the most precise specification you will ever be given. Open the task below for the full walkthrough.
Hands-On Tasks in This Topic (2)
Read a Failure Before You Fix It
Half the generated fixes are wrong because nobody read the error. Write the routine that turns a red test into a correct change.
Run the Red-Green Loop
Red, green, refactor - with an agent in the loop the discipline matters more, not less. Write the loop your team runs.