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


Can You Solve The GCHQ Christmas Challenge 2024
20/12/2024

The GCHQ Christmas Challenge has become a pre-Christmas tradition. While it is primarily targeted at school students working in teams, GCHQ encourages both children and adults to give it a try.



The Advent of SQL 2024 Has Commenced
11/12/2024

It's Advent - the time of year when we countdown the days to Christmas - and if your are a programmer complete daily coding challenges with the Advent of Code, the Advent of Perl, the Advent of Java,  [ ... ]


More News

espbook

 

Comments




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

Last Updated ( Monday, 08 January 2024 )