share
Stack OverflowCan you recommend an alternative for NCover?
[+66] [12] Keith
[2008-09-01 20:07:42]
[ .net unit-testing code-coverage ]
[ http://stackoverflow.com/questions/38360/can-you-recommend-an-alternative-for-ncover ] [DELETED]

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.

@Keith are you still using PartCover? would really love to know the outcome :-) - chakrit
We got the budget for VSTS after I asked this one, so in the end we went with that. - Keith
[+40] [2008-09-02 02:24:19] jfs [ACCEPTED]

You can use PartCover [1] (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.

UPDATE: PartCover [2] is now only supported on its GitHub fork

UPDATE 2: OpenCover [3] is now the current latest supported iteration.

[1] http://sourceforge.net/project/showfiles.php?group_id=175733
[2] https://github.com/sawilde/partcover.net4
[3] https://github.com/sawilde/opencover

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
PartCover now supports .NET4 and you can use ReportGenerator to view the results; it's little brother also supports branch coverage. - Shaun Wilde
(10) I think PartCover has been superseded by OpenCover. github.com/sawilde/opencover - Jedidja
1
[+8] [2011-03-03 18:46:47] gorohoroh

A valid alternative to NCover these days is JetBrains dotCover [1] This is especially true if you're using ReSharper test runner as dotCover integrates nicely into it.

[1] http://www.jetbrains.com/dotcover/

2
[+6] [2008-09-02 07:38:17] Thomas Lundström

I've used PartCover [1]. 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.

[1] http://sourceforge.net/projects/partcover/

(1) PartCover is now superseded by OpenCover github.com/sawilde/opencover - David Freitas
3
[+3] [2009-09-23 18:15:12] Lucas B

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...


4
[+2] [2009-08-14 19:33:10] Valien

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 [1]

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

[1] http://www.ncover.com/we%5Flove%5Fdevs

(1) It's not really free - you have to buy the support contract. Still, useful to know. - Keith
(3) not available any longer. - klm_
Good to know (I don't use NCover myself but I know the founder and some folks over there). - Valien
5
[+2] [2010-04-24 00:43:14] kibbled_bits

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.


6
[+2] [2010-06-14 22:21:28] mizipzor

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

[1] http://www.ncover.com/download/community
[2] http://www.ncover.com/download/file?filename=NCover-1.5.8.zip

(3) 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
7
[+1] [2008-09-01 20:18:11] Lex

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.


8
[+1] [2008-09-02 02:18:22] crucible

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!


9
[+1] [2009-08-14 11:53:21] Lee Englestone

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


(1) 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
10
[+1] [2009-08-29 02:51:08] Ira Baxter

Our Semantic Designs Test Coverage tool for C# [1], 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.

[1] http://www.semanticdesigns.com/Products/TestCoverage/CSharpTestCoverage.html

(3) Note, not free or open source. - Jeremy McGee
Note: neither is version of NCover that handles 3.5/4.0. - Ira Baxter
11
[+1] [2009-10-06 19:11:40] joe.feser

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


12