views:

4838

answers:

12

I'm looking for a good .Net code coverage alternative to NCover (insufficient .Net 3.5 coverage and now pay-for) or VSTS (way too expensive).

We currently test with NUnit, but could switch to something with a similar 'layout' for its text fixtures if it were better integrated.

+1  A: 

They haven't been updating as regularly as they used to but TestMatrix at http://www.exactmagic.com/products/testmatrix/index.html is a good tool. You can export reports to excel and with a few excel macros get some decent data extracted (though I admit the experience could be smoother).

I've not tried automating it in a build environment and if that's your goal you might want to see how that scenario plays out but it does work with both nUnit and MS Test (so if you ever find enough reason to move to TFS you are covered). Like the VSTS coverage tool it integrates with the Visual Studio IDE nicely highlighting code line by line. Better than VSTS it allows right click running of tests on the actual lines of code of the test itself; highlighting the region and showing a tooltip with a success report or exception details. Plus there's a time in method profiler stuck in there as well.

All in all a great IDE experience and worth a look - but again if build automation is an end goal you'll need to check that out.

Lex
+1  A: 

I'm not sure about the coverage, but there is a free version of NCover which is a version before NCoverExplorer, and we're still using that - it's available on the NCover site still.

That said, if you could elaborate on what is not covered by its coverage I'd be interested in hearing about that too!

crucible
+22  A: 

You can use PartCover (free)

This is analog for NCover application, but have some advantages. It specifies which assemblies and classes you want to report and can work not only assemblies that have debug symbols.

John
For me, the biggest reason for using NCover is that I can get nice statistics and line by line highlights with NCoverExplorer. Do PartCover have something similiar?
mizipzor
+6  A: 

I've used PartCover. The last time I checked, though, PartCover didn't support running code coverage metrics in an ASP.NET hosted app, which is quite a big drawback imho. But for measuring code coverage when unit testing domain logic, PartCover does the job well.

Thomas Lundström
+2  A: 

Thanks, I'll check out PartCover.

crucible - in response to your question

We're currently using the old free version of NCover. it can't handle anonymous delegates, auto-initialisers or Linq syntax.

Given that we use all of them lots it's a problem for us.

Keith
+1  A: 

It's worth mentioning that the old (free) NCover is available at Sourceforge.

-- Lee

Lee Englestone
It is, but it doesn't cover lamdas or linq expressions - I don't really want to try and write coverage for that myself. Thanks anyway.
Keith
That's odd - we still use NCover 1.5.8 against code built on 3.5sp1, and it has no trouble with lambdas. I've not tried with LINQ via keywords, but it has no trouble with LINQ in the form of fluent-style use of IEnumerable extension methods.
Steve Gilham
I've not had any problem with Linq or Lambdas either. I couldn;t get the free one working at sourceforge but DID get the free (old) version working from ncover.com.
Lee Englestone
+2  A: 

Have you checked out the full featured NCover 3.0 that's free for devs? All you have to do is pick up the support (which is still a bargain).

NCover 3.0 free for devs

I know the developers of NCover and there's some cool stuff coming down the pipe (4.0 in a few months I think...)

Valien
It's not really free - you have to buy the support contract. Still, useful to know.
Keith
+1  A: 

Our Semantic Designs Test Coverage tool for C#, handes C# 2.0, 3.0 (all features including lambdas and LINQ) and very soon 4.0. Handles very large systems with extremely low overhead. Intuitive graphical display of coverage data by coloring blocks of covered/uncoverd code; full report of coverage data down to the method level and summarized in larger elements such as classes and packages. Usable even in embedded development environments.

EDIT 3/30/2010 Now handles C# 4.0.

Ira Baxter
Note, not free or open source.
Jeremy McGee
+2  A: 

SharpDevelop has an integrated Nunit runner and Code Coverage toolset. I highly recommend it as an alternative. Oh, and it is open source: http://sharpdevelop.codeplex.com/ Also, it works with .net 3.5 and all that jazz...

Lucas B
A: 

The NCover on SourceForge is not the Same NCover that the user is asking about. It has been unsupported for over 4 years.

joe.feser
A: 

TestDriven.net is fairly cheap and they give out a free personal license (i.e. it's pretty liberally licensed). http://www.testdriven.net/

It comes with NCoverExplorer built-in and integrates nicely into Visual Studio. It supports pretty much every Unit testing framework in addition to NUnit.

kibbled_bits
A: 

I use NCover community edition (version 1.5.8) which is completely free, at least as far as I can tell. Direct link to download.

mizipzor
That version's now several years out of date. It can't handle most of the .Net 3.5 stuff. You're right that it's completely free, NCover used to be up until this version (about 3 years ago I think) and they went paid for future releases. It'll do if you're still on .Net 2 with no plans to upgrade.
Keith
Looking at NCoverExplorer, it seems to do as it should. Are you saying that this is something that might come back and bite me?
mizipzor