Testing With NCover/NCoverExplorer

The following screencast demonstrates how to achieve 100% coverage using TestDriven.NET 2.0, NCover and NCoverExplorer. Peter Waldschmidt and Grant Drake very kindly agreed to let me distribute NCover and NCoverExplorer with the RTM version of TestDriven.NET 2.0. This means that once TestDriven.NET is installed, there is nothing more to configure. Code coverage with NCover can be used from Visual Studio .NET 2002, 2003 or 2005. It is possible to use NCover if only .NET 1.1 is installed, however .NET 2.0 is recommended. If only .NET 1.1 is installed then NCover 1.3.3 will be used rather than the more mature NCover 1.5.6.

In the screencast I start off by showing how to zoom in on the partially covered regions of code. I then navigate back to Visual Studio and expand my unit test to cover all of the partially covered method. Rather than create a unit test for the ToString method, I decide to use the 'Coverage Exclude' feature of NCover 1.5 (TestDriven.NET uses "//ea CoverageExcludeAttribute" by default). I create a new CoverageExcludeAttribute and use it on the ToString method (extra assembly references are required). This enables me to achieve 100% coverage with the excluded code grayed out and not counted in the final coverage score.

 

You can watch the screencast here.

I'd like to thank Grant Drake in particular for his support, generosity and convincing me that it was worth carrying on with the project. :-)

Published Saturday, November 11, 2006 8:29 AM by Jamie Cansdale

Comments

# re: Testing With NCover/NCoverExplorer

Looks great (again!)

One question regarding the coverage configuration. Most of the unit testing I work with is in a separate DLL to the code being tested. Normally I have a script that fires off NUnit with NCover on the test (e.g. App.UnitTests.dll) and target DLL (e.g. App.Common.dll). That way I see the coverage on both the tests and the tested code.

Is there a way to configure that through TestDriven.NET or will I need to continue doing the separated DLL test manually?

Tuesday, November 21, 2006 4:54 AM by Paul Kohler

# PK Software Blog - Testing With NCover/NCoverExplorer Screencast

# re: Testing With NCover/NCoverExplorer

Great screencasts Jamie !!

God way to teach us to use all the potential of Testdriven !!

Let me ask you an offtopic: what screen record program are you using to create these screencast, sorry for ask, and you cant of course don't ask it to me.

Cheers and keep in the outstanding work

Marcos

Friday, November 24, 2006 3:24 PM by Marcos

# re: Testing With NCover/NCoverExplorer

Hello Jamie,

is it possible to specify the exclude attribute used by TestDriven.Net? I would like to exclude all the designer generated methods, which are marked with the System.Diagnostics.DebuggerNonUserCodeAttribute.

Best regards Dirk

Wednesday, November 29, 2006 4:55 AM by Dirk

# re: Testing With NCover/NCoverExplorer

Paul - by default it will do coverage on all assemblies with PDB info in the output directory. It should behave as you expect. It is possible to exclude the test assembly from inside NCoverExplorer.

Thursday, December 07, 2006 4:28 AM by Jamie Cansdale

# re: Testing With NCover/NCoverExplorer

Marcos - the screencasts were done using BB Flashback.

Thursday, December 07, 2006 5:19 PM by Jamie Cansdale

# re: Testing With NCover/NCoverExplorer

Dirk - I'm afraid there's no way to specify a different attribute at the moment. I'll add that as a feature request.

Thursday, December 07, 2006 5:22 PM by Jamie Cansdale

# re: Testing With NCover/NCoverExplorer

Does ncover support asp.net 2.0 ?

I can't profile the asp.net 2.0 web site application...How to do ?

Wednesday, March 28, 2007 5:56 AM by globe

# re: Testing With NCover/NCoverExplorer

I've done everything in the screencast but it won't exclude any methods. What could I be doing wrong? Do I need particular versions of the softwares?

Monday, June 25, 2007 1:18 AM by James Cook

# re: Testing With NCover/NCoverExplorer

Testing With NCover_2F00_NCoverExplorer.. Great! :)

Thursday, May 12, 2011 8:49 AM by weblogs.asp.net

# re: Testing With NCover/NCoverExplorer

Testing With NCover_2F00_NCoverExplorer.. Tiptop :)

Sunday, June 26, 2011 11:17 AM by weblogs.asp.net

# re: Testing With NCover/NCoverExplorer

Wednesday, October 19, 2011 2:43 AM by xlwtdvzt

# re: Testing With NCover/NCoverExplorer

Thursday, November 10, 2011 3:58 AM by abzbcsru

# re: Testing With NCover/NCoverExplorer

<a href=http://www.nfljerseysleague.com> new nfl jerseys</a>

Friday, November 11, 2011 3:04 AM by hcsybeua

# re: Testing With NCover/NCoverExplorer

Tuesday, November 15, 2011 3:59 PM by nkynvtnf

# re: Testing With NCover/NCoverExplorer

<a href=www.nfl2012jerseys.com/nhl-jerseys>wholesale cheap jerseys nfl.com</a>

Monday, December 05, 2011 10:51 PM by zwbdaovl

# re: Testing With NCover/NCoverExplorer

<a href=www.goodsgoodsale.com/index.php Jerseys sale,</a>

Thursday, January 05, 2012 3:45 AM by wtqrytvi

# re: Testing With NCover/NCoverExplorer

Wow! I could not even guess about it)) Not bad.

Wednesday, March 28, 2012 10:02 AM by Jordan

# re: Testing With NCover/NCoverExplorer

Tuesday, April 24, 2012 10:30 PM by ohjerseys

# re: Testing With NCover/NCoverExplorer

<a href=http://www.hrsholdingsltd.com>Mulberry Bags Outlet</a>  xfon

Saturday, May 26, 2012 7:28 AM by DrulkDalaWritk

# re: Testing With NCover/NCoverExplorer

<a href=http://www.mulberrybriefcase.com>mulberry outlet uk</a>  ejsw

Monday, May 28, 2012 4:11 AM by DrulkDalaWritk

# re: Testing With NCover/NCoverExplorer

Do you like handbags? In this short article you will find the greatest Coach, Gucci, Prada along with other designer bags for 2012. Styles will almost always be transforming and also 2012 is not any different. This year the very best designers have got develop a few truly awesome stuff. Many of these developers are incorporating leading edge engineering using the newest the latest fashions to produce absolutely extraordinary handbags.

Thursday, May 31, 2012 12:04 PM by DipsQuics

# re: Testing With NCover/NCoverExplorer

Mr. Smith taught English at a school.It's a long story.He was efficient in his work.I'm glad to see you againTake me to the airport£¬please.I bought it the day it was released.I bought it the day it was released.It's a fine day.He is acting an old man.Please ask her to call me back when she's back.

<a href="http://burberry.2096909555.com" title="burberry.2096909555.com">burberry.2096909555.com</a>

Wednesday, October 24, 2012 4:17 AM by burberry.2096909555.com

# re: Testing With NCover/NCoverExplorer

I am very happy to come here to see such a good article, a great help to me, I will come again.Welcome to login my website : www.bestiphone4covers.com ! It is a nice website !

Thursday, December 27, 2012 7:44 PM by fangnana

# re: Testing With NCover/NCoverExplorer

I'm glad to be here, and you are welcome to our website, I believe you will like it.www.fashioniphone5case.com

Thursday, December 27, 2012 8:00 PM by iPhone 5 Case

# re: Testing With NCover/NCoverExplorer

Very happy can be posted here, welcome to our website www.fashionsamsunggalaxys3cases.com

Thursday, December 27, 2012 9:00 PM by Samsung Galaxy S3 Cases

# re: Testing With NCover/NCoverExplorer

Your literary grace is really good, very happy to open it, because here, so no longer cold this winter, also welcome you to our website.http://www.casesiphone5.net/

Thursday, December 27, 2012 9:37 PM by yamayaoer

# re: Testing With NCover/NCoverExplorer

Welcome to login my website : www.bestipadminicase.net ! It is a nice website !

Thursday, December 27, 2012 10:38 PM by fangsisi

# re: Testing With NCover/NCoverExplorer

I'm glad to be here, and you are welcome to our website, I believe you will like it.www.uniquesamsunggalaxys3cases.com

Friday, December 28, 2012 1:00 AM by Samsung Galaxy S3 Cases

# re: Testing With NCover/NCoverExplorer

welcome to our website www.bestiphone5cover.com

Friday, December 28, 2012 2:04 AM by chrting798

# re: Testing With NCover/NCoverExplorer

i like your post,thanks

Saturday, December 29, 2012 12:28 AM by iphone cases

# re: Testing With NCover/NCoverExplorer

I never heard this post ago.

Tuesday, April 30, 2013 10:03 AM by iPhone 5 Cases

Leave a Comment

(required) 
(required) 
(optional)
(required)