Urgent.News

What's breaking now, across thousands of outlets.

Tech

Mutation Testing as a Merge Gate for Agent-Written Tests

An agent patch that passes its own tests is a baseline, not a verdict. The same model wrote the code and the tests, so both share the same blind spots. Mutation testing scores the tests themselves: inject a fault, run the suite, and see whether it notices. In practice, the first mutant often survives. Previous rounds on this account established three gates before merge: property checks, fixtures,…

Mutation testing is a new approach to evaluate the effectiveness of automated tests written by AI agents. This technique treats the tests themselves as a form of code, injecting faults and observing if the tests can detect the introduced errors. The process involves running the suite of tests after each mutation and comparing the results to the original tests.

If the tests pass despite the presence of a mutation, the mutation is considered "killed," indicating that the tests are effective at catching errors. However, if the tests continue to pass despite the mutation, the mutation is classified as "survived," revealing a weakness in the test suite. The source code utilizes a simple Python script that applies one mutation at a time to the implementation file, compiles it with an unchanged test file, and executes the resulting binary.

The script defines a set of mutations, such as replacing equality operators with inequality operators, less-than operators with less-than-or-equal operators, addition operators with subtraction operators, and returning zero to returning one. By systematically applying these mutations and observing the outcomes, developers can gain insights into the robustness of their tests and identify areas that require improvement.

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 Tech

Frontend Backend Correlated Logging: Browser Fetch Request IDs and Server Logs

Short answer: give each browser fetch a request ID, carry it to the backend in a standard HTTP header, and emit that same ID in structured logs on both sides.

  • Browser fetches receive unique request IDs for correlation
  • IDs passed via HTTP header to backend and included in structured logs
  • Separate flag-evaluation ID tracks pricing decisions and rule versions

More from Wednesday 26 August →