<?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: Why Settle for Unit Tests?</title>
	<atom:link href="http://www.developsense.com/blog/2007/03/why-settle-for-unit-tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.developsense.com/blog/2007/03/why-settle-for-unit-tests/</link>
	<description>DevelopSense Blog</description>
	<lastBuildDate>Mon, 26 Dec 2011 11:49:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Paul Wilson</title>
		<link>http://www.developsense.com/blog/2007/03/why-settle-for-unit-tests/comment-page-1/#comment-47</link>
		<dc:creator>Paul Wilson</dc:creator>
		<pubDate>Thu, 08 Mar 2007 22:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://developsense.com/wordpress/?p=41#comment-47</guid>
		<description>Replying to Michael:&lt;br/&gt;&lt;br/&gt;I agree with you on the general notion of distrusting &quot;one size fits all&quot; policies, but I&#039;m not so sure of the specifics of converting unit tests to assertions. &lt;br/&gt;&lt;br/&gt;Thanks for bringing up the idea, though. It&#039;s got me musing on DBC vs TDD.  I may write something contrasting the two approaches.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Replying to Noah:&lt;br/&gt;&lt;br/&gt;&quot;I think the preferred method is to check the parameters and gracefully return from the method if there is a violation of the contract, hence the DBC comment by Paul&quot;&lt;br/&gt;&lt;br/&gt;We digress a little, but interestingly the DBC ethos is to fail hard with an exception.  The idea being to highlight problems early.&lt;br/&gt;&lt;br/&gt;&quot;I don&#039;t necessarily agree with Paul&#039;s first point because it seems to imply that code will rot if not run every so often.&quot;&lt;br/&gt;&lt;br/&gt;I love that idea!  It reminds of my perception of climbing rope: no matter how carefully it is coiled and folded before being put away it seems always to be a tangled mess when it&#039;s next taken out.  &lt;br/&gt;&lt;br/&gt;Good point, though.  What I ought to have said was that putting an assertion in the code is no guarantee that the assertion is exercised during testing.</description>
		<content:encoded><![CDATA[<p>Replying to Michael:</p>
<p>I agree with you on the general notion of distrusting &#8220;one size fits all&#8221; policies, but I&#8217;m not so sure of the specifics of converting unit tests to assertions. </p>
<p>Thanks for bringing up the idea, though. It&#8217;s got me musing on DBC vs TDD.  I may write something contrasting the two approaches.</p>
<p>Replying to Noah:</p>
<p>&#8220;I think the preferred method is to check the parameters and gracefully return from the method if there is a violation of the contract, hence the DBC comment by Paul&#8221;</p>
<p>We digress a little, but interestingly the DBC ethos is to fail hard with an exception.  The idea being to highlight problems early.</p>
<p>&#8220;I don&#8217;t necessarily agree with Paul&#8217;s first point because it seems to imply that code will rot if not run every so often.&#8221;</p>
<p>I love that idea!  It reminds of my perception of climbing rope: no matter how carefully it is coiled and folded before being put away it seems always to be a tangled mess when it&#8217;s next taken out.  </p>
<p>Good point, though.  What I ought to have said was that putting an assertion in the code is no guarantee that the assertion is exercised during testing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.developsense.com/blog/2007/03/why-settle-for-unit-tests/comment-page-1/#comment-44</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Wed, 07 Mar 2007 16:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://developsense.com/wordpress/?p=41#comment-44</guid>
		<description>Hi, Paul...&lt;br/&gt;&lt;br/&gt;When you say, &quot;I&#039;m not sure you want to move the assertion into code...&quot;, I want to make it clear that &lt;i&gt;I&#039;m&lt;/i&gt; not sure either; I just think it might be a good idea to ask the question.  That&#039;s the part of the point of taking a testing perspective when you&#039;re writing code--the daemon in the back of your head that asks &quot;Is there a problem here?&quot; or &quot;Might there be a problem here?&quot; or &quot;If there were a problem here, how might we address it?&quot;  A parameter check or a unit test?--the answer is up to you in your context.</description>
		<content:encoded><![CDATA[<p>Hi, Paul&#8230;</p>
<p>When you say, &#8220;I&#8217;m not sure you want to move the assertion into code&#8230;&#8221;, I want to make it clear that <i>I&#8217;m</i> not sure either; I just think it might be a good idea to ask the question.  That&#8217;s the part of the point of taking a testing perspective when you&#8217;re writing code&#8211;the daemon in the back of your head that asks &#8220;Is there a problem here?&#8221; or &#8220;Might there be a problem here?&#8221; or &#8220;If there were a problem here, how might we address it?&#8221;  A parameter check or a unit test?&#8211;the answer is up to you in your context.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noah Campbell</title>
		<link>http://www.developsense.com/blog/2007/03/why-settle-for-unit-tests/comment-page-1/#comment-43</link>
		<dc:creator>Noah Campbell</dc:creator>
		<pubDate>Wed, 07 Mar 2007 16:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://developsense.com/wordpress/?p=41#comment-43</guid>
		<description>&quot;If there is a risk of a serious problem, why not move such assertions right into the code?&quot;&lt;br/&gt;&lt;br/&gt;I&#039;m not sure you want to move the assertion into code because the assertion typically throws an exception during execution (a slow operation).  I think the preferred method is to check the parameters and gracefully return from the method if there is a violation of the contract, hence the DBC comment by Paul.&lt;br/&gt;&lt;br/&gt;I don&#039;t necessarily agree with Paul&#039;s first point because it seems to imply that code will rot if not run every so often.  I cannot imagine that a block of code will spontaneously change.  I do, however, expect the intended use of the class or object will change spontaneously and that change should trigger the automated testing.</description>
		<content:encoded><![CDATA[<p>&#8220;If there is a risk of a serious problem, why not move such assertions right into the code?&#8221;</p>
<p>I&#8217;m not sure you want to move the assertion into code because the assertion typically throws an exception during execution (a slow operation).  I think the preferred method is to check the parameters and gracefully return from the method if there is a violation of the contract, hence the DBC comment by Paul.</p>
<p>I don&#8217;t necessarily agree with Paul&#8217;s first point because it seems to imply that code will rot if not run every so often.  I cannot imagine that a block of code will spontaneously change.  I do, however, expect the intended use of the class or object will change spontaneously and that change should trigger the automated testing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.developsense.com/blog/2007/03/why-settle-for-unit-tests/comment-page-1/#comment-42</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 05 Mar 2007 18:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://developsense.com/wordpress/?p=41#comment-42</guid>
		<description>Hi, Paul...&lt;br/&gt;&lt;br/&gt;First off, thanks for writing.&lt;br/&gt;&lt;br/&gt;I didn&#039;t have DBC in mind when I wrote the post, and I still don&#039;t, specifically.  My principal point is to question the universality of any particular approach, even one that I believe to be swell (as I believe unit tests to be).  DBC is an example of an approach that can be a worthy alternative to some unit tests.&lt;br/&gt;&lt;br/&gt;The regression testing paradigm as it&#039;s often discussed was more important years ago, when unit tests had fallen off people&#039;s radar, and configuration management tools were poorly understood and rarely used.  Now many teams have good configuration management and TDD tests in place, so for them, unwelcome changes are much less frequent than they used to be.  That indicates an opportunity to change the testing focus.  Now that we&#039;ve mitigated certain kinds of risks, let&#039;s use the time and effort we save to address other risks.&lt;br/&gt;&lt;br/&gt;If a particular risk is so darned important that we want to run a unit test for it every time, maybe we want to do exactly that.  On the other hand, maybe we want to put a check into the code itself.  The principal goal here is to ask the question and answer it based on the situation.&lt;br/&gt;&lt;br/&gt;Thanks for the comment!</description>
		<content:encoded><![CDATA[<p>Hi, Paul&#8230;</p>
<p>First off, thanks for writing.</p>
<p>I didn&#8217;t have DBC in mind when I wrote the post, and I still don&#8217;t, specifically.  My principal point is to question the universality of any particular approach, even one that I believe to be swell (as I believe unit tests to be).  DBC is an example of an approach that can be a worthy alternative to some unit tests.</p>
<p>The regression testing paradigm as it&#8217;s often discussed was more important years ago, when unit tests had fallen off people&#8217;s radar, and configuration management tools were poorly understood and rarely used.  Now many teams have good configuration management and TDD tests in place, so for them, unwelcome changes are much less frequent than they used to be.  That indicates an opportunity to change the testing focus.  Now that we&#8217;ve mitigated certain kinds of risks, let&#8217;s use the time and effort we save to address other risks.</p>
<p>If a particular risk is so darned important that we want to run a unit test for it every time, maybe we want to do exactly that.  On the other hand, maybe we want to put a check into the code itself.  The principal goal here is to ask the question and answer it based on the situation.</p>
<p>Thanks for the comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Wilson</title>
		<link>http://www.developsense.com/blog/2007/03/why-settle-for-unit-tests/comment-page-1/#comment-41</link>
		<dc:creator>Paul Wilson</dc:creator>
		<pubDate>Mon, 05 Mar 2007 17:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://developsense.com/wordpress/?p=41#comment-41</guid>
		<description>Hi Michael,&lt;br/&gt;&lt;br/&gt;That sounds very like &quot;Design by Contract&quot; (DBC), particularly the way it is &lt;a HREF=&quot;http://en.wikipedia.org/wiki/Eiffel_programming_language#.22Design_by_Contract.22&quot; REL=&quot;nofollow&quot; rel=&quot;nofollow&quot;&gt;&lt;br/&gt;baked in to Eiffel&lt;/a&gt;.  Did you have that in mind?&lt;br/&gt;&lt;br/&gt;I prefer &quot;unit tests&quot; to the &quot;DBC&quot; approach because&lt;br/&gt;&lt;br/&gt;- automated testing ensures that the code is exercised; some code may not be hit that often - particularly exception handling code.&lt;br/&gt;&lt;br/&gt;- similarly edge conditions may not get exercised so often; unit testing tends concentrate on the edges&lt;br/&gt;&lt;br/&gt;- it can be difficult to impossible to write &quot;postconditions&quot; that don&#039;t mimic the body of many methods.  It&#039;s much easier to be orthogonal with unit tests.</description>
		<content:encoded><![CDATA[<p>Hi Michael,</p>
<p>That sounds very like &#8220;Design by Contract&#8221; (DBC), particularly the way it is <a HREF="http://en.wikipedia.org/wiki/Eiffel_programming_language#.22Design_by_Contract.22" REL="nofollow" rel="nofollow"><br />baked in to Eiffel</a>.  Did you have that in mind?</p>
<p>I prefer &#8220;unit tests&#8221; to the &#8220;DBC&#8221; approach because</p>
<p>- automated testing ensures that the code is exercised; some code may not be hit that often &#8211; particularly exception handling code.</p>
<p>- similarly edge conditions may not get exercised so often; unit testing tends concentrate on the edges</p>
<p>- it can be difficult to impossible to write &#8220;postconditions&#8221; that don&#8217;t mimic the body of many methods.  It&#8217;s much easier to be orthogonal with unit tests.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.460 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2011-12-26 20:27:11 -->

