Greg
Greg

Reputation: 34818

how can I get test coverage statistics for VS2008 C# project

I am using Visual Studio 2008 for a C# WinForms application and I am using the MSTest unit testing framework. It doesn't seem to have test coverage (I think it's in Team System?).

What is the easiest (cheapest?) way to get some test coverage statistics for my project here? Effectively just an indication of for each *.cs file the % test coverage my unit tests are providing, and for the cases when it is not 100% which lines aren't covered.

Thanks

Upvotes: 0

Views: 310

Answers (3)

Ira Baxter
Ira Baxter

Reputation: 95420

See SD C# Test Coverage tool. It can provide coverage information reports not only at the file level, but down to the method level and rollups in between. It also provides a nice way to see the actual coverage overlayed on your source text.

Upvotes: 1

kervin
kervin

Reputation: 11858

Try these

http://consultingblogs.emc.com/merrickchaffer/archive/2008/06/13/code-coverage-in-visual-studio-2008-using-test-driven-net-and-team-coverage.aspx

and...

Code Coverage Basics with Visual Studio Team System

If you're using the Test System or Team Suite versions of Visual Studio, it should be straightforward.

Upvotes: 2

Adam Ralph
Adam Ralph

Reputation: 29956

Have a look at TestDriven.Net. It comes with NCover explorer. While you're about it, have a look at xUnit.net as an alternative to MSTest.

Upvotes: 1

Related Questions