Order 5001 is off by 100. What should an agent that fixes tests do?
Order 5001 in our practice API has a subtotal of 3170, a discount of 300 and a total of 2970. By the requirement the total should be 2870. A test written from the requirement fails. A test written from the response passe
Order 5001 in our practice API has a subtotal of 3170, a discount of 300 and a total of 2970. By the requirement the total should be 2870. A test written from the requirement fails. A test written from the response passes.
Give that failing test to an agent with the instruction "make CI green", and there are two fixes that both end in green.
- Change the expected value to 2970. The build passes, the bug ships, and the diff looks like a one-line test cleanup.
- Leave the test alone and report that the service computes the total wrong.
Launch boards this month are full of agents that write, run and fix your tests. I like most of that sentence. The word I'd want defined is fix. Which of the two does it do, and who gets to see it?
The rules we ended up with
- Expected values come from the requirement and are written down before anyone looks at the response.
- The agent can draft checks and run them. It can't quietly change an approved expectation. Every edit it makes shows up for a person, with an undo.
- Checks run from saved rules in a separate runner, so the same data gives the same verdict on every run. The agent reads the report. It doesn't grade its own work.
This isn't distrust of the model. A model asked to make something pass has its shortest path through the expectation, and from the diff alone a reviewer can't tell a real fix from a relabelled bug. Once writing and running are split, the second kind becomes visible.
Try it in five minutes
import requests
URL = "https://checkcraft.ru/practice-api/v1/orders/5001.json"
def test_order(): # passes on any successful response
r = requests.get(URL)
assert r.status_code == 200
def test_order_total(): # the rule from the requirement
order = requests.get(URL).json()
assert order["total"] == order["subtotal"] - order["discount"]
The second test fails with 2970 instead of 2870. That failure is the point. If your agent turns it green by editing the last line, you've learned what fix means in your setup.
Two things I'd ask any test agent vendor, us included. When a test fails, can I limit the agent to a code fix or a bug report and forbid test edits? And is a changed expectation shown separately from new tests, so a reviewer can't miss it?
We built Checkcraft around this split. An agent drafts checks over MCP, the desktop app runs them the same way every time, a person signs off. It's on DevHunt this week if you want to poke at it: https://devhunt.org/tool/checkcraft. The practice API is free and needs no sign-up.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.