Tests are never enough
From unit tests to production probes, each layer answers a different question about risk.
A passing suite says something specific about the behaviour it exercised, in one environment and under particular assumptions. Start with unit and integration tests because they catch many defects cheaply. Then ask what could still go wrong for a user, an operator or the business, and choose a check that can actually observe that failure.
Build up from fast feedback
- Unit
- Does a function or component preserve its rules across normal, boundary and invalid inputs?
- Integration
- Do components agree on contracts and failure behaviour when they use real dependencies or faithful substitutes?
- Regression
- Does a previously fixed defect stay fixed? Put each regression at the lowest test layer that reproduces the failure reliably.
- Smoke
- Has a build or deployment reached a usable state? Check a small number of critical paths before deeper testing or wider rollout.
- Synthetics
- Do production journeys still work after release? Run scheduled probes using dedicated accounts or data, and alert on meaningful user-facing failures.
- Penetration
- Do controls hold up to an independent, authorised security assessment? Agree scope and success criteria, then prioritise remediation and retesting.
- Mutation
- Would the suite notice a meaningful change in behaviour? Review surviving mutations in critical code to find assertions that should be stronger.
- Chaos
- Does the system recover when a dependency slows or disappears? Run a controlled experiment against a steady-state hypothesis, with a small blast radius and a clear abort condition.
- Performance
- Can the system meet latency, throughput and resource budgets under representative traffic? Test the relevant mix of load, spikes and sustained usage.
Put checks where they can inform a decision
In a payment flow, a unit test can verify retry rules, an integration test can check duplicate handling with the provider, and a synthetic can catch a live checkout problem after release. Load testing can expose queue growth, a controlled resilience test can verify recovery, and a scoped security review can assess the payment boundary. Each result supports a different decision.
Run fast, deterministic checks on changes. Use smoke checks after deployment and keep synthetics scheduled. Schedule slower or more disruptive checks according to product risk and change frequency. Pair release gates with observability, a rollback plan and an accountable owner so the team can act when assumptions fail.
Start with a failure you need to detect
Imagine that a team is changing how an online checkout handles interrupted payments. An intermittent provider timeout can leave the customer unsure whether to try again. A repeat charge causes financial harm and takes support time to resolve. A legitimate order that never completes is also a failure. List these outcomes before choosing which checks to write. A test plan that begins with the number of cases to automate can spend most of its effort on paths nobody needs help reasoning about.
The same feature invites questions at several boundaries. Does the order component respect a retry rule? Does the integration preserve that rule when events arrive in a different order? Will the deployed application route a customer to the correct provider? Does the path remain usable at peak traffic? Can on-call staff identify and contain an incident? The most direct way to check a rule often sits near the code. Evidence about production configuration, dependencies and recovery typically comes from different places.
One way to prioritise is to sketch each failure as a chain from cause to user impact. Identify the cheapest check that detects the cause reliably and a live signal that detects customer impact. A unit check can test whether a status changes only in permitted circumstances. A production signal can compare the number of accepted orders with finalised payments and reveal an operational drift. This puts a concrete claim next to every test or signal and shows where a fault would otherwise pass undetected.
Use fast feedback where it can reproduce the problem
Write unit tests for the decision rules and invariants people care about, including boundary values and representative failure outputs. For checkout, tests can exercise a request that returns a settled outcome, one that should wait for a pending payment and a retry that must reuse an existing order. Make the assertion describe the visible result. An assertion that an internal helper was called is valuable only where calling that helper is itself part of the contract. Otherwise, it can fail when behaviour stays correct or pass when behaviour changes.
Integration tests do their best work where components can disagree. A true database integration can exercise transaction constraints and concurrent requests. A test provider or a contract-checked substitute can reproduce ambiguous responses and delayed completion. Record what assumptions the substitute makes about concurrency, ordering and timeouts. Keep a focused contract test for the cases a production provider guarantees and make it obvious what the test environment cannot faithfully reproduce.
Place regression tests at the layer that can still reproduce the defect. If a repeat charge was possible only because two requests reached storage at once, preserve the concurrency and storage behaviour in the regression. A test that isolates away those conditions will be less expensive and may leave the original bug undetected. A small illustrative fixture with a test name describing the failure makes the coverage understandable to a reviewer who never saw the incident.
Fast checks should fail reliably for the same cause. If an integration case depends on arbitrary waits, machine speed may determine the result. Prefer an observable signal or a controlled clock, and capture the logs needed to explain a failure. Track flaky tests as defects in the evidence pipeline. If a flaky test must be quarantined temporarily, give someone ownership and a date for review. A routinely ignored failure message makes it harder for people to spot a real regression.
A QA engineer can start from a recorded checkout journey when adding a browser test. Retain the expected result, replace fragile recorded selectors and check that the new test actually fails when the behaviour breaks.
Distinguish release readiness from live availability
A smoke check is a small decision aid close to deployment. It might verify that the application starts, reads its configuration and completes a minimal checkout path in the deployed environment. Its value comes from being quick enough to inform a pause or rollback. The broader suite can run elsewhere. Someone deciding whether a canary can expand needs a clear signal about readiness and a reasonable time limit, so an unavailable test environment can be handled deliberately.
Synthetics then ask whether a user journey continues to work after deployment. For checkout, a scheduled probe could use an isolated account and a provider-approved test route. It needs a named owner and data-handling rules. Monitor the route from a location that can reveal useful failures. A synthetic that always checks the nearest healthy node may pass during a regional outage. Document what the probe exercises and pair it with telemetry showing what real customers experienced.
Be deliberate about alerting. A probe that retries a transient network error can avoid unnecessary paging, while retaining the first failure for investigation. Compare synthetic failures with traffic-based signals like actual checkout completion and payment provider errors. A provider outage calls for a different response from an expired synthetic test fixture. The alert should give the on-call engineer enough context to identify the owner. If nobody can act on it, revise the signal before paging everyone more often.
Measure the strength of the evidence
Line coverage can show where a suite never ran the code. It gives little information about whether the observed behaviour was asserted. Mutation testing perturbs a small part of a program and asks whether the existing checks fail. If changing a comparison on a payment status leaves the tests green, inspect the examples and assertions for that rule. A useful outcome is a stronger check or a documented explanation of why the mutation is irrelevant. Reporting a percentage without inspecting important survivors can turn the exercise into scorekeeping.
Start mutation runs on critical logic a team can maintain and interpret. The cost can be high if it runs across every service and every test for each change. A scoped or scheduled run lets the team learn from survivors without making feedback needlessly slow. Some changes are equivalent for the allowed inputs, and others expose weaknesses in an overly broad test setup. Review them as evidence about the suite. Agent-generated tests deserve the same scrutiny, especially when generated after the implementation with the same model context.
Penetration testing contributes an independent, authorised view of product controls. A checkout team can agree with its security reviewers on scope, affected environments, test data, remediation ownership and how results will be verified after fixes. Link the conclusions to release decisions and track what was assessed. Continuous security checks can cover selected expectations between assessments. A past report carries less weight after changes in identity, payment integration or the systems that handle customer data.
Check capacity and recovery under controlled conditions
A performance test is meaningful when its traffic reflects the question. A sudden promotion can create a brief surge, while a settlement batch can increase load for hours. Both may cause backlogs, but they stress different limits. Define an expected arrival pattern, representative payloads, workload mix and a latency or throughput budget. Capture error rates and resource use alongside the latency distribution. A stable average can hide a long tail or a queue that will take an hour to drain after the test ends.
For repeat benchmarks, pin the environment and datasets where practical. Compare the same workflow under the same conditions and keep a record of relevant differences, such as instance capacity or the version of a dependency. A result that misses its budget should point a developer towards a bottleneck they can examine. If the run spends most of its time waiting on an unrealistic substitute for the payment provider, improve the setup before optimising the application around the result.
Chaos experiments answer questions about service behaviour under disruption. Define the steady state, then choose a specific fault, a limited scope and a clear point at which to stop the experiment. A team could check that slow provider responses leave orders pending, protect the system from an escalating retry backlog, and still allow normal work to resume once the provider recovers. Agree ahead of time how each observation will be made and who can stop the experiment if the impact differs from expectations.
Plan the exit before running an experiment. A fallback can keep the API responsive while indefinitely collecting unfinished work. That may satisfy an availability check and leave the customer in limbo. Measure time to recover, time to drain the queue, and whether outstanding orders reach the expected final status. Rehearse the manual recovery path on scoped fixtures as well as the automated one. Use what you learn to update runbooks and release criteria—especially when responders had to guess about the state of the system.
Use the resulting evidence to make a release decision
A practical matrix can stay small. For a common change, run unit, integration and relevant regressions before merge. Run a focused smoke check after deploying to the candidate environment or a production canary. Keep scheduled synthetics and operational alerting in place. Schedule stronger assurance around changes to sensitive boundaries, and scale performance, mutation and resilience work according to the consequences of failure. Give each check an owner, a scope, an execution point and a stop or proceed criterion.
Ask a reviewer to pick one high-risk claim and trace the evidence from specification through production. For the duplicate-payment example, the record includes the normal rule, the concurrent integration case, the release check, live reconciliation and the ability to investigate an incident. This exercise can expose an assumption that several checks repeat without testing. It also reveals which checks duplicate expensive work without strengthening the decision. Remove or replace redundancy when you can make the scope and evidence clearer.
After a production incident, compare what happened with what the team believed it had verified. Add a regression for the condition the suite can reliably reproduce. Improve an operational signal if the incident surfaced first through a customer report. Revisit the rollout rule if the canary never exercised the important path. Over time the test strategy should reflect actual failures and changing product risk. The objective is a release decision someone can explain, plus a credible plan for what the checks could not tell them.
Further reading Google SRE on testing for reliability, OWASP’s Web Security Testing Guide, PIT mutation testing and Principles of Chaos Engineering.