Urgent.News

What's breaking now, across thousands of outlets.

AI

How to Verify AI-Generated Code With Evidence

An AI coding agent says the change is complete. The tests pass. Is that enough to merge? Not always. The code and its tests may share the same mistaken assumption. A unit test can pass while the feature fails when a real user follows the full workflow. A code review can miss a bug if the reviewer sees the same incomplete context that shaped the implementation. On November 16, 2026, Addy Osmani…

Verifying AI-generated code requires more than just passing tests. While a green test suite indicates that the checks ran successfully, it doesn't guarantee that the right checks were run or that they cover the user's task. To ensure the code meets requirements, start by defining the behavior that must remain true.

Write down the behavior in concrete terms before asking an AI agent to change code. For example, when testing a paginated endpoint, specify that no more than the requested number of parent records should be loaded, and that each record must include the expected child data. Additionally, verify that the database doesn't load all matches into application memory. These requirements serve as evidence of the change and provide a basis for the reviewer to check the result.

The verification process should also involve running the application, as reported by the Claude Code team. They recommend specific instructions for starting the app and exercising the change before committing the code. If failures persist after multiple repair attempts, they should be handed to a person.

To create a robust verification workflow, use tests that examine different failure modes. End-to-end (E2E) tests drive the application through user-visible flows and can uncover issues that unit tests might miss. These tests provide a running system for inspection and a clear result to act upon. Keep the failure information useful by preserving the step that failed, the relevant output, and a screenshot or trace.

Property-based tests generate many inputs based on a rule and look for counterexamples—inputs that break the rule. These tests are valuable when a rule has a broad input space, as they can reveal edge cases that hand-picked tests might miss. However, they are less useful for vague requirements or when generated cases are difficult to interpret. Begin with a property that a product owner or maintainer can articulate in a single sentence.

Differential tests compare the old and new behavior by running two implementations with the same inputs and comparing their outputs. This approach is helpful during migrations or rewrites, ensuring that the expected behavior remains consistent even if the internals change. When comparing outputs, normalize irrelevant details and record approved changes rather than treating every mismatch as a bug.

Lastly, it's crucial to keep the verifier independent from the patch. Tests should remain green even if the code under review can modify the test or the rule that runs it. This independence is essential for maintaining test coverage and preventing the AI-generated code from rewriting the verification process.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

How to Read an AI IPO Prospectus: Anthropic's Numbers as a Case Study

Anthropic began trading on Nasdaq under the symbol ANT on November 19, 2026. The company priced its shares at $83 each. Its final prospectus describes the business. It gives revenue and cost figures.

  • Anthropic IPO priced at $83 per share on Nasdaq, ticker ANT
  • Revenue surged 1,206% YoY to $33.2 billion in Q3 2026
  • $26 billion Class N shares sold to strategic investors without voting rights

Attune: Your Claude Can't Tell How You Feel. Now It Can, Privately

This is a submission for the Presage SmartSpectra SDK Challenge . What I Built AI assistants only get your words. They can't tell when you've gone quiet after a bad day or when your pulse is climbing…

  • Attune AI can detect user's emotional state via webcam.
  • System translates physiological cues into AI tone adjustments.
  • Users consent individually to each feature and can revoke access.

Gestalt: The Stealth AI Model at the Top of a Design Benchmark

A model named Gestalt is leading a new AI design leaderboard. But its maker has not been named, the model is not publicly available, and the result comes from one benchmark run by the company that…

  • Gestalt AI model tops Contra Labs' design benchmark
  • Stealth model with undisclosed team and details
  • Performs well on visual outputs and AI-style pattern detection

More from Friday 20 November →