Review code coverage results
Azure Pipelines | TFS 2018 | TFS 2017 | TFS 2015
Code coverage helps you determine the proportion of your project's code that is actually being tested by tests such as unit tests. To increase your confidence of the code changes, and guard effectively against bugs, your tests should exercise - or cover - a large proportion of your code.
Reviewing the code coverage result helps to identify code path(s) that are not covered by the tests. This information is important to improve the test collateral over time by reducing the test debt.
In Microsoft Team Foundation Server (TFS) 2018 and previous versions, build and release pipelines are called definitions, service connections are called service endpoints, stages are called environments, and jobs are called phases.
The code coverage summary can be viewed in the build timeline view. The summary shows the overall percentage of line coverage.
Merging code coverage results from multiple test runs is limited to .NET and .NET Core at present. This will be supported for other formats in a future release.
The code coverage artifacts published during the build can be viewed under the Build artifacts published milestone in the timeline view.
If you use the Visual Studio Test task to collect coverage for .NET and .NET Core apps, the artifact contains .coverage files that can be downloaded and used for further analysis in Visual Studio.
If you publish code coverage using Cobertura or JaCoCo coverage formats, the code coverage artifact contains an HTML file that can be viewed offline for further analysis.
For .NET and .NET Core, the link to download the artifact is available by choosing the code coverage milestone in the build summary.
- Publish Code Coverage Results publishes code coverage results to Azure Pipelines or TFS, which were produced by a build in Cobertura or JaCoCo format.
- Built-in tasks such as Visual Studio Test, .NET Core, Ant, Maven, Gulp, Grunt, and Gradle provide the option to publish code coverage data to the pipeline.
Help and support
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.