Module 3. Practice: from requirements to automated tests · Lesson 20 of 41 · 14 min
Requirements analysis: reviewing the spec before development starts
Testing requirements, ambiguous words, acceptance criteria and questions for the analyst — on a real user story.
Testing starts with a document
The cheapest defect is the one found in the text of a requirement: it's fixed in five minutes, with no code, no regression and no release. That's why a tester's first task on a new feature is a requirements review.
In this module we take one feature all the way from the document to the release verdict. Here it is:
US-214. Promo code in the cart. A user can enter a promo code and get a discount. The discount is applied to the order total quickly. The promo code has a limited validity period.
What to look for in a requirement
| Problem | Symptom | Example question |
|---|---|---|
| Ambiguity | "quickly", "user-friendly", "usually", "etc." | How many milliseconds is "quickly"? |
| Missing limits | No minimum, maximum or format | How long is the code? Is it case-sensitive? |
| Missing negative scenarios | Only success is described | What does the user see if the code has expired? |
| Contradictions | Two items say different things | Item 2 discounts the total, item 5 a single product? |
| Not testable | No observable result | How do we know the discount was "applied"? |
| Hidden dependencies | Integrations, roles, locales | Does the code work in the mobile app? |
Acceptance criteria
Good acceptance criteria are almost test cases already. The Given / When / Then format forces you to describe the state, the action and the observable result:
Given the cart contains items totaling $125.00
And promo code SALE10 is active through 11/30/2026 inclusive
When the user enters SALE10 and clicks "Apply"
Then the amount due becomes $112.50
And "10% discount applied" appears under the field
Review checklist
- Every statement can be verified and the result observed
- Every field has a known type, format, limits and whether it's required
- Errors and user-facing messages are described
- It's clear what happens to the data (storage, logging, audit)
- Roles and permissions are named
- Non-functional requirements have numbers (response time, load)
- No undefined weasel words
How to report the result
Don't rewrite the requirement yourself. Leave a numbered list of questions in a comment on the ticket or in the test plan and agree on who answers them. An unanswered question is a risk, and it must be visible in the release test plan.
Testability
During the review, ask for things that make testing easier: stable attributes for automation (data-testid), an endpoint for test data setup, logging with a request ID, a feature flag for gradual rollout. They're cheap at design time and expensive later.
Key takeaways
- A defect in a requirement is the cheapest: it's found before any code exists.
- Look for ambiguous words, missing limits and missing negative scenarios.
- Given/When/Then acceptance criteria are almost ready-made test cases.
Check yourself
1. Which requirement is testable?
2. The requirement doesn't describe what happens with an expired promo code. What do you do?
3. Why does QA ask for data-testid during design?