Day 4, 25 minutes · beginner
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
- Open your spec and your slice plan. You only write checks for slice one today.
- Write one check for each behaviour example in slice one, in the Given, When, Then form, with exact values.
- 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.
- 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.
- Mark the protected checks.
- 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 accountDo it in your tool
Claude
- Open your
AI-native courseproject and start a new chat. Your spec and slice plan should be in the project knowledge. - 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. - Answer each edge case question yourself. Add every new answer to your spec as well.
- 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.
ChatGPT
- Open your
AI-native courseproject and start a new chat in it. - If your spec or slice plan is not in the project, select the plus icon (+) in the message box, then Add photos & files, and attach them.
- 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. - Answer each edge case question yourself, and add every new answer to your spec as well.
- Ask ChatGPT to put the final list under Done when in the task brief, with a line naming the protected tests. Save the brief in your
slices.mdfile.
Note: Uploading documents and text files works on Free and paid plans, within plan limits.
Gemini
- Go to gemini.google.com and start a new chat. At the top left, click New chat; if it is not there, click Menu first.
- Click Add files and attach your
spec.txtandslices.txtfiles. - Paste the prompt below into the text box and send it.
Use my attached spec and the slice plan with the task brief for slice 1. 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 and short sentences. No code. - Answer each edge case question yourself, and add every new answer to your spec file as well.
- Ask Gemini for the final list under Done when, with a line naming the protected tests. Copy it into your
slices.txtfile under the task brief.
Note: Gemini Apps can make mistakes, as Google says on this page: the tool finds cases, you decide what should happen.
Microsoft Copilot
- Go to Copilot Chat and sign in with your Microsoft 365 account.
- In the Message Copilot compose box, select the plus sign and then Upload images and files, and pick your
spec.txtandslices.txtfiles. - Paste the prompt below and send it.
Use my attached spec and the slice plan with the task brief for slice 1. 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 and short sentences. No code. - Answer each edge case question yourself, and add every new answer to your spec file as well.
- Ask Copilot for the final list under Done when, with a line naming the protected tests. Copy it into your
slices.txtfile under the task brief.
Note: You can upload several files at once from your device. If what you see differs, Microsoft says the new Copilot Home is still rolling out.
Paid planWritten for Copilot Chat with a work or school account. Microsoft pages differ on which accounts need what; without a Copilot licence, adding content has some limits.
Create a free account to save your progress
Free, and no payment details. Your ticks and finished lessons are kept, on every device.
Create a free account I already have an accountCreate a free account to save your progress. Sign in or sign up