Skip to content
Quality and testing16 min

Beyond the happy path: how to design the test scenarios that actually find errors

By · co-founder and Chief Executive Officer of Hábil ·

Which test scenarios add value, which are almost always forgotten, and a step-by-step method to find them: limits, states, time, retries, permissions and more.

Illustrative scenario. A retail chain releases its new checkout flow on a Friday. All the tests passed: the customer picks a product, pays by card and receives a confirmation. On Monday, support has three complaints that nobody had seen. One customer paid twice because their phone lost its signal and they pressed "Pay" again. An order placed at 23:58 on December 31 was recorded with next year's date. And a "once per customer" coupon was used four times, from four tabs open at the same moment.

None of those three errors was hidden. All three were off the happy path: the route where everything goes well, the user does what is expected and every system answers on time. It is the first scenario we all think of, and it is usually the only one that gets tested in depth.

This article is for whoever answers for what happens on Monday: QA and development leads. It explains which families of scenarios are worth covering, which ones are almost always forgotten —with a concrete example of each— and a step-by-step method to find the fine-grained scenarios without depending on the inspiration of the day. At the end there is a list you can copy into your next user story.

If you are interested in the other half of the topic —which types of test exist and why a green dashboard guarantees nothing—, the related article is "Tests that actually catch errors".

A good scenario is not the one with the most cases

Cem Kaner, a professor at the Florida Institute of Technology, wrote in 2003 one of the most useful definitions of what makes a test case good [2]. Among his criteria, three work as a compass:

  • Powerful: it is more likely to expose an error if the error is there.
  • Significant: if it finds a problem, someone with influence would protest if it were not fixed.
  • Credible: whoever writes the code or makes the decision accepts it as something that can really happen.

Kaner quotes the phrase used to dismiss an uncomfortable scenario: "nobody would do that" [2]. It is the phrase that lets the most errors through to production. The customer who presses "Pay" twice is not unusual: it is anyone with a bad signal. When a scenario is dismissed with that phrase, it is worth asking how many times a day it happens in real life, not whether it sounds strange in the meeting.

The second compass is risk. The official ISTQB syllabus —the international body that certifies testing professionals— defines the risk level as the combination of likelihood and impact, and in the quantitative approach it calculates it as their product [1]. A scenario that rarely fails but costs a lot (a duplicate charge) deserves more attention than one that fails often but costs nothing (a misaligned label).

The families of scenarios

A practical way not to forget anything is to walk through families. Each one asks the system a different question.

The families of scenarios
FamilyThe question it asksShort example
Happy pathDoes it work when everything goes well?Purchase with a valid card and home delivery
LimitsWhat happens right at the edge of a rule?Free shipping from $1,000: test $999.99 and $1,000.00
NegativeDoes it correctly reject what it should reject?Expired card, postal code that does not exist
ConcurrencyWhat happens if two things occur at once?Two people reserve the last item in the same second
State and orderDoes it respect the sequence? What if a step is skipped?Cancelling an order that has already left the warehouse
Time and time zoneWhat happens at the change of day, month, year or time?Order at 23:58 on 31-Dec
Dirty dataDoes it hold up to what people really type?Surname with an apostrophe, name with accents or emojis
Integrations downWhat happens if the other system is slow or does not answer?The payment gateway answers after 40 seconds
PermissionsDoes everyone see and do only what is theirs?Changing the order number in the URL and seeing another customer's order
Idempotency and retriesDoes repeating the same request produce the same effect only once?The customer presses "Pay" twice
Quality of use and operationDoes it remain usable, accessible and within its target time under the expected load?A person using only a keyboard completes the payment; 500 simultaneous purchases stay within the agreed time

The happy path comes first because, if it fails, nothing else matters. But it is one row out of eleven. The last row is not covered by this article: performance, accessibility and security have their own specialized tests, and here it is enough to derive from them the scenarios for each story.

The scenarios that are almost always forgotten

1. The exact limit

ISTQB explains that boundary value analysis exists because whoever writes the code makes the most mistakes at the edges: the implemented limit ends up one place above or below what was requested, or is not implemented at all [1]. MITRE, the organization that maintains the international catalog of software weaknesses (CWE), has its own entry for that error: the off-by-one, "one too many or one too few" [11].

Scenario (retail). "Free shipping on purchases from $1,000". Does a cart of exactly $1,000.00 get free shipping? If the code says "greater than" instead of "greater than or equal to," it does not. It is tested with $999.99 (does not apply) and $1,000.00 (applies). ISTQB calls this two-value analysis; three-value analysis tests the boundary and its two neighbors: $999.99, $1,000.00 and $1,000.01 [1].

2. Two things at the same time

MITRE has another entry for what happens when two processes use the same resource without coordinating: the race condition [10]. It almost never shows up in manual testing, because a person does one thing at a time.

Scenario (retail). The "once per customer" coupon. The system checks "has it already been used?", answers no, and applies it. If four tabs ask at the same instant, all four receive "no" before any of them marks it as used. OWASP, the open foundation for application security, includes in its testing guide a specific case for limits on how many times a function can be used and another for process timing [4].

How it is tested: several identical requests fired in parallel, not one after another.

3. The order and the shortcuts

ISTQB proposes modeling behavior as a state diagram: possible states, the events that change them and the conditions that allow it. Its advantage over the diagram is the state table, which also shows the invalid transitions: the empty cells [1]. Every empty cell is a decision that someone has to make and a test that someone has to run.

Scenario (logistics). A shipment goes through created → picked up → in transit → delivered. What happens if the "delivered" event arrives before "in transit," because the courier had a bad signal and their phone sent the events out of order? And if "cancelled" arrives when it is already "delivered"? OWASP also has a case for circumventing workflow steps [4]: if the system accepts the confirmation without having gone through payment, the flow is exposed to abuse.

4. The clock

Scenario (insurance). A policy expires "on December 31." At 00:00 or at 23:59:59? In whose time? If the server stores the time in UTC (universal time) and Mexico City is six hours behind, a claim reported at 19:00 on December 31 in Mexico City is already January 1 on the server.

A fact worth keeping in mind: Mexico City no longer changes its time. The Time Zones Law left daylight saving time only for municipalities on the northern border, and Mexico City has not moved the clock since October 30, 2022 [13]. A system that still subtracts or adds an hour in April and October is wrong, and only a test with those dates will discover it.

Dates that are always worth testing: the last second of the day, the month and the year; February 29; and, if you serve other countries, the daylight saving change dates of each one.

5. The data people really type

Patrick McKenzie published a famous list of false assumptions about people's names; the first is that every person has exactly one canonical full name [9]. Every item on his list is false, he says, and each one can become a validation or a screen that shuts out a real person. There is also a public list of text strings that tend to break systems —special characters, empty texts, emojis, texts in other alphabets— designed to be used as test data [12].

Scenario (banking). A customer is named María José O'Connor Núñez. The apostrophe breaks the query, the "ñ" is saved as "ñ" and the account statement comes out with a name that the bank cannot match against their ID.

6. The other system that does not answer

The Principles of Chaos Engineering, a public manifesto of the practice, propose deliberately introducing real-world events: servers that go down, disks that fail, network connections that are cut [6]. Their authors prefer to experiment in production, with safeguards. Short of that, you can rehearse in a controlled environment what your system does when a dependency is slow, returns an error or never answers.

Scenario (retail). The payment gateway takes 40 seconds. Your system gave up at 30 and showed the customer "error." But the gateway did charge. Who tells the customer? Does the order exist or not?

7. Seeing what is not yours

OWASP publishes every few years its list of the ten most important risks for web applications. In the 2025 edition, first place goes to broken access control. In the set of applications that OWASP analyzed with data contributed for that edition, all of them showed some form of that error [5]; it is not a rate that can be carried over on its own to any portfolio, but it says a lot about how common it is.

Scenario (insurance). Agent A opens …/polizas/1043. She changes the number in the address to 1044 and sees the policy of a customer of agent B. The screen "works": no permission is missing from the menu. What is missing is the server-side check.

How it is tested: every important scenario is repeated with another user: one without a session, one from a different area and one with fewer permissions.

8. The same request twice

In its technical library, AWS (Amazon's cloud division) maintains that operations with side effects are not safe to retry unless they are idempotent: that is, they guarantee the effect happens only once, no matter how many times it is retried [7]. Stripe, a payments platform, documents how it solves this: the client sends an idempotency key with each operation, and repeating it does not execute the same operation twice; the exact response it receives depends on its API version [8]. The IETF, the body that writes internet standards, maintains an active draft for the Idempotency-Key header; it is not yet a standard [3].

Scenario (banking). A transfer is sent, the network drops before the response and the application retries on its own. Does the recipient receive one transfer or two? This scenario is not discovered by pressing a button twice calmly: it is discovered by cutting the connection right after sending.

The method: how to find the fine-grained scenarios

Inspiration helps, but a shared method makes scenario design repeatable. These seven techniques help discover test conditions. To turn each condition into a case that someone can run tomorrow, also write down the precondition, the data, the event or request, the expected result and state, the environment, the evidence and who tests it [1][2]. Five of them are in the official ISTQB syllabus (steps 2 to 5 and 7) [1]; the first comes from the Cucumber community [15] and the sixth has research backing from NIST [14].

Step 1 · Start with the rules, not the screens. Example Mapping, the method by Matt Wynne, co-founder of Cucumber, organizes the conversation about a story on cards of four colors [15]: the story in yellow, each rule in blue, the examples of each rule in green and the questions nobody knows how to answer in red. Some rules are so obvious that they need no example, says Wynne [15]; for the others, a rule without a concrete example calls for confirming how it will be checked and what its expected result is. A red card is a scenario that someone was going to discover in production.

Step 2 · Split the data into groups that behave the same. This is equivalence partitioning: if one value from a group finds an error, any other from the same group would find it, so one per group is enough [1]. For a policy enrollment age from 18 to 70: under 18, from 18 to 70, over 70. And one group that gets forgotten: what is not an age (empty, text, negative).

Step 3 · Test the edges of each group. Boundary value analysis applies to ordered groups. With two values you test the boundary and its neighbor from the adjacent group: 17 and 18, 70 and 71. With three, the boundary and its two neighbors [1].

Step 4 · When several conditions decide together, make a table. The decision table puts the conditions and actions in rows, and each combination in columns [1]. Example: "Frequent customer? Purchase over $1,000? Pays with the house card?" Three yes-or-no conditions produce up to eight combinations. For each one, define the expected result, including rejecting or doing nothing; if you cannot define it, there is a pending business rule.

Step 5 · Draw the states and decide each empty cell. The state diagram and its table [1]. Each empty cell raises a decision: if this event arrives in this state, should the system reject it, ignore it while leaving a record, or apply another rule? Test one invalid transition per case, so that one error does not mask another, and check the response, the final state and what should not have changed.

Step 6 · Combine in pairs, not everything against everything. NIST, the United States standards institute, reports that many known failures involve one or two parameters, and that those needing three or more are progressively less frequent [14]. That is why it is worth starting with pairwise coverage (two by two) to reduce the number of tests, and moving up to three or more variables when the risk analysis calls for it; neither replaces the rules, the limits or the security tests. NIST publishes a free tool to generate those combinations, ACTS [14].

Scenario (retail): the payment process has four variables with three options each: payment method (card, transfer, cash in store), delivery (home, in-store pickup, parcel service), customer type (new, frequent, business) and device (web, Android, iOS). Testing every combination gives 3 × 3 × 3 × 3 = 81 tests. With 9 well-chosen tests, every pair of options is covered at least once. (Verified with an orthogonal array of nine rows: the six pairs of variables are covered with their nine combinations.) This shows pairwise coverage; it does not replace cases with three or more variables when the risk demands them.

Step 7 · Guess with method and explore with time. ISTQB recognizes two experience-based techniques that complement the previous ones: error guessing —anticipating failures from how the application has failed before and from the typical mistakes of whoever writes the code— and exploratory testing, where you design, execute and evaluate at the same time [1]. An exploratory session pays off when it has a defined time, a written objective —for example, "abuse the once-per-customer coupon"—, notes on what was tried and a closing step in which you decide which findings become permanent tests [1]. The families in this article are, precisely, a list to inform error guessing.

And at the end, order by risk. Likelihood times impact [1]. Not all scenarios are worth the same, and your time is not infinite either.

A checklist for your next user story

ISTQB recommends that each item on a checklist be checkable separately and directly, that it not be too general, and warns that a checklist loses strength over time, when the team learns to avoid those errors; that is why it should be updated [1]. This one is ours, to copy and adjust. Each box is ticked only when there is an expected result and evidence:

SCENARIOS — story: ____________________ [ ] Happy path: I ran the main flow end to end and recorded the expected result.[ ] Limits: for each ordered rule, I tested the boundary and the neighbor on each side, with an expected result.[ ] Negative: I tested empty, invalid format and out of range; the system rejects and says what to correct.[ ] Concurrency: I launched N simultaneous requests of the same operation and checked that constraint in the stored data.[ ] State: for each prioritized invalid transition, I recorded event, initial state, response and final state.[ ] Shortcuts: I tried the last step without the previous ones and the server rejected it.[ ] Time: I tested end of day, month and year, February 29 and the user's time zone.[ ] Real data: I tested accents, ñ, apostrophes, emojis, very long texts and leading or trailing spaces.[ ] Dependencies: I simulated delay, error and silence from each critical dependency; I checked waiting behavior, notification and recovery.[ ] Permissions: I tested the critical resource with no session, with an insufficient role and with another customer; the server rejected it.[ ] Retries: I repeated the operation with the same idempotency key; there was a single effect.[ ] Use and operation: I defined the task, the assistive technology or the load, and the measurable acceptance criterion.[ ] If applicable — currency and country: I tested format, rounding, currency and zone of the target market.[ ] If applicable — migration and configuration: I tested prior data, rollback and each flag that changes the rule.[ ] If applicable — retention and deletion: I checked deletion, legal retention, backups and later access.[ ] Risk: I ordered the scenarios by likelihood × impact.[ ] Open questions: each has an expected decision, an owner and a date; without that it is not marked as tested.

Where to start

  1. Take the riskiest user story of your next sprint —the one that moves money, personal data or inventory— and run a 25-minute example mapping with your team.
  2. Run the checklist above over that story. Every box without an answer is a new scenario or a question for whoever defines the business.
  3. Automate the retry, permission and concurrency scenarios first. They are the ones a person almost never reproduces by hand and the ones that cost the most when they fail.
  4. Save every production error as a new scenario. That way your list learns from what has already happened to you, which is the basis of error guessing [1].

What Hábil does

A well-tested happy path is the floor, not the ceiling. At Hábil, as part of custom development, we help design and automate the evidence for your critical flows —payments, orders, policies, shipments— according to their risk: limits, states, retries, permissions and dependencies. When the context allows it, we validate it with the real integrations, with a sandbox or with a representative environment. And in Hábil MDW, our integration platform, retries are designed from the start not to repeat the effect —a retried payment does not generate a second charge— and every flow is tested with the scenarios of its risk.

The first conversation is at no cost: it starts from one of your user stories and the scenarios that protect it today. Write to us on WhatsApp.

Consulted on 20 November 2026. Each reference was opened and read at its original source; reference 3 is an IETF draft, not a standard.

References

  1. ISTQB, Certified Tester Foundation Level Syllabus v4.0.1 (2024-09-15), sections 4.2.1–4.2.4, 4.4.1–4.4.3 and 5.2. https://istqb.org/wp-content/uploads/2024/11/ISTQB_CTFL_Syllabus_v4.0.1.pdf
  2. C. Kaner, What Is a Good Test Case?, Florida Institute of Technology (2003). https://kaner.com/pdfs/GoodTest.pdf
  3. IETF, The Idempotency-Key HTTP Header Field, draft draft-ietf-httpapi-idempotency-key-header-08 (draft, not a standard). https://datatracker.ietf.org/doc/draft-ietf-httpapi-idempotency-key-header/
  4. OWASP, Web Security Testing Guide v4.2, 4.10 Business Logic Testing (Test for Process Timing, Test Number of Times a Function Can Be Used Limits, Testing for the Circumvention of Work Flows). https://wstg.owasp.org/v4.2/4-Web_Application_Security_Testing/10-Business_Logic_Testing/
  5. OWASP, Top 10:2025 — A01 Broken Access Control. https://owasp.org/Top10/2025/A01_2025-Broken_Access_Control/
  6. Principles of Chaos Engineering. https://principlesofchaos.org/
  7. AWS Builders' Library, Timeouts, retries, and backoff with jitter. https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/
  8. Stripe, Idempotent requests (API documentation). https://docs.stripe.com/api/idempotent_requests
  9. P. McKenzie, Falsehoods Programmers Believe About Names (2010). https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
  10. MITRE, CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization. https://cwe.mitre.org/data/definitions/362.html
  11. MITRE, CWE-193: Off-by-one Error. https://cwe.mitre.org/data/definitions/193.html
  12. M. Woolf, Big List of Naughty Strings. https://github.com/minimaxir/big-list-of-naughty-strings
  13. Diario Oficial de la Federación, Ley de los Husos Horarios en los Estados Unidos Mexicanos (28-Oct-2022). https://dof.gob.mx/nota_detalle.php?codigo=5670045&fecha=28/10/2022 · Secondary verification: timeanddate.com, Time changes in Mexico City ("Last change: 2022 Oct 30"). https://www.timeanddate.com/time/change/mexico/mexico-city
  14. NIST, Automated Combinatorial Testing for Software ("most software bugs and failures are caused by one or two parameters, with progressively fewer by three or more"). https://csrc.nist.gov/projects/automated-combinatorial-testing-for-software
  15. M. Wynne, Introducing Example Mapping, Cucumber. https://cucumber.io/blog/bdd/example-mapping-introduction/