Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the most effective (freely available) tools for C# code coverage? [closed]

Visual Studio C# Express edition is an adequate IDE when it comes to writing C# - and NUnit is an adequate framework for writing unit tests. This pairing, however, isn't sufficient to establish the code-coverage of these tests.

I realise that the Professional and Ultimate editions integrate with MSTest and provide fully integrated code-coverage... but this restricts verification of coverage to those who have purchased the relevant IDE - which isn't ideal.

I'm not worried about integration of coverage analysis into the IDE... that's one approach, but I'd be equally happy with a report generated by a batch process... this could be integrated into continuous integration.

I am concerned about the quality of the coverage metrics - for example, I'd want branch-level coverage analysis not just line-level.

I'm imagining that Visual Studio Professional/Ultimate is not an idea solution for developers in a Mono environment... can anyone tell me what's typically used in such a context?

like image 352
aSteve Avatar asked Jul 22 '11 13:07

aSteve


3 Answers

NCrunch is pretty cool. It gives you visual indicators on the left side of your code to let you know if it is covered, and if the tests on it have passed.

http://www.ncrunch.net/

like image 75
CassOnMars Avatar answered Oct 16 '22 17:10

CassOnMars


OpenCover and PartCover are currently the two main tools.

PartCover is the oldest and is no longer actively maintained on SourceForge. Support for this utility has since moved to GitHub (PartCover on GitHub)

OpenCover is newer and is also on GitHub (OpenCover on GitHub) it has 64 and 32 bit support and overcomes some of the limitations that PartCover has (memory and results delivery).

Both are supported by TypeMock (I think OpenCover support is being added soon see Can Opencover be used with TypeMock Isolator?)

Reports for both PartCover and OpenCover can be supplied using ReportGenerator ()

like image 40
Shaun Wilde Avatar answered Oct 16 '22 15:10

Shaun Wilde


PartCover?

Or SharpDevelop? SharpDevelop is an alternate IDE which has more features than Express version of VS.

like image 30
Vijay Gill Avatar answered Oct 16 '22 16:10

Vijay Gill