Microsoft Improves Code Coverage Tools
Written by Kay Ewbank   
Monday, 08 January 2024

Microsoft has announced updates to its code coverage tools to improve the reporting options with new formats. Alongside the updates, Microsoft has also released a new tool, dotnet-coverage.

Code coverage can be used to show a figure indicating how much of the code is tested by automated tests.  The coverage is usually shown as a percentage of the number of lines, methods, functions, branches, or conditions that are tested compared to the overall lines of code. 

Microsoft's code coverage tool comes in two versions, a command line tool and a Visual Studio Code extension. The command line tool can be used to collect code coverage for C++ and C# code1. It supports merging and converting code coverage reports1. 

net2

Code Coverage is a Visual Studio Code extension that can be used to analyze and improve the test coverage of your codebase. It highlights lines of code that are not covered by tests, providing insights into areas that require additional testing. The Coverage tool can also help you find unused JavaScript and CSS code.

There new dotnet-coverage tool can be used for cross-platform collection of code coverage data of a running process, and  provides cross-platform merging of code coverage reports. Microsoft says the new tool can be used to collect code coverage for console apps or web apps, and to merge coverage reports. 

The changes to the original tools are designed to make it easier to integrate the tools' report formats with tools like ReportGenerator. While the default report format remains the  .coverage format that is designed for viewing in Visual Studio, developers can now choose to create reports in binary or XML. There are two XML choices, Cobertura for an open-source XML format, or Microsoft's own XML format for viewing in Visual Studio Enterprise.

The updated version also now has an option to automatically merge code coverage for all your test projects. It is also faster, Microsoft says the performance is 80% faster. In earlier releases, the collection of code coverage report significantly slowed down test execution.

The new tools are available now. 

net2 

More Information

Microsoft.CodeCoverage

dotnet-coverage

Related Articles

Implementing Automated Code Testing

Codecov Opens Source Code

Visual Studio Can Now Upgrade Apps To Latest .NET

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


GitHub Universe AI Announcements - Copilot And Spark
30/10/2024

GitHub has announced several improvements for developers at Universe, its annual conference. Developers will get multi-model Copilot and GitHub Spark, an AI-native tool for building applications in na [ ... ]



Microsoft Introduces Vector Abstractions Library For .NET
21/11/2024

Microsoft has announced a preview release of the Microsoft Extensions VectorData Abstractions library, which can be used to help integrate vector stores into .NET applications and libraries.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 08 January 2024 )