Microsoft Unveils Open-Source Agent for Automated Unit Testing
Microsoft has released an open-source agent called Code-Testing-Generator that can create unit tests in any programming language. This tool, available on GitHub, uses a pipeline to generate and validate unit tests based on the user's repository.
The Code-Testing-Generator agent works by first identifying the code that needs testing, detecting the language and test framework, and looking for existing tests to guide its work. It then chooses the right amount of work from three paths: direct, single pass, or iterative.
Once it has chosen a path, the agent plans and writes the tests, starting with simple code and moving on to more complex code with dependencies. It checks that the generated tests are useful by looking for problems such as small code changes that should make the tests fail, weak or missing assertions, and scenarios without matching tests.
The Code-Testing-Generator agent is available in the dotnet-test plugin in the dotnet/skills repository on GitHub and can be used with GitHub Copilot CLI, Visual Studio Code, and VS Code Insiders through plugin support.