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


Gemini 1.5 Pro Now Available
29/04/2024

Google has released Gemini 1.5 Pro with improvements including Native Audio Understanding, System Instructions, and a JSON mode.



Actionforge Releases GitHub Actions VSCode Extension
09/04/2024

Actionforge has released the beta of its GitHub Actions tool as a VS Code extension. The extension consists of a suite of tools making up a visual node system for building and managing GitHub Actions  [ ... ]


More News

raspberry pi books

 

Comments




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

Last Updated ( Monday, 08 January 2024 )