← Latest papers
💻 computer science

Beyond Test Presence: Assessing the Quality and Robustness of Agent-Generated Tests in Open-Source Projects

This empirical study of over 200,000 test artifacts reveals that while AI agents outperform human developers in edge-case coverage, they generate tests with higher flakiness risks due to a lack of environmental awareness, highlighting a critical gap between test execution success and intrinsic quality.

Original authors: Preet Jhanglani, Zeel Kaushal Desai, Vidhi Kansara, Eman Abdullah AlOmar

Published 2026-07-15
📖 4 min read☕ Coffee break read

Original authors: Preet Jhanglani, Zeel Kaushal Desai, Vidhi Kansara, Eman Abdullah AlOmar

Original paper dedicated to the public domain under CC0 1.0 (http://creativecommons.org/publicdomain/zero/1.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you're running a massive, high-speed bakery where robots (AI agents) and humans are both trying to bake the perfect cake. But instead of just tasting the cake, you have to check the recipe cards they wrote to see if they actually know how to bake. That's exactly what this study did, but with computer code instead of flour and sugar. They looked at over 200,000 recipe cards (test files) from a giant digital library called AIDev, comparing 179,732 written by AI robots against 24,941 written by human bakers.

Here is the big surprise: The robots aren't just clumsy copycats; in some ways, they are actually better at spotting the weird, tricky ingredients, but they are terrible at keeping the kitchen clean.

The "Weird Ingredient" Contest (Edge Cases)

You know how sometimes a recipe says "add flour," but a smart baker knows to also test what happens if you add zero flour, or a negative amount of sugar, or a bowl full of nothing? These are called "edge cases."

Most people thought humans would be better at this because they have experience. But the paper suggests the opposite. The AI agents were like a robot that memorized a list of "weird things" and threw them all into the mix.

  • The Numbers: The robots tested for "zero" inputs 27.7% of the time, while humans only did it 11.2%.
  • The Variety: The robots covered almost twice as many different types of weird situations as humans did. Their "variety score" was 0.62, compared to the humans' 0.32.
  • The Catch: The paper notes that the robots did this almost mechanically, just listing standard weird values. They didn't necessarily understand why those values mattered, they just knew to check them. Also, neither group was very good at testing for negative numbers (both were at 0.0% for negative numeric boundaries), which is a blind spot for everyone.

The "Strict Judge" Contest (Assertion Strength)

Now, imagine the recipe card needs a "taste test" at the end. A weak test says, "Is the cake there?" A strong test says, "Is the cake exactly 5 inches tall and chocolate flavored?"

  • The Result: Humans were slightly better at writing these strict, specific tests. 88.1% of human tests were "strong," while only 85.4% of robot tests were.
  • The Robot Glitch: The robots made a lot of "unknown" mistakes. About 11.6% of their tests used weird, made-up commands that didn't exist in standard libraries, whereas humans only made this mistake 1.5% of the time. It's like a robot writing a recipe that says, "Add a pinch of fluffernutter," when no one knows what that is. This makes the recipes harder for humans to read and trust later.

The "Messy Kitchen" Problem (Flakiness)

This is where the robots really stumble. A "flaky" test is like a cake that passes the taste test one minute and fails the next, even though you didn't change the recipe. It happens because the robot didn't clean up its mess (like leaving a file open or using a random number generator).

  • The Verdict: The robots are much messier. The paper found that robot-generated tests had a "candidate rate" for being flaky of 0.41, while human tests were only 0.30.
  • Why? The robots loved to touch the "file system" (opening and closing files) and use "non-deterministic" things (like random numbers) without cleaning up afterward. Humans did this too, but at a lower rate. The paper suggests this is because the robots lack "environmental awareness"—they don't know they are in a busy, shared kitchen and need to be careful not to leave a mess that breaks the next person's cake.

The Bottom Line

The paper rejects the simple idea that "AI writes worse code than humans." It's not that simple.

  • What the paper proves: The robots are surprisingly good at casting a wide net to catch weird edge cases (like zero or null inputs), often better than tired humans.
  • What the paper suggests: However, the robots lack the "common sense" to write stable, clean tests that don't break when the environment changes. They are great at generating a huge volume of test ideas, but they need a human to come in, fix the "unknown" commands, and clean up the mess to make the tests reliable.

In short, the AI agents are like a hyper-active intern who checks every single possible ingredient combination but forgets to wash the dishes, while the humans are careful but sometimes miss the weird stuff. The best team? A human supervisor guiding the robot's energy.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →