Requirements Analysis & Specification

User Stories & Acceptance Criteria

18 min Lesson 5 of 10

User Stories & Acceptance Criteria

A use case can run to four pages. A bullet-point requirement list can bury the actual need under layers of system-speak. User stories were invented to fight both problems: they keep the conversation anchored to real people with real goals, and they deliberately stay short enough to fit on an index card. This lesson teaches you to write stories that are genuinely useful, evaluate them with the INVEST criteria, and pin down exactly what "done" means through Given-When-Then acceptance criteria.

The Three-Part User Story Formula

The canonical form is deceptively simple:

As a <role>, I want <goal>, so that <business value>.

Each part does a specific job. The role names the person whose life will change — not "the system" or "a user", but a concrete persona: receptionist, warehouse supervisor, returning customer. The goal describes an action, framed from the user's perspective. The so that clause states the reason — the outcome the user cares about. That third clause is the one teams most often drop, and it is the most valuable: it tells the team what success looks like and prevents over-engineering.

Three examples from different domains:

  • Clinic booking system: As a patient, I want to cancel my appointment from my phone, so that I do not need to call the clinic during office hours.
  • Online store: As a returning customer, I want to see my previous order history on one page, so that I can quickly reorder items I buy regularly.
  • Logistics firm: As a dispatch supervisor, I want to receive an alert when a delivery is more than 30 minutes late, so that I can proactively contact the driver and update the customer.

Notice what these stories do not say: they do not mention databases, API endpoints, or UI frameworks. That is intentional. A story is a placeholder for a conversation, not a complete specification. The detail lives in the acceptance criteria.

Stories vs Requirements: A traditional requirement says what the system shall do. A user story says why a person needs it. Both have a place; stories are the preferred format for Agile backlogs because they keep empathy front and centre throughout development.

INVEST: Six Criteria for a Healthy Story

Bill Wake's INVEST mnemonic gives analysts and product owners a fast quality check for every story before it enters a sprint. A story that fails one criterion will almost certainly cause problems in delivery.

INVEST criteria — six hexagons with labels INVEST — Six Criteria for a Good User Story I Independent Can be built and delivered on its own without another story N Negotiable Details are open for discussion between team and stakeholder V Valuable Delivers real benefit to a user or the business E Estimable Team can size it; ambiguity is resolved before sprint start S Small Completable in one sprint (split epics into child stories) T Testable Acceptance criteria exist so a tester can pass or fail it
INVEST mnemonic: six properties every well-formed user story should satisfy before entering a sprint.

A common INVEST failure in the wild is the non-independent story — for example, "As a patient, I want to log in" listed as a hard dependency before every other story can begin. The solution is to make login an enabler handled in the first sprint's infrastructure, not a formal story that blocks the entire backlog. Another frequent failure is the non-small story, called an epic: "As a customer, I want to manage my account" is not a story — it is a theme that will split into at least a dozen stories covering registration, login, profile editing, password reset, and order history.

Splitting epics: When a story feels too large, ask "What is the smallest version of this that still delivers value to the user?" Split along user types, data volume, happy path vs edge cases, or read vs write operations. Each resulting story must still pass the INVEST test independently.

Acceptance Criteria: Given-When-Then

The user story describes the desire; acceptance criteria describe the contract. They answer: how will we know, unambiguously, that this story has been fulfilled? The most widely used format is Given-When-Then (GWT), originating in Behaviour-Driven Development (BDD):

Given <an initial context or system state>, When <an action or event occurs>, Then <an observable outcome should follow>.

GWT forces three things: it names the starting condition (so tests are reproducible), it names the trigger (exactly one thing the user or system does), and it names the expected outcome (something a tester can observe and verify). Let us build a complete example for the clinic booking system.

Story: As a patient, I want to cancel my appointment from my phone, so that I do not need to call the clinic during office hours.

Acceptance Criteria:

  1. Happy path — successful cancellation:
    Given I am logged in and I have an appointment booked for a future date,
    When I tap "Cancel Appointment" and confirm the action,
    Then the appointment status changes to "Cancelled", the slot becomes available for other patients, and I receive an SMS confirmation within 2 minutes.
  2. Cancellation window constraint:
    Given I have an appointment booked for within the next 2 hours,
    When I attempt to cancel,
    Then the app displays the message "Appointments cannot be cancelled within 2 hours of the scheduled time. Please call the clinic on 555-0100."
  3. Already cancelled:
    Given I have an appointment that is already in "Cancelled" status,
    When I navigate to that appointment detail,
    Then the "Cancel Appointment" button is hidden and the status label reads "Cancelled".
One story, multiple criteria: A well-scoped story typically has 3–6 acceptance criteria covering the happy path, key edge cases, and error states. Fewer than two criteria is a warning sign that the story was not thought through; more than eight suggests the story should be split.
Given-When-Then flow — three-column anatomy of an acceptance criterion Anatomy of a Given-When-Then Acceptance Criterion GIVEN Initial Context System state before the action; makes the test repeatable. e.g. "Given the user is logged in and has a future booking" WHEN Trigger Action One specific action the user or system performs. e.g. "When the user taps Cancel and confirms" THEN Observable Outcome Verifiable result a tester can observe or measure. e.g. "Then status changes to Cancelled and SMS is sent" Each criterion = one testable scenario. Multiple criteria cover happy paths, edge cases, and errors.
The three parts of a Given-When-Then criterion and what each part must specify.

Common Pitfalls and How to Avoid Them

Even experienced analysts make the following mistakes:

  • Skipping the "so that" clause. Without a stated business value, developers default to the cheapest implementation — which may not serve the real need. Always write all three parts.
  • Writing stories for the system, not the user. "As the system, I want to validate the email address format" is a technical task, not a story. Rephrase as a user need or move it to a technical backlog item.
  • Vague acceptance criteria. "Then the page loads quickly" is untestable. "Then the booking confirmation page renders in under 1.5 seconds on a 4G connection" is testable.
  • Missing negative scenarios. Most stories need at least one criterion describing what happens when an action fails or is blocked. Negative paths prevent silent failures in production.
Acceptance criteria are not UI designs. Saying "Then a green tick icon appears in the top-right corner" over-specifies the UI and locks designers out of better solutions. Prefer outcome language: "Then the user receives a visual confirmation of success." Let the design team decide what that looks like.

From Stories to Sprint-Ready Backlog Items

In practice, the analyst and product owner write stories, attach GWT acceptance criteria, and then the development team reviews each story in a backlog refinement session. The team confirms the story passes INVEST, estimates it (story points or hours), and flags any missing criteria. Only after this conversation is the story considered sprint-ready. The acceptance criteria then drive test case creation: each GWT criterion maps directly to at least one automated or manual test, creating a living traceability thread from business need all the way to passing tests in CI/CD.

Mastering user stories is not about following a template — it is about building a habit of asking: who benefits, what do they need to do, why does it matter, and how will we know we succeeded? That habit, applied consistently, produces backlogs that teams actually understand and software that stakeholders actually wanted.