<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: a testing dilemma</title>
	<atom:link href="http://silkandspinach.net/2007/03/31/a-testing-dilemma/feed/" rel="self" type="application/rss+xml" />
	<link>http://silkandspinach.net/2007/03/31/a-testing-dilemma/</link>
	<description>development, by example</description>
	<lastBuildDate>Mon, 19 Mar 2012 12:48:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: kevin</title>
		<link>http://silkandspinach.net/2007/03/31/a-testing-dilemma/#comment-227</link>
		<dc:creator><![CDATA[kevin]]></dc:creator>
		<pubDate>Tue, 03 Apr 2007 21:30:51 +0000</pubDate>
		<guid isPermaLink="false">http://silkandspinach.wordpress.com/2007/03/31/a-testing-dilemma/#comment-227</guid>
		<description><![CDATA[ Agree with all you say about long methods, although I don&#039;t think that&#039;s the source of the problem in this case.  Even if it were broken into twenty 10-line pieces, the lack of test coverage at that level (and the calling levels above) would still mean that the same accident could occur.  Indeed, it could be argued that a flotilla of small classes and methods might serve to further obscure the importance of my tested method - and thus render the accident &lt;em&gt;more&lt;/em&gt; likely to occur. 

 But just one test of that method - did we find the configuration files, for example - would kill my worry stone dead.  The long method&#039;s lack of testability is the real problem.  Or the fact that I couldn&#039;t quickly see a way to test it! 

 (BTW, I meant &quot;geometric&quot; coloquially, in the sense of &quot;rising faster than linearly&quot;.  Apologies for the confusion...)
]]></description>
		<content:encoded><![CDATA[<p> Agree with all you say about long methods, although I don&#8217;t think that&#8217;s the source of the problem in this case.  Even if it were broken into twenty 10-line pieces, the lack of test coverage at that level (and the calling levels above) would still mean that the same accident could occur.  Indeed, it could be argued that a flotilla of small classes and methods might serve to further obscure the importance of my tested method &#8211; and thus render the accident <em>more</em> likely to occur. </p>
<p> But just one test of that method &#8211; did we find the configuration files, for example &#8211; would kill my worry stone dead.  The long method&#8217;s lack of testability is the real problem.  Or the fact that I couldn&#8217;t quickly see a way to test it! </p>
<p> (BTW, I meant &#8220;geometric&#8221; coloquially, in the sense of &#8220;rising faster than linearly&#8221;.  Apologies for the confusion&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hgs</title>
		<link>http://silkandspinach.net/2007/03/31/a-testing-dilemma/#comment-226</link>
		<dc:creator><![CDATA[hgs]]></dc:creator>
		<pubDate>Tue, 03 Apr 2007 11:22:47 +0000</pubDate>
		<guid isPermaLink="false">http://silkandspinach.wordpress.com/2007/03/31/a-testing-dilemma/#comment-226</guid>
		<description><![CDATA[I think the problem with this refactoring is that it didn&#039;t go far enough. Changing the structure by 1% won&#039;t change how the future programmer thinks of it, and (s)he will probably bring the code back in to &quot;save on a method call&quot;.  I think the problem is that the method you started with is 200 lines long. That is not insignificant for a whole program: I think the Ruby-Talk &lt;-&gt; comp.lang.ruby gateway was that long in total when it was created.  Printed out, it would be over 3 pages of 66-line paper.  I used to think that the instructions to keep methods short (one screen long, so about 25 lines) were just silly: clearly written code can be much longer and still well-understood.  I&#039;m finding now that when I move code out of long methods I suddenly see new ways in which the new, short methods can fail, which never occurred to me when the code was &quot;in context&quot;.  I think this is because the brain is so poor at managing logic, especially paths through code. That ties in with the short term memory limits of 7 &quot;chunks&quot;.  [Or maybe I&#039;m just saving face here, and should have the courage to admit to being thick :-)]  If code is about communicating with other humans, then some of them will be less bright than you, so simplifying the method by creating more methods is probably good.
Your points about testing unused methods are interesting, and I don&#039;t see a way around that which allows refactoring to work. Your points about test coverage make sense, though I could not assert that the relationship is geometric.]]></description>
		<content:encoded><![CDATA[<p>I think the problem with this refactoring is that it didn&#8217;t go far enough. Changing the structure by 1% won&#8217;t change how the future programmer thinks of it, and (s)he will probably bring the code back in to &#8220;save on a method call&#8221;.  I think the problem is that the method you started with is 200 lines long. That is not insignificant for a whole program: I think the Ruby-Talk &lt;-&gt; comp.lang.ruby gateway was that long in total when it was created.  Printed out, it would be over 3 pages of 66-line paper.  I used to think that the instructions to keep methods short (one screen long, so about 25 lines) were just silly: clearly written code can be much longer and still well-understood.  I&#8217;m finding now that when I move code out of long methods I suddenly see new ways in which the new, short methods can fail, which never occurred to me when the code was &#8220;in context&#8221;.  I think this is because the brain is so poor at managing logic, especially paths through code. That ties in with the short term memory limits of 7 &#8220;chunks&#8221;.  [Or maybe I'm just saving face here, and should have the courage to admit to being thick :-)]  If code is about communicating with other humans, then some of them will be less bright than you, so simplifying the method by creating more methods is probably good.<br />
Your points about testing unused methods are interesting, and I don&#8217;t see a way around that which allows refactoring to work. Your points about test coverage make sense, though I could not assert that the relationship is geometric.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

