<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" 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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>silk and spinach</title>
	
	<link>http://silkandspinach.net</link>
	<description>development, by example</description>
	<lastBuildDate>Wed, 28 Oct 2009 15:26:37 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain="silkandspinach.net" port="80" path="/?rsscloud=notify" registerProcedure="" protocol="http-post" />
<image>
		<url>http://www.gravatar.com/blavatar/3cce8f767b2351ad81c632bba4846f34?s=96&amp;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>silk and spinach</title>
		<link>http://silkandspinach.net</link>
	</image>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/SilkAndSpinach" type="application/rss+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>devver are using reek</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/XYUxmB4m-Mk/</link>
		<comments>http://silkandspinach.net/2009/10/28/devver-are-using-reek/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 15:26:37 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[reek]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1125</guid>
		<description><![CDATA[Interesting link:
In Improving Code using Metric Fu the folks at devver.net give a little insight into how they have been using Reek and the other Ruby quality tools to improve their codebase.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1125&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Interesting link:<br />
In <a href="http://devver.net/blog/2009/10/improving-code-using-metric-fu/" target="blank">Improving Code using Metric Fu</a> the folks at <a href="http://devver.net" target="blank">devver.net</a> give a little insight into how they have been using Reek and the other Ruby quality tools to improve their codebase.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1125&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=XYUxmB4m-Mk:EoHQ0kg0Q60:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=XYUxmB4m-Mk:EoHQ0kg0Q60:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=XYUxmB4m-Mk:EoHQ0kg0Q60:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=XYUxmB4m-Mk:EoHQ0kg0Q60:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=XYUxmB4m-Mk:EoHQ0kg0Q60:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/XYUxmB4m-Mk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/10/28/devver-are-using-reek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/10/28/devver-are-using-reek/</feedburner:origLink></item>
		<item>
		<title>why i broke 89 tests</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/rzqM9n-GEUQ/</link>
		<comments>http://silkandspinach.net/2009/10/18/why-i-broke-89-tests/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 21:00:51 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[5whys]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[5 whys]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1096</guid>
		<description><![CDATA[A couple of days ago I made a little change to Reek and to my surprise 89 tests broke, which is bad. I tweeted about it, and soon @logosity had asked me to write about why it had happened. I know the same sort of thing happens to people all the time, and it can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1096&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A couple of days ago I made a little change to <a href="http://gemcutter.org/gems/reek" target="blank">Reek</a> and to my surprise 89 tests broke, which is bad. I <a href="http://twitter.com/kevinrutherford/status/4831878857" target="blank">tweeted</a> about it, and soon <a href="http://twitter.com/logosity" target="blank">@logosity</a> had asked me to write about why it had happened. I know the same sort of thing happens to people all the time, and it can be quite traumatic in the otherwise placid flow of test-driven development. So I&#8217;m hoping it will be somewhat helpful to uncover the path that led me from blissful ignorance to test calamity with one keystroke. So without further ado, let&#8217;s do some root cause analysis&#8230;</p>
<p><strong>Undesirable event:</strong><br />
I deleted an <code>attr_reader</code> that was called in only one place and 89 of Reek&#8217;s 360-odd rspec examples broke. Of these broken tests, only three were tests of <code>SimulatedPolymorphism#examine_context</code>, which was the deleted attribute&#8217;s one caller.</p>
<p><strong>Why did the other 86 tests break unexpectedly?</strong></p>
<p>Because they each indirectly invoked the one method that now could no longer work.</p>
<p><strong>Why did they invoke the broken method?</strong></p>
<p>Because they are integration tests, checking the co-ordinated behaviour of a dozen or so classes.</p>
<p>The broken method sits on a relatively new class, an instance of which is automatically included in the framework that those tests invoke.</p>
<p>The central class in Reek is the <code>Sniffer</code>, which obtains a syntax tree from a <code>Source</code> (eg. a File or a String or an IO stream) and then traverses it, firing events at registered <code>SmellDetector</code> objects as it encounters syntax elements they subscribe to. The broken method is in one of these listeners, and it is fired whenever the parser encounters a new class definition in the syntax tree.</p>
<p>Reek has a couple of hundred tests that each run a <code>Sniffer</code> over a code snippet, checking that the detectors find a specific set of code smells (and don&#8217;t find any others). The broken detector (SimulatedPolymorphism) is fired on any code fragment that includes a class definition; it turns out that only 86 of these couple hundred tests do that. The damage could have been much worse.</p>
<p>All of which means that the failing tests are &#8220;integration tests&#8221;, checking the overall behaviour of over a dozen classes under a variety of specific circumstances. Under some circumstances one of those classes is broken, so some of these integration tests fail.</p>
<p><strong>Why are there so many integration tests in the unit test suite?</strong></p>
<p>Because they are much easier to write than the tests for a single class would be. And they express the desired behaviour in ways that unit tests can&#8217;t. So I never took the time to write the unit tests.</p>
<p>Here&#8217;s an example of one of these tests:</p>
<pre>
describe ControlCouple do
  it 'should report a ternary check on a parameter' do
    code = 'def simple(arga) arga ? @ivar : 3 end'
    code.should reek_only_of(:ControlCouple, /arga/)
  end
end
</pre>
<p>The corresponding unit tests would confirm that:</p>
<ul>
<li> the code parser and method context objects conspire together to record the method&#8217;s parameters
<li> the code parser sends an event to the control couple detector when, and only when, it sees a conditional expression
<li> the control couple detector can obtain the enclosing method&#8217;s parameters
<li> the control couple detector records a smell warning only when the conditional expression tests the value of a method parameter
<li> the smell warning includes the correct information
<li> no other detector records any warnings for the given code fragment
</ul>
<p>Unit tests exist for some of these cases and not for others. The ease with which I can write readable tests has made me lazy: I often don&#8217;t write the unit tests, because I get new features into Reek much more quickly this way. The penalty occurs when a change breaks one of the detectors or (worse) something in the Sniffer, because then I get dozens of broken tests and it can be difficult to pinpoint the problem quickly.</p>
<p>There&#8217;s also another reason I got lazy: As Reek&#8217;s internal architecture stabilized many months ago, most of the new code I write consists of adding new smell detector classes, which usually slot right into the existing stable framework with few surprises or problems.</p>
<p>So the root cause of my 89 test failures is the combination of a well-tested, stable, practically defect-free framework together with a great way to quickly write readable integration test examples. Is that so bad after all, I wonder.</p>
<p>Am I going to fix the problem? Yes and no. Each time this happens in future I will add the missing unit tests that should have failed. But I don&#8217;t want to lose the expressive value of these integration tests, so I plan to (gradually) organise them into a different test suite more closely related to Reek&#8217;s cucumber tests. What would you do?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1096/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1096/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1096/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1096/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1096/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1096/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1096&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=rzqM9n-GEUQ:KzV3HBCjakE:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=rzqM9n-GEUQ:KzV3HBCjakE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=rzqM9n-GEUQ:KzV3HBCjakE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=rzqM9n-GEUQ:KzV3HBCjakE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=rzqM9n-GEUQ:KzV3HBCjakE:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/rzqM9n-GEUQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/10/18/why-i-broke-89-tests/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/10/18/why-i-broke-89-tests/</feedburner:origLink></item>
		<item>
		<title>today’s kata</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/-4mAxbwtAbM/</link>
		<comments>http://silkandspinach.net/2009/09/28/todays-kata/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 10:51:06 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[kata]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1091</guid>
		<description><![CDATA[In Ruby, one easy way to check for palindromes would be to write a method such as this:

class String
 def palindrome?
   self == self.reverse
 end
end

But the C++ part of my brain screams that this is likely to be very inefficient. So, today&#8217;s kata: test-drive a palindrome? method for String, ensuring (with tests) that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1091&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In Ruby, one easy way to check for palindromes would be to write a method such as this:</p>
<pre><code>
class String
 def palindrome?
   self == self.reverse
 end
end
</code></pre>
<p>But the C++ part of my brain screams that this is likely to be very inefficient. So, today&#8217;s kata: test-drive a palindrome? method for String, ensuring (with tests) that it is much faster than the above.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1091/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1091/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1091/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1091/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1091/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1091/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1091/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1091/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1091/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1091/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1091&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=-4mAxbwtAbM:Jdk6GmJgKvw:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=-4mAxbwtAbM:Jdk6GmJgKvw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=-4mAxbwtAbM:Jdk6GmJgKvw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=-4mAxbwtAbM:Jdk6GmJgKvw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=-4mAxbwtAbM:Jdk6GmJgKvw:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/-4mAxbwtAbM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/09/28/todays-kata/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/09/28/todays-kata/</feedburner:origLink></item>
		<item>
		<title>thoughts on feature envy</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/0NWm_nu68ts/</link>
		<comments>http://silkandspinach.net/2009/09/23/thoughts-on-feature-envy/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 09:25:12 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code smells]]></category>
		<category><![CDATA[feature envy]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1086</guid>
		<description><![CDATA[I&#8217;m currently debating with myself on how and where to take Reek next. Specifically, I&#8217;m thinking about the FeatureEnvy / UtilityFunction class of code smell and their relation with classes and class methods. I&#8217;ve begun unravelling some thoughts over on the ruby-reek mailing list, and I thought I&#8217;d seek your opinion too. Much of what [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1086&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m currently debating with myself on how and where to take <a href="http://wiki.github.com/kevinrutherford/reek" target="blank">Reek</a> next. Specifically, I&#8217;m thinking about the FeatureEnvy / UtilityFunction class of code smell and their relation with classes and class methods. I&#8217;ve begun unravelling some thoughts over on the <a href="http://groups.google.com/group/ruby-reek" target="blank">ruby-reek</a> mailing list, and I thought I&#8217;d seek your opinion too. Much of what follows may turn out to be complete tripe&#8230;</p>
<p>There are always two views of any code, imo: specification-time and run-time. Code smells are, I think, (very nearly) 100% in the specification-time space; they deal with the code as written: does this name communicate well, is this code fragment coherent with those around it, will these two fragments change at different times, and so on; aspects of the specification that don&#8217;t affect behaviour. Classes are the means by which we describe the behaviour of runtime objects. It&#8217;s nice and sexy that in Ruby we also have runtime objects representing those classes, but I don&#8217;t necessarily see them as being the same beasts. One is a specification, the other is a runtime mechanism.</p>
<p>So one view of FeatureEnvy and UtilityFunction is that they help to improve the cohesiveness of the specification, by encouraging us to move code fragments closer to the state/data on which they operate. And this is where it begins to get hazy for me&#8230;</p>
<p>Consider a &#8220;helper&#8221; method that is only called by the methods of a single class, but which makes no use of the state of that class&#8217;s instances; where should its specification live? Shoulld it live with the class that uses it, or should it move towards the data on which it operates? Usually such methods exist in order to help simplify the caller&#8217;s interaction with something &#8212; I&#8217;ll posit that such methods are usually Adapters. So which is worse &#8212; have the adapter live with the adaptee or with the only client? Should it only move to (or towards) the adaptee when a second client needs it, perhaps?</p>
<p>One might argue that moving it to the adaptee creates a case of SpeculativeGeneralisation; in which case it should remain with the only client until it is duplicated by some other class. On the other hand, moving the fragment towards the adaptee can help to encapsulate the adaptee better, often allowing it to expose less to the outside world. All of which seems to imply that we can&#8217;t determine the best response to seeing Feature Envy without looking at other smells, current and future.</p>
<p>One approach would be to not treat FeatureEnvy / UtilityFunction as smells, but instead to look at the adaptee and call foul if we see a getter or setter; and in the absence of getters and setters, wait for duplication to show us what code needs to be shared, and hence moved. I think I may try living with that approach for a month and see what happens&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1086/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1086/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1086/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1086&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=0NWm_nu68ts:sSuEXK5ig7g:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=0NWm_nu68ts:sSuEXK5ig7g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=0NWm_nu68ts:sSuEXK5ig7g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=0NWm_nu68ts:sSuEXK5ig7g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=0NWm_nu68ts:sSuEXK5ig7g:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/0NWm_nu68ts" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/09/23/thoughts-on-feature-envy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/09/23/thoughts-on-feature-envy/</feedburner:origLink></item>
		<item>
		<title>performance kata by corey haines</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/W_5g84FCKIQ/</link>
		<comments>http://silkandspinach.net/2009/09/15/performance-kata-by-corey-haines/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 08:47:24 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1081</guid>
		<description><![CDATA[I just watched a great video of a &#8220;performance kata&#8221; by Corey Haines. Highly recommended!
Watching Corey solve the kata differently than I would have done has taught me several new tricks. Notably spec -fs spec &#8212; I get a completely unreadable mess when I run that on my own code, so there&#8217;s some work to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1081&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just watched <a href="http://charlesmaxwood.com/8-lessons-from-corey-haines-performance-kata/" target="blank">a great video</a> of a &#8220;performance kata&#8221; by <a href="http://www.coreyhaines.com/" target="blank">Corey Haines</a>. Highly recommended!</p>
<p>Watching Corey solve the kata differently than I would have done has taught me several new tricks. Notably <code>spec -fs spec</code> &#8212; I get a completely unreadable mess when I run that on my own code, so there&#8217;s some work to do there in terms of how I name my specs.</p>
<p>Also, my first instinct would not be to extract the <code>do_replacement</code> helper method. I noticed GeePawHill do that too during his <a href="http://anarchycreek.com/2009/08/13/doubledawg2-a-few-smoke-tests/" target="blank">Double Dawg Dare refactoring</a> videos; so it&#8217;s common, and a couple of years ago I was doing it all the time. But recently I&#8217;ve tried to work the opposite way &#8212; if the tests need a helper, I take that as a sign that the API under test isn&#8217;t as developer-friendly as it might be. So I look for ways to DRY up the tests by making the test subject&#8217;s interface more fluid. The helper method approach certainly gets results more quickly, but I worry about the longer term maintainability of the code; maybe I shouldn&#8217;t; maybe I think too much instead of just doing TDD &#8220;as if I meant it&#8221;.</p>
<p>All of which means that performance kata are a fantastic way to share knowledge, develop new skills and hone techniques. Time for some more practice&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1081/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1081/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1081/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1081&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=W_5g84FCKIQ:gExJNcCJooI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=W_5g84FCKIQ:gExJNcCJooI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=W_5g84FCKIQ:gExJNcCJooI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=W_5g84FCKIQ:gExJNcCJooI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=W_5g84FCKIQ:gExJNcCJooI:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/W_5g84FCKIQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/09/15/performance-kata-by-corey-haines/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/09/15/performance-kata-by-corey-haines/</feedburner:origLink></item>
		<item>
		<title>session accepted for XPDays Benelux 2009</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/5nowDyBMLOc/</link>
		<comments>http://silkandspinach.net/2009/09/14/session-accepted-for-xpdays-benelux-2009/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 10:21:49 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1079</guid>
		<description><![CDATA[I just had news that our session &#8220;Developing a Sense of Smell&#8221; has been accepted for XPDays Benelux this year. I&#8217;ll be running the session with Lindsay McEwan, and we plan to explore the use of code smells as a tool for communicating about software design. Join us if you can!
     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1079&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just had news that our session &#8220;Developing a Sense of Smell&#8221; has been accepted for <a href="http://www.xpday.net/" target="blank">XPDays Benelux</a> this year. I&#8217;ll be running the session with Lindsay McEwan, and we plan to explore the use of code smells as a tool for communicating about software design. Join us if you can!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1079/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1079/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1079/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1079&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=5nowDyBMLOc:6sUsZ-o2Xw8:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=5nowDyBMLOc:6sUsZ-o2Xw8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=5nowDyBMLOc:6sUsZ-o2Xw8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=5nowDyBMLOc:6sUsZ-o2Xw8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=5nowDyBMLOc:6sUsZ-o2Xw8:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/5nowDyBMLOc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/09/14/session-accepted-for-xpdays-benelux-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/09/14/session-accepted-for-xpdays-benelux-2009/</feedburner:origLink></item>
		<item>
		<title>support Corey Haines</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/Imyc6iYViYk/</link>
		<comments>http://silkandspinach.net/2009/09/01/support-corey-haines/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 13:33:51 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[pairprogramming]]></category>
		<category><![CDATA[journeyman]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1070</guid>
		<description><![CDATA[ For nine months now Corey Haines has been travelling around the Eastern US as a journeyman programmer. During that time he has run numerous code retreats, published numerous fantastic interviews with leading developers, and made dozens of blog posts and videos in which he reflects on the things he&#8217;s learned from the people he&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1070&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://www.coreyhaines.com/images/corey_haines.jpg" width="100" style="float:left;margin:0 1em 1em 0;" /> For nine months now <a href="http://www.coreyhaines.com/" target="blank">Corey Haines</a> has been travelling around the Eastern US as a journeyman programmer. During that time he has run numerous code retreats, published numerous fantastic interviews with leading developers, and made dozens of blog posts and videos in which he reflects on the things he&#8217;s learned from the people he&#8217;s paired with. The body of Corey&#8217;s travails is already beginning to form an invaluable reference, and all of the insights he has pushed into the public domain add to our collective knowledge about how to develop software carefully (in both senses of the word).</p>
<p>Just as amazing as the project&#8217;s knowledge elicitation is the fact that Corey is self-funded.  He pair programs for food and lodging, and just by doing that he has given back an enormous amount to the community. Well, <a href="http://programmingtour.blogspot.com/2009/08/hat-in-hand.html" target="blank">now he&#8217;s skint</a>. The journey will continue only if Corey can raise some funds.</p>
<p>So please visit <a href="http://programmingtour.blogspot.com/" target="blank">Corey&#8217;s blog</a> and pledge a few quid to keep the journeyman on the road. I did, and it didn&#8217;t hurt a bit.</p>
<p>And next year, Corey, how about we raise the cash to get you over to the UK for a tour?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1070/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1070/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1070/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1070/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1070/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1070/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1070/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1070/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1070/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1070/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1070&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=Imyc6iYViYk:Z2y7Vx1GQwQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=Imyc6iYViYk:Z2y7Vx1GQwQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=Imyc6iYViYk:Z2y7Vx1GQwQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=Imyc6iYViYk:Z2y7Vx1GQwQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=Imyc6iYViYk:Z2y7Vx1GQwQ:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/Imyc6iYViYk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/09/01/support-corey-haines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>

		<media:content url="http://www.coreyhaines.com/images/corey_haines.jpg" medium="image" />
	<feedburner:origLink>http://silkandspinach.net/2009/09/01/support-corey-haines/</feedburner:origLink></item>
		<item>
		<title>cucumber feature organisation</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/uNrT3RmjX50/</link>
		<comments>http://silkandspinach.net/2009/08/17/cucumber-feature-organisation/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 17:41:22 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1061</guid>
		<description><![CDATA[A few months ago I asked around to find out how (or whether) people organised the Cucumber feature files in their project&#8217;s features folder. Nothing in particular turned up. But yesterday the good folks at Thoughtbot posted their own very interesting convention: They have a sub-folder of features/ for each Actor served by the application. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1061&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A few months ago I asked around to find out how (or whether) people organised the Cucumber feature files in their project&#8217;s <code>features</code> folder. Nothing in particular turned up. But yesterday the good folks at Thoughtbot <a href="http://robots.thoughtbot.com/post/164479801/cucumber-directory-convention" target="blank">posted</a> their own very interesting convention: They have a sub-folder of <code>features/</code> for each Actor served by the application. For example:</p>
<pre>
features/admins/
features/api_clients/
features/users/
features/visitors/
</pre>
<p>I like this a lot, and I&#8217;ll be re-organising Reek&#8217;s features soon along the same lines. In fact, thinking about this has made me realise that there&#8217;s a whole class of user (API clients) not represented by <a href="http://wiki.github.com/kevinrutherford/reek" target="blank">Reek</a>&#8217;s current set of Cucumber features.</p>
<p>And here&#8217;s an interesting thought experiment I&#8217;ll also be trying out: How about adding another folder level for the Actor&#8217;s goal? So the folders would be organised according to the commonalities among the feature descriptions: <code>features/&lt;as_a&gt;/&lt;in_order_to&gt;/feature</code>. For example:</p>
<pre>
features/
  administrator/
    manage_products/
      create_catalogue.feature
      retire_product_line.feature
      ...
    manage_users/
      grant_access.feature
      ...
</pre>
<p>
Will that be useful, or just create more clutter? In general I dislike hierarchical classification, so I was keen to keep the sub-folder names as verbs. I&#8217;ll try it for Reek and report my feelings back here. Please let us know if you try it first&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1061/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1061/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1061/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1061/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1061/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1061/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1061/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1061/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1061/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1061/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1061&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=uNrT3RmjX50:qqpZe2t62Ws:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=uNrT3RmjX50:qqpZe2t62Ws:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=uNrT3RmjX50:qqpZe2t62Ws:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=uNrT3RmjX50:qqpZe2t62Ws:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=uNrT3RmjX50:qqpZe2t62Ws:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/uNrT3RmjX50" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/08/17/cucumber-feature-organisation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/08/17/cucumber-feature-organisation/</feedburner:origLink></item>
		<item>
		<title>reflections on shotgun surgery</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/DEZHT2Ku6lc/</link>
		<comments>http://silkandspinach.net/2009/07/24/reflections-on-shotgun-surgery/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 14:11:44 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1042</guid>
		<description><![CDATA[I&#8217;ve just finished refactoring the code of Reek to (almost) eliminate a large dose of Shotgun Surgery, so I thought the time was ripe for a little reflection on what occurred and why.
What is Shotgun Surgery?
This is a code smell that occurs when you have to change loads of existing code in order to make [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1042&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve just finished refactoring the code of Reek to (almost) eliminate a large dose of <a href="http://c2.com/cgi/wiki?ShotgunSurgery" target="blank">Shotgun Surgery</a>, so I thought the time was ripe for a little reflection on what occurred and why.</p>
<p><b>What is Shotgun Surgery?</b></p>
<p>This is a code smell that occurs when you have to change loads of existing code in order to make a single change to the overall codebase.</p>
<p>In this case I wanted to change the reports generated by Reek&#8217;s spec matchers so that test failures are described more succinctly. To do so I had to change 7 classes, adding 4 methods (three of which all had the same name) and modifying several others. I pushed quickly to GREEN, at which point the code looked like I had driven a bulldozer through it from one end to the other and back again.</p>
<p><b>Ok, that happens all the time. Why is it a problem?</b></p>
<p>Because it creates drag. I had known for a while that certain kinds of change in this codebase would be painful to make, and the pain I imagined was subconsciously steering me away from making those kinds of change. I had been spending my time making changes that I knew were easier, putting off tackling the no-go areas of the codebase.</p>
<p>Furthermore, as I was tackling this smell I discovered a few defects in the code. They were edge cases, but they were definitely bugs. They had festered there in the dark corners where I had been afraid to go; and for all I know they had tripped up some new user of Reek and put them off forever.</p>
<p>And perhaps worst of all, it indicates that there&#8217;s a single design decision whose implementation (and consequences) is distributed throughout the codebase. So any similar or related decisions are going to be just as difficult and messy, and pretty soon they&#8217;ll all pile up together and render the code completely unmaintainable.</p>
<p><b>Why did it get so bad?</b></p>
<p>I think the main reason is that I&#8217;m not particularly well tuned to noticing Shotgun Surgery. (I believe I&#8217;m not alone in this.) We write a test, and it takes a bulldozer to get to green. We get to green, and we make a few localized refactorings to tidy up some of the methods we touched. But we often don&#8217;t see the bigger picture. &#8220;Hey, I just had to touch 6 classes to get that done; there&#8217;s a design issue here.&#8221; I&#8217;m sure I had previously failed to notice this or related smells on several previous occasions.</p>
<p>I had also failed to listen to my inner demon. I had &#8220;seen&#8221; several pieces of the eventual puzzle many weeks earlier, but I hadn&#8217;t addressed them because they didn&#8217;t seem serious. For example, I knew that some classes violated one of my <a href="http://silkandspinach.net/2005/03/22/the-middle-hexagon-should-be-independent-of-the-adapters/">central tenets of a good hexagonal architecture</a>. But I told myself that was just a guideline &#8212; I shouldn&#8217;t push the code towards that shape unless the code told me it wanted to go. It turned out that the code had been screaming at me for some time!</p>
<p><b>How did I fix it?</b></p>
<p>The first, and most important, step is to identify the decision that hadn&#8217;t been properly and uniquely represented in the code. The aim is to refactor the code so that if I wished to change that decision again I would only need to make a single change to a single class. This is the hardest part of fixing Shotgun Surgery, and it&#8217;s a design step.</p>
<p>In this case I wanted to create a different kind of report, and I wanted to do it in the spec matcher. But quiet reports were currently a special case within full reports, implemented by reading an attribute from a global variable containing the user&#8217;s preferences. And the report itself was created way over the other side of the system. In a lazily evaluated cache.</p>
<p>I won&#8217;t bore you with the details. I decided to do this one &#8220;by the book&#8221;, inverting dependencies one by one until the Report object was created once, at the identified decision point in the code. Over the course of a dozen hours I changed all of the above 7 classes again; I introduced 4 new classes; and at the close of play <em>none</em> of the methods I had touched in the original change still remained.</p>
<p><b>Could this cost have been avoided?</b></p>
<p>I think this is a natural process &#8212; reasonablly well-refactored code suddenly receives a change request that goes against the grain, so there&#8217;s some origami required before the old and the new sit comfortably together. That much is inevitable.</p>
<p>But I&#8217;m sure I missed fainter warning signs earlier in the code&#8217;s life. Had I responded to them, this week&#8217;s change might have been much less traumatic. So in future I will try to be much more vigilant: the next time a test causes me to change more than one class, I&#8217;ll sort it out right there and then.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1042/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1042/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1042/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1042/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1042/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1042/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1042/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1042/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1042/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1042/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1042&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=DEZHT2Ku6lc:xSgo2UqlCfk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=DEZHT2Ku6lc:xSgo2UqlCfk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=DEZHT2Ku6lc:xSgo2UqlCfk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=DEZHT2Ku6lc:xSgo2UqlCfk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=DEZHT2Ku6lc:xSgo2UqlCfk:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/DEZHT2Ku6lc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/07/24/reflections-on-shotgun-surgery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/07/24/reflections-on-shotgun-surgery/</feedburner:origLink></item>
		<item>
		<title>factory method in ruby</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/cpuk2Vlc8xQ/</link>
		<comments>http://silkandspinach.net/2009/07/14/factory-method-in-ruby/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 13:29:16 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[refactoring]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[gof]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=1018</guid>
		<description><![CDATA[During my refactoring homework last evening I noticed a little tug-of-war between two different coding styles, and after a restless night I&#8217;ll try to analyse here what was going on&#8230;
Deep inside Reek is a Source class, whose instances are responsible for converting Ruby code into abstract syntax trees for later examination by the various code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1018&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>During my refactoring homework last evening I noticed a little tug-of-war between two different coding styles, and after a restless night I&#8217;ll try to analyse here what was going on&#8230;</p>
<p>Deep inside <a href="http://wiki.github.com/kevinrutherford/reek" target="blank">Reek</a> is a <code>Source</code> class, whose instances are responsible for converting Ruby code into abstract syntax trees for later examination by the various code smell detectors. Source code can come from many different places, and so Source has a number of Factory Methods like this:</p>
<pre>
class Source
  def self.from_io(ios)
    new(ios.readlines.join)
  end

  def self.from_s(code)
    new(code)
  end

  def self.from_f(file)
    from_path(file.path)
  end

  def self.from_path(filename)
    new(IO.readlines(filename).join)
  end

  # ...
end
</pre>
<p>(The factory methods also do some other stuff, which I&#8217;ve elided for clarity.)</p>
<p>As the refactoring exercise proceeded, I found that one of these methods came to be called from only one place. So I considered inlining it, and that&#8217;s when the tug-of-war began. Part of me resisted inlining the method, even though that&#8217;s what the code seemed to want. I argued that the Factory Methods were &#8220;potentially useful&#8221;, that they represented the <code>Source</code> abstraction and helped to document it; the code pulled the opposite way. (My wife was sitting across the room, so I kept this argument quiet inside my head; maybe that&#8217;s part of my problem.)  Anyway, to cut a long story short, at the end of my refactoring session the code had changed to (something very similar to) this:</p>
<pre>
class File
  def to_source
    Reek::Source.new(self.path)
  end
end

class IO
  def to_source
    Reek::Source.new(self.readlines.join)
  end
end

class String
  def to_source
    Reek::Source.new(self)
  end
end
</pre>
<p>The Gang of Four didn&#8217;t name this pattern, so I&#8217;ll call these methods &#8220;Converters&#8221;. (Please tell me if this pattern has a more well-known name.) They&#8217;re just like Factory Methods, but they sit on the class being converted <em>from</em> instead of on the class being converted <em>to</em>.</p>
<p>The argument between me and the code was between the <em>forces</em> in favour of each pattern. In favour of the original Factory Methods:</p>
<ul>
<li> In C++/Java &#8212; the world in which the GoF did their work, and where my roots lie &#8212; this is the only place to put the methods; </li>
<li> the dependencies point from Source to its origins (File, String, IO et al), which seems quite natural; </li>
<li> the compiler checks that the Factory Methods are called with the right types of input object; </li>
<li> all the ways to create a <code>Source</code> object are together, so they are easy to find and compare. </li>
</ul>
<p>In favour of Converters:</p>
<ul>
<li> We could later introduce new ways to create a Source without opening up that class; </li>
<li> they are instance methods, and hence just a little more natural, testable and &#8220;object-oriented&#8221;; </li>
<li> methods such as <code>to_s</code>, <code>to_a</code>, <code>to_i</code> are idiomatic in Ruby, which enhances the Communication value of this approach; </li>
<li> you need a File (for example) in order to call the Converter. (Actually, I&#8217;m not sure this counts as an advantage, because it prevents duck typing.) </li>
</ul>
<p>On balance, I feel the C++/Java form of Factory Method has many advantages. But I switched the code to use the Converter form, mainly to see what would happen. I could easily switch back again now I&#8217;ve seen the forces laid out for comparison in this blog post&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/1018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/1018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/1018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/1018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/1018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/1018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/1018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/1018/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/1018/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/1018/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=1018&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=cpuk2Vlc8xQ:zOtptk0W-cY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=cpuk2Vlc8xQ:zOtptk0W-cY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=cpuk2Vlc8xQ:zOtptk0W-cY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=cpuk2Vlc8xQ:zOtptk0W-cY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=cpuk2Vlc8xQ:zOtptk0W-cY:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/cpuk2Vlc8xQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/07/14/factory-method-in-ruby/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/07/14/factory-method-in-ruby/</feedburner:origLink></item>
		<item>
		<title>“refactoring in ruby” is available to buy!</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/8W2mp_E2M14/</link>
		<comments>http://silkandspinach.net/2009/06/18/refactoring-in-ruby-is-available-to-buy/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 20:01:39 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=987</guid>
		<description><![CDATA[The book I&#8217;ve been writing with Bill Wake for almost 2 years is now available on Safari Rough Cuts: Refactoring in Ruby!  This is a draft we completed a couple of months ago; we&#8217;ve since completed another round of edits, and we&#8217;re beginning to prepare for production now.  Woot!
(Our original working title was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=987&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The book I&#8217;ve been writing with Bill Wake for almost 2 years is now available on Safari Rough Cuts: <a href="http://www.informit.com/store/product.aspx?isbn=0321647920" target="blank">Refactoring in Ruby</a>!  This is a draft we completed a couple of months ago; we&#8217;ve since completed another round of edits, and we&#8217;re beginning to prepare for production now.  Woot!</p>
<p>(Our original working title was <em>Ruby Refactoring Workbook</em>, but apparently that kind of title was likely to limit sales.)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/987/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/987/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/987/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/987/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/987/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/987/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/987/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/987/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/987/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/987/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=987&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=8W2mp_E2M14:kc44FQU367Q:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=8W2mp_E2M14:kc44FQU367Q:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=8W2mp_E2M14:kc44FQU367Q:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=8W2mp_E2M14:kc44FQU367Q:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=8W2mp_E2M14:kc44FQU367Q:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/8W2mp_E2M14" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/06/18/refactoring-in-ruby-is-available-to-buy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/06/18/refactoring-in-ruby-is-available-to-buy/</feedburner:origLink></item>
		<item>
		<title>reek mailing list</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/r47F5PB3WVU/</link>
		<comments>http://silkandspinach.net/2009/06/16/reek-mailing-list/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 19:56:35 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[reek]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=984</guid>
		<description><![CDATA[Discussion about Reek seems to be popping up all over the place at the moment, so I&#8217;ve created a Google group where problems, ideas and suggestions can be shared in one place. I&#8217;ll be making release announcements there and seeking feedback from you on my ideas for Reek&#8217;s future.
So if you&#8217;re using Reek, hop over [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=984&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Discussion about <a href="http://wiki.github.com/kevinrutherford/reek" target="blank">Reek</a> seems to be popping up all over the place at the moment, so I&#8217;ve created a Google group where problems, ideas and suggestions can be shared in one place. I&#8217;ll be making release announcements there and seeking feedback from you on my ideas for Reek&#8217;s future.</p>
<p>So if you&#8217;re using Reek, hop over to <a href="http://groups.google.com/group/ruby-reek" target="blank">http://groups.google.com/group/ruby-reek</a> and let&#8217;s get the ball rolling.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/984/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=984&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=r47F5PB3WVU:oyOUDnuNmx0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=r47F5PB3WVU:oyOUDnuNmx0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=r47F5PB3WVU:oyOUDnuNmx0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=r47F5PB3WVU:oyOUDnuNmx0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=r47F5PB3WVU:oyOUDnuNmx0:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/r47F5PB3WVU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/06/16/reek-mailing-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/06/16/reek-mailing-list/</feedburner:origLink></item>
		<item>
		<title>initial observations on kanban introduction</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/do_c9EJhN7Y/</link>
		<comments>http://silkandspinach.net/2009/06/05/initial-observations-on-kanban-introduction/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 14:40:54 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[value streams]]></category>
		<category><![CDATA[kanban]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=978</guid>
		<description><![CDATA[One of the teams I coach decided this week to adopt kanban-style limits on the WIP at each part of their value stream. It&#8217;s much too early to tell how beneficial this will prove; the transition, though, showed up a few points of interest:

 In order to set WIP limits we had to map the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=978&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One of the teams I coach decided this week to adopt kanban-style limits on the WIP at each part of their value stream. It&#8217;s much too early to tell how beneficial this will prove; the transition, though, showed up a few points of interest:</p>
<ul>
<li> In order to set WIP limits we had to map the company&#8217;s value stream more completely. In retrospect, the previous fuzzy understanding of the value stream had been one cause of the bottlenecks towards the customer end of the process. Kanban was the catalyst to fixing this, but otherwise unrelated.
<li> Re-mapping the value stream temporarily focussed everyone on clearing some inventory, because a couple of WIP piles were initially bigger than the WIP limits we had all agreed.
<li> We quickly discovered that some of the existing inventory was caused by cards only having customer value in batches. Cards had been held up in huge piles at the &#8220;Beta&#8221; and &#8220;UAT&#8221; stages, because they didn&#8217;t represent stand-alone demonstratable user value.
<li> The introduction of WIP limits helped everyone to realise that the cards had been representing engineering tasks rather than customer value. So either the WIP limits had to be multiplied by the number of engineering tasks per user story, or future cards had to change and <em>become</em> user stories.
<li> The introduction of WIP limits also served to focus everyone&#8217;s attention on the whole value stream. Previously the developers had been throwing cards &#8220;over the wall&#8221; into &#8220;Beta&#8221; and &#8220;UAT&#8221; and then forgetting about them. WIP limits quickly encouraged the developers to address bottlenecks in all areas.
<li> Some of the existing value stream stages turned out to be buffers for others; and at least two of these buffers were &#8220;discovered&#8221; during the mapping exercise. We set low WIP limits on these buffers, to help squash the &#8220;over the wall&#8221; mentality.
</ul>
<p>No doubt WIP limits will throw up other subtle side-effects as the next month or so unfolds. Interesting times ahead&#8230;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/978/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/978/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/978/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=978&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=do_c9EJhN7Y:tOC1rOJ33Pk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=do_c9EJhN7Y:tOC1rOJ33Pk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=do_c9EJhN7Y:tOC1rOJ33Pk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=do_c9EJhN7Y:tOC1rOJ33Pk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=do_c9EJhN7Y:tOC1rOJ33Pk:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/do_c9EJhN7Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/06/05/initial-observations-on-kanban-introduction/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/06/05/initial-observations-on-kanban-introduction/</feedburner:origLink></item>
		<item>
		<title>discussion on TDD and code analysis tools</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/B860P3ZQ41g/</link>
		<comments>http://silkandspinach.net/2009/06/01/discussion-on-tdd-and-code-analysis-tools/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 08:08:15 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[quality]]></category>
		<category><![CDATA[reek]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=975</guid>
		<description><![CDATA[During the last few weeks I&#8217;ve been participating in an email discussion about the relationship between static analysis tools (such as Reek) and TDD. The discussion was instigated by Pat Eyler, and he has now organised and posted the results on his On-Ruby blog.
To help me get an initial handle on the topic, I found [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=975&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>During the last few weeks I&#8217;ve been participating in an email discussion about the relationship between static analysis tools (such as <a href="http://wiki.github.com/kevinrutherford/reek" target="blank">Reek</a>) and TDD. The discussion was instigated by Pat Eyler, and he has now organised and <a href="http://on-ruby.blogspot.com/2009/05/questions-five-ways-static-code.html" target="blank">posted the results on his On-Ruby blog</a>.</p>
<p>To help me get an initial handle on the topic, I found it extremely useful to list the main areas of discomfort I feel when using Reek in my own work. Then for each of these (there were two) I constructed conflict clouds to get a balanced view of the problem. I don&#8217;t have the clouds to hand now, but you can read the results in Pat&#8217;s article. I&#8217;ll definitely be using that technique again, because it very quickly helped me to organise my thoughts.  (Note to self: throw <strong>nothing</strong> away.)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/975/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=975&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=B860P3ZQ41g:sFXRHD_HTCU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=B860P3ZQ41g:sFXRHD_HTCU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=B860P3ZQ41g:sFXRHD_HTCU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=B860P3ZQ41g:sFXRHD_HTCU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=B860P3ZQ41g:sFXRHD_HTCU:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/B860P3ZQ41g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/06/01/discussion-on-tdd-and-code-analysis-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/06/01/discussion-on-tdd-and-code-analysis-tools/</feedburner:origLink></item>
		<item>
		<title>crap4r</title>
		<link>http://feedproxy.google.com/~r/SilkAndSpinach/~3/t9-70r84yLg/</link>
		<comments>http://silkandspinach.net/2009/05/22/crap4r/#comments</comments>
		<pubDate>Fri, 22 May 2009 13:38:34 +0000</pubDate>
		<dc:creator>Kevin Rutherford</dc:creator>
				<category><![CDATA[quality]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[metrics]]></category>

		<guid isPermaLink="false">http://silkandspinach.net/?p=971</guid>
		<description><![CDATA[Inspired by Uncle Bob&#8217;s use of crap4j, and egged on somewhat by various members of the Twitterverse, Marty Andrews and I have spiked crap4r on Github. This version looks for Rspec examples in all files called spec/**/*_spec.rb; then it runs them using Rcov and calculates the CRAP metric using code from Roodi. Very neat.
It&#8217;s all [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=971&subd=silkandspinach&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Inspired by Uncle Bob&#8217;s <a href="http://blog.objectmentor.com/articles/2009/05/20/clean-code-and-battle-scarred-architecture" target="blank">use</a> of <a href="http://www.crap4j.org/" target="blank">crap4j</a>, and egged on somewhat by various members of the Twitterverse, <a href="http://blog.martyandrews.net/" target="blank">Marty Andrews</a> and I have spiked crap4r on Github. This version looks for Rspec examples in all files called <code>spec/**/*_spec.rb</code>; then it runs them using Rcov and calculates the CRAP metric using code from Roodi. Very neat.</p>
<p>It&#8217;s all a bit scrappy and difficult to use right now, but we&#8217;ve proved the concept, and over the next few weeks we&#8217;ll get it licked into shape and (hopefully) published as a gem.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/silkandspinach.wordpress.com/971/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/silkandspinach.wordpress.com/971/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/silkandspinach.wordpress.com/971/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/silkandspinach.wordpress.com/971/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/silkandspinach.wordpress.com/971/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/silkandspinach.wordpress.com/971/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/silkandspinach.wordpress.com/971/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/silkandspinach.wordpress.com/971/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/silkandspinach.wordpress.com/971/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/silkandspinach.wordpress.com/971/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=silkandspinach.net&blog=1064186&post=971&subd=silkandspinach&ref=&feed=1" /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=t9-70r84yLg:PVT3Y2ti5-g:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=t9-70r84yLg:PVT3Y2ti5-g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=t9-70r84yLg:PVT3Y2ti5-g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/SilkAndSpinach?a=t9-70r84yLg:PVT3Y2ti5-g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/SilkAndSpinach?i=t9-70r84yLg:PVT3Y2ti5-g:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/SilkAndSpinach/~4/t9-70r84yLg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://silkandspinach.net/2009/05/22/crap4r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9c39ead2d025bde14f3f39b20ff7d113?s=96&amp;d=identicon&amp;r=G" medium="image">
			<media:title type="html">kevinrutherford</media:title>
		</media:content>
	<feedburner:origLink>http://silkandspinach.net/2009/05/22/crap4r/</feedburner:origLink></item>
	</channel>
</rss>
