Skip to content
mentoor

Test-first with agents

For engineers

Write or approve failing tests first, lock them, then let the agent implement until they pass for the right reason

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

Why write and approve tests before the agent writes the code?

Choose one answer

Check yourself · 2 of 5

What should you ask an agent for first when you want tests for a new function?

Choose one answer

Check yourself · 3 of 5

In the red step, what do you check?

Choose one answer

Check yourself · 4 of 5

A function has 100% line coverage. What does that guarantee?

Choose one answer

Check yourself · 5 of 5

An agent says all tests pass. Which change in its diff is most suspicious?

Choose one answer

Topics

  1. Approved tests as the agent's contract4 min read · Failing tests that encode the acceptance criteria, approved by a person and locked before implementation starts
  2. Drafting test cases with an agent4 min read · Asking for a list of cases before test code, then adding the edge, error and boundary cases the agent left out
  3. The red, green, review cycle4 min read · Seeing each test fail for the expected reason, letting the agent make it pass, then reviewing and refactoring
  4. Coverage numbers versus real confidence4 min read · Why high coverage proves little, and how mutation thinking shows whether tests protect a behaviour
  5. Agents that cheat to pass tests5 min read · Special-cased inputs, skipped or deleted tests, weakened assertions and other reward hacking in agent changes

Start here

110 questions · last verified 2026-12