Introduction to code coverage testing
With code coverage testing, you can measure what source code for an application is going to be tested. Code coverage testing measures how many lines, blocks, and classes are executed while automated tests, such as unit tests, are running.
The more code that's tested, the more confident teams can be about their code changes. By reviewing the outcome of the code coverage tests, teams can identify what code is not covered by these tests. This information is very helpful as it reduces test debt over time.
Azure DevOps supports code coverage testing from the build pipeline. The Test Assemblies task allows us to collect code coverage testing results. There is also a separate task, called Publish Code Coverage Results, that can also publish these results. This task offers out-of-the-box support for popular coverage results formats such as Cobertura and JaCoCo.
Important Note
Cobertura and JaCoCo are both Java tools that calculate the...