Blog
User Stories in Testing: Examples, BDD and Automation

Rishabh Kumar
Published on

Table of contents
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
Lorem ipsum
In testing, a user story tells you what to prove. It describes what a user needs and why, and its acceptance criteria say exactly what “done” looks like. Good testing turns each story into tests that show the software keeps that promise, release after release.
Most teams are good at writing stories and good at testing software. Where it goes wrong is the gap in between. The product owner writes the story, developers build it, testers rewrite it as test cases, and automation engineers rewrite those as scripts. By the time an automated test exists, the sprint has usually moved on, and the story’s meaning has shifted a little at every hand-off.
This guide is about closing that gap. It covers what makes a story testable, how to turn acceptance criteria into test cases, where BDD helps and where it doesn’t, and how AI is shortening the path from story to running test without taking people out of the decision.
What is a User Story in Testing?
A user story is a short description of something a user wants to do. Most teams write it in the same format.
As a [type of user], I want [goal] so that [reason].
That simple shape keeps attention on who needs the feature, what they’re trying to achieve and why it matters.
Why Stories Help Testers
Instead of checking software against a technical specification, you check it against a real need. Take this story.
As an insurance claims adjuster, I want to upload several damage photos at once, so that I can document incidents quickly during field visits.
It tells you who to test as, what to try and what success looks like for that person.
Acceptance Criteria Turn a Story into Something You Can Test
A story on its own is too loose to test against. Acceptance criteria are the specific conditions that must be true for the story to count as done. For the claims adjuster, they might look like this.
Up to 10 photos can be selected at once.
Each photo can be up to 10MB.
Progress shows for each photo separately.
Only JPEG, PNG and HEIC files are accepted.
A confirmation appears when every upload has finished.
A failed upload shows a specific error.
Now everyone shares the same definition of done. Developers know what to build, testers know what to check, and the product owner can confirm the result matches the request.
Acceptance criteria cover one story, while the quality bar every story has to meet lives in the team’s definition of done.
How to Write User Stories That Are Easy to Test
Most testing problems start in the story. If you can’t say how you’d prove a story is done, it isn’t ready for the sprint, however well it’s written.
Five habits make the biggest difference.
Be Specific About the User and the Outcome
A vague story gives a tester nothing to check. A specific one names the user, the goal and a measure you can see.
Too Vague to Test | Ready to Test |
|---|---|
As a user, I want better performance. | As a customer service agent, I want search results within two seconds, so that I don’t keep customers waiting. |
As a customer, I want an easier checkout. | As a returning customer, I want my saved card offered at checkout, so that I can pay without typing my details again. |
Keep Stories Small
“As an admin, I want complete user management” sounds like one story. It’s really three or four.
As an admin, I want to create user accounts.
As an admin, I want to change a user’s permissions.
As an admin, I want to deactivate an account.
Small stories are easier to build, test and release on their own. When a test fails, it points straight at the problem.
Check Every Story Against INVEST
Many teams run each story through the INVEST checklist before it enters a sprint. A good story passes six checks.
Independent. It can be built and tested without waiting for another story.
Negotiable. The details can still be discussed.
Valuable. It delivers something a user or the business cares about.
Estimable. The team can size it.
Small. It fits comfortably in a sprint.
Testable. Everyone knows how to prove it’s done.
For testers, the last check matters most. If it fails, the others don’t count for much.
Write Acceptance Criteria for the “No” Paths
The happy path is rarely where bugs live. Good criteria also cover errors, limits, duplicate actions and other parts of the system. For a registration story, that means writing criteria for situations like these.
Someone registers with an email that’s already in use.
A password breaks the rules.
The confirmation email doesn’t arrive.
Two people register with the same email at the same moment.
Refine Stories Together
When the product owner, a developer and a tester refine a story before the sprint, ambiguity surfaces early. Many teams call this the “three amigos”. Testers bring the most useful questions to the room.
How will we know this works?
What could go wrong?
What happens at the edges?
What else in the system does this touch?

Planning refusals as carefully as successes is the habit positive vs negative testing builds, and every limit in your criteria deserves a test at its edge through boundary value analysis.
Turning a User Story into Test Cases
The simplest reliable method is to take each acceptance criterion and write at least one test that proves it, plus one for each way it could fail.
Here’s what that looks like for the photo upload story.
Upload five valid JPEG photos at once, and check all five upload successfully.
Check each photo shows its own progress while uploading.
Upload exactly 10 photos, and check all 10 are accepted.
Try to upload 11 photos, and check the limit message appears and nothing uploads.
Upload a 10MB photo, and check it’s accepted.
Upload a 12MB photo, and check the size error appears.
Upload a GIF, and check the format error appears.
Simulate a failed upload, and check the specific error message appears for that photo.
Check the confirmation appears only once every upload has finished.
Six acceptance criteria became nine test cases, and every one links back to the criterion it proves. That link is what lets you answer “is this story done?” with evidence rather than a feeling.
If you’re new to breaking stories down this way, our guide to test cases vs test scenarios explains where each fits.
Where BDD Helps, and Where It Doesn’t
Behaviour-driven development (BDD) was designed to close the story-to-test gap. It writes acceptance criteria in a structured language that both people and tools can read.
What a Story Looks Like in Gherkin
BDD’s language, Gherkin, uses Given to set the scene, When for the action and Then for the expected result. Here’s part of the photo upload story.
Gherkin
What BDD Does Well
Everyone in the team can read a Gherkin scenario. That’s BDD’s real strength. It forces the conversation about behaviour to happen before anyone writes code, and the scenarios double as documentation.
Where BDD Falls Short
Every Gherkin step needs a step definition underneath, a piece of code that finds the right elements, performs the action and checks the result. “When I select 5 JPEG photos” is one readable line, backed by code someone has to write, and fix every time the upload screen changes.
Teams adopting BDD often find they’ve moved the coding effort rather than removed it.
Whether BDD or test-driven development suits your team depends on who writes the tests and why, as our comparison of TDD vs BDD explains.
How AI Shortens the Path from Story to Test
AI test platforms work from the story and its criteria directly, instead of passing them through several rounds of translation. In my view, the important question isn’t how fast that happens. It’s who decides whether the result is right.
Drafted from the Story, Approved by a Person
In Virtuoso QA, Touchstone’s agents read your stories, acceptance criteria and supporting documents. They turn them into requirements that cite the story they came from, then draft journeys that test each criterion, including the limits and failures.
Nothing joins the suite until a named person reviews and approves it. The tester’s job moves from writing every test to checking drafts against the story, and adding the cases only someone with domain knowledge would think of.
Plain English Instead of Step Definitions
The journeys are written in plain English, so there’s no code layer underneath. Steps like “Upload the five photos to Damage photos” and “Look for ‘5 photos uploaded’” are the test.
Business analysts and product owners can read them, and even write them. That means the person who wrote the story can check the test proves what they meant.
As people write, StepIQ suggests the likely next step, and each step runs against the live application straight away.

Three Ways to Turn Stories into Automated Tests
Here’s how the three approaches compare for a typical sprint of around 20 stories. The timings are illustrative, and will vary with your stories and your team.
Manual Translation | Gherkin with Coded Steps | AI-Drafted, Human-Approved | |
|---|---|---|---|
How it works | Testers write test cases, then engineers code them | The team writes scenarios, then engineers code each step | AI drafts journeys from stories, and a person approves them |
Typical time | Two to five weeks | Two to four weeks | Hours to a day or two, including review |
Who can contribute | Testers, then engineers | Anyone for scenarios, engineers for steps | Testers, analysts and product owners |
Tests ready in the same sprint? | Rarely | Sometimes | Usually |
When the UI changes | Test cases and scripts both need updating | Scenarios survive, step code breaks | Fixes are proposed for someone to approve |
Link back to the story | Kept by hand | Through feature files and tags | Each requirement cites its story, and each test links to its requirement |
What the AI approach shouldn’t do is skip the review. A test nobody has checked against the story isn’t evidence that the story is done. It’s just a green tick.
Testing Stories Before They’re Built
Acceptance test-driven development (ATDD) applies the test-first idea to whole stories. You write the acceptance tests before development starts, watch them fail, then watch them pass as the feature is built. It’s a great way to make “done” concrete, but writing every test by hand before the sprint has always made it hard to sustain.
When draft tests can be produced during refinement and approved the same day, ATDD becomes practical. Developers start the sprint with the story and a set of tests that define done, and the team gets a live view of progress as tests turn from red to green.
The same red-to-green rhythm at the level of individual functions is covered in our guide to test-driven development.
Keeping Stories, Tests and Results Connected
Story-based testing only works while the links hold. When a story changes, you need to know which tests it affects. When a test fails, you need to know which story is at risk.
And when an auditor or release board asks how a requirement was checked, you need an answer you can show.
Link Every Test to Its Story
Most agile teams keep their stories in Jira. Virtuoso QA links tests to Jira issues. Inside the platform, each requirement cites its story, each journey links to the requirement it proves, and each run records the result and who approved the test. That chain is what turns a passing suite into evidence.
Keeping that chain intact as stories change between sprints is the job of a requirements traceability matrix.
Use Test Data That Matches the Story
A claims story needs policies, a patient story needs records, and a shop story needs products and accounts. Data-driven journeys let one test run across many rows. A single story can then be checked for a UK customer paying in pounds, a German customer paying in euros and a customer with an expired card.
In Virtuoso QA, you can describe the data you need in plain English, and AI generates it in a table for you to review.
Building that variety without copying real customers into test systems keeps you clear of privacy problems, as our explainer on synthetic test data shows.
Keep Existing BDD Suites Running
If you already run Cucumber or SpecFlow suites, there’s no need to replace them overnight. Many teams keep BDD suites for the areas they cover well, and use plain English journeys for new stories and for journeys that cross several systems.
Where Story-Based Testing Is Heading
AI is starting to read stories critically, not just turn them into tests. Expect tools that point out ambiguous wording, suggest acceptance criteria a similar story had and flag when a story is likely to touch other systems, all before anyone writes code. When stories change mid-sprint, as they always do, AI will draft the updated tests for someone to approve, while leaving coverage for the unchanged parts alone.
The part I’d hold on to is the human decision. However good the drafting gets, someone still has to decide what “done” means for this story, and whether the tests prove it.
Turn User Stories into Approved, Running Tests with Virtuoso QA
The gap between a story and a running test has always been filled with hand-offs. Virtuoso QA closes it while keeping people in charge. Touchstone drafts journeys from your stories and acceptance criteria, each citing its source, and a named person approves what joins the suite. Testers, analysts and product owners work in plain English, and every run records the story, the result and the approver.
User Stories in Testing FAQs
What is a user story in testing?
What's the difference between a user story and acceptance criteria?
How do you write test cases from user stories?
Do I need Gherkin to test user stories?
Can AI write tests from user stories?
What makes a user story testable?
Written by

Rishabh Kumar
AI Testing & Quality Engineering Contributor
Rishabh leads business development and marketing at Virtuoso QA. He writes about AI-powered test automation, end-to-end testing, self-healing tests, and quality engineering, exploring how these capabilities can improve test coverage, reduce test maintenance, and support reliable software releases.









