Learn Everything

Module · Codex Engineer

Testing with Codex

Tests first, failures read properly, and the loop that keeps a change honest.

2 topics4 interactive tasks

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.md

A generated test that never fails is worse than no test. Open the task below for the full walkthrough.

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.md

The failure message is the most precise specification you will ever be given. Open the task below for the full walkthrough.