How to write acceptance checks before the agent writes code

Day 4, 25 minutes · beginner

Goal of this lessonTurn your spec into a plain-words test list for slice one, with edge cases and the tests an agent may not change on its own.

Why it matters

When an agent writes the code, the tests are how you find out whether it did what the spec asked. Not by reading every line, but by running checks that pass or fail. That makes tests the safety net of the whole flow.

There is a catch. If the agent writes the code first and the tests after, it can end up writing tests that fit the code it just wrote, mistakes included. And when a test fails, the quickest way to make it pass is to change the test. So the order matters: decide what "working" means first, in plain words, from the spec, and only then let anyone write code.

Today you write that list for slice one: one check for every behaviour example, checks for the edge cases, and a short list of tests the agent may not change on its own. You do not need to write code; a developer or an agent can turn your list into code later.

Three words for today

  • An acceptance check is a test written from the user's point of view that says when a behaviour counts as done. It passes or fails; there is no "mostly".
  • A test in code is a small program that runs a check automatically, every time someone changes the code.
  • A regression is something that worked before and breaks after a change. Tests that stay in place catch regressions, which is why they keep paying off long after the feature is done.

From behaviour example to check

Your behaviour examples from day 2 are already almost checks. Give each one a number, make the values exact and say what you look at:

Check 1 (example 2): Given an offer of 6 tomato plants with 6 left,
when member B claims 2, then the board shows 4 left.
Check 2 (edge case): Given an offer with 2 left, when member B tries
to claim 3, then nothing is claimed and B sees "Only 2 left".

Then go through your edge cases. Each one gets at least one check. If you cannot write a check for an edge case, the spec is not clear yet: go back and decide what should happen.

Why green tests are not proof

All tests passing (green, in most tools) only means the checks that exist did not fail. It says nothing about what is not checked. Watch for these, with or without an agent:

  • Missing checks. Only the happy path is tested, so the edge cases were never tried.
  • Tests that test nothing. A test that passes whatever the code does. Ask: would this test fail if the feature were broken?
  • Changed tests. A test that failed was edited, skipped or deleted so that everything turns green. This is the one to watch most closely with agents, because it is the shortest path to green.
  • Tests that match the code, not the spec. If a test was written after the code by looking at the code, it confirms the code, not what the user needed.

Protect the checks that matter

Pick the checks that guard the spec's promises, usually the edge cases about data and who may see what, and mark them as protected. Then add a line to the task brief, for example:

Protected tests: checks 2, 4 and 5. Do not change, skip or delete
them. If one fails, stop and tell me which one and why.
When you finish, list every test file you added or changed.

This is our suggestion, not a feature of any tool. Some coding agents let a team write standing rules for a project, and a line like this belongs there too. You will meet those rules on day 6.

The steps

  1. Open your spec and your slice plan. You only write checks for slice one today.
  2. Write one check for each behaviour example in slice one, in the Given, When, Then form, with exact values.
  3. Add checks for the edge cases that touch slice one. Pick your tool below and follow the steps: the prompt asks it to find edge cases you missed, not to decide what should happen.
  4. Decide each new edge case yourself. If the tool asks "what should happen when...", that is a spec question. Answer it and add the answer to the spec.
  5. Mark the protected checks.
  6. Put the list under "Done when" in your task brief from day 3, with the protected tests line.

If you are a developer, you can ask your coding agent to turn the list into tests in your project's own test tool. Read each test it writes and check that it would fail if the behaviour were wrong.

Okke's list for slice one

Slice one only shows offers from sample data, so the list was short: five checks. The tool suggested an edge case Okke had missed: an offer whose end date is today. Is it still on the board? That is not Okke's call, so it went to Wren, who decided "yes, until midnight", and the answer went into the spec. Okke marked one check as protected: a visitor who is not logged in sees nothing.

Common mistakes

  • Letting the tool decide the expected result. It can find the cases; you decide the answers.
  • Writing checks for slice two today. Keep the list to the slice you will build next.
  • Vague results. "Then it works" is not a check. Say what the person sees.

Deeper dive

Today's actions

Ticks are not saved without an account

Do it in your tool

Claude

  1. Open your AI-native course project and start a new chat. Your spec and slice plan should be in the project knowledge.
  2. Paste the prompt below and send it.
    Use my spec and the slice plan with the task brief for slice 1 (in this project or attached).
    Write acceptance checks for slice 1 only. An acceptance check is a pass or fail test from the user's point of view.
    Format: Check [number] (from example or edge case [which]): Given [exact situation], When [action], Then [what the person sees or what happens].
    1. One check for each behaviour example in slice 1.
    2. Then list edge cases for slice 1 that the spec does not cover yet. For each, ask me what should happen. Do not decide it yourself.
    3. After I answer, add a check for each edge case.
    4. Suggest which checks should be protected: tests a coding agent may not change, skip or delete without asking. Explain each choice in one line.
    Use plain words. No code.
  3. Answer each edge case question yourself. Add every new answer to your spec as well.
  4. Ask Claude to put the final list under Done when in the task brief, with a line naming the protected tests. Save it and upload the new version to the project knowledge with the + button.

Note: If you prefer a separate chat outside the project, attach the files with the + button in the chat box. If you are a developer, you can later ask your coding agent to turn this list into tests; read each test it writes.

Checked on 4 December 2026 · Source: Claude Help Center: How can I create and manage projects? (opens in a new tab)

Create a free account to save your progress. Sign in or sign up