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


Women Who Code Closing For Lack of Funding
24/04/2024

Women Who Code the US-based non-profit organization that since its foundation in 2011 has advocated for women and diversity in technology, has announced its imminent closure due to critical funding cu [ ... ]



Udacity's Offer To Recently Unemployed
01/05/2024

Layoffs, across the board from major tech companies to struggling small businesses, are constantly in the news. Today Udacity has announced a special offer to help the recently unemployed professional [ ... ]


More News

raspberry pi books

 

Comments




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

Last Updated ( Monday, 08 January 2024 )