← All posts
Best practices

Reviewing AI-authored code without losing the behavior

An AI-assisted change can arrive faster than your team can review it. If the queue is growing, start with a concrete question: which user journeys does this change touch, and what evidence shows they still work? Pair those checks with review of the code, security, and data changes.

Consider a hypothetical review queue: three engineers using coding agents, each opening two or three PRs a day. The reviewers still have the same hours. Larger changes can push them toward skimming, which leaves important questions unanswered even when the PR has an approval.

An approval should say what was checked

An approval can be mistaken for evidence of a thorough review. State what you checked and what still needs attention. That gives the next reviewer useful information instead of asking them to infer coverage from an "LGTM."

Large, frequent changes put pressure on line-by-line review. Measure that pressure in your own repository: change size, review time, duplicated code, and regressions caught after merge. Those numbers are more useful for setting your review budget than an unsupported claim about every team adopting AI.

If change volume exceeds the review budget, reduce PR size and prioritize the highest-risk code. Behavior checks can supply additional evidence; they do not remove the need to inspect implementation risks.

Review behavior alongside the code

Add a behavior checklist to each review. A change may span many files while affecting a small set of important journeys. Naming those journeys gives reviewers a concrete scope for regression checks.

An agent can rewrite a checkout flow across fourteen files, and the behaviors sitting under it stay the same four they always were: guest can check out, invalid card shows an error, totals include tax, empty cart blocks the button. Those are reviewable. They're finite, they're stable, and they map directly to what a user would notice if the diff broke something.

Alongside reviewing code correctness, ask "which behaviors does this diff touch, and what did the checks observe?" Inspect the expectations and results, then use that evidence to assess whether the change implements the intended behavior.

The same review principle applies to tests an AI wrote: execution supplies evidence about the checked behavior, while reviewers assess the expectations and the code.

The playbook

Here's the concrete version. Four moving parts, each of which you can stand up incrementally.

1. Map the behaviors that matter. You can't assert behaviors you haven't enumerated, and the hardest part of enumerating them is knowing what you're missing. Coverage mapping does this by deriving your app's areas from the source and lining them up against what your tests actually exercise, so the gaps are visible instead of assumed. The goal is a named list of user-visible behaviors per area, ranked by what breaks a customer's day if it fails, and that list is your review checklist. See coverage mapping in practice for how the app-area-to-coverage view works.

2. Run a full regression every night. Not every behavior needs to gate every PR. Some flows are slow, and running the entire suite on each push would throttle your merge rate right back down to the speed you were trying to escape, so move the broader pass to a scheduled nightly run against a stable environment. The configured suite is exercised daily when the scheduled run dispatches and completes. The nightly regression playbook covers the scheduling, environment, and triage-in-the-morning workflow.

3. Smoke the critical paths on every PR. The subset that must never break, meaning sign-up, login, checkout, and whichever one flow is your actual business, gets asserted per-PR, in CI, as a merge gate. Keep it small and fast enough that it never becomes the reason people skip it. This is the layer that catches the agent that confidently refactored auth and broke the redirect. Wire it into your pipeline so a red behavior blocks the merge the same way a failed unit test does, and CI/CD integration shows the hook points.

4. Make "which behaviors does this diff touch?" a review question. Use coverage mapping to locate affected areas, inspect the relevant test expectations, and confirm the smoke run passed. Keep reviewing security, data handling, and implementation details that those journeys do not cover.

The checklist turns a broad question into specific evidence: four checkout expectations, their run results, and the code changes behind them. It is easier to see both what was checked and what remains uncertain.

Where generated tests can help

This playbook depends on maintaining useful behavior checks. Authoring, data setup, review, and triage all belong in the budget. Plain-language generation can help draft those checks, but measure the effort on your own suite.

TestVibe generates Playwright code from a behavior description and verifies the assembled test against your app. Review the assertions before relying on the result, and investigate failures before deciding whether to change the app or the test.

A green behavior suite tells you its checked expectations passed on that run. It does not establish that every requirement is covered or that a security or data-model change is correct. Use those results to focus further review, with the 2026 e2e strategy piece as a guide to the other testing layers.

Start with the next PR in your queue: list its important behaviors, link their test results, and record any uncovered risks. That gives an approver a concrete basis for the decision.


Want to see which behaviors your suite already covers, and assert the critical ones on every PR? Get early access, or read how coverage mapping turns your source into a reviewable behavior list.

Coming soon

Turn a described flow into a reviewable test.

Describe a flow in plain English. Generate a Playwright test, run it on your schedule, and review proposed fixes when your UI changes. Join the waitlist for early access.

  • Plain English in, real Playwright out
  • Runs in your CI, on your schedule
  • No credit card, unsubscribe anytime