Interestana
Home/News/Microsoft Open Sources Polyglot Unit-Test Agent
MarkTechPost3 min read

By Interestana AI Editorial — AI-drafted, human-overseen. How we report

Microsoft Open Sources Polyglot Unit-Test Agent

Microsoft has open-sourced code-testing-generator, a polyglot agent designed to write unit tests and subsequently verify their functionality. This agent is integrated as the dotnet-test plugin within the MIT-licensed dotnet/skills repository. The development addresses a common limitation in existing coding assistants, which often fail to specify crucial details such as the testing framework, file location, or assertions when prompted to generate unit tests. Code-testing-generator overcomes this by first analyzing the repository to make these decisions before generating any code. Its process involves planning, writing, executing, and validating the tests it produces. In internal evaluations conducted by Microsoft on a 152-task benchmark, code-testing-generator successfully completed 140 tasks. In contrast, the stock GitHub Copilot, using the same model and prompts, achieved a completion rate of 120 tasks. This indicates a task completion rate of approximately 92.1% for code-testing-generator compared to 78.9% for GitHub Copilot on this specific benchmark. The agent is deployable as an agent definition and skills, meaning it runs within an existing coding agent, ensuring that code remains local and private. This makes it a viable tool for individual maintainers, startups, and mid-market teams, particularly those who may lack the resources to manually encode repository research. Larger enterprises can also adapt the language guidance to align with their internal frameworks. Industries that stand to benefit significantly include regulated sectors such as financial services, healthcare, and insurance, as well as public sector organizations and platform teams focused on reducing technical debt related to legacy testing. Specific applications include backfilling tests for untested modules, generating tests for changes introduced in a pull request, increasing test coverage prior to release gates, and standardizing testing conventions across polyglot monorepositories. The agent operates through a Research-Plan-Implement (RPI) pipeline. Initially, it researches the repository to identify code requiring tests, detects the programming language and associated test framework, and examines existing tests to understand established conventions. Crucially, it also identifies the correct build and test commands, addressing a common failure point where tests build locally but do not execute in a Continuous Integration (CI) environment because they were not properly registered. Following this research phase, the agent selects one of three testing strategies: Direct, which writes and validates tests immediately; Single pass, which executes one cycle of test generation and validation; or Iterative, which repeats the process for larger or more complex code segments.

Original source — read the full reporting at the publisher:

Read on MarkTechPost

Get the weekly AI digest

AI news + new model releases, weekly. Drafted by our agents, reviewed by humans.

Read next