~/qa-guides/error-guessing
>_ Error Guessing in Software Testing: Examples and Test Cases
Use experience to form defect hypotheses, design controlled probes, and evaluate the evidence. Includes three worked investigations and ten practical test cases.
Short answer
Error guessing is an experience-based test technique that uses knowledge of previous failures and likely mistakes to select tests. A tester identifies a plausible defect, creates conditions that could expose it, and compares the result with an agreed expectation.
For example, a form reset after an earlier validation failure gives a reason to investigate whether a new form also loses entered data when its server rejects a submission. The useful output is a testable hypothesis and evidence about the behavior, rather than a general instruction to try unusual inputs.
The ISTQB Foundation Level syllabus, section 4.4.1, describes error guessing and fault attacks, which organize possible faults into tests. The investigations below show one practical way to record and evaluate those ideas. Their application rules and data are invented fixtures, not requirements for every product.
Error guessing versus exploratory and negative testing
These terms answer different questions about a test. They can describe the same activity without being interchangeable.
| Approach | What it tells you | Example |
|---|---|---|
| Error guessing | Why a particular failure is worth investigating | A changed retry handler might create a second export job after a lost response. |
| Exploratory testing | How learning, design, execution, and evaluation happen together | Investigate an export failure, inspect its evidence, and choose the next experiment from what you learn. |
| Negative testing | Whether the scenario exercises invalid or adverse conditions | Submit an unavailable option and check the rejection and recovery. |
| Specification-based | Which tests follow from an explicit behavior model | Derive shipping outcomes from condition combinations or inputs from defined partitions. |
The ASTQB explanation of experience-based techniques distinguishes error guessing from exploratory testing. An error-guessing idea can guide an exploratory session; exploratory testing also includes learning activities that did not start with a specific suspected defect.
Error guessing is not limited to invalid data. Two valid searches with different response times can expose a stale-result defect. A valid zero setting can expose an incorrect default. Conversely, a negative test selected directly from a documented rejection rule does not need an experience-based hypothesis to justify it.
For the formal techniques, see black-box versus white-box testing. Experience-based ideas complement those methods: use a suspected off-by-one defect to identify a risky limit, then use boundary value analysis to derive the values around it. Do not replace a model's required cases with whichever examples happen to come to mind.
Where useful defect hypotheses come from
Collect signals close to the changed feature. A report that another product once had a problem is a starting clue; a similar operation, data representation, or recovery path makes it more relevant.
- Previous defect reports: Read the triggering sequence, affected state, and missed assertion. A label such as "form bug" is less useful than "server validation response replaced user-edited fields with initial values."
- Support observations: Convert reports such as "the result changed after I stopped typing" into questions about request ordering, updates, and the point at which the user saw the change.
- Implementation changes: Ask what a shared parser, retry helper, or reused dialog now assumes. The changed assumption should explain why an existing workflow deserves another test.
- Interface handoffs: Look for values that cross representations or ownership boundaries, such as a reference moving from a text field through a numeric conversion into a stored record.
- Gaps in existing evidence: Check whether a passing suite always starts from a fresh screen, receives responses in order, or verifies only the message shown to the user.
Keep the source separate from the conclusion. "A shared defaults helper changed" is evidence about the change. "It may replace zero with the default" is a hypothesis. Only an execution with a trustworthy expectation can establish whether the required behavior failed.
Prefer mechanisms and observable effects over assumptions about particular developers. A reusable lesson describes the conditions under which a defect can occur, rather than assigning blame or treating one person's habits as a permanent risk model.
A practical error guessing workflow
1. Write a hypothesis that could be tested
Use this structure: Because of this signal, under these conditions, this operation may violate this expectation.
For example: "Because the form now uses the shared error handler, a server rejection may reset fields that the user has already filled in, even though the recovery requirement says to preserve them."
Name the affected operation and the user-visible or stored consequence. "The form might be broken" does not tell another tester what to set up or observe. A precise hypothesis also makes it easier to recognize when two ideas investigate the same behavior and should share a case.
2. Prioritize consequences and missing evidence
Start with hypotheses that could cause substantial harm and have a plausible connection to the change. Losing a long user draft, duplicating an operation, or displaying results for the wrong query can justify investigation before a low-impact visual concern.
Consider exposure and existing evidence as well as impact. A critical recovery path never exercised by the suite deserves attention even when the normal path has many passing checks. A suspected issue already covered by a stable assertion may need a review of that assertion rather than another duplicate test.
Avoid inventing a precise failure probability from familiarity. A tester remembering a defect does not establish how often it will occur in the current implementation.
3. Establish the expected result and a control
A test oracle is the basis for deciding whether a result is correct. Use an agreed requirement, business rule, interface contract, or independently checked state. Record unresolved behavior as a question for the responsible owner.
Separate the suspected implementation from the expectation. If the suspicion is that retry creates another job, counting the jobs returned by the same possibly stale UI is weak evidence. Use the test environment's authoritative job lookup as an additional observation.
Run a useful control: the same form without the server rejection, the same requests delivered in order, or the same operation without losing its response. A control can show that the fixture works and help isolate the trigger. It does not establish that all unrelated paths are correct.
4. Make the suspected condition happen deliberately
Arrange the event needed by the hypothesis instead of hoping to encounter it. Hold a response until the newer search has rendered. Force the server-side validation branch through a test fixture. Pause delivery after a creation has committed.
Record what the intervention actually affected. Blocking a request before it reaches the server and losing its response after a commit create different histories. A generic network error does not distinguish them.
Reset affected records and local state between independent runs. Change one relevant condition at a time while isolating a failure; combine conditions later when that combination has its own reason to be tested. Prefer event checkpoints over fixed delays that only happened to work on one machine.
5. Classify the result without overstating it
Use outcomes that reflect the available evidence:
- Defect observed: The trigger occurred, and an agreed expectation was violated. Record expected and actual behavior with the affected execution or record identifiers.
- Not observed under these conditions: The trigger occurred, and the selected assertions passed. Record the conditions and repetitions rather than claiming that the defect is impossible.
- Inconclusive: A required condition, expectation, or observation could not be established. Identify the missing checkpoint, access, or product decision.
An observed failure can confirm a behavior defect without proving the proposed internal cause. A form losing text establishes data loss in that execution; it does not by itself prove which handler cleared the state.
When investigating timing, report how the ordering was established. "Passed ten times" is weak evidence if none of those runs actually delivered the older response last.
6. Close a defined investigation, not an imaginary coverage target
Agree on a scope and time limit before starting. One session might investigate recovery after server rejection in a changed form, including the rejected submission and one corrected resubmission. Save unrelated discoveries for separately scoped work.
At the end, list the hypotheses investigated, triggering conditions reached, unresolved questions, and important exclusions. Stop when the agreed work is complete or its time limit requires a review; escalate a serious finding instead of quietly expanding the session indefinitely.
Error guessing has no universal list of all possible defects. Reporting that eight of eight recorded hypotheses were investigated describes that list, not complete coverage of the feature. Use a state transition model or another explicit model when you need a defined set of coverage items.
Worked example 1: data loss after a form rejection
Define the form and the suspected defect
Consider a support request form with a name, email, topic, and description. For this fictional investigation, assume a recent change routes server validation errors through a shared response handler, and an earlier defect report describes another form restoring initial values instead of preserving edits.
For this fixture, agree on these rules:
- A rejected submission preserves all four entered values and explains which topic must be changed.
- The browser's topic list can become stale. The server rejects a topic removed after the form loaded.
- Rejection creates no support ticket and no confirmation entry in the notification queue.
- Correcting the topic and submitting creates one ticket and one queued confirmation using the current field values.
Seed topic T-old as available, and keep T-new available throughout the test. Use name Maya Chen, email maya@example.test, and description Cannot export project P-17. Use an isolated test account and record its starting ticket and queue counts. Pause notification delivery so queue consumption does not alter those counts during the test.
The hypothesis is that the server rejection resets field state or leaves an outdated submission payload. Both would obstruct recovery, but they require different observations. The broader form testing checklist covers other field types, validation rules, and downstream integrations.
Test case 1: preserve values after server rejection
- Setup: Open a fresh form, fill the four fields, and select
T-old. RemoveT-oldthrough the test fixture after the browser has loaded its options. - Action: Submit and confirm from the response evidence that the server rejected the unavailable topic.
- Expected UI: The name, email, description, and selected unavailable topic remain identifiable. The form explains that another topic is needed, and no success message appears.
- Expected state: The account's ticket count and queued-confirmation count remain at their starting values.
- Evidence: Keep the sent payload, server rejection, visible field values, and before-and-after counts associated with this attempt.
Compare this with a fresh, normally accepted submission to establish that the fixture can create a ticket and confirmation. Reset that control's records before continuing. A client-side required-field warning is not an equivalent trigger: it may never reach the shared response handler.
If the topic control cannot display a removed option, agree on an explicit unavailable-selection presentation before testing. Do not quietly treat an unexplained blank field as preserved data.
Test case 2: submit the corrected values, including a later edit
- Setup: Restore
T-oldas available and start from a clean record baseline. Repeat the load, edit, topic removal, and rejected submission from case 1. Leave the recovered form open. - Action: Select
T-new, change the description toCannot export project P-18, and submit once. - Expected request: The payload contains
T-newandP-18, together with the preserved name and email. - Expected state: Exactly one ticket and one queued confirmation have been added across this rejected attempt and its corrected submission. The ticket contains the corrected topic and description.
- Evidence: Associate both attempts with their responses, the created ticket ID, and the confirmation's reference to that ticket.
Changing the description adds an important distinction: fields can look correct while a retry closure still sends the original payload. If the stored ticket contains P-17, reporting only that the form recovered would hide the failed data assertion.
If case 1 fails, preserve that finding and note any manual restoration needed to investigate case 2. Do not report a continuous successful recovery when the tester had to re-enter lost data.
Worked example 2: an export retry after an unknown outcome
Define operation identity before testing retries
Suppose an export screen gains a retry action after a response timeout. The experience-based concern is that the retry may submit a new operation even when the first request already created a job.
This fixture has a specific contract:
- A creation request carries a client operation key and an export payload.
- The same key with the same payload, retried within ten minutes, resolves to the same job ID.
- A fresh key represents a new export, even if its payload matches an earlier export.
- A completed job produces one stored output artifact. An interrupted response alone does not cancel the job.
These are application rules, not properties to assume for any creation endpoint. If the real product offers status lookup instead of a deduplicated retry, design the investigation around that recovery contract.
Seed an immutable export dataset with record IDs E-101 and E-102. Use the same format and filter payload throughout each case. Inspect jobs by operation key, and inspect artifacts by job ID. Keep the server clock inside the ten-minute window so expiration is not a second variable.
Test case 3: retry after creation committed but its response was lost
- Setup: Use a fresh key
K-committed. Allow the request to reach the server, then confirm through the test checkpoint that jobJ-1has committed. - Trigger: Prevent that response from reaching the browser. Let the screen enter its unconfirmed-outcome state without canceling
J-1. - Action: Use the supported retry. Inspect that it sends
K-committedwith the unchanged payload inside the deduplication window. - Expected state: The retry returns the original job ID
J-1. After completion, the key has one job, that job has one output artifact, and the output containsE-101andE-102once each. - Expected UI: The screen resolves to the existing job and its completion result rather than presenting a second export as the recovered operation.
Capture attempt identifiers, the operation key, commit confirmation, recorded job IDs, and the final artifact relationship. Two HTTP attempts are expected here; two stored jobs are not. A completed job with two artifacts would also fail this contract even if the job count stayed at one.
If the tool only lets you block the request before server receipt, this case is inconclusive. You have not reproduced an unknown outcome after commit. Do not label the different network condition as a passing retry-after-commit test.
Test case 4: recover when the original request never reached the server
- Setup: Use a different fresh key
K-unsent. Block the original request before the server receives it, and verify that the key has no job. - Action: Restore delivery and retry the same payload with
K-unsentwithin the window. - Expected state: The retry creates one new job. After completion, that job has one artifact containing the two expected record IDs once each.
- Expected UI: The screen reaches the new job's result instead of waiting indefinitely for a nonexistent earlier job.
- Evidence: Keep the blocked original attempt, zero-job checkpoint before retry, successful retry, and created job and artifact IDs.
This contrast tests an overly broad recovery assumption: a client that always searches for an existing job could handle case 3 but never create the job needed in case 4. Neither case requires changing payloads or using expired keys; those are separate contract questions.
For a wider review of error responses and recovery paths, use the API error handling testing checklist. This investigation focuses on whether the observed failure history supports the chosen recovery action.
Worked example 3: stale search results after a newer action
Define the visible result contract
A search screen now updates results as the user changes the query. The normal automated flow waits for each response before typing again, so it provides no evidence about overlapping requests.
Use this deterministic fixture:
- Query
alphareturns recordsA-1andA-2, with total count 2. - Query
betareturns recordB-1, with total count 1. - A completed result must belong to the currently active query. An older response must not replace newer results or their count.
- Clearing the query shows
Enter a search term, removes the result rows and count, and ends the loading indication. A late response from a cleared search must not repopulate the screen.
The suspected defect is that the screen applies whichever response arrives last without checking whether that request is still relevant. Cancellation or ignoring an obsolete response can satisfy this fixture; the test does not require one particular implementation.
Test case 5: deliver the older search response last
- Setup: Enter
alphaand wait until its request is captured, but hold its response. Enterbetaand confirm that a second request was sent. - Action: Deliver the
betaresponse first. Confirm thatB-1and count 1 render. Then release the heldalpharesponse. - Expected UI: The query stays
beta, the visible set stays exactlyB-1, and the total stays 1.A-1andA-2do not replace or briefly appear in the completed newer result. - Evidence: Record the query for each request, request identity, delivery order, and the result IDs and count before and after releasing the older response.
Run the in-order delivery as a control. Reaching alpha, then beta successfully proves that both datasets can render; it does not exercise the stale-response condition. If cancellation prevents the old response from being applied, record that observed outcome rather than forcing a UI overwrite that bypasses the real handler.
Test case 6: clear the query while an earlier response is pending
- Setup: Start a fresh
alphasearch and hold its response before it reaches the screen. - Action: Clear the query, confirm the empty-search presentation, and then release the held response.
- Expected UI: The input remains empty,
Enter a search termremains visible, and there are no result rows, total count, or loading indication. - Evidence: Keep the clear action's position in the event sequence and the final result region after the pending request has settled or been canceled.
This case investigates a different terminal state from case 5. A guard that handles two nonempty searches may still forget to invalidate the pending search when the input becomes empty. The extra case is justified by that reset path, not by adding another arbitrary query string.
Additional error guessing test cases
The following cases cover different mechanisms from the three investigations. Each declares its own product rule so its expected result can be adapted deliberately.
Test case 7: preserve leading zeros in a reference
- Signal and hypothesis: A reference field now passes through a shared data mapper. Converting its text to a number may discard meaningful leading zeros.
- Contract: References are five-character digit strings.
00127is a valid reference and must remain exactly00127in storage and after reopening the record. - Steps: Create a record with
00127, inspect the submitted representation, save, and reopen it from an independent read. - Expected result: The request, stored reference, and reopened display all contain the five-character value. A display-only padding rule must not conceal a stored value of
127.
Test case 8: keep a valid zero setting instead of applying a default
- Signal and hypothesis: A new defaults helper may treat zero as an absent value and replace it with the default retry count.
- Contract: The retry setting is the number of additional attempts. Zero is valid, and an omitted setting defaults to three additional attempts.
- Steps: Save an explicit setting of
0, reopen it, and run a test task that always fails. Observe the worker's attempt ledger until it reaches its declared terminal state. - Expected result: The saved and reopened setting remains
0. The task has one initial attempt, no additional attempts, and no pending retry. An omitted-setting control has four total attempts under the same failure fixture.
Test case 9: render the empty collection after removing its final item
- Signal and hypothesis: A list was refactored to reuse its populated view. Removing the last item may leave a stale row or bypass the empty-state rendering path.
- Contract: Deleting the only saved item leaves zero stored items, no item rows, count 0, and an empty-state message with an available create action.
- Steps: Seed exactly one deletable item, load the list, delete it, and wait for acceptance. Check the independent item lookup and the current page, then reload.
- Expected result: Both the immediate screen and reloaded screen show the defined empty state. A zero badge beside a stale item row is a failure, even if the underlying deletion succeeded.
Test case 10: discard an unsaved edit when a dialog is reused
- Signal and hypothesis: Two records now share one edit dialog instance. Draft state may leak from the first record into the second.
- Contract: Cancel discards unsaved changes. Opening a different record loads that record's saved values, and no save request occurs on Cancel.
- Steps: Seed
R-1with titleFirstandR-2with titleSecond. OpenR-1, typeUnsaved first, cancel, and openR-2. Finally reopenR-1. - Expected result:
R-2showsSecond; reopeningR-1showsFirst. Neither stored title changes, and the request log contains no save caused by Cancel.
Turn a useful discovery into a regression check
Preserve the smallest sequence that demonstrates the failed requirement. The whole investigation may include several controls and discarded hypotheses; the permanent regression does not need to reproduce every exploratory step.
Choose the assertion level by the behavior that failed. For the form example, a handler-level check can detect lost draft values, while an integration check can compare the corrected request with the created ticket. For the export example, backend deduplication needs a job-identity assertion; a browser test that merely finds a success banner cannot establish it. For search, a deterministic component or integration test can control response ordering and inspect the final result set.
Keep a user-journey check when it adds evidence across boundaries that the narrower test misses. Avoid copying the same assertion into multiple suites without identifying the additional risk each version covers. The regression testing checklist helps place the resulting check into the affected release scope.
Store the lesson in a form that can guide future investigations: the triggering condition, violated expectation, affected boundary, and evidence that exposed it. Replace a vague note such as "try errors on forms" with "after a server rejection, compare recovered field values, the next payload, and the saved record." The latter transfers a useful observation method without assuming that every form has the same defect.
Review these lessons when the product changes. Retire an obsolete hypothesis when its workflow disappears, and revise it when a new contract changes the correct behavior. An ever-growing list of remembered bugs becomes expensive unless each item still explains a relevant risk or points to a maintained regression.
FAQ
Yes. A beginner can start with well-described defect reports, pair with someone who understands the workflow, and ask developers which assumptions changed. Write down the source of each idea and review the expected behavior with the feature owner. Build experience from actual investigation results rather than memorizing a list of supposedly universal bugs.
No. Error guessing describes how experience suggests a defect worth probing. Random testing describes a way of selecting inputs, and fuzzing commonly uses automated input generation or mutation. A generated input can help investigate a specific hypothesis, but generation alone does not explain the suspected mechanism or the business expectation. Useful error-guessing cases can also use entirely valid, ordinary inputs with a carefully chosen history or event order.