interesting framing. I agree that AI makes implementation cheaper, but I’m a little skeptical that behavioral end-to-end tests alone can become the main source of authority.
They are strong for validating user-visible workflows, like the single-use password-reset example. But many expensive failures live below that layer: authorization boundaries, race conditions, migrations, performance under load, data integrity, and operational behavior in production.
It feels like the real challenge is deciding which parts of the specification need deterministic checks at each layer not just E2E, but unit, integration, contract, security, and observability-based verification too.
Still, the principle is solid: the agent should not be the only system deciding that its own work is correct. The most interesting part for me is whether we can make those different verification signals easy enough for an agent to iterate against autonomously.
The Verification Bottleneck in AI-Generated Software
7 Comments
@[JustineDevs] I agree, and I think this is an important qualification to the argument.
I don't see behavioral E2E as the single source of authority. I happened to be experimenting with this layer because the question was whether an implementation exhibited a specified user-visible behavior. The claim changes, and so does the appropriate verifier.
An authorization boundary might need security and integration tests. A migration needs data-integrity checks. A race condition may need concurrency testing. Performance needs load testing, and production behavior may need observability signals. The common principle isn't "E2E verifies everything." It's that the system making a claim should have an appropriate, independent source of evidence for that claim.
Your last point is where I think this gets especially interesting for agentic development. If those different verification layers can return structured, deterministic evidence in a form the agent can consume, then the loop doesn't have to stop at pass/fail E2E results. Unit, integration, contract, security, performance, and operational signals can potentially become different kinds of evidence feeding the same refinement loop.
So perhaps the architecture isn't one verifier at all. It's a set of verification authorities, selected according to the claim the agent is trying to make.
The agent can propose. The harder design problem is deciding what gets authority to say it was right.
Please log in to add a comment.
The password reset bug is a good example because it's exactly the kind of thing that never shows up in a demo. Nobody clicks the same link twice on stage.
I've been circling the same split from the API side rather than the testing side, mostly around whether an action can repeat safely and whether a failure tells the caller what it's allowed to do next. Your point about specifications outliving implementations is that idea from another angle. "This link becomes invalid after one use" isn't really a test case, it's an operating contract, and it has to hold regardless of which route or framework happens to sit underneath it that month.
The "don't let the student grade the exam" section is the part I'd underline for anyone skimming this. An agent testing its own understanding of a requirement just proves it's internally consistent. It doesn't prove it's correct, and those are very different claims to ship on.
@[Mike Dabydeen] I like “operating contract” as the distinction here. That’s probably a better way to describe what I was reaching for.
“This link becomes invalid after one use” shouldn’t belong to the implementation, and it shouldn’t really belong to the test either. It’s a property of the system that both implementation and verification have to answer to.
That becomes especially important with generated code because the implementation is suddenly much more disposable. An agent might replace a route, swap a library, restructure the persistence layer, or regenerate most of the feature and still produce something that looks correct in a demo. The operating contract is what has to survive all of those changes.
Your API point also adds something I didn’t spend enough time on: failure behavior is part of that contract. It isn’t enough to specify what happens when an operation succeeds. Whether an action may be retried, whether it is idempotent, and what a failure permits the caller to do next are all observable behaviors too.
And yes, that’s exactly why I keep coming back to the student grading the exam problem. If the same agent interprets the requirement, writes the implementation, and decides whether the implementation satisfies its interpretation, you can get a beautifully self-consistent system that is consistently wrong.
The interesting engineering problem now is making the operating contract independent enough, and executable enough, that an agent can iterate against it without also being allowed to quietly redefine what “correct” means.
@[Ken W. Alger] That's the sharpest way I've seen this stated. The independence requirement rules out most of the shortcuts people reach for, like asking the same agent to write both the code and the acceptance test from the same prompt. It'll pass, because it's grading its own definition of correct, not because the behavior is right. What I keep turning over is who writes the contract in the first place. A human writing it up front gets you independence, but puts the bottleneck back on human authorship of specs at scale. An agent proposing the contract, verified by a separate process, moves the trust problem rather than solving it, but at least it's now a smaller, more inspectable question: is this operating contract right, not is this whole feature right. That feels like the more tractable thing to build tooling around.
@[Mike Dabydeen] I think that's exactly where the interesting problem moves next.
I don't think "humans write complete specifications up front" scales particularly well either. Beyond the cost, the comments I've gotten on this article have already shown that humans don't necessarily know all the invariants up front. Someone pointed out that my single-use reset token test covers sequential reuse but not two concurrent attempts. That's a legitimate hole in my own specification.
What I find compelling about your framing is the reduced surface we have to trust.
An agent can propose an operating contract. A human, another system, or some combination can challenge that contract before implementation. Then independent verification can test behavior against the accepted contract. When the implementation or production reality exposes another invariant, that knowledge gets promoted back into the contract.
So instead of asking a human to understand and verify every implementation detail, we're asking a narrower question: "Is this an adequate definition of correct behavior?"
That's still a hard problem, but I agree that it feels substantially more tractable.
It also makes me wonder whether the real bottleneck isn't ultimately verification itself, but contract discovery: finding the assumptions that everybody was making before one of them becomes a production incident.
@[Ken W. Alger] Contract discovery is a good name for it, and I think it already has a home in operations, just not a useful one. Every postmortem I have written was contract discovery. Something was assumed, nobody wrote it down, production found it. The output was a prose document and a ticket, and the invariant stayed in the prose.
That is the gap I would try to close first. Not because postmortems are bad, but because what comes out of them is not in a form anything can check against later. Six months on, someone regenerates the feature and the invariant is gone, along with the person who remembered why it was there.
The concurrency hole in your reset token example is worth sitting with too. A reader found it. That is a review process that works and does not scale. The things that surface those cases cheaply tend to be adversarial rather than descriptive: property tests, fuzzing, replaying real traffic shapes. None of them tell you what correct is. They are good at showing you where you never said.
So I would put it as verification scaling and discovery not scaling yet. Whether the fix is tooling or just discipline about where the output of an incident lands, I am not sure. Probably some of both.
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
More From Ken W. Algerverified
Related Jobs
- Bilingual Store Associate (Spanish)Sherwin-Williams · Full time · Hagerstown, MD
- Tech Consulting - Cybersecurity Privacy -Identity Verification Engineer - Senior - Location OpenEY · Full time · Charleston, WV
- Software Engineer, Test & Infrastructure II (Bilingual Spanish)Vail Systems · Full time · Springfield, IL
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!