Šarūnas.
← All writing

On verification

We’re generating code faster, and there’s more of it to verify. For many teams, verification is becoming the bottleneck.

At the AI Engineer Code Summit in San Francisco, verification kept coming up in conversations. What I heard less about was what it takes to make verification fast and reliable enough for agents to use.

Conference slide reading ‘verification is the most important step,’ seen from the audience.A presenter at the Code Summit in front of a slide reading ‘quality & quantity.’

Get the foundations right

We’re rushing to the tip of the spear: generating test cases, writing tests, self-healing, and so on. But if the foundations underneath are weak, none of this gets us very far.

Agents make weak foundations more costly because they run our feedback loops more often. They can also help us tackle some of the work we’ve put off for years.

This is the cheat sheet I use when I’m looking for ideas on what to improve:

Breaking down the work

Quality foundations
Time to feedback
Measure the wait
Break down queue, build, setup, and test time
Track feedback time for common changes
Build and setup
Cache dependencies and build artifacts
Prepare environments and test data earlier
Test execution
Shard and run independent tests in parallel
Select relevant tests for fast feedback
Reruns and diagnosis
Remove flaky tests that trigger reruns
Make failures easy to reproduce and investigate
Testability
Local and ephemeral environments
Run a useful slice of the stack locally
Create isolated environments for changes
Dependencies
Use containers or simulations where appropriate
Make external failures and edge cases reproducible
Production testing
Isolate or exclude test data
Use test-specific routing or headers where safe
Reliability
Test design
Reduce shared state and unnecessary dependencies
Make test data isolated and reproducible
Find flakiness
Track flaky test rates and reruns
Assign an owner and make quarantine visible
Prevent regressions
Repeat new or fixed tests under CI-like conditions
Investigate failures instead of relying on reruns
Observability
User journeys
Monitor critical flows, not just 5xx errors
Use synthetic checks for important paths
Investigate
Connect logs, metrics, and traces to a change
Make the impact and affected users visible
Respond
Route actionable alerts to the right owners
Give agents and people useful diagnostic context
Recovery
Limit exposure
Release incrementally or use canaries
Watch meaningful signals during rollout
Roll back
Make rollback or feature disablement fast
Plan for data and schema compatibility
Practice
Exercise recovery before an incident
Document ownership and measure recovery time

I don’t think we’re being ambitious enough about raising the bar in any of these. Take time to feedback as an example. Builds can take forever, tests fail randomly, and you can run a 5K before the pipeline gives you a pass or fail.

We’ve lived with this for years, often saying, “Reducing build times would take too much effort. Our product priorities are more important.”

Well, well, well. Now that we have LLMs, maybe it’s finally time to address it?

Time to feedback

Do your tests take hours to run?

That’s expensive for humans. It’s also expensive for agents, which may need to run the same feedback loop many times while working on a change. The longer each loop takes, the longer it takes to find out whether the agent’s latest attempt worked.

Start by measuring where the time goes: queueing, building, setting up environments and data, running tests, or rerunning failures. Then look at caching, parallelization, test selection, and reducing expensive setup. The tree above breaks these into smaller areas of work.

Test selection deserves more thought than just picking the fastest checks. What changed? Which dependencies does it touch? What has failed before, and what could hurt users if we get it wrong? A small change to a critical flow may need more attention than a larger change elsewhere. Whatever we select, we should be clear about what we haven’t checked too.

My north star: the test suite should finish in roughly the time it takes to run its longest test.

I know, I know. Ambitious as fuck. You’d need enough parallel capacity, world-class test design, and infrastructure. And setup time doesn’t magically disappear. But it’s a useful direction to aim for.

Testability

Testability isn’t just about how easy the code is to test. Think beyond the code: systems, dependencies, and environments. An agent can write a test, but if the feature depends on a service it can’t reach or data it can’t set up, that test may tell you very little.

Do you need to deploy to staging before you can verify that a feature works or that you haven’t broken something? That’s a tad too late.

Do your core features depend on services that only run in production? Can your automation run in production?

Things to work on:

  • Local development environments that let you test across the stack.
  • Hermetic tests that control their dependencies and don’t rely on shared external services.
  • Ephemeral environments: isolated environments created for a change and removed when they’re no longer needed.
  • Simulations and virtualization to mimic dependencies earlier in the build pipeline.
  • Ways to test safely in production: test-specific headers, test data isolation or exclusion.

The goal is to make useful checks possible earlier, without waiting for a shared environment or a production-only dependency.

Reliability

Are your tests flaky?

Unreliable test runs are a deal breaker for agentic development. As humans, we rely heavily on tribal knowledge: “Oh, that test fails sometimes. Just rerun it.” An agent may have no way to know that.

Start with test design. Look at how many dependencies a test needs and how much work it takes to set up the data before the test can even start.

Setting up data through the UI can be slow and brittle. APIs, direct database setup, and seeded data can be faster, but each comes with trade-offs. Whatever you choose, aim for data that’s quick to prepare, isolated from other tests, and easy to reproduce.

You also need ways to identify and get rid of flaky tests. Track intermittent failures, make someone responsible for fixing them, and make it visible when a test is temporarily quarantined. Quarantine buys time; it doesn’t fix the test.

One option is a reliability pipeline for new and fixed tests: run them multiple times before merging, ideally under conditions that resemble CI. A clean run doesn’t prove a test will never flake, but it can catch problems before they affect everyone else.

What an agent sees

Imagine an agent changes the checkout flow, runs the tests, and gets this back:

FAIL  checkout › completes an order
Timed out after 30 seconds waiting for the order confirmation.

What should it do with that? The change could have broken checkout. The test could be flaky. A dependency could be slow. The output doesn’t say, so the agent has to start digging or guess.

Now imagine the same failure with a bit more context:

FAIL  checkout › completes an order
Timed out after 30 seconds waiting for the order confirmation.

Recent history: 2 of the last 20 runs on the base branch
failed with the same timeout.
Changed files: checkout/confirmation.ts
Exercises: checkout confirmation flow.
Artifacts: screenshot and trace available for this run.
Owner: checkout team.

That history doesn’t prove the failure is unrelated to the change. The agent can inspect the trace, compare it with failures on the base branch, and investigate the changed code. It has somewhere to start, and a piece of tribal knowledge is available in the feedback loop. A human can use it too.

But better context alone doesn’t mean the agent will get it right. Before letting it make decisions on its own, try it on cases where you know what happened, including flaky tests, real regressions, and missing or misleading evidence. Look at the times it sounds confident but gets the answer wrong, not just how often it finishes the task.

Start with human review and a limited scope. If the agent proves reliable for a particular task, give it more room to act. It still needs clear permissions, a way to stop, and someone to ask when it’s unsure.

Observability

Look beyond 5xx checks. Synthetic tests and monitors that exercise important user journeys can tell you a lot more about whether the system is actually working.

Then a release goes bad, and an agent is asked to investigate. Can it connect the failing journey to the change that went out, see the relevant logs, metrics, and traces, and understand who or what is affected? If all it gets is an alert saying “something broke,” it has a lot of guessing to do. And if someone needs to make a decision, the alert and its context need to reach them.

Quality folks should care about how features work across their entire lifecycle. The work doesn’t stop when we release.

A green build and healthy dashboards don’t tell us whether the change solved the right problem. Look at support conversations, user feedback, and how people actually use the feature. If we learn that something was confusing or went wrong, that should feed back into the product and the checks we run next time.

We also need signals about the engineering system itself. Feedback time, flaky test rates, and time to recover are worth collecting alongside service health. Agents can help gather them from the tools we already use, but someone still needs to check what the numbers mean and whether they’re useful.

Recovery

Knowing something is wrong is only half the job. We also need a way to limit the damage and recover.

We’re shipping more code, faster, and it’s hard to keep up. If we have no way to limit the impact of a bad production release and recover quickly, a small mistake can become a big problem.

Think incremental rollouts, canaries, blue-green deployments, and fast rollback. An agent watching a canary needs to know which signals matter, when to stop the rollout, and who can approve or carry out a rollback. And a rollback isn’t much help if a database change makes the previous version incompatible.

Practice those recovery paths before an incident, including who owns each step. This matters to us as quality folks, not just the ops team: reducing the impact of a bad release is part of delivering quality too.

Make room for exploration

If agents can take some of the repetitive work off our hands, what do we do with the time? I’d spend more of it exploring the parts of the product we don’t understand well yet: a new journey, an interaction between systems, or a flow where the intended behavior isn’t obvious.

An agent can help set up data, collect screenshots, or reproduce what we find. People still need to ask the questions, notice what feels off, and decide what matters. When exploration finds a real problem, we can fix it and turn what we learned into a check or better observability.

Closing thoughts

It’s easy to get carried away. My social feeds are full of “agentic testing” sales pitches and clout-seeking LinkedIn posts promoting a Markdown file that generates test cases. A lot of these products are no better than a vanilla “test this feature, make no mistakes” prompt in Claude Code.

There’s also impressive work out there, like Meta’s JiTTesting, which generates and runs tests against code changes before they land. Even with sophisticated solutions like this, the foundations have to come first.

Agents can help us move faster, but they need fast, reliable signals and systems we can safely change. If the foundations are weak, that speed just helps us reach the problems sooner.

If you want to go deeper on any of these ideas, reach out to me on LinkedIn.