Sub topic 4
Writing Stories and Acceptance Criteria Engineers Can Build From
Assume you already understand a product backlog and can describe a user problem. This chapter focuses on turning that problem into a small, testable slice of behavior. Your role is to explain the outcome and constraints. Engineers decide the implementation.
Start with the user outcome
A useful user story names:
- The user or actor
- The behavior they need
- The reason it matters
A common format is:
> As a [user], I want [behavior], so that [outcome].
For example:
> As a registered customer, I want to reset my password by email, so that I can regain access without contacting support.
This sentence is a conversation starter, not a complete specification. During refinement, discuss the normal path, important alternatives, data requirements, and boundaries. Keep the story small enough to estimate and finish within one sprint.
Make acceptance criteria testable
Acceptance criteria define observable conditions that must be true for the story to be accepted. They should describe behavior, not implementation details such as database tables, class names, or framework choices.
Given/When/Then scenarios work well:
Feature: Password reset by email
Scenario: Registered user requests a reset link
Given a registered user with the email "[email protected]"
When the user submits that email on the reset form
Then the system sends a reset link to that address
And the page shows a confirmation message
Scenario: Unregistered email is submitted
Given no account exists for "[email protected]"
When someone submits that email on the reset form
Then the page shows the same confirmation message
And no email is sentGiven establishes the starting state. When describes the action. Then states the result that a person or automated test can observe.
The second scenario captures a security requirement: the message does not reveal whether an account exists. Discuss such constraints explicitly with engineering, design, security, and legal stakeholders when they affect the product behavior.
Refine before planning
Bring a draft story to refinement with:
- The user problem and desired outcome
- Acceptance criteria, including important edge cases
- Designs, policies, or analytics requirements
- Known dependencies and unanswered questions
Ask engineers to challenge ambiguity. If the team cannot agree how to verify a criterion, the criterion is not yet clear. If the work contains major uncertainty, split out a short technical investigation, called a spike, rather than hiding the uncertainty inside the estimate.
Common errors
Avoid these patterns:
- Solution-first stories: “Build a React component...” hides the user outcome and constrains implementation too early.
- Vague criteria: “The page is user-friendly” cannot be tested consistently.
- One giant story: Combining registration, billing, reporting, and notifications makes progress difficult to evaluate.
- Missing failure paths: Describing only the happy path leaves important behavior for engineers to guess.
- Criteria that change during implementation: Record a genuine scope change and agree on its effect instead of silently moving the goal.
Exercise
A criterion says, “The export should be fast.” How would you make it testable?
Show answer
Define an observable limit and conditions, such as, “Given a report with up to 10,000 rows, when the user starts an export, then a downloadable file is available within 30 seconds.”