Blog

Acceptance criteria: examples, formats and how to write them

Acceptance criteria are the conditions a user story must meet before anyone calls it finished. Two formats, worked examples and a login page.

A user story says who wants something and why. It does not say when the work is finished. Acceptance criteria fill that gap: a short list of conditions the story has to meet before the person who asked for it will accept it. Write them before the work starts and everyone on the team is reading the same finish line. Leave them out and each person carries a slightly different picture of “done” until the demo.

Most of the examples here follow a single imaginary product: an app for a town library, where members search the catalog, place holds on books that are out on loan and sign in to see what they have borrowed. Nothing about the library is real, its numbers included. The login example also uses published guidance from NIST and OWASP.

What are acceptance criteria?

The idea is older than the name most teams use for it. In 2001 Ron Jeffries, one of the creators of Extreme Programming, described a user story as three parts: “Card, Conversation, and Confirmation”. The card is the short note. The conversation is where the detail gets worked out. Confirmation is how the customer will check that the story was built correctly, which Jeffries described as acceptance tests the customer defines at the start of the iteration.

Two years later Bill Wake proposed the INVEST checklist for good stories: independent, negotiable, valuable, estimable, small and testable. His note on the last letter comes at the idea from the opposite direction. If a customer cannot say how a story would be tested, he writes, the story may not be clear enough yet.

So acceptance criteria are the confirmation, written down. Each one is a statement that is either true or false when someone tries the finished feature. For the library’s hold feature, “a member can see their place in the queue as soon as the hold is placed” is a criterion. “Holds should be easy to use” is not, because two people can try the feature and disagree about whether it passes.

Acceptance criteria vs definition of done

People mix these up because both decide whether work is finished. The difference is scope. Acceptance criteria belong to one story. A definition of done applies to every item the team delivers.

The Scrum Guide describes the definition of done as “a formal description of the state of the Increment when it meets the quality measures required for the product”. An item that falls short of it “cannot be released or even presented at the Sprint Review” and goes back to the Product Backlog. The guide does not mention acceptance criteria at all. The term comes from the user story tradition.

Acceptance criteria Definition of done
Applies to One story or feature Every story the team finishes
Changes Written fresh for each story Agreed once, revised now and then
Mostly about What this feature does for its user The quality bar for all work: reviewed, tested, documented, deployable
Library example "A member can hold up to 10 titles at once" "Code reviewed by a second developer and merged to the main branch"

A story is finished only when it passes both. Meeting its own criteria while skipping the team’s review step still leaves it unfinished, and so does passing every team check while the hold limit does nothing.

How do acceptance criteria relate to requirements and tests?

A requirement states what a product must do or how well. In a formal software requirements specification, each requirement can carry its own acceptance criteria: the check that proves it was met. In an agile backlog the user story takes the place of the requirement, and its acceptance criteria hold most of the detail a specification would have spelled out.

Qualities such as speed or security can be criteria too, when they apply to one feature. When they apply everywhere they usually sit in the definition of done or in a separate list of non-functional requirements.

Criteria are not the same thing as tests, though they lead straight to them. A criterion says what must be true. A test is a procedure, manual or automated, that checks it. One criterion often needs several tests: the normal case, the boundary and the error.

Two formats: rule lists and Given/When/Then

Teams write acceptance criteria in two main ways, and many mix them within one backlog.

A rule list is a numbered set of plain statements. It is quick to write and easy to scan in a planning meeting.

Given/When/Then describes one scenario at a time. It comes from behavior-driven development, and Gherkin, the language behind the Cucumber testing tool, gives each keyword a job. In its reference, Given steps “describe the initial context of the system”, When steps “describe an event, or an action” and Then steps “describe an expected outcome, or result”. And and But add further steps of the same kind.

The same library rule, both ways:

Rule: A member can hold up to 10 titles at once. An 11th hold is refused with a message that names the limit.

Given a member who already holds 10 titles
When they try to place a hold on another title
Then the hold is not placed
And they see “You can hold up to 10 titles at once”

Gherkin has two more keywords that help with criteria. Rule groups the scenarios that illustrate one business rule. A Scenario Outline runs the same scenario once for each row of an Examples table, which suits limits and boundaries: a 9th, a 10th and an 11th hold, with the expected result on each row.

Use When
A rule list The behavior is simple, the team knows the domain, or the criteria are mostly limits and messages
Given/When/Then The outcome depends on what happened before, the team will automate the checks, or people outside the team need to follow each case step by step

The format matters less than the test that every line has to pass: someone could try the feature and say yes or no.

Sample user stories and acceptance criteria

Two stories from the library app, written the way a team might bring them to refinement.

Story 1: place a hold. As a library member, I want to place a hold on a book that is out on loan, so that I get it when it comes back.

  1. The Place hold button appears only when no copy of the title is on the shelf at any branch.
  2. The member chooses the branch where they will collect the book. Their home branch is selected to begin with.
  3. Once the hold is placed, the member sees their place in the queue, such as “3rd in line”.
  4. A member can hold up to 10 titles at once. An 11th hold is refused with a message that names the limit.
  5. When a copy is ready, the member gets an email and an app notification on the same day.
  6. A ready copy waits at the branch for 7 days, and the notification says the last day to collect it.

Story 2: cancel a hold. As a library member, I want to cancel a hold I no longer need, so that the next person in the queue gets the book sooner.

  1. Each hold on the My holds screen has a Cancel button.
  2. The member is asked to confirm before the hold is removed.
  3. After canceling, the title leaves the list and the member’s hold count drops by one.
  4. Everyone behind the member in that title’s queue moves up one place.
  5. If the copy was already waiting at the branch, it is offered to the next member in the queue.

Story 1 reads like a list of decisions, and that is the point. Number 1 settles a question someone would otherwise ask a developer in the middle of a sprint. Number 6 is a library policy that has to be confirmed by someone who has the authority to set it. Writing criteria is often where a team finds out that nobody has decided yet.

Acceptance criteria for a login page

Login pages come up often in searches for examples, and they make a useful one because a weak set of criteria can leave a security hole without any feature being missing. The rules below use two published sources: NIST Special Publication 800-63B, revision 4, which sets password rules for US federal systems, and the OWASP Authentication Cheat Sheet. A business outside government is not bound by NIST, but both documents give published values to start from.

Story 3: sign in. As a library member, I want to sign in with my card number and password, so that I can see my loans and holds.

  1. With a correct card number and password, the member is signed in and lands on My loans.
  2. A wrong password and an unknown card number get the same message, “Card number or password is incorrect”, with the same response code and response times within 50 milliseconds of each other on average over 100 attempts of each kind. OWASP gives this rule so that an attacker cannot use the login form to learn which card numbers exist.
  3. The password field accepts at least 64 characters and allows pasting and password managers. NIST says verifiers should permit at least 64 characters and shall allow password managers and autofill.
  4. After 10 failed attempts in a row on one card, sign-in for that card pauses for 15 minutes. The count is kept per account, so attempts from many devices or networks still add up. NIST requires a system to disable a password after no more than 100 failed attempts in a row and lets an organization set a lower number. The 10 attempts and the 15-minute pause are this library’s choices, a temporary lockout of the kind OWASP describes.
  5. The Forgot password page shows the same confirmation whether or not the card number exists, and it still works for a card that is paused under rule 4, so a locked-out member has a way back in.

Choosing a password is a story of its own, with its own criteria. The NIST revision 4 rules for it (a minimum length that depends on whether there is a second factor, a blocklist check, no scheduled changes) appear in our web app build guide. Each of them converts into one numbered line.

The given/when/then version of rule 2, for a team that automates it:

Given the card number 2900 0012 3456 exists and 2900 0099 9999 does not
When someone signs in with 2900 0012 3456 and a wrong password
And someone signs in with 2900 0099 9999 and any password
Then both see “Card number or password is incorrect”
And both responses carry the same status code

Notice what the list leaves out: the color of the button, the framework, how the password is stored. Those are design and build decisions. Criteria describe what a member and an attacker would each observe.

How to write acceptance criteria for user stories

Who writes them. The product owner, or whoever speaks for the user, is responsible for them. They are better written with a developer and a tester in the room, because each sees different gaps: the developer spots the cases that are hard to build, the tester the cases nobody mentioned.

When. Before the story is planned into a sprint, during refinement. The Scrum Guide calls refinement “the act of breaking down and further defining Product Backlog items into smaller more precise items”. A story should come out of refinement with its criteria written.

A technique that helps: example mapping. Matt Wynne of the Cucumber team described it in 2015. The story goes on a yellow card. Each rule (an acceptance criterion the group already knows) goes on a blue card beneath it. Concrete examples of each rule go on green cards under that rule. Questions nobody in the room can answer go on red cards. He suggests about 25 minutes for a well-understood story of the right size. The table tells you something at the end: lots of red means the group still has a lot to learn about the story, and lots of blue means the story is big and may need splitting.

An example map for the library's place a hold story. A yellow story card sits at the top. Beneath it are three blue rule cards: up to 10 holds at once, queue place shown at once, and ready copy kept 7 days. Under each rule are green example cards, such as a 9th or 10th hold being placed and an 11th being refused, and a notice that names the last day to collect. A red card holds an open question: do children's cards have the same limit?

The red card in that map is the kind of question only the library can answer. The developers cannot settle it, and it is better found in a 25-minute conversation than halfway through building the feature.

Rules of thumb for each line:

  • Pass or fail. If two careful people could try the feature and disagree, rewrite the line with a number, a message or an exact state.
  • The outcome, not the build. “The member sees their place in the queue” leaves the design open. “Show a progress bar in the header” makes a design decision in the wrong place.
  • The unhappy paths. Limits, errors, empty states, canceled actions and permissions. Most of the questions that hold up a sprint live here.
  • Numbered. A bug report that says “rule 4 fails” needs no further explanation.
  • A handful. Somewhere between three and eight usually covers one story. A list that runs to fifteen usually describes two or three stories, which is the blue-card warning again.

Common mistakes, with better versions

Weak line What is wrong A better line
"Search results load quickly" No measure, so it cannot fail Results appear within one second for a title search on a catalog of 200,000 records
"Use a modal to confirm cancellation" Fixes the design, not the outcome The member confirms before a hold is removed
"The member can place a hold" Repeats the story, and covers only the case where everything goes right An 11th hold is refused with a message that names the limit
"Holds work like the old system" Points at something the reader may never have seen Write out each rule the old system applied that still matters
"Code has unit tests" True of every story, so it belongs in the definition of done Move it to the definition of done

A user story template with acceptance criteria

A plain layout that works in a Jira ticket as well as in a shared document:

Story: As a [type of user], I want [a goal], so that [a reason].

Acceptance criteria

  1. [A condition that is true or false when someone tries it]
  2. [A limit, an error or an empty state]
  3. [What the user sees or receives afterward]

Scenarios (optional, for behavior that depends on earlier steps)

Given [the starting situation]
When [the action]
Then [the expected result]

Open questions

  • [The question], owner: [name], needed by: [date]

The open questions section is worth keeping. A story can go into refinement with questions on it. It should not go into a sprint with them.

Acceptance criteria in testing

Testers turn each criterion into one or more test cases, and settling the criteria early means those cases can be written before a line of code exists. How each of those cases is set out, with its steps, data and expected result, is shown in our test cases guide. In acceptance test-driven development the team writes the tests from the criteria before building the feature, as explained in what software testing is. User acceptance testing, where the people who will use the software try it before release, checks the finished product against the same criteria. Where acceptance sits among the other test levels is covered in levels of testing.

Criteria also feed a user story map. The map decides which stories go into a release. The criteria decide what each of those stories has to do.

Questions people ask

Are acceptance criteria the same as the definition of done?

No. Acceptance criteria are written for one story. The definition of done is one list for all work, covering things like review, testing and deployment. A story is finished when it meets both.

Where do acceptance criteria go in Jira?

Teams commonly put them in the issue description under a heading, or in a separate field set up for them. What matters is that everyone can find them in the same place on every story, and that they are written before the sprint starts.

How many acceptance criteria should a user story have?

Enough to remove guesswork, usually somewhere from three to eight. Far more than that is a sign the story should be split.

Can acceptance criteria change during a sprint?

They can, if the product owner and the team agree, but a change often means the story is now a different size. Many teams treat a significant change as a new story for a later sprint.

Criteria and the size of a story

An estimate is a judgment about how much work a story holds, and the criteria are most of what the person estimating has to go on. A story that spells out its limits and error cases shows its size. A story with one line of intent hides its size until the work is under way, and on a fixed price that is the worst moment to find out.

Devrisen’s Scope week is free. Its working sessions take the idea you bring and turn it into a written spec, and the week closes with a fixed quote covering the build. See how Scope week leads into an MVP build.

Stories you have drafted already are a fine starting point, whatever state their criteria are in. Tell us what you are planning. Our reply comes back within one business day.

The full service behind this post: MVP Development Services for Startups.

Ready to scope your project?

Send us two sentences about what you need. We reply within one business day with the next step and any questions we need answered first.

Get a Quote