Skip to content
Advertisement
Microsoft study finds AI coding agents write bigger patches, mostly by adding tests

Microsoft study finds AI coding agents write bigger patches, mostly by adding tests

Microsoft official logo (public domain, Wikimedia Commons) — CryptoBriefing brand treatment

Researchers traced 7,660 GitHub Copilot CLI runs and found agent fixes run larger than human ones, though much of the extra bulk is tests

AI coding agents write bigger fixes than human developers do. A new Microsoft Research preprint finds that most of the extra lines are tests, not additional code.

The study, dated November 25, 2026, looked at how frontier models behave when given real coding tasks. Its conclusion is that agents write more, but they are not necessarily sloppier.

What the researchers measured

The authors are Microsoft researchers Aakash Goel, Benjamin Steenhoek, and Yu Hu. They analyzed 7,660 resolved trajectories from GitHub Copilot CLI, produced by 18 frontier models.

The runs came from two benchmarks. SWE-bench Verified supplied 6,728 of them, and DeepSWE supplied 932.

The first finding is about size. On SWE-bench Verified, agent patches changed a median of 2.33 times more lines than the patches developers wrote for the same problems.

Advertisement

The breakdown of those lines is more mixed. On SWE-bench Verified, 61% of the extra edits were tests, and another 13% were documentation.

A new way to judge whether code earns its place

To work out which lines mattered, the team introduced a method called Delta Residue Attribution, or DRA. It traces agent-generated patches and re-evaluates them to see what each piece contributes to the final result.

On this measure the agents did well. On SWE-bench Verified, the agents’ code necessity score, labeled NP_code in the paper, was higher than the developers’ score on average.

There were problems. About 11% of agent code units on SWE-bench Verified turned out to be unneeded after testing.

And 89% of those unneeded units changed behavior. They were not harmless leftovers like an extra blank line. They were edits that changed how the program runs, even though the fix did not require them.

DeepSWE tells a different story

The second benchmark produced a different mix. On DeepSWE, most of the extra edits were code modifications, which made up 58% of the surplus.

What this means for developers and toolmakers

The 11% figure may be the most useful for practitioners. If about one in nine agent code units on SWE-bench Verified is unnecessary, and nearly all of those change behavior, removing them is a real engineering problem.

For Microsoft, the research is also a study of its own product. All the trajectories come from GitHub Copilot CLI, so the company is in effect auditing how its agent behaves across 18 different underlying models.

This is a preprint, so its methods and conclusions have not gone through formal peer review. DRA in particular is new, and other researchers will likely want to check whether it holds up on other tools and codebases.

For now, the study gives a more measured picture than most commentary on AI coding. AI agents do write more, but on at least one major benchmark, most of the extra is tests and documentation.

Disclosure: This article was edited by Diego Almada Lopez. For more information on how we create and review content, see our Editorial Policy.