November 19th, 2025
0 reactions

Supercharge Your Test Coverage with GitHub Copilot Testing for .NET

McKenna Barlow
Product Manager 2

Writing high-quality unit tests is critical for reliable software, but it’s often time-consuming and repetitive. What if GitHub Copilot could take care of that for you?

Today we’re thrilled to announce GitHub Copilot testing for .NET is now available in Visual Studio Insiders. This new capability brings AI-powered unit test generation directly into your development workflow, helping you go from zero coverage to tested confidence in just a few clicks.

GitHub Copilot testing for .NET

Unlike a one-off prompt, GitHub Copilot testing is purpose-built for testing. It understands your code’s structure, your project’s setup, and what good tests should look like. Whether you need tests for a single member, a file, an entire project, or even your whole solution, Copilot automatically generates, builds, and runs tests across the selected scope. The result? Faster feedback, fewer bugs, and more confidence in your code.

GitHub Copilot testing generating unit tests in Visual Studio

Key Features

Unit testing is essential for shipping reliable software, but writing tests by hand can be tedious and time-consuming. GitHub Copilot testing for .NET makes it faster and easier to create high-quality tests that reflect your real code.

Here’s what makes GitHub Copilot testing different

  • AI-generated unit tests at scale: Automatically create, build, and run tests for individual members, files, projects or entire solutions.
  • Deterministic, type-safe results: Tests are grounded in compiler and language semantics, ensuring consistency and predictability.
  • Support for MSTest, xUnit, and NUnit: Works with your existing frameworks and workflows.
  • Smart Visual Studio integration: GitHub Copilot testing is more deeply integrated with Visual Studio than prompt-writing in vanilla Copilot Chat. It uses Roslyn analyzers, MSBuild, project system integrations, and Test Explorer to deliver a seamless experience for setup, execution, and test discovery, all from within your IDE.
  • Automatic test recovery: Sometimes not every test will pass right away – and that’s okay. Copilot doesn’t stop there. When a test fails, it attempts to fix the issue, regenerate the test, and rerun it to ensure it works, giving you a strong starting point for reliable coverage.

From zero coverage to confidence

GitHub Copilot testing for .NET lets you go from zero tests to meaningful coverage with just a few clicks. AI isn’t just changing how we write code, but it’s also changing how we validate it. What used to take hours of manual work is now automated, giving you faster feedback and the confidence to keep shipping.

Getting Started

Pre-requisites: The latest Visual Studio 2026 Insiders Build, C# code, and a GitHub Copilot license.

  1. Install the latest Visual Studio Insiders build and ensure that the “GitHub Copilot testing” capability is enabled in Tools > Options > GitHub > Copilot > Testing.
    Settings option for tool
  2. Open your C# project or solution and make sure it builds without errors to simplify the process.
  3. Use the following syntax in the Copilot Chat window to start GitHub Copilot testing and begin generating tests:
    @Test #target
    Where #target can be the name of a member, class, file, project, solution, or #changes for git diff.
    Prompt to invoke tool
  4. In the Chat window, select Send. GitHub Copilot testing for .NET will then initiate an iterative process. Copilot will analyze your code and create a test project if one doesn’t exist. Then it generates tests, builds, and runs them, all automatically.
    GitHub Copilot testing showing iterative test generation process
  5. Test explorer shows the results as the tests are generated. If Test Explorer is not automatically opened, you may do so by selecting Test > Test Explorer.
  6. After test generation is complete, GitHub Copilot testing will provide a summary in Copilot Chat which includes the following:
    1. Stats about the number of unit tests, files, and projects that were created or modified.
    2. Before and after view of coverage so that you can easily understand the change in coverage.
    3. Quality indicators will surface pass/fail signals and any skipped or unstable cases to watch.
    4. If there are testability gaps, Insights point you to them and suggest practical fixes.
    5. Direct links take you straight to the new test projects and files so you can jump right in and iterate.

Post-generation summary

For more information, check out our Getting Started docs.

Try it out today

Download the Visual Studio Insiders build, enable GitHub Copilot testing, and see how AI can help you ship faster with fewer bugs. We’d love to hear what you think. Let us know with the “Give Feedback” button in Visual Studio. Your feedback will help shape the future of AI-powered development for .NET.

Author

McKenna Barlow
Product Manager 2

PM on the .NET Tools Team

0 comments