Skip to content
TestLine Menu
TestLine
QA process

How to test requirements before the code is written? Reviewing user stories

Questions that catch gaps in requirements before anyone writes code, an example of an improved user story and short meeting formats that help.

author
Artur Machowski, Senior QA Engineer
published
reading
6 min

Short answer

You test requirements by asking about edge cases, errors and data before anyone writes code. The simplest way: the tester reviews every user story during planning, asks 10-12 standard questions and adds the missing acceptance criteria in “Given… when… then…” format. Short meeting formats help: three amigos (product owner, developer, tester, 15-30 minutes per story) or example mapping (25 minutes, rules and examples). A question during planning takes a minute; the same gap found in production costs a fix and a new release.

12 questions for every user story

  1. Who exactly is the user? Are there different roles?
  2. What happens with invalid data? What message?
  3. What if the user doesn’t have permission?
  4. What does the empty state look like: an empty list, a new user?
  5. What about a very large amount of data: 10,000 items, long names?
  6. What about data that already exists? Does it need migrating?
  7. What are the limits: numbers, lengths, amounts?
  8. What if an external service doesn’t respond?
  9. What if two users do the same thing at once?
  10. What does it look like on a phone?
  11. Does the change affect other features: reports, emails, exports?
  12. How will we know the feature works in production?

Not every question fits every story. It’s enough for 2-3 of them to catch a gap.

Example: before and after review

Before:

As a customer I want to add a discount code in the cart so that I pay less.

After review, acceptance criteria:

  • Given an active -10% code, when I enter it in the cart, then the total drops by 10% and I see the code’s name.
  • Given an expired code, when I enter it, then I see the message “Code expired” and the total doesn’t change.
  • Given one code already in the cart, when I enter a second, then the second replaces the first (codes don’t stack).
  • Given a code with a minimum order of PLN 200, when I remove products and the total falls below PLN 200, then the code is removed with a message.
  • Given a code in the cart, when I go to payment, then the amount at the payment provider equals the discounted total.

Five sentences that save several bug reports and one post-release argument. Other shop cases are covered in e-commerce testing before peak season.

Example mapping in 25 minutes

card colourwhat we writeexample
yellowuser storydiscount code in the cart
bluerulecodes don’t stack
greenexample for a ruleI enter a second code, the first disappears
redunanswered questiondoes the code work on products already on sale?

If there are more red cards than green ones, the story isn’t ready for development. The questions go to the product owner and the story comes back at the next planning session.

When to do it

  • during backlog refinement: the tester reads the story before the meeting and comes with questions;
  • before work starts: 15-30 minutes of three amigos for bigger stories;
  • not after the fact: reviewing requirements after the code is written is already testing, not prevention.

Reviewing requirements is one of the practices in how to reduce bugs in production. Finished acceptance criteria come in handy later in user acceptance testing with the client.

How I can help

As part of QA support I take part in planning and review user stories before development. In a QA audit I check how many production bugs come from requirements and suggest how to change that. Describe your team in the contact form.

Frequently asked questions

Why test requirements before development?

Because a requirements bug is cheapest to fix before the code exists. A question asked during planning takes a minute. The same gap found in production means a fix, a new release and sometimes a conversation with the customer.

What questions should I ask when reviewing a user story?

Who exactly the user is, what happens with invalid data, without permissions, with an empty list, with a very large amount of data, what about existing data, what the limits are, what a mobile user sees and how we'll know the feature works.

What is example mapping?

A short session, usually 25 minutes, where the team breaks a user story down into rules and concrete examples for each rule, and writes unanswered questions down separately. If there are more questions than examples, the story isn't ready for development.

What is a three amigos meeting?

A short conversation between the product owner, a developer and a tester about one user story before work starts. Each looks from a different angle: business, implementation, risk. It usually takes 15-30 minutes.

Does a tester need to know the business to review requirements?

Not better than the product owner. It's enough to ask about edge cases, errors and data. Precisely because they look from the outside, they see gaps the author of the requirement considers obvious.

Got a release in a few weeks?

Describe your project in the form. I'll reply with questions about scope or an initial test plan.