We make Checkcraft, an API testing tool, so we read a lot of AI-written tests. This is what we keep seeing, and none of it needs our tool.
Where AI really helps
Give a model the docs, an OpenAPI spec or a curl example and you get a decent set of test cases in minutes. It is also good at the boring part of negative testing: empty fields, extra fields, wrong types, boundary values, someone else's token. That alone saves hours.
Where it quietly fails
- It takes expected values from the response the server already returned. The test then locks the bug in.
- It checks
status == 200and that fields exist, but not thattotalequals the sum of the items. - An agent that sees a red test may "fix" it by changing the expectation, or rewrite an older test to agree with its own bug.
- It cannot see the logs of the next service, so a payment that failed after a 200 stays invisible.
A five minute check
Feed the test a deliberately wrong response. Change the total, add a typo to the status, add a field that should not be there. If the test stays green, it checks nothing. For code, mutation testing does the same thing at scale, and the number of surviving mutants tells you more than coverage.
Keep the expected values in the requirements, apart from the response, and do not let the agent edit them.
Try it on a practice API
We put up a free practice API where every response is 200 and ten bugs are hidden inside, one of them only visible in the service log. Ask your favourite model to write tests for it and count how many of the ten they catch. Tests that check only the status and that fields exist miss almost all of them.
https://checkcraft.ru/en/guides/bug-hunt.html?utm_source=devto
A longer write-up with an example prompt that keeps expectations out of the agent's hands is here: https://checkcraft.ru/en/guides/ai-in-api-testing.html?utm_source=devto
How many of the ten did your AI find?

