<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: There&#8217;s Only One Thing You Can Learn From Code Coverage</title>
	<atom:link href="http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/feed/" rel="self" type="application/rss+xml" />
	<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/</link>
	<description>Trying to walk that thin line between intelligence and ignorance</description>
	<lastBuildDate>Tue, 16 Mar 2010 15:10:50 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Koen</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22749</link>
		<dc:creator>Koen</dc:creator>
		<pubDate>Mon, 19 Oct 2009 12:36:33 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22749</guid>
		<description>@awkward: still you can forget to write tests around code (it&#039;s only human to forget). And obviously not all code is behavior driven and described in a use case, so if you never use code coverage, you can only rely on yourself-making-no-mistakes. It&#039;s just an extra check you can do and it may help...

Also code coverage could be a tool for reviewers, to see quickly if everyone done their job properly.</description>
		<content:encoded><![CDATA[<p>@awkward: still you can forget to write tests around code (it&#8217;s only human to forget). And obviously not all code is behavior driven and described in a use case, so if you never use code coverage, you can only rely on yourself-making-no-mistakes. It&#8217;s just an extra check you can do and it may help&#8230;</p>
<p>Also code coverage could be a tool for reviewers, to see quickly if everyone done their job properly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julio Santos</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22747</link>
		<dc:creator>Julio Santos</dc:creator>
		<pubDate>Sun, 18 Oct 2009 23:28:36 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22747</guid>
		<description>er:

&quot;In other words, if your coverage/temperature is bad, your system is probably sick. If your coverage/temperature is *GOOD*, you need to start measuring other things in addition to coverage/temperature.&quot;</description>
		<content:encoded><![CDATA[<p>er:</p>
<p>&#8220;In other words, if your coverage/temperature is bad, your system is probably sick. If your coverage/temperature is *GOOD*, you need to start measuring other things in addition to coverage/temperature.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julio Santos</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22746</link>
		<dc:creator>Julio Santos</dc:creator>
		<pubDate>Sun, 18 Oct 2009 23:27:19 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22746</guid>
		<description>Coverage is no guarantee of a bug-free system. Not sure where this idea comes from, but it shouldn&#039;t be too hard to understand. Coverage is *one* of the many indicators of how healthy your system is. It&#039;s *not* the only one. I never heard any coverage proponent advocate otherwise.

Perhaps an analogy is your own physical health. A doctor won&#039;t let you go and promise you eternal life just because your temperature happens to be a nice 98.6 F. Not at all. There are other signs that need to be measured. 

In other words, if your coverage/temperature is bad, your system is probably sick. If your coverage/temperature is bad, you need to start measuring other things in addition to coverage/temperature. 

From here, and for whatever reason I fail to understand, some people make the argument that it&#039;s useless to measure your body temperature, since a perfect body temperature is not an indicator of perfect health.</description>
		<content:encoded><![CDATA[<p>Coverage is no guarantee of a bug-free system. Not sure where this idea comes from, but it shouldn&#8217;t be too hard to understand. Coverage is *one* of the many indicators of how healthy your system is. It&#8217;s *not* the only one. I never heard any coverage proponent advocate otherwise.</p>
<p>Perhaps an analogy is your own physical health. A doctor won&#8217;t let you go and promise you eternal life just because your temperature happens to be a nice 98.6 F. Not at all. There are other signs that need to be measured. </p>
<p>In other words, if your coverage/temperature is bad, your system is probably sick. If your coverage/temperature is bad, you need to start measuring other things in addition to coverage/temperature. </p>
<p>From here, and for whatever reason I fail to understand, some people make the argument that it&#8217;s useless to measure your body temperature, since a perfect body temperature is not an indicator of perfect health.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22732</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Sun, 18 Oct 2009 07:49:39 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22732</guid>
		<description>@Dave

let me throw a modified version of that question back to you:
&quot;If you do have complete coverage, can you say for certain that no regression bugs were introduced?&quot;

I don&#039;t think anyone can truly say yes to that, and that is the whole point of the post</description>
		<content:encoded><![CDATA[<p>@Dave</p>
<p>let me throw a modified version of that question back to you:<br />
&#8220;If you do have complete coverage, can you say for certain that no regression bugs were introduced?&#8221;</p>
<p>I don&#8217;t think anyone can truly say yes to that, and that is the whole point of the post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kilfour</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22728</link>
		<dc:creator>kilfour</dc:creator>
		<pubDate>Fri, 16 Oct 2009 21:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22728</guid>
		<description>@Dave : Bugs can easily be introduced even with 100% code coverage. 
I don&#039;t quite understand how tests can identify dead code. If I write a test for something and then remove the call to that code in the app without changing the test, it doesn&#039;t help me at all, in fact it makes it harder to locate the problem. There&#039;s far more usefull tools out there to identify dead code than unit-testing. 
On my blog I&#039;ve posted a couple of examples of how you can have 100% code coverage and still have bugs. See the &lt;a href=&quot;http://kilfour.wordpress.com/2009/08/02/testing-tool-tour-quicknet-preview/&quot; rel=&quot;nofollow&quot;&gt;QuickNet preview article&lt;/a&gt;, for a simple example.
As far as regression bugs are concerned, again I think it is not the 100% code coverage that guards you against this. Even with full coverage you can have a bug and you need to write an extra test to guard yourself against reintroducing bugs (as demonstrated in aforementioned post). If programming was pure math, then yes, 100% code coverage might do the trick. But there&#039;s side effects (any kind of IO, file, db or other, being a killer) and other unexpected stuff (casts f.i. come to mind) that you need to take into account. 
In my experience the effort required to achieve 100% code coverage is better spent in trying to figure out the problem corner cases for code that&#039;s already covered and write tests for those cases, than to put your time into those last couple of percentages which are not going to yield much result.

Sorry about the shameless blog plug, but I thought it might be relevant. 

Oh, and if you&#039;re interested in &#039;a path to every line of code&#039;, you should check out PEX. It generates the unit tests that cover everything for you. But you&#039;ll still have bugs ;-)</description>
		<content:encoded><![CDATA[<p>@Dave : Bugs can easily be introduced even with 100% code coverage.<br />
I don&#8217;t quite understand how tests can identify dead code. If I write a test for something and then remove the call to that code in the app without changing the test, it doesn&#8217;t help me at all, in fact it makes it harder to locate the problem. There&#8217;s far more usefull tools out there to identify dead code than unit-testing.<br />
On my blog I&#8217;ve posted a couple of examples of how you can have 100% code coverage and still have bugs. See the <a href="http://kilfour.wordpress.com/2009/08/02/testing-tool-tour-quicknet-preview/" rel="nofollow">QuickNet preview article</a>, for a simple example.<br />
As far as regression bugs are concerned, again I think it is not the 100% code coverage that guards you against this. Even with full coverage you can have a bug and you need to write an extra test to guard yourself against reintroducing bugs (as demonstrated in aforementioned post). If programming was pure math, then yes, 100% code coverage might do the trick. But there&#8217;s side effects (any kind of IO, file, db or other, being a killer) and other unexpected stuff (casts f.i. come to mind) that you need to take into account.<br />
In my experience the effort required to achieve 100% code coverage is better spent in trying to figure out the problem corner cases for code that&#8217;s already covered and write tests for those cases, than to put your time into those last couple of percentages which are not going to yield much result.</p>
<p>Sorry about the shameless blog plug, but I thought it might be relevant. </p>
<p>Oh, and if you&#8217;re interested in &#8216;a path to every line of code&#8217;, you should check out PEX. It generates the unit tests that cover everything for you. But you&#8217;ll still have bugs <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22727</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 16 Oct 2009 13:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22727</guid>
		<description>I don’t use code coverage to determine if an application is bug free.  I use to determine the every line of code is tested, and that there is a path to every line of code.  This is a great way to find dead code.  If you are not worried about having every line of coded tested then why even worry about code coverage at all.  If you don’t have complete coverage how can you say for certain, that no regression bugs were introduced?  It defeats the purpose of automated testing if not all the code gets tested.</description>
		<content:encoded><![CDATA[<p>I don’t use code coverage to determine if an application is bug free.  I use to determine the every line of code is tested, and that there is a path to every line of code.  This is a great way to find dead code.  If you are not worried about having every line of coded tested then why even worry about code coverage at all.  If you don’t have complete coverage how can you say for certain, that no regression bugs were introduced?  It defeats the purpose of automated testing if not all the code gets tested.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nappisite</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22725</link>
		<dc:creator>nappisite</dc:creator>
		<pubDate>Fri, 16 Oct 2009 13:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22725</guid>
		<description>I agree that code coverage metrics are better at telling you what isn&#039;t tested than what is, but I think that&#039;s still pretty valuable.</description>
		<content:encoded><![CDATA[<p>I agree that code coverage metrics are better at telling you what isn&#8217;t tested than what is, but I think that&#8217;s still pretty valuable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefano Ricciardi</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22724</link>
		<dc:creator>Stefano Ricciardi</dc:creator>
		<pubDate>Fri, 16 Oct 2009 10:16:24 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22724</guid>
		<description>I completely agree with your post. I would even say that high coverage might even give you a false sense of &quot;confidence&quot; about the fact that your tests are good.

I&#039;d rather be happy with 80% of code coverage but with lot of corner cases test to stress the logic of the application where it&#039;s more likely to break.</description>
		<content:encoded><![CDATA[<p>I completely agree with your post. I would even say that high coverage might even give you a false sense of &#8220;confidence&#8221; about the fact that your tests are good.</p>
<p>I&#8217;d rather be happy with 80% of code coverage but with lot of corner cases test to stress the logic of the application where it&#8217;s more likely to break.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #456</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22723</link>
		<dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #456</dc:creator>
		<pubDate>Fri, 16 Oct 2009 07:16:40 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22723</guid>
		<description>[...] There&#8217;s Only One Thing You Can Learn From Code Coverage - Davy Brion talks about the concept of code coverage as a metric, and argues that the only meaningful thing that can be derived is that when code coverage is low you have a problem [...]</description>
		<content:encoded><![CDATA[<p>[...] There&#8217;s Only One Thing You Can Learn From Code Coverage &#8211; Davy Brion talks about the concept of code coverage as a metric, and argues that the only meaningful thing that can be derived is that when code coverage is low you have a problem [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22722</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Thu, 15 Oct 2009 19:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22722</guid>
		<description>@Awkward Coder

fully agreed</description>
		<content:encoded><![CDATA[<p>@Awkward Coder</p>
<p>fully agreed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Awkward Coder</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22721</link>
		<dc:creator>Awkward Coder</dc:creator>
		<pubDate>Thu, 15 Oct 2009 18:58:01 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22721</guid>
		<description>&#039;Still there is a good reason to use code coverage: find pieces of code you forgot to cover. That means to me that using it occasionally is necessary.&#039;

IMO this should never happen if your doing TDD (ideally BDD) properly - and I don&#039;t mean always writing tests firsts, I mean writing tests based around behaviour. Ideally that behaviour will have come from a use case.</description>
		<content:encoded><![CDATA[<p>&#8216;Still there is a good reason to use code coverage: find pieces of code you forgot to cover. That means to me that using it occasionally is necessary.&#8217;</p>
<p>IMO this should never happen if your doing TDD (ideally BDD) properly &#8211; and I don&#8217;t mean always writing tests firsts, I mean writing tests based around behaviour. Ideally that behaviour will have come from a use case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Koen</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22717</link>
		<dc:creator>Koen</dc:creator>
		<pubDate>Thu, 15 Oct 2009 12:03:03 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22717</guid>
		<description>Still there is a good reason to use code coverage: find pieces of code you forgot to cover. That means to me that using it occasionally is necessary.</description>
		<content:encoded><![CDATA[<p>Still there is a good reason to use code coverage: find pieces of code you forgot to cover. That means to me that using it occasionally is necessary.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akash Chopra</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22714</link>
		<dc:creator>Akash Chopra</dc:creator>
		<pubDate>Thu, 15 Oct 2009 10:56:17 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22714</guid>
		<description>I completely agree. Code coverage is only the &quot;low bar&quot; that your software must clear. Other techniques are required to identify the missed edge cases in your test suite.

If your team is already doing 100% TDD, there is probably no need for code coverage. However, for other (most?) teams, code coverage is a useful indicator of areas that require attention.</description>
		<content:encoded><![CDATA[<p>I completely agree. Code coverage is only the &#8220;low bar&#8221; that your software must clear. Other techniques are required to identify the missed edge cases in your test suite.</p>
<p>If your team is already doing 100% TDD, there is probably no need for code coverage. However, for other (most?) teams, code coverage is a useful indicator of areas that require attention.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://davybrion.com/blog/2009/10/theres-only-one-thing-you-can-learn-from-code-coverage/comment-page-1/#comment-22713</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 15 Oct 2009 10:54:54 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=1718#comment-22713</guid>
		<description>Hi Davy,

In my team we have 100% code coverage as a requirement for our build to pass. We don&#039;t for one second think that this means we&#039;ve exhaustively tested our code or that we&#039;re bug free, but we do find it exceptionally useful to find areas that we&#039;ve missed, especially after big refactorings.

As you said, it shows you things that could potentially be wrong, not whether everything is right. :)</description>
		<content:encoded><![CDATA[<p>Hi Davy,</p>
<p>In my team we have 100% code coverage as a requirement for our build to pass. We don&#8217;t for one second think that this means we&#8217;ve exhaustively tested our code or that we&#8217;re bug free, but we do find it exceptionally useful to find areas that we&#8217;ve missed, especially after big refactorings.</p>
<p>As you said, it shows you things that could potentially be wrong, not whether everything is right. <img src='http://davybrion.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.348 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-16 16:48:50 -->
