<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>CoverageExclude</title><link>http://weblogs.asp.net/nunitaddin/archive/2006/10/04/CoverageExclude.aspx</link><description>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</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Dealing with Code Un-Coverable by Tests - taccato! trend tracker, cool hunting, new business ideas</title><link>http://weblogs.asp.net/nunitaddin/archive/2006/10/04/CoverageExclude.aspx#6432947</link><pubDate>Tue, 22 Jul 2008 19:24:29 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6432947</guid><dc:creator>Dealing with Code Un-Coverable by Tests - taccato! trend tracker, cool hunting, new business ideas</dc:creator><author>Dealing with Code Un-Coverable by Tests - taccato! trend tracker, cool hunting, new business ideas</author><description>&lt;p&gt;Pingback from &amp;nbsp;Dealing with Code Un-Coverable by Tests - taccato! trend tracker, cool hunting, new business ideas&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6432947" width="1" height="1"&gt;</description></item><item><title>re: CoverageExclude</title><link>http://weblogs.asp.net/nunitaddin/archive/2006/10/04/CoverageExclude.aspx#619049</link><pubDate>Thu, 05 Oct 2006 10:30:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:619049</guid><dc:creator>Olaf</dc:creator><author>Olaf</author><description>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.




&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=619049" width="1" height="1"&gt;</description></item><item><title>re: CoverageExclude</title><link>http://weblogs.asp.net/nunitaddin/archive/2006/10/04/CoverageExclude.aspx#614859</link><pubDate>Wed, 04 Oct 2006 17:15:40 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:614859</guid><dc:creator>Jamie Cansdale</dc:creator><author>Jamie Cansdale</author><description>&lt;p&gt;Ian, at the moment there is nothing like this. Can you suggest it on the NCover forums?&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://ncover.org/SITE/forums/default.aspx"&gt;http://ncover.org/SITE/forums/default.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=614859" width="1" height="1"&gt;</description></item><item><title>re: CoverageExclude</title><link>http://weblogs.asp.net/nunitaddin/archive/2006/10/04/CoverageExclude.aspx#614636</link><pubDate>Wed, 04 Oct 2006 15:40:53 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:614636</guid><dc:creator>Olaf Conijn</dc:creator><author>Olaf Conijn</author><description>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?

&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=614636" width="1" height="1"&gt;</description></item><item><title>re: CoverageExclude</title><link>http://weblogs.asp.net/nunitaddin/archive/2006/10/04/CoverageExclude.aspx#614531</link><pubDate>Wed, 04 Oct 2006 15:11:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:614531</guid><dc:creator>Ian Ringrose</dc:creator><author>Ian Ringrose</author><description>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&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=614531" width="1" height="1"&gt;</description></item></channel></rss>