Fake the inputs that make a test safe and repeatable, while keeping the behavior under examination real. If an agent is supposed to save a report, a test that replaces the save operation with a success message can verify the agent’s response to that message. It cannot establish that a report was stored.
The reference below covers sixteen selected test cases. Use it to ask what each passing test actually demonstrates. “Real” here means the relevant implementation or boundary is exercised in a controlled environment. It does not mean using customer records, sending live messages or spending money to make a test look authentic.
- 01Choose the claim first.Decide whether the test examines an interface, a calculation, a permission boundary or a persisted outcome.
- 02Label every substitute.Record which inputs, tools and responses were supplied by the test instead of the system.
- 03Inspect the resulting state.A success-shaped message is weak evidence when the claimed result is a file or record elsewhere.
01 — Match each test case to a bounded claimMatch each test case to a bounded claim
A mock is a controlled replacement for part of the system. A fixture is a prepared input or starting state. Both are useful. The table identifies what must remain exercised for the named test to mean anything, then names the claim that still needs separate evidence. Rows are choices for test design, not a ranking from bad to good.
| Test case and group | Controlled setup | What stays real and what remains unproven |
|---|---|---|
| Inputs: Personal identifiers | Use synthetic identifiers with consistent relationships. | Keep matching logic real; this does not test handling of every production identity. |
| Inputs: Free-text content | Use authored examples with relevant ambiguity and length. | Keep parsing real; a small example set does not measure broad language coverage. |
| Inputs: Dates and time zones | Use fixed boundary dates and explicit zones. | Keep conversion logic real; a fixed clock does not test real scheduling delay. |
| Inputs: Missing or duplicate values | Plant deliberate gaps and repeated records. | Keep validation rules real; do not infer their prevalence in actual data. |
| Responses: Tool success | Return a controlled success payload. | Exercise downstream handling; the actual tool operation remains untested. |
| Responses: Tool rejection | Return a documented error shape. | Exercise the recovery branch; real permission enforcement is a separate check. |
| Responses: Delayed answer | Introduce a controlled delay or timeout. | Exercise waiting behavior; this is not a service latency measurement. |
| Responses: Malformed content | Supply missing fields or invalid types. | Exercise validation; distinguish your fixture from a captured service response. |
| Destinations: Local files | Use a disposable directory with the real writer. | Reopen the output; remote storage and audience access remain outside this check. |
| Destinations: Database records | Use controlled records in a test database. | Exercise actual constraints; production configuration is not established. |
| Destinations: Messages | Use a capture destination instead of real recipients. | Inspect payload and routing; public transport delivery is not demonstrated. |
| Destinations: Paid actions | Use a supported test environment or a local substitute. | Inspect the request path; settlement and live commercial effects are excluded. |
| Outcomes: Browser success state | Keep the real interface and assert its visible result. | A success view does not independently prove a remote write. |
| Outcomes: Persisted artifact | Read the output through a separate inspection step. | Check content and identity; existence alone is insufficient. |
| Outcomes: Agent explanation | Compare the agent’s report with observed state. | Treat self-reported success as a claim to check, not the answer key. |
| Outcomes: Expected answer | Specify expected values or properties outside the run. | Keep the checker independent of the generated explanation; disclose judgment gaps. |
02 — Why a mock needs an explicit boundaryWhy a mock needs an explicit boundary
Playwright’s API-mocking guide shows an intercepted request fulfilled with a custom response without calling the API. It also distinguishes modifying a real response from replacing the request altogether. That difference determines whether a passing browser test observed the remote system.
Playwright’s testing guidance recommends user-visible checks, isolated tests and controlled data. It also recommends mocking third-party dependencies. These are useful ways to test the application you own. They do not turn a substituted dependency into evidence of a live integration.
The table extends that boundary into agent tests as an editorial design reference. It does not claim Playwright implements every listed substitute or that all agent tests belong in a browser. A file-processing agent and a scheduling agent need different controls, even if both produce a final status message.
03 — Separate a report test from a delivery testSeparate a report test from a delivery test
Imagine a hypothetical agent that turns a short input file into a report and delivers it to a review folder. Synthetic names and a tiny example file can be appropriate. Keep the actual transformation and file-writing code in the test, then reopen the output from the controlled folder. That checks more than asking the agent whether saving succeeded.
If the remote upload is mocked, label the result “local report generation checked; remote storage simulated.” A separate authorized check can use a disposable destination and confirm the uploaded copy. Inspect content as well as existence: an empty file at the expected path does not establish report generation.
The delivery-state reference helps describe the resulting boundary. The file-output acceptance reference supplies the checks for the actual copy. A passing local test should not silently acquire a claim about recipient access.
04 — Preserve the difficult properties of the inputPreserve the difficult properties of the input
Synthetic data becomes misleading when it removes the difficulty the tool must handle. A parser expected to accept names with accents should not be tested only with short plain-English names. A calculation that handles missing values needs deliberate missing cases, not a spreadsheet where every cell is populated.
Preserve relationships as well as individual values. If two records are meant to refer to the same entity, give them a consistent synthetic identifier. If a duplicate is intentional, label why it is present. Otherwise a test can pass because the fixture accidentally avoids the business rule under examination.
Our own-traffic evaluation guide addresses whether tasks represent intended use. This reference addresses what gets replaced within those tasks. Representative examples still need clear substitution boundaries; realistic-looking records alone do not make an integration real.
05 — Keep a substitution note beside the resultKeep a substitution note beside the result
For each test, write: claim, fixture, substituted boundaries, implementation exercised, observed result and remaining check. Include the test version so someone can tell whether a later run used the same setup. This note is more useful than a single “all tests passed” message when the reader must decide whether work is ready.
Do not invent a universal minimum number of examples. Choose cases from the behavior you promise and the failures you need to distinguish. A controlled expiry response can examine recovery logic; an authorized expired credential in a test environment examines whether the real boundary produces the expected denial. Neither alone estimates how often expiry happens.
Keep expected outcomes separate from the agent’s own assertions. For a transformation, use an independently specified expected value or a property the output must satisfy. For a write, inspect the destination through a separate read path where practical. The test should have a way to reject a plausible explanation of a result that never occurred.
- Scope
- 16 test cases across 4 concerns. The complete selected reference appears above; no claim of exhaustive coverage.
- As-of date
- September 7, 2026. Actual source collection and review date; assigned publication is September 7, 2026.
- Collection
- Read Playwright guidance on mocked requests and test isolation. Select cases involving inputs, responses, destinations and outcome checks. For each, specify the exercised behavior and the claim that remains outside the test.
- Counting
- Each row is one selected editorial case, assigned to its displayed group. Chart widths use 45 SVG units per entry. Group sizes describe this reference, not a measured distribution.
- Sources and interpretation
- This is a selected editorial test-design map, not a benchmark or universal testing standard. No live integrations or model runs were measured. “Real” refers to the boundary under test in a controlled environment.
- Exclusions
- No vendor census, model benchmark, search-volume estimate, measured savings or failure rate. Worked examples are hypothetical; no customer operations were tested.
- Gaps and limitations
- UNVERIFIED means the required evidence was not inspected, was inaccessible or remains ambiguous after inspection. A selected case can overlap others in practice; preserve the specific claim and its uncertainty.
06 — DecisionWhat to do next
Make every pass say what was exercised.
Keep the relevant behavior real, replace what makes the test unsafe or unstable, and name each substitution. Inspect the resulting state before making a claim that crosses a simulated boundary.
For implementation support, explore our AI transformation services.