Microsoft’s New Testing Agent Tackles the Trust Gap in AI-Generated Code
AI coding assistants write code fast. Whether that code can be trusted is a separate question, and it’s becoming a more urgent one. Surveys this year put average developer trust in AI-generated output at just above the midpoint of a five-point scale, and more than half of developers admit they ship AI code without testing […]
Microsoft has unveiled a new open-source AI agent to improve trust in AI-generated code, specifically for unit testing. This new tool, called code-testing-generator, addresses the issue of developers shipping AI-generated code without proper testing. The agent works by researching the repository, detecting the existing test framework, and studying existing tests to understand local conventions.
It then tailors its approach to the size of the task, starting with simple methods and moving to larger ones. During the writing process, the agent tests its own work using mutation testing and checks for weak assertions and coverage gaps. When compared to GitHub Copilot using the same underlying model, the specialized agent achieved a 63% reduction in failures, particularly on vague prompts and larger requests.
Microsoft claims this is due to the agent's verification process, which ensures tests catch injected bugs. The agent is currently available as open-source through the GitHub Copilot CLI and supports multiple programming languages, including Python, Go, Java, and Rust. Microsoft plans to further develop this approach for other types of testing in the future.
Written by urgent.news from DevOps.com's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

