Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 29 ยท Requirements and Estimation

User Stories and Acceptance Criteria

Write good user stories with the As a, I want, so that format, check them against INVEST, add Given-When-Then acceptance criteria and split big epics.

A Product Backlog full of vague wishes ("improve booking") is hard to build, hard to estimate and hard to test. A user story is a short description of something a person wants from the product, written so that the team can talk about it, size it and finish it in a Sprint. It is not a specification. It is a promise to have a conversation, backed by just enough detail to start.

This lesson shows the standard story format, the INVEST checklist that tells you if a story is any good, how to write acceptance criteria, and how to split stories that are too big. The runnable examples are JavaScript checkers that apply these rules to sample text. They are stand-ins: a real review is a human conversation, and the tools only catch the mechanical slips. If you need a refresher on where stories live, see Scrum Artifacts and Commitments.

Three parts of a story

Who A specific kind of person.
What The need, not the screen.
Why The value they get.

As a ..., I want ..., so that ...

1 / 2

The story format

The most common template is:

TEXT
As a <type of person>,
I want <something>,
so that <a benefit>.

Each part does a job.

  • The role says who benefits. "As a returning guest" tells the team more than "As a user", because a returning guest has history we can use. If you cannot name a real person or role, ask whether anybody actually wants this.
  • The want states the need, not the solution. "I want to rebook my last table in one tap" leaves room for design. "I want a dropdown of dates" locks the team into one UI before anyone has asked whether a dropdown is best.
  • The benefit explains the value. It is the part people skip most often and the part that lets the Product Owner decide whether the story is worth doing at all. If the benefit is "so that I can use the feature", the story does not yet explain why.

The template is a prompt, not a law. Some teams use "In order to ... as a ... I want ...". Others write jobs-to-be-done sentences. What matters is that the who, what and why are all clear. Technical work can use stories too ("As a support engineer, I want booking errors in one dashboard, so that I find failures within a minute"), but pure chores such as upgrading a library are often better kept as plain tasks with a clear reason.

A story checker

The first stand-in checks a few mechanical slips: a missing template, a vague role, a solution hiding in the goal, a very short benefit, and an "and" that may mean two stories. These are heuristics, not truth, so expect false alarms. The point is to see how a review can be made concrete.

JS Check stories against the template

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Only the first story passes. The second names a vague role and prescribes a dropdown. The third is a task, not a story, because it hides who needs it and why. The fourth contains two wants joined by "and", which is a hint (not proof) that it could be two stories delivered separately.

INVEST: is the story any good?

The INVEST checklist is a widely used way to judge a story before it enters a Sprint. Each letter names one quality.

Letter Quality Question to ask
I Independent Can it be built and released without waiting for another story?
N Negotiable Is the detail open to discussion, or is it a fixed contract?
V Valuable Does a user or the business get something from it on its own?
E Estimable Does the team know enough to size it?
S Small Can it be finished in a fraction of a Sprint?
T Testable Could someone say clearly whether it works?

No story is perfect on all six at all times, and INVEST is about trade-offs. Independence is often partial (some stories have a natural order), and "estimable" sometimes needs a short experiment first, which is called a spike. But a story that fails several letters, such as one that is huge, vague and impossible to test, is not ready.

The letter teams struggle with most is Small. A story that takes the whole Sprint leaves no margin for surprises. A good target is that a team can finish several stories per developer per Sprint, so that progress is visible every few days.

Acceptance criteria

Acceptance criteria describe the conditions a story must meet to be accepted by the Product Owner. They answer "how will we know it is done for this story?". They are different from the Definition of Done, which applies to every item (code reviewed, tests passing). Acceptance criteria are specific to the story.

Two styles are popular.

A checklist is simple and works well for small stories:

TEXT
- A guest can cancel from the link in the confirmation email.
- Cancelling more than 24 hours ahead releases the table at once.
- The guest sees a confirmation message and receives an email.

Given-When-Then (also called Gherkin style) writes examples as scenarios:

GHERKIN
Scenario: Cancel a booking more than 24 hours ahead
  Given a booking for Saturday 19:00
  And today is Thursday
  When the guest cancels the booking
  Then the table is released
  And the guest receives a cancellation email
  • Given sets the starting state.
  • When is the single action or event.
  • Then is the observable outcome.
  • And continues the previous keyword.

Scenarios are concrete examples with real values. That makes them easy to discuss with non-technical people and easy to turn into automated tests (tools such as Cucumber read this format). A scenario should have exactly one When. If you need two, you probably have two scenarios.

Write the outcome as something you can observe ("the table is released"), not an action ("tap the confirm button"). Also mention at least one unhappy path per story, such as a late cancellation, because that is where defects hide.

A scenario checker

The second stand-in checks the structure of each scenario: all three keywords present, in order, one When, and no action hiding in a Then. Real Gherkin tools are far more capable. This one only shows what "well-formed" means.

JS Check Given-When-Then scenarios

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Splitting big stories

Stories that are too big go through an epic first. An epic is a large body of work that spans several Sprints, such as "Online booking". It is useful as a label and a planning view, but nobody can finish an epic in one Sprint. Before work begins, the Product Owner and Developers split it into stories, and split large stories into smaller ones.

The key rule is to split vertically: each piece should cut through every layer (screen, logic, data) and deliver something a user can notice. Splitting horizontally ("build the database", "build the screens") produces pieces that are worthless until all are done.

Some reliable ways to split:

  • By workflow step: "pick a time", "enter details", "pay", "get confirmation".
  • By rule or variation: one-person bookings first, groups later; card payment first, vouchers later.
  • By happy path and exceptions: the normal case now, the unusual errors next.
  • By data or platform: one restaurant location first, many later.
  • By simple and complex: a basic version of a feature first, then the advanced options.
  • By acceptance criteria: each scenario may become its own story.

If a story keeps growing during a discussion, write the new idea on its own card instead of adding it to the old one. Every extra "and" is a splitting point.

Always check that each slice still has value on its own and passes INVEST. A slice that does nothing for a user is often a sign you split by layer.

flowchart TD
  E["Epic: Online booking"] --> S1["Story: Pick date and time"]
  E --> S2["Story: Confirm by email"]
  E --> S3["Story: Cancel a booking"]
  S3 --> S3a["Cancel from the email link"]
  S3 --> S3b["Cancel late: fee applies"]

One epic becomes several stories, and a large story can be split again.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which part of a user story explains why it is worth doing?

    The benefit states the value to the person. It helps the Product Owner order the story and the team make good design choices.
  2. 2. In the INVEST checklist, what does the 'S' stand for?

    Small means the story can be finished in a fraction of a Sprint, which leaves room for surprises and shows progress often.
  3. 3. Which Given-When-Then scenario is best structured?

    It has one Given, one When and an observable Then, in that order. The others have two actions, a missing Given, or steps in the wrong order.
  4. 4. Which is a good way to split the epic 'Online booking'?

    Vertical slices, such as one workflow step, deliver value on their own. Splitting by technical layer gives pieces that are useless until all are finished.
  5. 5. How do acceptance criteria differ from the Definition of Done?

    Acceptance criteria are specific to a story. The Definition of Done is the shared quality bar every finished item must meet.

Summary

  • A user story says who wants what and why, in a few lines, and invites a conversation.
  • Write the need, not the solution, and always state the benefit.
  • Use INVEST (Independent, Negotiable, Valuable, Estimable, Small, Testable) to judge whether a story is ready.
  • Acceptance criteria make a story testable: use a checklist or Given-When-Then scenarios with one When each.
  • Epics are too big for a Sprint. Split them vertically by workflow step, rule, path or data so each slice delivers value.
  • Checkers can catch format slips, but only people can judge value.

Next, learn how teams size these stories in Estimating with Story Points.