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


Get Ready For Google Summer Of Code 2025
24/01/2025

2025 will be the  21st consecutive year of Google Summer of Code and the 4th year in which it will accept anybody aged 18 years and over who is a newcomer to open source software. As us [ ... ]



Spot With AI - The New Robotics
29/12/2024

It was just last week I complained that despite the advances in AI robots seems to be just as stupid as ever. Now  I have found a video of Spot embracing AI in a way that is a step on the way to  [ ... ]


More News

espbook

 

Comments




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

Last Updated ( Monday, 08 January 2024 )