What can I use for good quality code coverage for C#/.NET?

C#.NetCode Coverage

C# Problem Overview


I wonder what options there are for .NET (or C# specifically) code coverage, especially in the lower priced segment?

I am not looking for recommendations, but for a comparison of products based on facts. I know the following:

C# Solutions


Solution 1 - C#

I use the version of NCover that comes with TestDriven.NET. It will allow you to easily right-click on your unit test class library, and hit Test With→Coverage, and it will pull up the report.

Solution 2 - C#

An alternative to NCover can be PartCover, is an open source code coverage tool for .NET very similar to NCover, it includes a console application, a GUI coverage browser, and XSL transforms for use in CruiseControl.NET.

It is a very interesting product.

OpenCover has replaced PartCover.

Solution 3 - C#

JetBrains (of ReSharper fame) has been working on a coverage tool for a little while called dotCover. It's showing a great deal of promise.

Solution 4 - C#

I just tested out NCrunch and have to say I am very impressed. It is a continuous testing tool that will add code coverage to your code in Visual Studio at almost real time. At the time as I write this NCrunch is free. It is a little unclear if it going to be free, cost money or be opened source in the future though.

Solution 5 - C#

TestCocoon is also pretty nice. It is in active development and has a user community:

  • Open source (GPL 3)
  • Supports C/C++/C# cross platform (Linux, Windows, and Mac)
  • CoverageScanner - Instrumentation during the Generation
  • CoverageBrowser - View, Analysis and Management of Code Coverage Result

However, TestCocoon is no longer developed and its creators are now producing a commercial software for C/C++.

Solution 6 - C#

There are pre-release (beta) versions of NCover [available for free][2]. They work fine for most cases, especially when combined with NCoverExplorer.

[2]: http://www.ncover.com/download/discontinued "available for free"

Solution 7 - C#

I am not sure what the difference is with the retail NCover, but there is also an NCover project on SourceForge that is of course open source and free.

Solution 8 - C#

See the C# Test Coverage tool from my company, Semantic Designs:

It has very low overhead, handles huge systems of files, intuitive GUI, howing coverage on specific files, and generated report with coverage breakdown at method, class and package levels.

Solution 9 - C#

TestMatrix is a unit test runner and code coverage tool.

Solution 10 - C#

C# Test Coverage Tool has very low overhead, handles huge systems of files, intuitive GUI showing coverage on specific files, and generated report with coverage breakdown at method, class, and package levels.

Solution 11 - C#

Code coverage features, as well as programmable API's, come with Visual Studio 2010. Sadly, the only two editions that include the full Code Coverage capabilities are Premium and Ultimate. However, I do believe the API's will be available with any edition, so creating code coverage files and writing a viewer for the coverage info would likely be possible.

Solution 12 - C#

We've released EAP to dotCover and will be releasing the beta version soon.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMichael StumView Question on Stackoverflow
Solution 1 - C#David PView Answer on Stackoverflow
Solution 2 - C#Christian C. SalvadóView Answer on Stackoverflow
Solution 3 - C#Mike TwoView Answer on Stackoverflow
Solution 4 - C#Martin OdheliusView Answer on Stackoverflow
Solution 5 - C#Minh Cuong TranView Answer on Stackoverflow
Solution 6 - C#jalbertView Answer on Stackoverflow
Solution 7 - C#DavidView Answer on Stackoverflow
Solution 8 - C#Ira BaxterView Answer on Stackoverflow
Solution 9 - C#sergebView Answer on Stackoverflow
Solution 10 - C#Kanwar Singh View Answer on Stackoverflow
Solution 11 - C#jristaView Answer on Stackoverflow
Solution 12 - C#Hadi HaririView Answer on Stackoverflow