How to write acceptance criteria engineers and QA can test
A six-step guide for product managers to write Given/When/Then acceptance criteria that engineers can build against and QA can pass or fail.

A story says what the user wants. Acceptance criteria say how the team will know it works. When they are vague, engineers guess, QA guesses differently, and you find out in review. This guide shows a way to write them so each one can pass or fail.
In brief
Who it is for: product managers who write user stories.
What you will have at the end: a set of Given / When / Then criteria for one story, with edge cases covered, scope stated, and a review booked with an engineer and a QA.
What good criteria look like
Three things make criteria useful. They are testable: someone can run them and say pass or fail. They are agreed before the build starts, not written after the fact. And they describe behaviour, not implementation. You say what the user sees and what the system does. You leave how it is built to the engineers.
The format used here is Given / When / Then. It comes from behaviour-driven development. Each criterion has three parts:
Given the starting situation
When the user does one thing
Then the system does this, and the user sees this
The format is plain on purpose. It makes you name the starting point, the action and the result. If you cannot fill in one of the three, the criterion is not ready.

Start from the user's goal
Write down what the user is trying to get done, in the story itself. Every criterion should trace back to it. If a criterion does not help the user reach the goal, it probably belongs in another story.
If you want a starting point for the story, PikoPM's User story tool can help you draft it before you write the criteria.
List the rules the feature must follow
Before you write any scenario, list the rules in plain sentences. A rule is something that is always true of the feature. For example: a saved item is kept for a set time, or a signed-out user must sign in first.
Keep each rule to one sentence. If a rule needs the word “and” to describe two different behaviours, split it into two rules.
Write one scenario per rule
Turn each rule into one Given / When / Then scenario. One rule, one scenario, one clear result. This keeps the criteria short and lets QA map each test to a rule.
Use the user's words. Say “I choose Save for later”, not “the save handler fires”.
Add the edge cases
The main path is the easy part. Most bugs sit at the edges. Go through this list and ask what should happen in each case:
- Empty state: there is nothing to show yet.
- Too many items: the list is far longer than you planned for.
- No permission: the user is not allowed to do this.
- Slow network: the response takes a long time.
- An error: something fails along the way.
Not every case needs a scenario. But decide each one on purpose, and write down the answer.
Say what is out of scope
Add a short line for what this story does not cover. It stops a reasonable guess from turning into extra work. It also gives QA a clear edge: anything outside it is not a failure of this story.
Review with one engineer and one QA before the sprint starts
Ask one engineer and one QA to read the criteria with you. Ask the engineer what is unclear or missing in the behaviour. Ask QA how they would test each line. If they cannot say how to test one, rewrite it.
Do this before the sprint starts. Changes are cheap now and costly once the build is under way.
Three common faults
| Fault | Why it fails | Better |
|---|---|---|
| “Should be fast” | Nobody can test it. Fast to whom? | “Results appear within 2 seconds for 95% of searches.” |
| Describing pixels and layout | It fixes the implementation and says nothing about what the user can do. | Describe the behaviour: what the user does and what happens. |
| Several behaviours in one criterion | It cannot pass or fail cleanly. If half of it works, what is the result? | Split it into one criterion per behaviour. |
A worked example
The example below is made up for this guide. It is not from a real product.
The story: “As a shopper I want to save my basket so I can buy later.”
1. Given I am signed in with items in my basket, when I choose Save for later, then the basket is kept for 30 days and appears under Saved.
2. Given I am signed out, when I choose Save for later, then I am asked to sign in, and the basket is saved once I have.
3. Given a saved item has gone out of stock, when I open Saved, then it is marked Out of stock and cannot be moved to the basket.
Out of scope: sharing a saved basket with someone else.
See how it follows the steps. The goal is in the story. Each scenario matches one rule: how long a basket is kept, what happens when signed out, and what happens to an item that is no longer available. Each has one action and one result a tester can check. Nothing says where a button sits or what colour it is.

Now look at what is still open. The three scenarios cover the rules, but not every edge case from step 4. For this story you would still ask questions such as: is there a limit on how many items a saved basket can hold? and what should the shopper see if saving fails because of an error or a slow network?. Those answers are product decisions, so they come from you and the team, not from the criteria template.
A checklist before you hand it over
- The story states the user's goal.
- Each rule has its own scenario.
- Every criterion has one action and one result.
- Nothing is vague, such as “fast”; each target is a number a tester can measure.
- The criteria describe behaviour, not pixels or layout.
- Empty, too many, no permission, slow network and error are each decided.
- Out of scope is written down.
- One engineer and one QA have read it, before the sprint starts.
Start with the next story in your backlog. Write the rules first, then the scenarios, then book the review.


