views:

583

answers:

7

I am about to start a new project and am looking around for both a unit testing framework and some sort of code coverage profiler. I've used the unit test framework in Visual Studio Pro in the past but I've never used a coverage framework.

Does anyone have views on the best unit testing and code coverage frameworks around at the moment?

+3  A: 

Personally I use MB Unit (instead of NUnit) and NCover.

MB Unit follows the same conventions as NUnit, but offers additional powerful test capabilities as well.

EDIT: Changed NCover link to the open source project rather than the commercial offering.

Eric J.
+3  A: 

There are lots of different unit testing frameworks out there: MSTest, nUnit, xUnit and MbUnit are probably the most popular. As far as coverage, I've used both the coverage in Team Suite and nCover (free). I probably use nCover more than the built-in coverage. I would also suggest using the TestDriven.NET plugin (not sure if it works with xUnit).

tvanfosson
The commercial version of NCover you link to is not free. See my post for the link to the (older) open source project. It may well be worth buying the commercial license though.
Eric J.
Oops. I actually got my version through TestDriven.NET.
tvanfosson
Updated link to SourceForge.
tvanfosson
+1  A: 

nUnit is probably the most widespread, especially if your using some of the popular Visual Studio add-ons like ReSharper (a MUST have for anyone doing c# TDD).

I'd go with NCover for coverage. It integrates well with CruiseControl and Hudson for CI.

I would also highly recommend Fitnesse.Net for integration testing.

ryber
+1  A: 

Everyone else seems to hate it, but I find the built-in tools in Visual Studio (Team System) adequate. Sure, there are quirks, and the unit test API could be better, but I find the IDE integration very convenient.

Depending on your version of Visual Studio, it is already included (and thereby free).

Mark Seemann
+1  A: 

I usually use the integrated tools in VS for both unit test & coverag

bashmohandes
+1  A: 

See SD C# Test Coverage for a test coverage tool with low overhead, effective displays of coverage data and ability to handle small and large applications.

This will work with any unit testing framework.

Ira Baxter
A: 

I use NUnit and NCover (open source) for all projects.

Tiendq