Microsoft Open Sources code-testing-generator: a Polyglot Unit-Test Agent That Hits 92.1% Task Completion Versus 78.9% for Stock Copilot

Disclosure: Some links in this article are affiliate links. AI Maestro may earn a commission if you make a purchase, at no…

By Vane August 7, 2026 3 min read
Microsoft Open Sources code-testing-generator: a Polyglot Unit-Test Agent That Hits 92.1% Task Completion Versus 78.9% for Stock Copilot

Microsoft has released the code-testing-generator, an open-source agent that writes unit tests and verifies they execute correctly. It lives inside the MIT-licensed dotnet/skills repository as part of the dotnet-test plugin.

The tool addresses a common failure mode in standard coding assistants. A simple prompt like ‘generate unit tests’ often leaves the agent guessing regarding frameworks, file paths, or assertion styles. code-testing-generator resolves this by scanning the repository before writing a single line of code. It plans, drafts, runs, and validates the tests it produces. On Microsoft’s internal benchmark of 152 tasks, the agent completed 140 tasks, compared to 120 for stock GitHub Copilot. Both systems used the same model and prompts.

Deployment and fit

The software is an agent definition paired with skills, not a hosted service. It runs inside your existing coding agent environment, keeping all code local.

  • Company stage: The tool works for solo maintainers, but startups and mid-market teams benefit most. These groups often lack the bandwidth to encode repository research manually. Enterprises can fork the language guidance to match internal frameworks.
  • Industries: It suits regulated software estates such as financial services, healthcare, insurance, and the public sector. Platform teams can also use it to reduce legacy test debt.
  • Applications: Teams can backfill tests for untested modules, generate tests for a pull-request diff, raise coverage before a release gate, or standardise conventions across polyglot monorepos.

How the agent works

The workflow follows a Research-Plan-Implement pipeline. The agent searches the repository for code requiring tests, identifies the language and framework, reads existing tests for conventions, and locates the actual build and test commands. This final step fixes a specific issue where a test project builds locally but never runs in CI because nothing registered it.

The agent then selects one of three strategies. Direct writes and validates tests immediately. Single pass runs one cycle. Iterative repeats the process for large scopes or coverage targets. The system never modifies production code and avoids tests that call external URLs, bind ports, or depend on timing.

The verification gate

Before reporting completion, the agent runs five checks. It reasons about small code changes that should cause tests to fail, a lightweight form of mutation testing. It flags weak or missing assertions. It maps every requested scenario to a test. It builds the full workspace and runs the full suite. Finally, it confirms the repository’s own test command discovers the new tests.

Benchmark results

On Microsoft’s internal benchmark of 152 tasks from real repositories, the agent completed 140 (92.1%) versus 120 (78.9%) for stock GitHub Copilot on the same model and prompts. This represents 63% fewer failures.

The improvement is concentrated. On 89 vague prompts, the agent resolved 79 (88.8%) against 59 (66.3%), cutting failures from 30 to 10. On 63 detailed prompts, both scored 61 (96.8%). On 15 tasks targeting a specific diff, the agent passed all 15 while stock Copilot passed none.

Notably, the agent generated 2.3% fewer tests (6,963 vs 7,129) at effectively identical line coverage (72.4% vs 72.2%). Average task time was 359 seconds against 380. Token use per completed task was 3.2% higher.

On 45 .NET tasks, Claude Opus 4.8 reached 43/45 with the agent versus 35/45 stock; GPT-5.5 reached 41/45 versus 36/45. On the harder external SWE Atlas benchmark, completion was 16/44 versus 12/44.

What it means

Developers no longer need to manually specify every detail of a test suite. The agent handles the discovery of build commands and conventions, which reduces friction when working with legacy code or complex monorepos. The results show that reliability comes from planning rather than volume; the tool produces fewer tests but achieves the same coverage with higher success rates.

Scroll to Top