Paul Krill
Editor at Large

Microsoft improves code coverage tools

news
Jan 2, 20242 mins

New dotnet-coverage tool collects code coverage for console and web applications, merges coverage reports, instruments binaries, and calculates code coverage for each test separately.

Reactive programming, events, data, streams, streaming
Credit: NicoElNino/Shutterstock

Microsoft has enhanced its code coverage tools, adding new features to Microsoft.CodeCoverage and introducing dotnet-coverage. The enhancements include fresh report formats that integrate smoothly with tools such as ReportGenerator.

Microsoft posted a bulletin about its enhanced code coverage tools on December 21. Both Microsoft.CodeCoverage and dotnet-coverage can run on any platform supported by .NET, due to the addition of static instrumentation. While the default remains the familiar coverage format, other report formats include Cobertura and XML. Cobertura is an open source XML format that can be opened in Visual Studio Enterprise or any text editor. Microsoft’s XML format also can be opened in Visual Studio Enterprise or a text editor.

Mirosoft’s new dotnet-coverage tool collects code coverage for console and web applications, merges coverage reports, instruments binaries, and calculates code coverage for each test separately. Running dotnet test --collect "Code Coverage" at the solution level automatically merges code coverage for all test projects (see a full example).

Microsoft also has improved documentation for code coverage at GitHub, while noting code coverage functionality is closed-source. Code coverage performance has been made faster as well. Microsoft has published a Get Started guide for collecting code coverage for a .NET test project.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author