CoverageExclude

Eric Sink recently wrote an article, advocating the use of code coverage. In the article Eric writes about a hobby project of his where he has managed to achieve 100% code coverage. The following may be of interest to anyone who finds themselves driven towards such ridiculous levels of coverage. ;)

When using NCover, particular methods and classes can be marked with an attribute so they are excluded from the coverage report. TestDriven.NET tell NCover to use an attribute called 'CoverageExcludeAttribute' as this special attribute. When using the NCover console application, this option is:

//ea CoverageExcludeAttribute

The 'CoverageExclude' attribute isn't defined in an external assembly. This is because 'CoverageExclude' is most likely to be used in non-test code. We don't want to create a dependency on another assembly (just as you wouldn't want to reference 'nunit.framework' from non-test code). Instead the 'ExcludeAttribute' can be defined in the empty namespace as follows:

class CoverageExcludeAttribute : System.Attribute { }

Once defined this attribute can be used to exclude specific methods and classes from the NCoverExplorer coverage report.

Published Wednesday, October 04, 2006 2:47 PM by Jamie Cansdale

Comments

# re: CoverageExclude

I wish to be able to exclude some error checking code from coverage, e.g. if (arg == null) { Throw new … } Would it be possible to write something like? if (arg == null) { CoverageExcludeBasicBlock(); Throw new … } Ian Ringrose www.ringrose.name email address on website

Wednesday, October 04, 2006 11:11 AM by Ian Ringrose

# re: CoverageExclude

sounds like a neat trick, though I have been giving CodeCoverage some though within the context of the team I work... conclusion was that it might be desirable not to measure test coverage agains code-statements, but to measure test coverage agains complexity. Since there are ways to determine the complexity of code (such as "Cyclomatic Code Complexity") it might be well possible to measure test-coverage in a way that makes more sense... Do you know about innitiatives in this direction? Does my conclusion hold?

Wednesday, October 04, 2006 11:40 AM by Olaf Conijn

# re: CoverageExclude

Ian, at the moment there is nothing like this. Can you suggest it on the NCover forums?

http://ncover.org/SITE/forums/default.aspx

Olaf, what you say makes sense. I don't know about any innitiatives to do this. The trick would be making it easy to visualize.

Wednesday, October 04, 2006 1:15 PM by Jamie Cansdale

# re: CoverageExclude

Jamie, the easiest (and most straightforward) way in which this could be implemented is automatically excluding stuff with a complexy of 0 (simple setter, getter, empty custructor) or another configurable complexity level. Taking it further, could mean defining a success ratio, which could be expressed as: my code coverage is acceptable if 95% of my branches are covered. This again shows success when not covering a method without branches (or complexity). This could be visualized the same way unittest success is (red=bad/green=good). Eventually you might be able te not show percentages over LOCs/ covered LOCs, but Branches/ covered branches.

Thursday, October 05, 2006 6:30 AM by Olaf

# Dealing with Code Un-Coverable by Tests - taccato! trend tracker, cool hunting, new business ideas

Pingback from  Dealing with Code Un-Coverable by Tests - taccato! trend tracker, cool hunting, new business ideas

# re: CoverageExclude

"Well it feels like this web page is relatively hot, congratulations for the proprietor! I try to study as a lot as feasible on the net when I have additional time. Unfortunatley it  is beginning to be the norm for people to invest all day for the internet rather than of basically residing, what a shame. All of the similar, proceed together with the excellent  composing anyhow.!!!.leastwise the flocks can have option content material to feed thier dying minds. Probably its ideal off, the common people arn't quite smart at any  charge."

--------------------------------------------

<a href="xiangyan.info/8mg-p-119.html">&

Also welcome you!

Tuesday, November 30, 2010 9:56 AM by &#27931;&#26441;&#30710;&#30041;&#23398;&#29983;

# re: CoverageExclude

Variety is the spice of life.

-----------------------------------

Tuesday, December 21, 2010 10:45 PM by penultimate ipad app

# re: CoverageExclude

I am curious  what  thinks about that!?

<a href="www.live-girls-webcam-chat.com/">community chat</a>

Saturday, December 25, 2010 9:39 PM by Arturo

# re: CoverageExclude

-----------------------------------------------------------

I desire finding over a broken coronary heart can be so easy as following a couple of steps.! but its not…

Sunday, January 09, 2011 6:17 AM by best ipad stand

# re: CoverageExclude

Lindsey is the best.

Kindest regards

Helene

<a href="http://www.xxl-odskodnina.si">poravnava</a>

Wednesday, January 12, 2011 11:18 PM by Jill

# re: CoverageExclude

I want to know  what Cheryl thinks with that??

Terri

<a href="www.cigars-now.com/.../oliva-cigars.html">oliva cigars</a>

Tuesday, January 25, 2011 10:39 PM by Willa

# re: CoverageExclude

CoverageExclude.. He-he-he :)

Saturday, March 26, 2011 4:40 AM by weblogs.asp.net

# re: CoverageExclude

CoverageExclude.. Awesome :)

Sunday, April 24, 2011 7:56 AM by weblogs.asp.net

# re: CoverageExclude

CoverageExclude.. Smashing :)

Tuesday, June 07, 2011 7:42 AM by weblogs.asp.net

# re: CoverageExclude

Y como comprenderlo

http://www.elcoru.com/

Doggy

Thursday, August 11, 2011 5:16 AM by Doggy

# re: CoverageExclude

Saturday, April 28, 2012 9:24 PM by Nuptlypeteace

# re: CoverageExclude

Sunday, May 13, 2012 4:55 AM by offiviors

# re: CoverageExclude

Saturday, May 19, 2012 3:17 PM by arteplyCype

# re: CoverageExclude

Sunday, May 20, 2012 4:12 AM by senepreli

# re: CoverageExclude

Sunday, May 20, 2012 8:38 PM by AbegeAroche

# re: CoverageExclude

Tuesday, May 22, 2012 7:27 PM by TYmnimmatty

# re: CoverageExclude

composed by hsm 2012-06-05

Tuesday, June 05, 2012 2:44 PM by Beetafriele

# re: CoverageExclude

The benefits are unrestricted. This can be a best present for a girl whom do not want the main designer purses. Folks who wants discover duplicate makers of proper artist handbags, you can always search for these on-line. Upon websites, you will find an enormous assortment of this sort of manufactured model designer handbags; you are able to find the best the one that fits your thing. The actual repayment methods are likely to be straightforward, and the things are generally delivered within just occasion.

Sunday, June 17, 2012 7:09 PM by Arnettaxaq

# re: CoverageExclude

cheap <a href="www.ctntrip.com/.../forum.php

">packers jerseys Nike</a>

nfl jerseys

Thursday, August 09, 2012 5:06 PM by guethighsiz

# re: CoverageExclude

GJTRSDGSADASDFHGAD  FGBNFASDGASDDSFGHADS

ERYERASDGASDADSFHGADFS ERYERSDGSADSDGASD

ZVXZADFGASDGSDFH SDGSDSDGSADDSFGHADS

ADFHGADFGASDGSDGASD ADFHGSDGSADADFHAD

Wednesday, September 05, 2012 10:47 AM by GafeWrofe

# re: CoverageExclude

DSGAADFGASDGASDFHGAD  GJTRZSDGASDASDGHASD

YUYSDGSADGSDGASD  ASFDZSDGASDADSFHGADFS

YUYZSDGASDADFHGAD  ERYERADFGASDGASDFHGAD

DSGAASDGASDDSFGHADS  FGBNFADFGASDGASDFHGAD

Wednesday, September 05, 2012 8:54 PM by Zesemensush

# re: CoverageExclude

ZVXZSDGSADXZCBZX  YUKYSDGSADGADFHAD

GJTRADFGASDGXZCBZX  ASFDSDGSADADFHAD

ZVXZADFGASDGADFHGAD  YUYZSDGASDADFHAD

SDGSDSDGSADXZCBZX  FGBNFZSDGASDSDGASD

Wednesday, September 05, 2012 9:39 PM by Absordreibe

# re: CoverageExclude

Another benefit to the new last used in this year's Hyperdunk is increased breathability. The silhouette is greatly improved and the number of different colorways that this shoe is available in is quite remarkable.  <a href="sonofmarsbordeaux.webs.com/">Son Of Mars</a>

Sunday, September 09, 2012 8:05 AM by dredgerWemype

# re: CoverageExclude

TwellaJep  <a href=>giants Nike jerseys</a>

TotInsuts  <a href=>steelers jersey</a>

guethighsiz  <a href=>steelers nike jersey</a>

Audisrurn  <a href=>giants jersey nike</a>

Tuesday, September 18, 2012 1:51 AM by reorcerak

# re: CoverageExclude

ERYERSDGSADSDFH  FGBNFADFGASDGXZCBZX

ASFDSDGSADASDGHASD  ERYERSDGSADSDFH

YUKYSDGSADGXZCBZX  QWERADFGASDGADFHAD

ADFHGADFHGDAFASDFHGAD  DSGAADFHGDAFXZCBZX

Wednesday, September 19, 2012 1:42 AM by myncWrismic

# re: CoverageExclude

ADFHGSDGSADSDFH  ASFDSDGSADADFHGAD

FGBNFASDGASDDFHAD  QWERSDGSADSDAFHSAD

YUYASDGASDADFHGAD  QWERASDGASDASDGHASD

GJTRADFHGDAFASDFHGAD  SDGSDADFHGDAFSDFH

<a href=www.pugster.com/.../a>

Thursday, September 20, 2012 2:28 PM by SicEmpigmabic

# re: CoverageExclude

<a href=www.wholesaleartmall.com/>oil painting</a>

Thursday, October 18, 2012 4:46 PM by Promoowep

# re: CoverageExclude

HATE some women who work there. ,<a href=therairmax2011hx.webs.com Max 24 7</a>

Wednesday, October 24, 2012 1:54 AM by fivedsdfve

# re: CoverageExclude

mwwuq<a href=> jason witten jersey </a>

ietyj<a href=> ben roethlisberger jersey </a>

bkrjn<a href=> jake locker jersey </a>

nosoa<a href=> sebastian janikowski jersey </a>

tqkfp<a href=> robbie gould jersey </a>

Thursday, October 25, 2012 2:32 PM by Jimmyuk8ew

# re: CoverageExclude

I think what Specktra members called this collection. ,<a href=thenorthfacesaler.webs.com face uk</a>

Tuesday, November 27, 2012 10:32 AM by rrmacmakel

# re: CoverageExclude

definitely androgynous! ,<a href=themacmakeupcheaphx.webs.com mac Cosmetics</a>

Friday, December 21, 2012 12:10 AM by bswelayrun

# re: CoverageExclude

But if the worst was to happen, this could have a critical knock-on impact for the whole family in terms of currently being in a position to maintain a comparatively regular and steady life.

isabel marant basketRetain in mind that you do much much more than make Tiffany jewelry as a organization proprietor. <a href=sneakersisabelmarantsneaker.monwebeden.fr/>isabel marant sneakers</a> Return to 80a€?s layout is refreshing, purses series, the hibiscus vivid red patent leather coupled with a unique entire body shape, layout a daring exaggeration intriguing total.

Friday, December 21, 2012 1:48 AM by fainymn

# re: CoverageExclude

Get the comfortable at ease fit of your preferred sneaker but in your preferred more fashionable styles.

isabel marant boutiqueIt can be perfectly fine to purchase yourself a small gift. <a href=sneakersisabelmarantsneaker.monwebeden.fr/>isabel marant</a> Leather golfing Toms Sneakers are favorite by several golfers.

Saturday, December 22, 2012 2:41 AM by fainymn

# re: CoverageExclude

In India they wore wood Fitflop Sandals, the Greeks and Egyptians wore leather-based Fitflop Sandals and in Japan they would make their Fitflop Sandals by using rice straw. sneaker isabel marantYou must just take further care though. <a href=sneakersisabelmarantsneakers.monwebeden.fr/>sneaker isabel marant</a> one.

Thursday, December 27, 2012 7:49 AM by Doognory

# re: CoverageExclude

In fact each thirty day period of a yr has something to offer you for the vacationers of the Caribbean. flip flopYou really should not overlook the type of footwear you have on if you want to get the full look. <a href=fitflopsmallsaustralia.weebly.com/>flip flop sandals</a> Although all manufacturers make some of the nicest biking Toms Footwear for women in most dimensions, a best in shape is nevertheless a make any difference of opportunity.

Thursday, January 03, 2013 12:15 PM by arbivolla

# re: CoverageExclude

Good to see some detailed information on this topic. Thanks for the share. I really appreciate it.

Friday, January 11, 2013 2:53 PM by dissertation for master's degree

# re: CoverageExclude

There's a brand-new creation that everybody who smokes should really know about. It is really termed the e-cigarette, also known as a smokeless cigarette or <a href=shopping.lycos.com/.../vapor-ultra electronic cigarettes </a> , and it truly is modifying the lawful panorama for cigarette smokers across the earth.

The patented E-cigarette gives you to effectively simulate the working experience of smoking cigarettes an genuine cigarette, without the need of any on the overall health or legal challenges encompassing regular cigarettes.

When E cigs glimpse, truly feel and flavor similar to traditional cigarettes, they functionality incredibly in different ways. You see, electronic cigarettes usually do not actually melt away any tobacco, but fairly, if you inhale from an e-cigarette, you activate a "flow censor" which releases a h2o vapor that contains nicotine, propylene glycol, and also a scent that simulates the flavour of tobacco. All of which merely implies that e cigs allow you to get your nicotine fix although staying away from every one of the cancer leading to agents discovered in classic cigarettes such as tar, glue, a huge selection of additives, and hydrocarbons.

Also to staying healthier than common cigarettes, and maybe most importantly of all, is the proven fact that e cigs are totally lawful. Because Electronic cigarettes usually do not contain tobacco, you may lawfully smoke them anyplace that traditional cigarettes are prohibited like as bars, places to eat, the function location, even on airplanes. On top of that, e-cigs assist you to smoke with no fears of inflicting harm on others due to nasty 2nd hand smoke.

The refillable cartridges can be found in a mess of flavors and also nicotine strengths. It is possible to get normal, menthol, even apple and strawberry flavored cartridges and nicotine strengths are available in entire, medium, gentle, and none. Though e-cigs are technically a "smoking alternative" fairly than the usual smoking cigarettes cessation product, the array of nicotine strengths provides some noticeable prospective being an assist during the ones attempts to stop using tobacco and appears being proving preferred within that marketplace.

The good factor about e-cigs as apposed to convey, nicotine patches, is the fact e-cigarettes deliver the identical tactile sensation and oral fixation that people who smoke motivation, whilst satisfying ones tobacco cravings at the same time. When you require a drag from n ecigarette you actually sense the your lungs fill that has a warm tobacco flavored smoke and after you exhale the smoke billows away from your lungs similar to normal smoking cigarettes, nonetheless, as described, that smoke is definitely a much much healthier h2o vapor that swiftly evaporates and as a consequence doesn't offend everyone inside the fast vicinity.

Whilst e-cigarettes have already been approximately for a while in numerous incarnations, it's been recent innovations within the technologies and also at any time raising restrictions against using tobacco that have propelled the e-cigarette right into a new located level of popularity. If you're considering a healthier option to using tobacco, or for those who basically desire to possess the flexibility to smoke wherever and every time you wish, an electric cigarette could possibly be the solution you've been looking for.

Tuesday, January 22, 2013 4:28 AM by Heelolfquable

# re: CoverageExclude

but this looks amazing! I have gotten a lot of compliments from different people about the blue Product! ,<a href=makeupmacwholesale.webs.com makeup wholesale</a>

Thursday, February 07, 2013 8:29 AM by lricggkvid

# re: CoverageExclude

What are the two next best makeups after Mac? ,<a href=airmax2013.webs.com Max 2013</a>

Tuesday, February 12, 2013 11:44 AM by hoifrkvquh

# re: CoverageExclude

<strong><a href="www.michaelkorsouth.com/" title="Michael Kors outlet">Michael Kors outlet</a></strong> khpwddha

Tuesday, March 12, 2013 11:48 AM by Mandykqf

# re: CoverageExclude

<strong><a href="www.michaelkorsouth.com/" title="Michael Kors outlet">Michael Kors outlet</a></strong> nhuervhz

Monday, March 18, 2013 10:57 PM by Mandyjme

Leave a Comment

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