Error Guessing in Software Testing: A Checklist and a Real Demo
Error guessing is a test design technique where testers use experience to predict where software will break, then target those spots. Learn how it works, when to use it, a ready checklist of risky inputs, and a pytest demo where guessed inputs exposed 8 failures.
- Error guessing is an experience-based technique: you predict likely mistakes in the code and design tests aimed straight at them.
- It works best after formal techniques such as boundary value analysis, to catch what the specification never mentioned.
- Keep a shared checklist of past failures so guessing does not depend on one person’s memory.
- In our demo, 13 guessed test cases against three small functions produced 8 failures, including one input we did not expect to pass.
Every experienced tester has a list in their head. Empty strings. Leap days. A name with an apostrophe. Pressing submit twice. These are not in the requirements, yet they break software again and again. Error guessing turns that intuition into deliberate test cases.
This guide explains the technique, gives you a reusable checklist, and shows it working on real code. We wrote three small Python functions, guessed where they would fail, and ran the guesses with pytest 9.2 on Python 3.13.6.
What is error guessing?
Error guessing is a test design technique in which the tester anticipates errors, defects and failures based on knowledge and experience, then writes tests to expose them. The ISTQB groups it with exploratory testing and checklist-based testing as an experience-based technique, alongside the black-box and white-box families.
The guesses come from several sources:
- Bugs found earlier in this product or similar ones.
- Typical developer mistakes, such as off-by-one errors and missing null checks.
- Known weak areas, such as date handling, money, text encoding and concurrency.
- Production incidents and customer support tickets.
Why error guessing works
Specifications describe what should happen. They rarely list the hundred ways input can be wrong. Developers, in turn, tend to test the happy path they had in mind while coding. Error guessing targets the gap between those two views. It is cheap, fast and needs no special tools, which is why it is one of the most widely used techniques in practice, even when teams do not call it by name.
How to do error guessing, step by step
- Study the feature. Read the requirements and any existing tests. Note inputs, outputs, states and integrations.
- List likely errors. Use your checklist, past defect reports and team knowledge. Ask “what would I get wrong if I wrote this?”
- Turn each guess into a test case with a concrete input and an expected result. A guess without an expected result is not a test.
- Run and record. Log failures as bugs with clear steps, as described in our bug report guide.
- Feed back. Add every new failure type to the checklist so the next feature benefits.
A checklist of risky inputs
Use this list as a starting point and grow it with your own team’s history.
| Area | Inputs worth guessing |
|---|---|
| Text | Empty, only spaces, leading or trailing spaces, very long, emoji, accents, right-to-left script, apostrophes as in O’Brien, HTML and SQL fragments |
| Numbers | 0, negative, decimal where an integer is expected, huge values, non-digits, digits from other scripts, thousands separators |
| Dates | 29 February, 31st of short months, year boundaries, daylight saving changes, time zones, future and very old dates |
| Collections | Empty list, one item, duplicates, very large lists, unsorted input |
| Money | Rounding, 0.1 + 0.2 style float errors, negative totals, discounts over 100% |
| Files | Empty file, wrong extension, huge file, name with spaces, missing permissions |
| Users and flows | Double click on submit, back button after payment, two tabs at once, session expiry mid-form |
| Integrations | Timeouts, 500 errors, slow responses, malformed JSON, missing fields |
Demo: error guessing with pytest
Here are three functions a developer might write quickly for a shopping cart:
def parse_qty(text):
"""Parse a quantity typed into a cart field."""
return int(text)
def average_rating(ratings):
return sum(ratings) / len(ratings)
def apply_coupon(total, percent):
return round(total - total * percent / 100, 2)
Each looks fine on the happy path. Now the guesses. For quantity we tried normal input, padding, empty, a decimal, a negative, letters, Arabic-Indic digits and a huge number, and expected a whole number from 1 to 99. For ratings, an empty list. For coupons, 0%, 100%, 150% and -10%. We used pytest parametrize to keep it compact:
@pytest.mark.parametrize("text", ["3", " 3 ", "", "3.5", "-2", "abc",
"١٢", "99999999999999999999"])
def test_parse_qty_guesses(text):
q = parse_qty(text)
assert 1 <= q <= 99
def test_average_empty():
assert average_rating([]) == 0
@pytest.mark.parametrize("pct", [0, 100, 150, -10])
def test_coupon_bounds(pct):
assert 0 <= apply_coupon(50.0, pct) <= 50.0
What the guesses found
FAILED test_guess.py::test_parse_qty_guesses[] - ValueError: invalid literal ...
FAILED test_guess.py::test_parse_qty_guesses[3.5] - ValueError: invalid liter...
FAILED test_guess.py::test_parse_qty_guesses[-2] - assert 1 <= -2
FAILED test_guess.py::test_parse_qty_guesses[abc] - ValueError: invalid liter...
FAILED test_guess.py::test_parse_qty_guesses[99999999999999999999] - assert 9...
FAILED test_guess.py::test_average_empty - ZeroDivisionError: division by zero
FAILED test_guess.py::test_coupon_bounds[150] - assert 0 <= -25.0
FAILED test_guess.py::test_coupon_bounds[-10] - assert 55.0 <= 50.0
8 failed, 5 passed in 0.65s
Eight of thirteen guesses exposed a problem: crashes on bad text, negative and absurd quantities accepted, a division by zero on a product with no reviews, and coupons that could make an order cost less than nothing or more than its price.
The most interesting result was a pass. The input "١٢" (12 written in Arabic-Indic digits) returned 12, because Python’s int() accepts digits from many scripts. That may be fine, or it may break a downstream system that expects ASCII. Error guessing surfaced a question nobody had asked, which is just as valuable as a failure.
Fixing and retesting
We fixed the functions to strip spaces, accept only ASCII digits, enforce a 1 to 99 range, return 0 for an empty rating list, and reject coupons outside 0 to 100:
def parse_qty(text):
text = text.strip()
if not (text.isascii() and text.isdigit()):
raise ValueError(f"not a whole number: {text!r}")
q = int(text)
if not 1 <= q <= 99:
raise ValueError("quantity must be 1-99")
return q
A new suite with pytest.raises(ValueError) for the bad inputs, plus checks for the good ones, finished with 13 passed in 0.19s. Those tests now guard the fixes as part of regression, as our retesting vs regression guide explains.
Tip: write the guess as a failing test first, then fix the code. The test proves the bug existed and proves the fix works.
Error guessing vs formal techniques
| Technique | Based on | Strength |
|---|---|---|
| Equivalence partitioning | Specification | Few tests cover each input class |
| Boundary value analysis | Specification | Catches off-by-one errors |
| Decision tables | Business rules | Covers rule combinations |
| Error guessing | Experience | Finds what the spec never mentioned |
The techniques complement each other. Formal techniques give measurable coverage of the specification. Error guessing adds the unknown unknowns on top. Run the formal ones first, then guess.
Pros and cons
Pros: fast, cheap, no tooling needed, finds real-world bugs, and improves as the team learns.
Cons: results depend on the tester’s experience, there is no way to measure coverage, and it is hard to repeat unless guesses are written down. That is why the checklist matters: it turns personal intuition into a team asset.
Tips for better guesses
- Read old bug reports for the same module before testing.
- Ask developers which part they found hardest to write.
- Pair junior and senior testers so experience transfers.
- Automate good guesses so they run on every build.
- Combine with exploratory testing sessions and with property-based testing, which generates many unexpected inputs for you.
Error guessing for APIs and web pages
The checklist above focuses on input values. Two other areas reward guessing just as well.
APIs
- Send the request with a required field missing, then with an extra unknown field.
- Send a string where a number is expected, and a number as a string.
- Send the same POST twice quickly. Does it create two orders? Our API idempotency guide covers the fix.
- Use an expired or malformed token, and a token from another user.
- Ask for page 0, page -1 and a page far beyond the end.
- Send a body larger than the server limit, or invalid JSON.
Web pages
- Paste text with leading spaces into every form field.
- Refresh the page in the middle of a multi-step form.
- Open the same record in two tabs, edit both and save both.
- Zoom to 200% and switch to a narrow phone width.
- Turn off the network just before pressing save.
These are classic failure points that formal techniques rarely cover, and each takes seconds to try. Record the ones that fail in your own checklist so they become standard test cases.
Final thoughts
Error guessing is simple: think about how the code could fail, then test exactly that. It is not a replacement for systematic techniques, but it reliably finds the bugs they miss. Start with the checklist above, write each guess as a test with an expected result, and add every new failure back into the list. Over time, your team’s guesses become remarkably accurate.
FAQ
What is error guessing in software testing?
It is an experience-based test design technique where testers predict likely defects from past bugs and common mistakes, then write tests targeting them.
Is error guessing black box or white box?
It is classed as experience-based. It usually treats the system as a black box, but knowledge of the code can improve the guesses.
When should error guessing be used?
Use it after formal techniques such as equivalence partitioning and boundary value analysis, to catch errors the specification did not describe.
What are examples of error guessing?
Entering an empty field, a negative quantity, 29 February, a very long name, double clicking submit, or a coupon over 100 percent.
What is the main weakness of error guessing?
Its quality depends on the tester and coverage cannot be measured. A shared checklist of past failures reduces that weakness.
Keep learning
Need help with testing, WordPress or SEO?
We help teams ship better software and grow their sites. Tell us what you are working on and we will suggest a clear next step.