Freedom251 › Test Coverage Tools
Microsoft Code Coverage

What Microsoft Code Coverage is
Microsoft Code Coverage measures how much of a project’s code is exercised by coded tests, including unit tests. Its documented workflows cover .NET test projects using `dotnet test` and other .NET applications using the `dotnet-coverage` tool. It supports managed CLR and unmanaged native code, with static and dynamic instrumentation. When installed with MSTest, NUnit, or xUnit runners through Microsoft.Testing.Platform.MSBuild, coverage extensions are auto-registered. The MTP extension can produce coverage, XML, and Cobertura reports, and settings can control output, inclusion and exclusion rules, and instrumentation. The tooling supports Windows, macOS, and multiple Linux distributions, although instrumentation varies by operating system, version, and architecture. Other systems are supported on a best-effort basis, and some combinations allow static instrumentation only. Dynamic instrumentation on macOS and Linux requires libxml2; a missing dependency may leave an empty report. MTP excludes test assemblies by default unless configured otherwise. The free offering is closed-source, and the repository describes its content as documentation and samples for that functionality.
Who it suits
Microsoft Code Coverage suits developers measuring coverage in .NET test projects or other .NET applications. It is relevant to teams using supported test runners and operating systems.
What it does well
- Measures coverage for managed and native code
- Offers static and dynamic instrumentation
- MTP extension supports coverage, XML, and Cobertura output
- Works with MSTest, NUnit, and xUnit runners
- Free to use
What to know first
- Dynamic instrumentation on macOS and Linux requires libxml2
- MTP excludes test assemblies by default
- Instrumentation varies by OS, version, and architecture
- Repository describes closed-source functionality
Limits
The free plan costs nothing. Native coverage is disabled by default in the MTP extension, and MTP excludes test assemblies unless configured otherwise. Dynamic instrumentation on macOS and Linux requires libxml2; support also varies by OS, version and architecture.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Microsoft Code Coverage | Closed-source · free to use | Free |
As github.com lists them, read 4 Oct 2026. The maker's own page has the final word.
Getting started
- Open the Microsoft Code Coverage repository.
- For .NET tests, collect coverage with `dotnet test`.
- For another .NET application, use the `dotnet-coverage` tool.
- For Microsoft.Testing.Platform, install the coverage extension with an MSTest, NUnit or xUnit runner.
- Configure output, inclusion and exclusion rules, and instrumentation through runsettings or a coverage settings file.
- On macOS or Linux, ensure libxml2 is available for dynamic instrumentation.
Verdict
Microsoft Code Coverage provides configurable coverage collection for .NET workflows across Windows, macOS, and Linux. Check the operating-system requirements and default test-assembly exclusion when setting up collection.
Questions
How much does Microsoft Code Coverage cost?
The Microsoft Code Coverage plan is free to use and costs nothing.
Which operating systems are supported?
Supported operating systems include Windows, macOS and multiple Linux distributions. Instrumentation support varies by OS, version and architecture.
Which programming languages are listed?
The listed supported languages are C# and C++.
What report formats can the MTP extension produce?
It supports coverage, XML and Cobertura output formats.
Does it support native code coverage?
Yes, it supports unmanaged native code. Native coverage is disabled by default in the MTP extension.
Is the repository's coverage functionality open source?
No. Its README describes the repository as documentation and samples for closed-source coverage functionality.
Facts from Microsoft Code Coverage's own pages
- Configuration
- Coverage settings can control output, inclusion and exclusion rules, and instrumentation options using runsettings or dedicated coverage settings files. · github.com, 4 Oct 2026
- Instrumentation
- The tooling supports static and dynamic instrumentation. · learn.microsoft.com, 4 Oct 2026
- Intended users
- The documented workflows cover .NET test projects and other .NET applications that users want to measure for code coverage. · github.com, 4 Oct 2026
- Managed and native code
- Coverage analysis supports managed CLR code and unmanaged native code; native coverage is disabled by default in the MTP extension. · learn.microsoft.com, 4 Oct 2026
- Operating systems
- The supported operating systems include Windows, macOS, and multiple Linux distributions, with instrumentation support varying by OS, version, and architecture. · github.com, 4 Oct 2026
- Platform limits
- Other operating systems are supported on a best-effort basis, and some OS and architecture combinations support static instrumentation only. · github.com, 4 Oct 2026
- Purpose
- Measures what proportion of a project's code is exercised by coded tests such as unit tests. · learn.microsoft.com, 4 Oct 2026
- Report formats
- The MTP coverage extension supports coverage, XML, and Cobertura output formats. · learn.microsoft.com, 4 Oct 2026
- Runtime dependency
- Dynamic instrumentation on macOS and Linux requires the libxml2 package; missing required dependencies may cause an empty coverage report. · github.com, 4 Oct 2026
- Security
- The repository links to a security policy, but its README describes this repository as documentation and samples for closed-source coverage functionality. · github.com, 4 Oct 2026
- Support
- The repository invites users to report issues related to the Microsoft.CodeCoverage and dotnet-coverage NuGet packages and Visual Studio code coverage functionality. · github.com, 4 Oct 2026
- Test assembly default
- MTP excludes test assemblies from coverage by default unless configured otherwise. · learn.microsoft.com, 4 Oct 2026
- Test frameworks
- With Microsoft.Testing.Platform.MSBuild, coverage extensions are auto-registered when installed with MSTest, NUnit, and xUnit runners. · learn.microsoft.com, 4 Oct 2026
- Usage
- The repository documents collecting coverage for .NET tests with dotnet test and for other .NET applications with the dotnet-coverage tool. · github.com, 4 Oct 2026
Where Microsoft Code Coverage stands on Freedom251
- Test Coverage Tools#13 of 27