Addy Osmani starts from an observation: giving an agent a way to verify its own work strongly improves the quality of what it produces. What made "good code" expensive — tests, benchmarks, specifications, real end-to-end paths — can now be delegated to the agent. Human work therefore shifts from line-by-line review to building loops the agent runs on its own, and taste gets capitalized: every error becomes a shared configuration, a hook, or a test. A human remains responsible for what ships, but reviews evidence rather than diffs.
In his view, models are now good enough that verification is the bottleneck. An agent that cannot check itself guesses, and correction then requires a slow, costly, unscalable human round trip. An agent that tests itself writes, checks, reads the result, and tries again before any human steps in. Tests change role: they become how the agent perceives the world and knows it is done.
End-to-end tests are the oracle of choice: they describe what the user does and are hard to fool, unlike a mock-based unit test, which can share the agent's own misunderstanding. They must point to the failing step, turning a vague instruction into a target. Slow and flaky, they should stay few in number.
Property-based tests state what must never happen; tools such as fast-check, Hypothesis, or proptest generate thousands of inputs and shrink failures down to a minimal case. Common properties: round-trips, invariants, idempotence, equivalence with a simple version. They stop the agent from picking examples that merely confirm its own logic and serve as a specification.
For a rewrite, differential tests turn the old system into the oracle: identical inputs, random or drawn from real traffic, output comparison, normalizing away the insignificant, and a justified list of intended changes, until the old system can be retired.
The loop must be fast and deterministic: an agent facing slow or flaky tests learns to retry rather than fix, or spaces out its runs and loses track of causes. Osmani recommends a core loop under a second, controlled randomness, immediate exclusion of flaky tests, concise output, and heavier tests before integration. His conclusion: write the check before the code.