The conversation about test coverage almost always starts in the wrong place. A team is two sprints from launch, coverage sits between 30 and 50 percent, and the engineering lead is doing the calendar math: another month of QA time to push coverage up, or accept the risk and ship. Either answer is bad. Manual coverage takes longer than the team has; skipping it bets on production to surface the bugs.
That choice — write tests by hand or skip them — was the only option until recently. AI-assisted test generation has moved fast enough that high coverage no longer requires the months of typing it used to. What it requires instead is a different discipline: knowing what AI can generate, what engineers still need to review, and what categories of test no AI is going to write for you. This article is about that discipline as it sits inside the Built to Last™ 2.0 framework's Right Code pillar.
High test coverage is a tooling problem now, not a person problem. Teams that recognise this are reaching coverage targets in weeks that previously took quarters.
Why Coverage Gaps Cost More Than They Used To
The cost of insufficient coverage is the same shape it has always been. The bug a unit test in week three should have caught becomes the production incident in week thirty. The regression an integration test would have flagged is found by a customer instead, and the support cost dwarfs whatever the test would have cost to write. What has changed is how cheap the prevention has become — which has moved the cost of skipping it from "a difficult trade-off" to "an unforced error."
Three lines on the invoice. The first is the production-incident line: a team without coverage finds bugs late, after a customer has felt the failure. The fix is then triaged against feature work, often loses, and accumulates as a backlog of small reliability debts that compound into a brittle product by month eighteen.
The second is the velocity line. A codebase without coverage gets harder to change. Every refactor risks breaking something that wasn't protected, so engineers refactor less and accumulate workarounds more. By month twelve the team is shipping slower than at month three and nobody can fully explain why except in vague terms like "complexity." A disciplined project delivery framework is partly designed to keep that trajectory from setting in.
The third is the team line. Engineers don't enjoy working in codebases where any change might cause a regression nobody notices. They become risk-averse, then they leave. The cost of replacement — onboarding, knowledge loss, recruiting cycles — is the line item finance never expects to see traced back to the testing decision.
In recent engagements, our internal benchmark for Built to Last 2.0 work is 85%+ test coverage achieved without months of manual typing. The hedging matters: it is a benchmark, not a guarantee. The point of stating it is that the number sits inside an explicit operating discipline rather than a wish.
What an AI-Assisted Testing Strategy Actually Is
The component sits inside Right Code, alongside the developer onboarding guide, code standards, peer review, AI-powered code review, and the CI/CD pipeline. These are designed to work together. Tests are what the pipeline runs. Code review is what catches the judgement calls. Code standards are what make tests readable. The automated testing strategy is the layer that determines what gets tested, by what mechanism, and to what depth.
The component has five constituent parts.
The coverage definition. Coverage is not one number; it is a small set of numbers, each measuring a different thing. Statement coverage tells you how many lines executed. Branch coverage tells you whether every if/else path was exercised. Mutation coverage tells you whether your tests actually fail when the code is broken — the strongest signal of the three, and the one most teams don't measure. A coverage target without a coverage definition is theatre. The framework's target — around 85%+ — refers to branch coverage with mutation testing on critical paths.
The test pyramid. Unit tests at the base, fast and many. Integration tests in the middle, slower and fewer, validating that real components hold together. End-to-end tests at the top, slowest, fewest, covering the handful of user journeys whose failure would be visible to a customer. Inverted versions — E2E-heavy, unit-light — are slow to run, flaky to maintain, and miss the unit-level regressions where most bugs actually live.
The AI generation layer. Modern tooling — LLM-based test generators integrated into IDEs and CI — can produce a credible first draft of unit tests for most pure functions, integration tests for typed API contracts, and skeleton end-to-end tests from journey definitions. A function with five branches and clear inputs and outputs goes from zero tests to a working suite in seconds. The Stack Overflow Developer Survey now shows AI use in writing tests as mainstream rather than experimental, which has changed both the cost curve and the expectations.
The engineer review layer. This is the part the framing "AI writes the tests for you" usually omits. AI generates tests against the code as written, not against what the code should do. If the code has a bug, the AI-generated test will confirm the buggy behaviour. If the code lacks an edge case, the AI may or may not invent one — and it can produce assertions that pass for the wrong reason. Every AI-generated test goes through engineer review with the same discipline as engineer-written code: does this test capture intent, or does it just mirror current behaviour? The review is where the time goes — and it is still far less time than writing the test from scratch.
The categories AI doesn't handle. Property-based tests for invariants the code must hold. Adversarial tests for inputs designed to break the system. Performance tests for response under load. Security tests aligned to the OWASP Top 10 categories. AI can scaffold these; it cannot reason about what the right invariants or attack vectors are without explicit prompting from someone who understands the domain. That work stays engineer-driven, with AI in the role of typist rather than thinker.
The component produces a test suite that meets a measured coverage target, runs on every commit through the CI/CD pipeline, and signals regressions before they reach staging.
Who's in the Room, What Gets Documented
The strategy is set by the engineering lead with the QA lead, if one exists, and the senior engineers who will own the relevant codebases. Decisions made in that room: which coverage metric to track, which target to set, what mix of unit, integration, and end-to-end the pyramid will hold, the policy for AI-generated tests entering the suite, who reviews them, and the failure budget — meaning how many failing tests block which kinds of merge. Three artefacts come out of it: the testing strategy document, the pipeline configuration that runs the suite and fails the build on regression, and the test catalogue listing critical user journeys with their associated E2E tests, kept current alongside the roadmap rather than at handover.
Failure Modes Even When the Component Is Present
A team can have a testing strategy and still ship a fragile product. Four failure modes recur. First, high statement coverage with low mutation coverage — tests exercise the code without asserting anything meaningful, and a 90% coverage badge hides a suite that catches almost nothing. Second, flaky E2E tests treated as background noise — a "rerun once" becomes a signal nobody trusts, and the regression it would have caught gets through. Third, AI-generated tests merged without review — coverage rises, but the suite locks in current behaviour rather than intended behaviour. Fourth, a pipeline that runs the tests but doesn't act on the results — coverage drops by five points across two sprints and nobody notices because the threshold gate is permissive. The discipline is in the gate, not the report.
A Concrete Example
Take a typed API endpoint that takes a user ID and a date range and returns a list of transactions. The AI generation pass produces seven unit tests covering the happy path, an empty result, an invalid user ID, a future date range, a date range with start after end, a permission-denied case, and a database-timeout scenario. The engineer tightens three assertions that were too loose — confirming something was returned rather than the specific shape — and adds two property-based tests covering invariants the AI didn't infer: the result set never includes transactions outside the requested range, and pagination is consistent across repeated calls. Nine tests, generated and reviewed in roughly an hour, where the manual version would have been most of a day.
How to Put It in Place
For a project starting fresh, this is week-one work. The longer you defer it, the more code accumulates without test scaffolding, and the larger the catch-up bill grows. The strategy isn't expensive to set up; it is expensive to retrofit.
In the first week, write the testing strategy document. It should fit on three or four pages. Name the coverage metric: branch coverage as the headline, statement coverage as a secondary, mutation coverage applied to critical paths. Set the target — for most product engagements, around 85% branch coverage on application code, with payment, identity, and data-mutation paths held to a higher standard. Document which AI tooling is sanctioned and where it integrates: IDE plug-in, pre-commit hook, CI generation step.
In the same week, configure the CI gate. The pipeline should run the full suite on every commit, report coverage back to the engineer who pushed the change, and block merges that drop coverage below the threshold or introduce failing tests. The exact threshold matters less than the gate being binding. A gate that warns is a gate that gets ignored under deadline pressure. Setting it up properly is what makes a DevOps practice operational rather than aspirational.
In the second week, generate the first wave of tests. For a greenfield codebase, this is a fast pass over utility functions, API handlers, and the data access layer. Tests are reviewed in batches by the engineer who wrote the corresponding code, then merged. For a brownfield codebase, target the highest-traffic, highest-risk modules first — payments, authentication, the data layer — and accept that lower-traffic modules will accrete coverage as they are touched.
In parallel, define the test catalogue. List the critical user journeys whose failure would be visible to a customer. Most products have between five and fifteen such journeys, not fifty. Write the end-to-end tests for those journeys deliberately — they are too valuable to delegate fully to generation. AI can scaffold; the engineer owns the assertion.
What to avoid: generating tests at the end of a sprint rather than alongside the code (retrospective coverage mirrors current state rather than intent); treating coverage as the only signal (mutation testing on critical paths is the check that coverage is honest); ignoring flakes (a flaky test is a bug in the suite, not a property of the universe); and allowing AI-generated tests to merge without engineer review. The last is the most expensive shortcut — the suite ends up locking in current behaviour, including bugs, and every legitimate refactor breaks the wrong things.
If your CI/CD pipeline is not yet built, get the pipeline in place first — even a basic version that runs tests on every commit is enough to start. The strategy gets stronger as the pipeline matures. If your team is unfamiliar with mutation testing or property-based testing, run a half-day workshop with the senior engineers before rolling out. Both techniques have learning curves and both pay back quickly.
Once the strategy is operating, the metrics to watch weekly: branch coverage trend, mutation score on critical paths, flake rate, and mean time from regression introduction to detection.
A Tale of Two Suites
A mid-sized SaaS client (engineering team of around 15) we worked with had reached 60% statement coverage over roughly four months of disciplined manual test writing. The suite caught most regressions and the production incident rate was lower than the prior year, but pushing coverage higher was running into diminishing returns. Every additional percentage point cost more hours than the last, and the engineers had started to resent the slog.
Their next product, started six months later, took a different approach. The testing strategy was drafted in week one. AI test generation was wired into the CI pipeline from sprint one, with a policy that every generated test required engineer review before merge. Mutation testing ran on the payments and identity modules. Critical user journeys were end-to-end tested deliberately, with engineers writing the assertions and AI generating the scaffolding.
Eight weeks in, the suite had passed 85% branch coverage with a mutation score on critical paths in the high seventies. The same engineering quality, in roughly half the calendar time. The suite was discoverable to new joiners — the test for a function lived next to the function, was readable, and explained what the code was supposed to do. Onboarding sped up as a side effect. The same testing discipline carries across the embedded payments work visible in our engagement with Nuvei / Till Payments, where regulator-grade coverage and production reliability are non-negotiable.
A second composite is worth naming briefly. A Sydney-based fintech we worked with treated AI generation as a coverage-padding exercise — generate, merge, move on. Within a quarter, the suite was at 87% coverage and catching almost nothing; a refactor of a fee-calculation module passed every test and broke real customer invoices. The fix wasn't more AI; it was the engineer review the team had skipped. They installed the review gate, ran mutation testing on critical modules, and rewrote roughly a quarter of the generated tests to assert intent rather than current behaviour. Coverage dropped to around 82% on paper and the suite became actually useful.
When This Is Critical, When You Can Get Away With Less
The strategy is critical from sprint one when the product will be alive for more than 18 months, when more than two engineers touch the codebase, when any regression would be visible to a paying customer, or when the product is subject to compliance obligations that require demonstrable test evidence. That set describes almost every commercial product engagement. If you fit any of them, the strategy should land in week one.
The contexts where you can defer the full discipline are narrower than most teams admit. A genuine throwaway prototype testing a single assumption — the kind of work that should run inside a Riskiest Assumption Test™ before any production code is contemplated — can move with skeleton testing and an honest acknowledgement that the output is throwaway. A spike to explore a technical option can skip the rigour, provided the code is rewritten rather than productionised. The decision that catches most teams out is the "we'll add tests later" assumption on a build that grows past two engineers, then past five — by the time the test debt becomes obvious, the cost of catching up has multiplied.
For AI-heavy products, the calculus has a twist: the test of the underlying model behaviour belongs in the AI evaluation framework, a separate component. The strategy here is for the code around the model — prompt routing, the retrieval pipeline, the response handling — not the model itself. The pattern shows up across our agentic AI delivery work, where code-level testing and model evaluation are kept as distinct disciplines on purpose.
What to Do Next
Pick one application area — the one where regression cost is highest — and instrument it this week. Draft a two-page testing strategy, wire AI generation into your IDE workflow, configure the CI gate to fail on coverage regression, run a mutation pass against the most critical paths, and review every generated test before merge. The first week is set-up; the next four are where coverage and quality compound. For a fuller picture of how the Right Code pillar fits with the rest of the framework, see how we deliver custom software. For embedded squad work, our staff augmentation engagements treat this as ongoing operational practice. The same applies to how we deliver mobile apps, where app-store release cadence makes pre-merge test gates non-negotiable.
Frequently Asked Questions
How much test coverage do we actually need?
How does AI-assisted test generation actually work?
What can AI not test?
What's the engineer review process for AI-generated tests?
Same discipline as engineer-written code review, with one extra check. The reviewer asks: does this test capture what the code is supposed to do, or just what it currently does? The distinction matters because AI generates against the code, not against intent. A test that asserts buggy behaviour is worse than no test — it locks the bug in and breaks legitimate refactors. The reviewer tightens loose assertions, adds missing edge cases, and rejects assertions that pass for the wrong reason.
How do we keep the suite from becoming flaky?
Does this replace the QA engineer?
No. It changes what the QA engineer spends their time on. Manual exploratory testing, designing adversarial inputs, writing the property invariants and the performance tests, owning the test catalogue and the journey definitions — these are the high-leverage parts of QA work that AI doesn't touch. The repetitive scaffolding of unit tests is what gets automated. Teams that frame QA as test typing miss the point; teams that frame QA as quality engineering get more value from the role as the scaffolding gets cheaper.
Joseph Bridge, Business Development Manager at EB Pearls, excels in driving growth and forging strategic partnerships in the tech sector.
Read more Articles by this Author