<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>henko.net</title>
	
	<link>http://henko.net</link>
	<description>Home of a human being and tech manager</description>
	<pubDate>Mon, 17 Nov 2008 23:06:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/henko" type="application/rss+xml" /><item>
		<title>Cross-Functional Teams</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/455673435/</link>
		<comments>http://henko.net/imperfection/cross-functional-teams/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 07:00:43 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://henko.net/?p=381</guid>
		<description><![CDATA[A buzz word within the Agile camp is &#8221;cross-functional teams&#8221;. For some reason though, there seems to be quite some confusion about what it really means. More precisely, it seems that some people argue for that members of a cross-functional teams should be generalists rather than specialists, that everyone should be able to do every [...]]]></description>
			<content:encoded><![CDATA[<p>A buzz word within the Agile camp is &#8221;cross-functional teams&#8221;. For some reason though, there seems to be quite some confusion about what it really means. More precisely, it seems that some people argue for that members of a cross-functional teams should be generalists rather than specialists, that everyone should be able to do every job. Other argue the opposite.</p>

<h3>Definitions</h3>

<p><a href="http://en.wikipedia.org/wiki/Cross-functional_team" title="According to Wikipedia">According to Wikipedia</a>, a cross-functional team is:</p>

<blockquote>
  <p>A group of people with different functional expertise working toward a common goal. It may include people from finance, marketing, operations, and human resources departments. Typically, it includes employees from all levels of an organization.</p>
</blockquote>

<p>If we instead look at the definition of a cross-functional team in Wikipedia&#8217;s <a href="http://en.wikipedia.org/wiki/Agile_software_development" title="Agile Software Development">Agile Software Development</a> article, we learn that such a team &#8220;is usually cross-functional and self-organizing without consideration for any existing corporate hierarchy or the corporate roles of team members.&#8221; This seems to suggest that the meaning of cross-functional in agile is often interpreted a bit differently.</p>

<h3>Why confusion arises</h3>

<p>Part of the problem might be that leaders in the field are sometimes a bit unclear. For example, reading Henrik Kniberg&#8217;s otherwise excellent piece on <a href="http://blog.crisp.se/henrikkniberg/2007/05/07/1178493480000.html" title="agile testing">agile testing</a> quickly, you can easily get the perception that he is arguing for the generalist approach. Quotes such as the following certainly helps one reaching such a conclusion.</p>

<blockquote>
  <p>In agile projects, testing is considered to be far too important to be confined to a single role, a single team, or a single project phase. Having a role called Tester implies that others don&#8217;t need to test. In an agile project almost everyone tests.</p>
</blockquote>

<p>On the other hand, if you read it more carefully, he is actually arguing for a specialist approach. (Although he plays safe &#8212; and increases confusion &#8212; by calling them generalizing specialists.) Anyhow, this quote gives a rather other feeling than the previous.</p>

<blockquote>
  <p>Since the programmers have automated all the boring, repetetive tests, you are free to focus on the hard stuff. The stuff that is difficult to automate. Exploratory testing. Usability testing. Performance test scripts. Figuring out those tricky test cases that only a veteran like you could come up with.</p>
</blockquote>

<p>Finally, in his own words:</p>

<blockquote>
  <p>Agile teams are cross functional, they are made up of generalizing specialists. People who are experts at certain areas, but have basic knowledge of a whole bunch of other areas as well. A team of generalizing specialists is extremely fast at learning and adapting.</p>
</blockquote>

<h3>Why specialists?</h3>

<p>For me, I&#8217;m in the specialists camp. As some form of evidence, I&#8217;d like to quote Marcus Buckingham and Curt Coffman from the great book <a href="http://www.amazon.com/gp/product/0684852861?ie=UTF8&amp;tag=henkonet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0684852861">First, Break All the Rules</a><img src="http://www.assoc-amazon.com/e/ir?t=henkonet-20&amp;l=as2&amp;o=1&amp;a=0684852861" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.</p>

<blockquote>
  <p>Great managers do not believe that a productive team has camaraderie as its cornerstone and team members who can play all roles equally well. On the contrary, they define a productive team as one where each person knows which role he plays best and where he is cast in that role most of the time. &#8230; The founding principle here is that excellent teams are built around individual excellence.</p>
</blockquote>

<p>The nice part about this last quote is that it is not simply anecdotal &#8220;evidence&#8221;, but actually conclusions drawn by the Gallup organization after interviewing over 80 000 managers!</p>

<h3>Your experience?</h3>

<p>What&#8217;s your experience in the matter? Is specialist or generalist the way to go?</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/455673435" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/cross-functional-teams/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/cross-functional-teams/</feedburner:origLink></item>
		<item>
		<title>Join a Proud Minority, Read Books</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/448114489/</link>
		<comments>http://henko.net/imperfection/join-a-proud-minority-read-books/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 07:00:30 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://henko.net/?p=312</guid>
		<description><![CDATA[A few days ago, I a girl caught my attention on the tram. Now, a lot of girls catch my attention, but this time it wasn&#8217;t actually the girl herself but her shoulder bag which caught my attention. It happened to have a print which I thought was pretty funny.


  Join a proud minority [...]]]></description>
			<content:encoded><![CDATA[<p><script type='text/javascript' language='javascript' src='http://s3.polldaddy.com/p/1049315.js'></script><noscript> <a href='http://answers.polldaddy.com/poll/1049315/'>View Poll</a></noscript></p>

<p>A few days ago, I a girl caught my attention on the tram. Now, a lot of girls catch my attention, but this time it wasn&#8217;t actually the girl herself but her shoulder bag which caught my attention. It happened to have a print which I thought was pretty funny.</p>

<blockquote>
  <p>Join a proud minority &#8212; read books.</p>
</blockquote>

<p>First I thought that was rather witty, but then it actually made me sad. Are people who read books (by free will) actually a minority? If I restrict myself to the software development world, then apparently they are. According to DeMarco and Lister in <a href="http://www.amazon.com/gp/product/0932633439?ie=UTF8&amp;tag=henkonet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0932633439">Peopleware</a>:<img src="http://www.assoc-amazon.com/e/ir?t=henkonet-20&amp;l=as2&amp;o=1&amp;a=0932633439" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p>

<blockquote>
  <p>The statistics about reading are particularly discouraging: The average software developer, for example, doesn&#8217;t own a single book on the subject of his or her work, and hasn&#8217;t ever read one. That fact is horrifying for anyone concerned about the quality of work in the field.</p>
</blockquote>

<p>Consider if this would have been some other field, say medicine. Would you have liked to hear your surgeon say, &#8220;nah, I don&#8217;t really read books, I base most of what I do on reading blogs&#8221;. I sure wouldn&#8217;t!</p>

<h3>Why you should read books</h3>

<p>Alright, why should you read books? Why not just read blogs? Good question! And here&#8217;s why:</p>

<p><strong>Books are better than blogs!</strong></p>

<p>Now, that&#8217;s a pretty tough argument. Of course, I&#8217;m not saying that blogs are bad, but what I am saying is that so much more work has been put into the really great books than into any blog out there. Don&#8217;t waste all that work! By reading books, you will learn stuff you otherwise wouldn&#8217;t have and you&#8217;ll get a deeper understanding of it.</p>

<p>Now, don&#8217;t get me wrong. Blogs are truly essential and a great part of the internet. All programmers should consider themselves very lucky for having access to all that material. However, their content is typically only good after a couple of loops in the echo chamber (aka blogosphere). When you buy a (good) book, the material you get is already refined, it has already gone through all that necessary editing.</p>

<h3>When not to buy books</h3>

<p>You might ask yourself, why should I buy books which will be outdated in a year anyway? Also, there are no hyperlinks in books. Books suck! Well, in this regard, I completely agree. The answer is:</p>

<p><strong>Don&#8217;t buy reference books.</strong></p>

<p>Here I&#8217;m going to quote Jeff Atwood, because he <a href="http://www.codinghorror.com/blog/archives/001108.html" title="explained it">explained it</a> very nicely.</p>

<blockquote>
  <p>The best programming books are timeless. They transcend choice of language, IDE, or platform. They do not explain how, but why. If you feel compelled to clean house on your bookshelf every five years, trust me on this, you&#8217;re buying the wrong programming books.</p>
</blockquote>

<h3>How about you?</h3>

<p>So, that&#8217;s my thoughts on the subject. What do you think? Do you read books? What is the best book you&#8217;ve read? The worst? Why? Answer with a comment!</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/448114489" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/join-a-proud-minority-read-books/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/join-a-proud-minority-read-books/</feedburner:origLink></item>
		<item>
		<title>People Who Are Smarter Than I Am</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/440687036/</link>
		<comments>http://henko.net/imperfection/people-who-are-smarter-than-i-am/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 07:00:54 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://henko.net/?p=330</guid>
		<description><![CDATA[I have realized that some people are smarter than I am. It is a painful realization but I just can&#8217;t ignore the evidence any longer. Allow me to explain.



I often get inspiration to write posts from reading books or blogs by really smart people. Thus, I often refer to people who are smarter than me. [...]]]></description>
			<content:encoded><![CDATA[<p>I have realized that some people are smarter than I am. It is a painful realization but I just can&#8217;t ignore the evidence any longer. Allow me to explain.</p>

<p><a href="http://flickr.com/photos/nelsonlai/1258727102/"><img src="http://henko.net/wp-content/uploads/2008/11/1258727102_3a89581878_m1.jpg" alt="Sign: No understanding at any time." title="No understanding (Image copyright by Nelson Lai)" class="alignright size-medium wp-image-362" /></a></p>

<p>I often get inspiration to write posts from reading books or blogs by really smart people. Thus, I often refer to people who are smarter than me. Sometimes I&#8217;m lucky enough to get comments from these people on my posts. While I&#8217;m typically rather convinced by my own reasoning when I write the post in question, every time I get such a comment I am struck by how much smarter they are than me.</p>

<p>Recent cases where this has happened:</p>

<ul>
<li><a href="http://henko.net/imperfection/not-converging-on-an-estimate/#comment-10420" title="Mike Cohns comment">Mike Cohns comment</a> on <a href="http://henko.net/imperfection/not-converging-on-an-estimate/" title="Not Converging on an Estimate">Not Converging on an Estimate</a>:  I discussed an adaption of some advice he gave in a book. However, my adaption forced me to ignore other parts of the same advice. He pointed out that there was no problem in actually doing both parts.</li>
<li><a href="http://henko.net/imperfection/full-statement-coverage/" title="Full statement coverage">Full Statement Coverage</a>: I wondered why Ron Jeffries was writing such sloppy unit tests in <a href="http://search.atomz.com/search/?sp-q=sudoku&amp;sp-a=sp01062000&amp;sp-advanced=1&amp;sp-p=any&amp;sp-w-control=1&amp;sp-d=custom&amp;sp-date-range=-1&amp;sp-start-month=0&amp;sp-start-day=0&amp;sp-start-year=&amp;sp-end-month=0&amp;sp-end-day=0&amp;sp-end-year=&amp;sp-x=title&amp;sp-c=10&amp;sp-m=1&amp;sp-s=0" title="some of his articles">some of his articles</a>. He didn&#8217;t seem to test even half of the code he wrote. A short email conversation later I had realized that he of course wasn&#8217;t sloppy, but rather just much more clever than I was.</li>
</ul>

<p>So, I simply hadn&#8217;t understood what they meant the first time? I don&#8217;t believe it&#8217;s as simple as that. I think I did understand. Most of the time anyway. But my level of understanding just wasn&#8217;t as deep as theirs.</p>

<p>The upside is that every such moment makes me a little bit smarter! <img src='http://henko.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Have you experienced a similar situation? What was your latest &#8220;revelation&#8221;?</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/440687036" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/people-who-are-smarter-than-i-am/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/people-who-are-smarter-than-i-am/</feedburner:origLink></item>
		<item>
		<title>Not Converging on an Estimate</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/433270471/</link>
		<comments>http://henko.net/imperfection/not-converging-on-an-estimate/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 06:00:06 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Planning]]></category>

		<guid isPermaLink="false">http://henko.net/?p=234</guid>
		<description><![CDATA[In his great book User Stories Applied, Mike Cohn suggests that &#8220;the goal is for the estimators to converge on a single estimate.&#8221; While discussing this with a senior product owner at a major Swedish telco (guess which one!), I came to realize that there might be a point in not converging on a single [...]]]></description>
			<content:encoded><![CDATA[<p>In his great book <a href="http://www.amazon.com/gp/product/0321205685?ie=UTF8&amp;tag=henkonet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321205685">User Stories Applied</a><img src="http://www.assoc-amazon.com/e/ir?t=henkonet-20&amp;l=as2&amp;o=1&amp;a=0321205685" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, Mike Cohn suggests that &#8220;the goal is for the estimators to converge on a single estimate.&#8221; While discussing this with a senior product owner at a major Swedish telco (guess which one!), I came to realize that there might be a point in <em>not</em> converging on a single estimate when doing time estimation.</p>

<div class="alignmiddle">
<a href="http://flickr.com/photos/dcassaa/520211405/"><img src="http://henko.net/wp-content/uploads/2008/10/converge-300x76.jpg" alt="" title="Converge. (Image copyright by Davide Cassanello)" width="300" height="76" class="size-medium wp-image-285" /></a>
</div>

<h3>The steps</h3>

<p>I tried to perform the following steps.</p>

<ol>
<li>Define the scope of what you&#8217;re estimating.</li>
<li>As Mike Cohn suggests, ask each developer to make an estimate and write it down.</li>
<li>After everybody has made up their own mind, take note of all estimates.</li>
<li>Discuss the estimates if wanted, but do <em>not</em> revise them! (Unless someone completely misunderstood the scope.)</li>
</ol>

<p>By writing the scores down and not revising them, developers do not get a chance to influence each other. If all of these original, uninfluenced, estimates are close to each other, you can probably be more secure with that estimate. On the other hand, if they are spread out you get an indication that risk is rather high. Estimating this way actually gives you more information, as you not only get a mean value from the estimates, but also a precision or confidence interval.</p>

<h3>Related thoughts</h3>

<p>Max Pool has been arguing for <a href="http://www.codesqueeze.com/quit-sweeping-known-uncertainity-under-the-rug/" title="a similar approach">a similar approach</a>, where you estimate in ranges. However, using the approach suggested above, you don&#8217;t have to set a percentage probability yourself (which might be a hard number to come up with) &#8212; you get it for free.</p>

<p>Furthermore, if you think about it, estimating with just a single value is almost meaningless anyway &#8212; you&#8217;ve always got a precision, that is, an interval. When you say that something will take &#8220;2 days&#8221;, what is the precision? Two days within a second? Minute? Hour? Day? Week? Also, is it an upper bound? Lower bound? Mean value? Using an interval gives you a good way of making these assumptions much more explicit.</p>

<p>What are your thoughts? Have you estimated using something else than a point value? Do you disagree? Let me know!</p>

<h3>Update</h3>

<p>In his comment below, Mike Cohn pointed out that I in fact can have my cake and eat it too. I can use the highest estimate as a &#8220;upper bound&#8221; and also continue discussing and re-estimating until everybody agrees on a single estimate. That way we get a range but do not lose the valuable discussion during the convergence.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/433270471" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/not-converging-on-an-estimate/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/not-converging-on-an-estimate/</feedburner:origLink></item>
		<item>
		<title>Minimizing Irreversible Actions</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/426110289/</link>
		<comments>http://henko.net/imperfection/minimizing-irreversible-actions/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 06:00:11 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Principles]]></category>

		<guid isPermaLink="false">http://henko.net/?p=173</guid>
		<description><![CDATA[Reading Lean Software Development, I stumbled upon the following quote.


  As a keynote speaker at a software conference, Enrico Zaninotto, an Italian economist, pointed out that the underlying economic mechanism for controlling complexity in just-in-time systems is minimizing irreversible actions.


The notion of &#8220;minimizing irreversible actions&#8221; strikes me as a better way of capturing that [...]]]></description>
			<content:encoded><![CDATA[<p>Reading <a href="http://www.amazon.com/gp/product/0321150783?ie=UTF8&amp;tag=henkonet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321150783">Lean Software Development</a><img src="http://www.assoc-amazon.com/e/ir?t=henkonet-20&amp;l=as2&amp;o=1&amp;a=0321150783" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, I stumbled upon the following quote.</p>

<blockquote>
  <p>As a keynote speaker at a software conference, Enrico Zaninotto, an Italian economist, pointed out that the underlying economic mechanism for controlling complexity in just-in-time systems is minimizing irreversible actions.</p>
</blockquote>

<p><a href="http://flickr.com/photos/lucias_clay/2699584043/"><img src="http://henko.net/wp-content/uploads/2008/10/2699584043_a50b5056a4_m.jpg" alt="" title="Irreversible decision. (Image copyright by Lucias Clay)" width="118" height="240" class="alignright size-full wp-image-178" /></a>The notion of &#8220;minimizing irreversible actions&#8221; strikes me as a better way of capturing that whole idea than the more established &#8220;<a href="http://www.codinghorror.com/blog/archives/000705.html" title="last responsible moment">last responsible moment</a>&#8220;. The latter suggests that you should delay making decisions for as long as you can. I feel that sends the wrong signal. You can make decisions. You <em>must</em> make decisions. Not making a decision is a decision in itself. Just don&#8217;t make decisions that you cannot change &#8212; keep your options open. By thinking that you must not make decisions until the &#8220;last responsible moment&#8221;, it is easy to delay the decision longer than is actually responsible.</p>

<p>I believe this is especially true for software architecture. In the name of &#8220;last responsible moment&#8221;, many developers <a href="http://henko.net/imperfection/do-design/" title="Do design, just not Big and Up Front">avoid making architectural decisions</a>, thinking the architecture will emerge by itself. But to quote Grady Booch in a response to a letter &#8220;The Relevance of Architecture&#8221; in IEEE Software (Volume 24 Number 5).</p>

<blockquote>
  <p>Every system has an architecture; some are accidental, others intentional.</p>
</blockquote>

<p>Which is yours?</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/426110289" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/minimizing-irreversible-actions/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/minimizing-irreversible-actions/</feedburner:origLink></item>
		<item>
		<title>Metaphors of Software Development</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014604/</link>
		<comments>http://henko.net/imperfection/metaphors-of-development/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 06:00:30 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://henko.net/?p=155</guid>
		<description><![CDATA[I&#8217;m really starting to get annoyed by people who insist on comparing creating software to building a car, and software development to an assembly line. That might have worked more or less fine with old, long forgotten(?), waterfall processes. But wake up, we don&#8217;t do software that way any more &#8212; most of us anyway.

The [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://henko.net/wp-content/uploads/2008/10/no-car1.png" alt="" title="No cars please" width="150" height="150" class="alignright" />I&#8217;m really starting to get annoyed by people who insist on comparing creating software to building a car, and software development to an assembly line. That might have worked more or less fine with old, long forgotten(?), <a href="http://henko.net/imperfection/agile-soon-considered-harmful/" title="Agile (Soon) Considered Harmful?">waterfall processes</a>. But wake up, we don&#8217;t do software that way any more &#8212; most of us anyway.</p>

<p>The problem with this comparison is that it&#8217;s simply wrong. I&#8217;m fine with comparing creating software with creating a car. But the closest thing to an assembly line in software development is the work done by build and deployment scripts, turning source code into executable software. The actual analysis, design, and coding corresponds to developing a brand new car model. It is a creative process without a single given &#8220;right answer&#8221; and of which experimentation and iteration are natural ingredients.</p>

<p>To use another metaphor, and at the same time cite <a href="http://www.poppendieck.com/" title="Mary and Tom Poppendieck">Mary and Tom Poppendieck</a> from their book <a href="http://www.amazon.com/Lean-Software-Development-Agile-Toolkit/dp/0321150783" title="Lean Software Development">Lean Software Development</a>:</p>

<blockquote>
  <p>Development is like creating a recipe, while production is like making the dish. Recipes are designed by experienced chefs who have developed an instinct for what works and the capability to adapt available ingredients to suit the occasion. Yet even great chefs produce several variations of a new dish as they iterate toward a recipe that will taste great and be easy to reproduce.</p>
</blockquote>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014604" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/metaphors-of-development/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/metaphors-of-development/</feedburner:origLink></item>
		<item>
		<title>Commit message too long</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014610/</link>
		<comments>http://henko.net/imperfection/commit-message-too-long/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 06:00:30 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://henko.net/?p=133</guid>
		<description><![CDATA[This time, I&#8217;ll just provide a short note of insight regarding checking code into version control.

If a commit message feels very long, or you feel a resistance against writing it because you don&#8217;t know what to write, it has probably been too long since you last committed! If you commit after each task is done, [...]]]></description>
			<content:encoded><![CDATA[<p>This time, I&#8217;ll just provide a short note of insight regarding checking code into version control.</p>

<p>If a commit message feels very long, or you feel a resistance against writing it because you don&#8217;t know what to write, it has probably been too long since you last committed! If you commit after each task is done, writing a good one-sentence message is a no-brainer.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014610" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/commit-message-too-long/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/commit-message-too-long/</feedburner:origLink></item>
		<item>
		<title>Better, not perfect</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014615/</link>
		<comments>http://henko.net/imperfection/better-not-perfect/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 20:00:32 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Principles]]></category>

		<guid isPermaLink="false">http://henko.net/?p=122</guid>
		<description><![CDATA[My apartment is not always in perfect condition, and cleaning up that mess isn&#8217;t exactly what I look forward to. Therefore, in a discussion with a friend about this subject, I complained about that I couldn&#8217;t come up with good rules for myself on how and when to clean. (I like rules &#8212; simple, consistent, [...]]]></description>
			<content:encoded><![CDATA[<p>My apartment is not always in perfect condition, and cleaning up that mess isn&#8217;t exactly what I look forward to. Therefore, in a discussion with a friend about this subject, I complained about that I couldn&#8217;t come up with good rules for myself on how and when to clean. (I like rules &#8212; simple, consistent, and easy-to-follow rules.)</p>

<p>Every time I manage to actually do a proper cleaning of my apartment, I usually think: &#8220;Okay, now the apartment is clean, it shouldn&#8217;t be too difficult to keep it this way. I&#8217;ll just make sure that after every day it is still clean.&#8221; That&#8217;s a great rule in theory but it never works in practice. As soon as you slip, and let the apartment get messy, you&#8217;re lost. It has now become more of a mess than you can muster energy for to clean up.</p>

<h3>A different strategy</h3>

<p>But my friend suggested a different strategy: &#8220;Before you go to bed every night, make sure that the apartment is at least a little bit cleaner than it was when you woke up.&#8221; This rule has worked out extremely well for me. They both work fine as long as I follow them every single day. The difference is when I slip, when I allow the apartment to become a bit of a mess, I won&#8217;t automatically freeze and ignore it. All I have to do is to remove <em>one</em> single thing from the floor or wash <em>one</em> single glass, and I will have fulfilled my promise. If I just keep doing this, my apartment will eventually be clean. And also, once I&#8217;ve picked this single thing from the floor, or washed that single glass, it&#8217;s rather easy to take another and a third one as well.</p>

<p>When your apartment finally is clean, you&#8217;ll have to use a bit more imagination to fulfill the rule. You might archive those payed bills lying in your closet, remove the clothes you never use in your wardrobe and send them to a suitable charity, or do any other thing that you&#8217;ve long thought of doing. This would never even have happened with my first rule as it would have acknowledged my apartment as clean and I would need to do no work.</p>

<h3>In software development</h3>

<p>The reason I&#8217;m talking here about cleaning my apartment, is that I believe the very same principle applies to software development as well. It&#8217;s easy to ignore accumulating technical debt in your system, become paralyzed by it, and not have energy to deal with it. In that situation, just ensure that the system gets <a href="http://henko.net/imperfection/improve-as-you-go/" title="Improve as you go">a little better by every commit</a>, and one day, you&#8217;ll realize that your system is really in quite nice shape. So don&#8217;t aspire to be perfect, just to become better every day and you&#8217;ll get there (or at least very close <img src='http://henko.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014615" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/better-not-perfect/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/better-not-perfect/</feedburner:origLink></item>
		<item>
		<title>Agile (Soon) Considered Harmful?</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014619/</link>
		<comments>http://henko.net/imperfection/agile-soon-considered-harmful/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 19:47:47 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://henko.net/?p=125</guid>
		<description><![CDATA[In the nineties, software development was conceptually simple and straight-forward; you gathered requirements for the system, designed it, built it, tested it and deployed it. This was the era of waterfall, RUP, UML, and lots of up-front design. The more details decided in advance, the less costs from changing later, and thus, the better.

Then, somewhere [...]]]></description>
			<content:encoded><![CDATA[<p>In the nineties, software development was conceptually simple and straight-forward; you gathered requirements for the system, designed it, built it, tested it and deployed it. This was the era of waterfall, <acronym title='Rational Unified Process'>RUP</acronym>, <acronym title='Unified Modelling Language'>UML</acronym>, and lots of up-front design. The more details decided in advance, the less costs from changing later, and thus, the better.</p>

<p>Then, somewhere about the turn of the century, agile development became the preferred way of creating software in the more trendy corners of the development community. Today, mainstream developers have started to follow and software shops all over the place are introducing Scrum, doing test-driven development or using other agile techniques.</p>

<p>In the second edition of his popular book Code Complete, author Steve McConell describes this by saying that while he was writing the first edition, design zealots argued for “big design up-front” (BDUF), and as he was writing the second, software swamis instead argued for “emergent design”, which basically means no initial design at all. As he put it:</p>

<blockquote>In ten years the pendulum has swung from “design everything” to “design nothing”.</blockquote>

<p>Now it seems to me that the pendulum is on its way back.</p>

<p>In an article in IEEE Software, the July/August 2008 issue, Rebecca J. Wirfs-Brock argues in favor of up-front design.</p>

<blockquote>These days, some developers shy away from even suggesting that a project might need up-front design and experimentation. They equate any up-front work with “big design up front” (BDUF) and totally wasted effort. Up-front design needn’t be wasteful if you develop a design rhythm that balances thinking, learning, and doing. You’ll build confidence and sleep better at night.</blockquote>

<p>On a similar note, <a href="http://www.codethinked.com/post/2008/09/13/It-is-BDUF-not-DUF.aspx" title="Justin Etheredge argues">Justin Etheredge argues</a> that some agile developers might be a little bit naïve.</p>

<blockquote>A lot of developers think that agile development represents doing no design up front. That we will figure out what we want to do and then just jump right into coding it without any concern for what we are going to build. Then we will just come back later, refactor the whole thing, and voila, instant working application. Well, it just doesn&#8217;t work that way.</blockquote>

<p>Frans Bouma <a href="http://weblogs.asp.net/fbouma/archive/2008/09/14/is-bduf-really-bduf.aspx" title="adds to the theme">adds to the theme</a>, possibly suggesting that even laziness might be a part of it.</p>

<blockquote>Yes, Software Engineering is hard, deal with it. Don&#8217;t use the excuse that because goals are unknown, because the client changes his mind every day the design therefore has to be done in the code editor. If those are your problems, solve them, deal with them.</blockquote>

<p>My own earlier posts deal with similar issues, such as developers who do <a href="http://henko.net/imperfection/thoughtless-development/" title="Thoughtless Development">TDD without thinking</a>, and that you <a href="http://henko.net/imperfection/do-design/" title="Do design, just not Big and Up Front">can't skip design</a>.</p>

<p>To be fair to gurus arguing for the principles of agile development (which to a large degree I myself believe in), these comments apply more to average developer Joe than the gurus themselves. But then, the gurus are probably smart enough to succeed in building their software no matter what process they use. There are however way more average Joes than gurus, so the points above are still very valid.</p>

<p>Given this shift of thinking, where will we head now? Will the pendulum actually swing right back to BDUF? Will we find the sweet spot between emergent design and up-front design? Or will we rush off once again in a new chase for design nirvana? If so, where will we end up this time? I sure hope for the sweet spot option, but given human nature I’m not convinced. What are your thoughts?</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014619" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/agile-soon-considered-harmful/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/agile-soon-considered-harmful/</feedburner:origLink></item>
		<item>
		<title>Solution: “Specified RequestProcessor not compatible with TilesRequestProcessor”</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014627/</link>
		<comments>http://henko.net/imperfection/specified-requestprocessor-not-compatible-with-tilesrequestprocessor/#comments</comments>
		<pubDate>Fri, 09 May 2008 11:54:21 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://henko.net/?p=124</guid>
		<description><![CDATA[When using Struts 1.3 with Tiles and SSLEXT plug-ins, the application server throws an exception while trying to process a request telling you that the specified request processor isn't compatible with Tiles. Here's the solution.]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>

<p>When using Struts 1.3 with Tiles and SSLEXT plug-ins, the application server throws the following exception while trying to process a request.</p>

<pre><code>SEVERE: Allocate exception for servlet action
javax.servlet.UnavailableException: TilesPlugin : Specified RequestProcessor
        not compatible with TilesRequestProcessor
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:399)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    ...
</code></pre>

<h3>Cause</h3>

<p>You are using a <code>RequestProcessor</code> which does not extend <code>TilesRequestProcessor</code>, most likely <code>org.apache.struts.action.SecureRequestProcessor</code> provided by SSLEXT.</p>

<h3>Solution</h3>

<p>As stated on SSLEXT&#8217;s web page, in order to use Tiles and SSLEXT together, you need to use specific Tiles-enabled custom request processor and plug-in classes. These classes are provided by SSLEXT and their full names classes are:</p>

<ul>
<li><code>org.apache.struts.action.SecureTilesRequestProcessor</code></li>
<li><code>org.apache.struts.tiles.SecureTilesPlugin</code></li>
</ul>

<p>Note that the SSLEXT web page incorrectly states the last class&#8217; name as <code>SecureTilesPlugIn</code> (with a capital i).</p>

<h3>See also</h3>

<ul>
<li><a href="http://sslext.sourceforge.net/" title="http://sslext.sourceforge.net/">http://sslext.sourceforge.net/</a></li>
<li><a href="http://www.jroller.com/JamesGoodwill/entry/using_tiles_and_a_custom" title="http://www.jroller.com/JamesGoodwill/entry/using_tiles_and_a_custom">http://www.jroller.com/JamesGoodwill/entry/using_tiles_and_a_custom</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014627" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/specified-requestprocessor-not-compatible-with-tilesrequestprocessor/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/specified-requestprocessor-not-compatible-with-tilesrequestprocessor/</feedburner:origLink></item>
		<item>
		<title>Increasing sustainable pace</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014631/</link>
		<comments>http://henko.net/imperfection/increasing-sustainable-pace/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 08:50:31 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://henko.net/?p=119</guid>
		<description><![CDATA[In the last few years, especially in the agile corners of the web, there's been quite a lot written about the 40 hour workweek, sustainable pace, no overtime, and so on. I agree with most of this stuff and think exhausted developers in the long run do more harm than good. I can't help to wonder, however, what's so magical about 40 the hour workweek? Why not 35, 45, or even 55? Just playing safe on 40 seems a waste, if my team can do better.]]></description>
			<content:encoded><![CDATA[<p><img src="http://henko.net/wp-content/uploads/2008/04/sustainable-pace.png" alt="" title="" align="right" style="margin: 0.5em 0 0.5em 1em;" />In the last few years, especially in the agile corners of the web, there&#8217;s been quite a lot written about the 40 hour workweek, <a href="http://c2.com/cgi/wiki?SustainablePace" title="sustainable pace">sustainable pace</a>, <a href="http://www.extremeprogramming.org/rules/overtime.html" title="no overtime">no overtime</a>, and <a href="http://www.infoq.com/news/2008/02/crunch_mode_allstar_paradox" title="so on">so on</a>. I agree with most of this stuff and think exhausted developers in the long run do more harm than good.</p>

<p>I can&#8217;t help to wonder, however, what&#8217;s so magical about 40 the hour workweek? Why not 35, 45, or even 55? Also, it will naturally vary among different people. So I want to know where to draw the line. Just playing safe on 40 seems a waste, if my team can do better.</p>

<h3>The capacity model</h3>

<p>In the figure above, I&#8217;ve created a simple model for how I imagine things work. It&#8217;s pretty safe to assume that everyone has a <em>maximum</em> productivity level, over which it is simply not possible to get. I&#8217;d say this maximum is defined by the programmers talent. No matter how much experience, practice or training one gets, there&#8217;s still some basic inherent talent level which defines one&#8217;s maximum. (If nothing else, let it be the number of words per minute the developer can type.)</p>

<p>More interestingly, we&#8217;ve got a current <em>capacity</em> which is the highest amount we can currently produce without lowering quality. A sustainable pace is any pace which is below this current capacity. That is, we can keep going at this rate forever, without accumulating any technical debt. We can go above it once in a while too, in a coding crunch, but then we start accumulating technical debt. This forces us to work at a lower rate later to pay back.</p>

<h3>How do you go faster?</h3>

<p>There are at least two interesting questions in this model. First, how do you find your current capacity? I believe that question can be answered empirically by increasing development speed until developers start getting (too) tired and bugs start to slip in. The second, and more interesting, question is: how do you raise your current capacity? To answer this, we must first answer another question which is: what defines your capacity? (In the figure, this unknown entity is called <em>x</em>.) My best bet is <a href="http://stevemcconnell.com/articles/art05.htm" title="motivation">motivation</a> with a tad of discipline thrown in for good measure.</p>

<p>To sum up, my point is that while we want to achieve a sustainable pace in development, we shouldn&#8217;t have to limit ourselves to 40 hours per week. If we can hold a sustainable pace of say 45 hours per week, as opposed to 40, we gain <em>more than one month</em> of extra development time during a year! Especially in start-ups, such as where I work, 40 hours a week is a luxury one cannot afford. Large companies such as Microsoft and Google also very much rely on peoples desire for and ability to work (much) more than 40 hours per week. So the question is, how do we increase our development pace while keeping it sustainable? Is it possible? (I sure hope so.) If so, how do you do?</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014631" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/increasing-sustainable-pace/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/increasing-sustainable-pace/</feedburner:origLink></item>
		<item>
		<title>Improve as you go</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014639/</link>
		<comments>http://henko.net/imperfection/improve-as-you-go/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 18:42:10 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Principles]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/improve-as-you-go/</guid>
		<description><![CDATA[Sometimes we come to situation where we need to perform a major change in our code base, one that is likely to affect more or less the whole system and that would require many man-weeks to complete. Time that we typically do not have in the condensed schedule of a modern software development project. By performing the improvement step by step, at each commit, we can amortize the time spent over the course of the project, yet ensure that it performed.]]></description>
			<content:encoded><![CDATA[<p>Sometimes we come to situation where we need to perform a major change in our code base, one that is likely to affect more or less the whole system. This might be a application-wide refactoring such as extracting business logic from the controller into the model. It can be introducing in-code documentation into a undocumented system, or introducing unit tests in a legacy system (because only system&#8217;s we&#8217;ve inherited is lacking unit tests, right?).</p>

<p>No matter exactly what task it is, we&#8217;ll assume that completing it is something that would require many man-weeks to complete. Time that we typically do not have in the condensed schedule of a modern software development project. Thus, it can be hard to motivate spending the resources that would be required to perform such a change. All to often, this leads to a situation where change is regarded as &#8220;something that should be done, but which we don&#8217;t have time for right now&#8221;. That is the same thing as &#8220;something we will never do&#8221;. Furthermore, as we typically perform the improvement in order to make the code base easier to work with in the future, we want to  prioritize the parts of the system where we spend most of our development time.</p>

<h3>A simple rule</h3>

<p>In situations like this, I suggest the following rather simple rule.</p>

<blockquote>
  <p>Every time you commit, ensure that all files in that changeset are updated to the new standard.</p>
</blockquote>

<p>Thus, if your current commit touches a controller which contains business logic, you may not commit until you&#8217;ve extracted and merged it into the model. Or if your commit touches an undocumented or untested class, you may not commit until that problem has been corrected.</p>

<h3>Rationale</h3>

<p>The rationale behind this recommendation is twofold. First, the performing the change won&#8217;t feel like a gigantic task, as it only involves modifying a couple of classes at any time. This helps to get around the &#8220;something that should be done, but which we don&#8217;t have time for right now&#8221; problem. This helps to amortize the work over the course of the project.</p>

<p>Secondly, you don&#8217;t spend time on updating files on which no one is working. This connects to the assumption that the improvement is done in order to make the code base easier to work with. Thus, as long as no one is working on a file, there is no need to make the improvement there. However, as soon as someone touches that file, it will brought up to the new standard. This is really just the <a href="http://www.codinghorror.com/blog/archives/000705.html" title="Last Responsible Moment">Last Responsible Moment</a> principle, or <a href="http://c2.com/xp/YouArentGonnaNeedIt.html" title="YAGNI">YAGNI</a>, put in a slightly different context.</p>

<p>As a bonus we reduce the risk that the change introduces bugs. This is because, as opposed to performing the change in one big go, only code on which the developer has just been working is updated. Thus, the developer is more familiar with the code and is in a better position to avoid introducing bugs by breaking non-obvious relationships and dependencies in the code. This advantage becomes more important the worse shape the code in question is in.</p>

<h3>Possible drawbacks</h3>

<p>To be fair, I should mention possible drawbacks. The major argument against this method is that the system is left in a &#8220;in between&#8221; state for an extended period of time. Depending on the type of change this could become problematic. If you&#8217;re switching from using one library to another, you might for a while be dependent on both libraries rather than any one of them. This might in turn create confusion about what library to use. Or if the system is in the middle of a major large scale refactoring, developers might in the same way be confused about the correct way to implement a feature.</p>

<p>I think that the best solution to this problem is to ensure that all developers are aware of what is happening. It&#8217;s really a question about communication within the team. Exactly how to solve this potential problem depends on the team. You can create a list of ongoing improvements which everybody can check when in doubt or when committing. You can emphasize collective ownership of the code and use pair programming to spread knowledge. Do whatever fits your team, as long as you consciously considers and manages the risk.</p>

<h3>Summing it up</h3>

<p>All in all, I think performing large scale changes in many smaller chunks is the preferred way to go. Pay off some of your <a href="http://www.martinfowler.com/bliki/TechnicalDebt.html" title="technical debt">technical debt</a> every day, rather than all of it at once. After all, to pay off your whole technical debt at once, you most likely will have to take on debt of some other kind &#8212; economical, working overtime, or implementing less new business value.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014639" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/improve-as-you-go/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/improve-as-you-go/</feedburner:origLink></item>
		<item>
		<title>Story Cards on a Whiteboard</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014643/</link>
		<comments>http://henko.net/imperfection/story-cards-on-a-whiteboard/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 09:31:07 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Planning]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/story-cards-on-a-whiteboard/</guid>
		<description><![CDATA[I just found what might be the greatest thing since sliced bread. It is so smart, so ingenious, that it made me excited like a child on Christmas for a whole week.]]></description>
			<content:encoded><![CDATA[<p><img src="http://henko.net/wp-content/uploads/2008/02/magnetic-tape1.jpg" alt=" (The greatest thing since sliced bread.)" title=" (The greatest thing since sliced bread.)" align="right" style="margin: 0.5em 0 0.5em 1em;" />I just found what might be the greatest thing since sliced bread. It is so smart, so ingenious, that it made me excited like a child on Christmas for a whole week.</p>

<p><strong>The problem</strong>: My team had a lot of index cards which we wanted to put on a wall in order to simplify planning. We had thought about using pins, tape, magnets, and pretty much every type of device used to put a piece of paper on a wall known to man. That&#8217;s when I found it.</p>

<p><strong>The solution</strong>: Flexible and adhesive magnetic tape. Just stick a piece of tape on the back of the card. Then you can post your cards on a whiteboard and move them around all day long. Up, down, left, right, left again, rearrange. If you wanna take it down and edit it, just do it and put it right back up again. So simple, so obvious. Love it!</p>

<p>If you happen to live in Sweden, you can pick a roll up at <a href="http://www.clasohlson.se/Product/Product.aspx?id=23366413" title="Clas Ohlson">Clas Ohlson</a>. In the US, I found the same product at <a href="http://www.magnetsource.com/Consumer%20Pages/Flex_TapeOFFC.html" title="The Magnet Source">The Magnet Source</a> (see product C). They&#8217;re cheap too.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014643" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/story-cards-on-a-whiteboard/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/story-cards-on-a-whiteboard/</feedburner:origLink></item>
		<item>
		<title>Solution: “Could not load a dependent class” when using Ant through Eclipse</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014646/</link>
		<comments>http://henko.net/imperfection/could-not-load-a-dependent-class-ant-eclipse/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 12:48:15 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/could-not-load-a-dependent-class-ant-eclipse/</guid>
		<description><![CDATA[When running an optional Ant task through the Eclipse Ant interface, you get an error saying a dependent class could not be loaded. However, you have found all required dependencies for the tasks you are trying to use and put them in one of the folders as specified. This might be the solution.]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>

<p>When running an optional Ant task (e.g. <code>scp</code> or <code>sshexec</code>) through the Eclipse Ant interface, you get an error similar to the one below.</p>

<pre><code>BUILD FAILED
C:\Path\To\build.xml:45: Problem: failed to create task or type scp
Cause: Could not load a dependent class com/jcraft/jsch/UserInfo
       It is not enough to have Ant's optional JARs
       you need the JAR files that the optional tasks depend upon.
       Ant's optional task dependencies are listed in the manual.
Action: Determine what extra JAR files are needed, and place them in one of:
        -C:\Path\To\Ant\Home\lib
        -C:\Path\To\User\Home\.ant\lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem
</code></pre>

<p>However, you have found all required dependencies for the tasks you are trying to use and put them in one of the folders as specified.</p>

<h3>Cause</h3>

<p>Although you have added the right dependencies, Eclipse might not yet know of the file(s). If this is the case, you can see this by running Ant diagnostics (<code>ant -diagnostics</code> on the command line or the <code>&lt;diagnostics&gt;</code> ant task). You will see that the dependency is listed in the appropriate &#8220;lib jar listing&#8221; but is missing in the <code>java.class.path</code> system property.</p>

<h3>Solution</h3>

<p>Go to <code>Window &gt; Preferences &gt; Ant &gt; Runtime &gt; Classpath</code>, select &#8220;Ant Home Entries (default)&#8221; and click &#8220;Add External JARs&#8230;&#8221;. Select the required dependency or dependencies and accept. Now, the selected JAR files will be loaded to the class path and the optional ant task depending on them will work.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014646" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/could-not-load-a-dependent-class-ant-eclipse/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/could-not-load-a-dependent-class-ant-eclipse/</feedburner:origLink></item>
		<item>
		<title>Thoughtless Development</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014651/</link>
		<comments>http://henko.net/imperfection/thoughtless-development/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 10:25:54 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/thoughtless-development/</guid>
		<description><![CDATA[Test-Driven Development has gone from being a new idea, considered slightly crazy, to a serious development style used by many professional developers in their everyday life. However, it is a style of development which requires much discipline, or you will not realize it’s potential. In fact, you might end up doing more harm than good.]]></description>
			<content:encoded><![CDATA[<p>Test-Driven Development has gone from being a new idea, considered slightly crazy, to a serious development style used by many professional developers in their everyday life. However, it is a style of development which requires much discipline, or you will not realize it&#8217;s potential. In fact, you might end up doing more harm than good.</p>

<h3>Traditional vs Test-Driven</h3>

<p>The traditional way of developing (if there is such a thing) typically follows this pattern.</p>

<ol>
<li>Implement a feature.</li>
<li>Test follows from implementation.</li>
</ol>

<p>Whereas Test-Driven Development reverses that order.</p>

<ol>
<li>Test a (missing) feature.</li>
<li>Implementation follows from test.</li>
</ol>

<p>The idea here is that if we design and write the test before concerning ourselves with a particular implementation, we are more open-minded and the resulting feature will be designed <em>as we want to use it</em> rather than <em>how it&#8217;s easiest to implement</em>.</p>

<h3>Thoughtless Development</h3>

<p>Some people (myself included, in an earlier life), tend to get this idea slightly wrong. They end up with, what I call, <em>Thoughtless Development</em>. When converting from traditional development to TDD, they know the implementation is supposed to go last and follow from the tests.</p>

<p>For some reason though, they keep the &#8220;test follows from implementation&#8221; part. But as the test is supposed to be written first, there is no longer anything it can follow from. To make it even better, it is also supposed to be as simple as possible, which is easily interpreted as <em>easy to do</em> as possible. The flow typically ends up something like this.</p>

<ol>
<li>Test follows from (vague expectations of) implementation.</li>
<li>Implementation follows from test.</li>
</ol>

<p>Do I need to add that they typically end up with a heap of junk? That&#8217;s because there is no room for thought in this process. All the thinking and care that should go into designing tests is forgotten.</p>

<p>As I&#8217;ve written about earlier, some people tend to use TDD as an excuse for <a href="http://henko.net/imperfection/do-design/" title="Do design, just not Big and Up Front">doing no design at all</a>. Either purposefully or by accident. This is ironic, as TDD is really all about design! So let us all make sure that we are doing Test-Driven Development, and not Thoughtless Development.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014651" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/thoughtless-development/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/thoughtless-development/</feedburner:origLink></item>
		<item>
		<title>Sorted collections in Hibernate</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014654/</link>
		<comments>http://henko.net/imperfection/sorted-collections-in-hibernate/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 11:29:10 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Solution]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/sorted-collections-in-hibernate/</guid>
		<description><![CDATA[We want a collection field belonging to an entity object to be sorted. There are two possible solutions.]]></description>
			<content:encoded><![CDATA[<h3>Problem</h3>

<p>We want a collection field belonging to an entity object to be sorted.</p>

<h3>Solution</h3>

<p>There are two possible solutions:</p>

<ul>
<li>If you want the collection to be sorted when loaded, but not necessarily keep that sorting order all the time, use the <code>OrderBy</code> annotation where you set the actual <code>ORDER BY</code> SQL clause. In that case, the collection can be of any type (e.g. <code>Collection</code>).</li>
<li><p>If you want the collection to be sorted at all times, make it of type <code>SortedSet</code> or <code>SortedMap</code> and set the <code>Sort</code> annotation.</p>

<ul>
<li>If the objects in the collection implements <code>Comparable</code> set type to <code>SortType.NATURAL</code>.</li>
<li>Otherwise set it to <code>SortType.COMPARATOR</code> and specify your own <code>Comparator</code> class in the <code>comparator</code> attribute.</li>
</ul></li>
</ul>

<h3>Remarks</h3>

<ul>
<li>There exists an annotation with name <code>OrderBy</code> in both the <code>javax.persistence</code> package as well as the <code>org.hibernate.annotations</code> package. The former should be used.</li>
</ul>

<h3>See also</h3>

<ul>
<li><a href="http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#entity-hibspec-collection-enhance" title="Collection related annotations">Collection related annotations</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014654" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/sorted-collections-in-hibernate/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/sorted-collections-in-hibernate/</feedburner:origLink></item>
		<item>
		<title>Constructors and Creation Methods</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014657/</link>
		<comments>http://henko.net/imperfection/constructors-and-creation-methods/#comments</comments>
		<pubDate>Sat, 22 Sep 2007 12:53:36 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Imperfection]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/constructors-and-creation-methods/</guid>
		<description><![CDATA[Sometimes a constructor doesn't communicate intention very effectively. This could be because instantiating the class in question isn't as straight-forward as "creating a new object", or because there are many alternative constructors. In those circumstances it might be useful to use well-named static or non-static methods to create instances of the class instead.]]></description>
			<content:encoded><![CDATA[<p>Sometimes a constructor doesn&#8217;t communicate intention very effectively. This could be because instantiating the class in question isn&#8217;t as straight-forward as &#8220;creating a new object&#8221;, or because there are many alternative constructors. In those circumstances it might be useful to use well-named static or non-static methods to create instances of the class instead.</p>

<p><a href="http://industriallogic.com/xp/refactoring/constructorCreation.html" title="Joshua Kerievsky introduced">Joshua Kerievsky introduced</a> the term <em>Creation Method</em> for these kinds of methods. The GOF pattern <a href="http://en.wikipedia.org/wiki/Factory_method" title="Factory Method">Factory Method</a> is similar as it includes a subset of all possible <em>Creation Method</em>s.</p>

<p>So, how does a <em>Creation Method</em> differ from a constructor, semantically? When should one use one or the other?
<h3>Is computation required?</h3></p>

<p>I tend to use a <em>Creation Method</em>s when the instance creation requires much computation. In one sense, it is very similar to when to use properties and when to use Get-methods in VB/C#.</p>

<p>Possibly, a <em>Creation Method</em> which does a lot should be seen as a separate responsibility and moved to a a separate <em>Factory</em> class. This is similar to what Joshua Kerievsky discusses in <a href="http://www.industriallogic.com/xp/refactoring/classesWithFactory.html" title="Encapsulate Classes with Factory">Encapsulate Classes with Factory</a>, that some developers might not like having a class which has a <em>Factory</em> responsibility as well as its normal responsibility. In the end, I guess it&#8217;s a matter of taste.
<h3>Do you actually get a <em>new</em> object?</h3></p>

<p>A <em>Creation Method</em> may be used when there is a finite set of possible objects to create. In such a case, a well named <em>Creation Method</em> may indicate that you cannot actually create a <em>new</em> object, but rather get one of the already defined.</p>

<p>An example would be the Java class <a href="http://java.sun.com/javase/6/docs/api/java/nio/charset/Charset.html" title="Charset">Charset</a>. There is a limited number of possible charsets (or at least number of charsets the system will understand), and therefore it does not provide a public constructor, but rather uses the method <code>forName(String)</code>. You would use the following code to create a <code>Charset</code> object.</p>

<pre><code>Charset c = Charset.forName("ISO-8859-1");
</code></pre>

<h3>Other reasons</h3>

<p>Another reason to use a <em>Creation Method</em> could be to hide the fact that it&#8217;s actually a (private) subclass which is being instantiated. In other words, that the <em>Creation Method</em> is actually a true <em>Factory Method</em>. See for instance the Money example in Kent Beck&#8217;s <a href="http://www.amazon.com/Test-Driven-Development-Addison-Wesley-Signature/dp/0321146530" title="Test-Driven evelopment">Test-Driven evelopment</a>.</p>

<p>You&#8217;ve got more ideas on what differs <em>Creation Method</em>s and constructors? Post a comment.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014657" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/constructors-and-creation-methods/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/constructors-and-creation-methods/</feedburner:origLink></item>
		<item>
		<title>Testability vs coupling</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014661/</link>
		<comments>http://henko.net/imperfection/testability-vs-coupling/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 09:45:19 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Imperfection]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/testability-vs-coupling/</guid>
		<description><![CDATA[I want to describe a situation I came across where designing for testability seems to be in conflict with the always-valuable principle of loose coupling.]]></description>
			<content:encoded><![CDATA[<p>I want to describe a situation I came across where designing for testability seems to be in conflict with the always-valuable principle of loose coupling.</p>

<h3>Summary of coupling</h3>

<p><a href="http://stevemcconnell.com/" title="Steve McConnell">Steve McConnell</a> in <a href="http://cc2e.com/" title="Code Complete">Code Complete</a> describes coupling as follows.</p>

<blockquote>
  <p>Coupling describes how tightly a class or routine is related to other classes or routines. The goal is to create classes and routines with small, direct, visible, and flexible relations to other classes and routines, which is known as &#8220;loose coupling&#8221;.</p>
</blockquote>

<p>McConnell furthermore lists a number of different types of coupling, some of which are better than other.</p>

<ul>
<li><em>Simple-data-parameter coupling</em>: All data passed between <em>A</em> and <em>B</em> are of primitive data types and passed through parameter lists. This kind of coupling is normal and acceptable.</li>
<li><em>Simple-object coupling</em>: <em>A</em> instantiates an object of type <em>B</em>. This kind is also fine.</li>
<li><em>Object-parameter coupling</em>: <em>A</em> requires <em>B</em> to send it an object of type <em>C</em>. This type is tighter since it requires <em>B</em> to know of <em>C</em>.</li>
<li><em>Semantic coupling</em>: <em>A</em> makes use of, not some syntactic element of <em>B</em>, but knowledge of its inner workings. Should be avoided.</li>
</ul>

<h3>Dependency injection to simplify testing</h3>

<p>So, loose coupling is definitely good as it makes the system easier to work with. However, when I read one of <a href="http://codebetter.com/blogs/jeremy.miller/archive/2006/03/09/140465.aspx" title="Jeremy Miller's excellent posts">Jeremy Miller's excellent posts</a> I started thinking. He suggests using dependency injection to simplify testing in some cases, which to me seems to be creating tighter coupling within the system.</p>

<p>More specifically, the problem he describes is as follows. A class <code>ClassUnderTest</code> internally creates an object of type <code>Dependency</code>. However, if it is hard to create a new instance of <code>Dependency</code> equal to the first one (e.g. a datetime object representing &#8220;now&#8221;), <code>ClassUnderTest</code> becomes very difficult to test.</p>

<p>When the unit test wants to create a copy of the the hard-to-reproduce-object <code>Dependency</code> to compare with <code>ClassUnderTest</code>&#8217;s <code>Dependency</code> instance, a non-equal instance is created (the system clock has changed) and the test fails.</p>

<p>The solution is to provide the object under test with either:</p>

<ul>
<li>the <code>Dependency</code> object in question itself, or </li>
<li>an object which provides <code>ClassUnderTest</code> with the wanted <code>Dependency</code> instance.</li>
</ul>

<p>I agree with this completely. In fact, I&#8217;ve had the problem a number of times myself, and solved it successfully this very way.</p>

<h3>In terms of coupling</h3>

<p>With respect to coupling, the case is that before we add the test (let&#8217;s assume we&#8217;re testing legacy code) we have <em>simple-object coupling</em>, since <code>ClassUnderTest</code> creates another object <code>Dependency</code>. However, when we test <code>ClassUnderTest</code> we want to create another object of the same type as <code>Dependency</code> equal to the one <code>ClassUnderTest</code> created.</p>

<p>As noted above, the solution is dependency injection &#8212; to provide <code>ClassUnderTest</code> with <code>Dependency</code>, either directly or indirectly. That way, we have the possibility to get hold of <code>Dependency</code> to perform the assertion in question. In terms of coupling however, this changes the coupling to be of type <em>object-parameter coupling</em> which is considered tighter than the type of coupling we had before.</p>

<h3>A counter argument</h3>

<p>Thinking about this, I thought that maybe the key here is that to test <code>ClassUnderTest</code> in the first case, the test would need to be <em>semantically coupled</em> to <code>ClassUnderTest</code> because it would have to know what kind of <code>Dependency</code> object it created internally (&#8221;now&#8221; vs any other datetime) and try to recreate it in some clever way. So we actually replace semantic coupling with object-parameter coupling &#8212; an improvement.</p>

<p>The counter argument (to the counter argument) is that without the test code, we would have no need to create such an object and there would be no semantic coupling in the first place. Thus, writing the test tightens the coupling in the system.</p>

<h3>The question</h3>

<p>Am I missing anything, or is this an example of where designing for testability actually leads to worse (as in more complex and more tightly coupled) design? Or am I just getting lost completely in theory? Maybe this slightly tighter coupling is nothing compared to what we gain from having a good and simple unit test in place.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014661" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/testability-vs-coupling/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/testability-vs-coupling/</feedburner:origLink></item>
		<item>
		<title>Scope control</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014667/</link>
		<comments>http://henko.net/imperfection/scope-control/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 14:30:18 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Implementation]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/scope-control/</guid>
		<description><![CDATA[Again, the book <em>Test-Driven Development: By Example</em> by Kent Beck provides me with an eye-opening experience. It explains how test-driven development is useful for scope control when developing.]]></description>
			<content:encoded><![CDATA[<p><a href="http://henko.net/imperfection/non-obvious-duplication/" title="Non-obvious duplication">Again</a>, the book <a href="http://www.awprofessional.com/bookstore/product.asp?isbn=0321146530&amp;rl=1" title="Test-Driven Development: By Example">Test-Driven Development: By Example</a> by Kent Beck provides me with an eye-opening experience. It explains how test-driven development is useful for scope control when developing.</p>

<blockquote>
  <p>Programmers are good at imagining all sorts of future problems. Starting with one concrete example and generalizing from there prevents you from prematurely confusing yourself with extraneous concerns. You can do a better job of solving the immediate problem because you are focused. When you go to implement the next test case, you can focus on that one, too, knowing that the previous test is guaranteed to work.</p>
</blockquote>

<p>I&#8217;ve found this to be very true. Before starting to think this way, I way to often started writing a test (or even started implementing some feature), only to stray away to a number of different tasks; adding guard clauses for the function, writing a helper function that I might need, refactoring a related method, and so on. By writing a simple test and implement that piece of functionality (and only that), then write a new test and implement that, and so on, my coding has become much more focused and I move forward noticeably faster.</p>

<p>However, this doesn&#8217;t mean you should just ignore thoughts on potential related problems. Write them down to look at later — but don&#8217;t let them grab your attention for longer time than that. Keep pen and paper ready at all times.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014667" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/scope-control/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/scope-control/</feedburner:origLink></item>
		<item>
		<title>Slightly different and even simpler</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014673/</link>
		<comments>http://henko.net/imperfection/slightly-different-and-even-simpler/#comments</comments>
		<pubDate>Mon, 11 Jun 2007 12:24:28 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Imperfection]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/slightly-different-and-even-simpler/</guid>
		<description><![CDATA[I'm constantly trying to become better at estimating how long a development task will take. As one step in this process I decided to create a simple web-based timer which I could use to measure time. Shouldn't be too hard, I just needed a simple stop watch &#8212; the simplest thing that that could possibly work. That's what I thought at least.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m constantly trying to become better at estimating how long a development task will take. As one step in this process I decided to create a simple web-based timer which I could use to measure time. Shouldn&#8217;t be too hard, I just needed a simple stop watch &mdash; the simplest thing that that could possibly work. That&#8217;s what I thought at least.</p>

<p>The problem was that instead of thinking about what functionality I actually needed, I just assumed that since I was going to measure time I needed a regular stop watch. Thus, the first version of my timer had the operations <code>start</code>, <code>pause</code>, <code>stop</code> and <code>reset</code>, where <code>reset</code> was only available when the timer was stopped.</p>

<p>After a while I realized I was pressing the sequence <code>stop</code>-<code>reset</code>-<code>start</code> a lot of times. I did it every time a task was finished and I was about to start with a new one. So to make my life easier I added <code>restart</code> which did just that.</p>

<p>After using it even more I realized that <code>restart</code> now actually was the only button I was pushing. Therefore, I simply removed all other buttons than <code>restart</code> (which was renamed <code>reset</code>).</p>

<p>The result is a very simple timer. It auto-starts and is then always running. Thus, no need for <code>start</code> or <code>stop</code>. That&#8217;s great for measuring time while working, because real time doesn&#8217;t stop. I always spend time doing <em>something</em>. The only thing I can do with my time is divide it into chunks of time which I spend doing different tasks. That is exactly what my <code>reset</code> button allows me to do &mdash; tell where one such chunk ends and the next starts.</p>

<p>I&#8217;m actually very satisfied with the result. What is rather funny about this whole thing is that although I first thought I needed &#8220;just a simple stop watch&#8221;, my need was in fact slightly different and <em>even simpler</em>.</p>

<p>P.S. If you want to use the timer, it&#8217;s available at <a href="http://timer.henko.net/" title="http://timer.henko.net/">http://timer.henko.net/</a>. However, it currently assumes Central European Time (+1). Time is also only shown in hours, since that is how I enter time in my time reporting tool.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014673" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/slightly-different-and-even-simpler/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/slightly-different-and-even-simpler/</feedburner:origLink></item>
		<item>
		<title>Do design, just not Big and Up Front</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014676/</link>
		<comments>http://henko.net/imperfection/do-design/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 13:38:20 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Imperfection]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/do-design/</guid>
		<description><![CDATA[While evolving a design is good and nice one has to remember that even though big design <em>up front</em> might not be a good idea, all the hard design work still needs to be done at some point. Otherwise you'll just end up with a big piece of garbage. Therefore, while starting with a story, <em>do</em> take time and think it through and answer a couple of the following questions for yourself.]]></description>
			<content:encoded><![CDATA[<p>The term <a href="http://c2.com/xp/BigDesignUpFront.html" title="Big Design Up Front">Big Design Up Front</a> (BDUF) is used in the Agile community as a derogatory word for the practice of doing all (or most of) the design before starting coding. Agilists agree on the fact that BDUF is not the way to go, but rather to let the design evolve as coding is done.</p>

<p>While evolving a design is good and nice one has to remember that even though big design <em>up front</em> might not be a good idea, all the hard design work still needs to be done at some point. Otherwise you&#8217;ll just end up with a big piece of garbage. Therefore, while starting with a story or use case, <em>do</em> take time and think it through and answer a couple of questions for yourself (not an exhaustive list).</p>

<ul>
<li>What is the goal of the story?</li>
<li>In what ways can we solve this?</li>
<li>How does these solutions fit into the current system?</li>
<li>What are the pros and cons of these solutions?</li>
<li>What are the larger problems (if any)?</li>
</ul>

<p>However, while thinking about all this, don&#8217;t try to work <em>all</em> the details out, they will sort themselves out while coding. More importantly, don&#8217;t <em>commit</em> to any of the design alternatives you come up with. The important part is thinking the problem through thoroughly. A quote from David Eisenhower sums this up nicely:</p>

<blockquote>
  <p>In preparing for battle I have always found that plans are useless, but planning is indispensable.</p>
</blockquote>

<p>Steve McConnell in the second edition of <a href="http://cc2e.com/" title="Code Complete">Code Complete</a>, describes how while he was writing the first edition, design zealots argued for BDUF, and as he was writing the second, some software swamis instead argued for no initial design at all. He says:</p>

<blockquote>
  <p>In ten years the pendulum has swung from &#8220;design everything&#8221; to &#8220;design nothing&#8221;. But the alternative to BDUF isn&#8217;t no design up front, it&#8217;s a Little Design Up Front (LDUF) or Enough Design Up Front — ENUF.</p>
</blockquote>

<p>Another take on this is to make the decision in the <em>Last Responsible Moment</em>, described by Jeremy Miller in <a href="http://codebetter.com/blogs/jeremy.miller/archive/2006/01/18/136648.aspx" title="one of his articles">one of his articles</a>.</p>

<blockquote>
  <p>The key is to make decisions as late as you can responsibly wait because that is the point at which you have the most information on which to base the decision. In software design it means you forgo creating generalized solutions or class structures until you know that they’re justified or necessary.</p>
</blockquote>

<p>However, one might not use this advice to justify not designing at all. The key here is that you don&#8217;t <em>commit</em> to a certain design (i.e. make the decision) until the last possible minute, but you still <em>consider the alternatives</em> — which of course requires you to research and actually think about them!</p>

<div class="modifications">

<p>Modifications:</p>

<ul>
<li>2007-02-08: Original post.</li>
<li>2007-07-12: Added the paragraphs on ENUF.</li>
<li>2007-07-13: Added the paragraphs on Last Responsible Moment.</li>
</ul>

</div>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014676" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/do-design/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/do-design/</feedburner:origLink></item>
		<item>
		<title>Refactoring vs performance optimization</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014679/</link>
		<comments>http://henko.net/imperfection/refactoring-vs-performance-optimization/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 08:56:23 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Implementation]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/refactoring-vs-performance-optimization/</guid>
		<description><![CDATA[The thought popped up into my mind a while ago, that there is actually a striking similarity between refactoring and performance optimization.]]></description>
			<content:encoded><![CDATA[<p>The thought popped up into my mind a while ago, that there is actually a striking similarity between refactoring and performance optimization. Both of them&#8230;</p>

<ul>
<li>are meant to make the program better.</li>
<li>preserve semantics of the program (hopefully).</li>
<li>should be driven by a real and provable need.</li>
<li>can be harmful when premature/speculative.</li>
</ul>

<p>In fact, they have the same goal as well. They are both meant to to make the program easier to interpret. The only difference is that refactoring tries to make it easier for the developer, and performance optimization for the computer.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014679" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/refactoring-vs-performance-optimization/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/refactoring-vs-performance-optimization/</feedburner:origLink></item>
		<item>
		<title>Take a deep breath</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014683/</link>
		<comments>http://henko.net/imperfection/take-a-deep-breath/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 08:52:45 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/take-a-deep-breath/</guid>
		<description><![CDATA[Sometimes when I'm trying to get my head around something complex, I suddenly feel overwhelmed and my head starts to feel like its about to explode. I realize that there are at least a dozen cases which I've failed to consider so far. All the thoughts I was trying to keep track of just runs off in every possible direction and I can't chase them all. Dispair overwhelmes me. Then I have to close my eyes, take a deep breath, hold it for a second, and let it go slowly. Then start over, think it through one more time.]]></description>
			<content:encoded><![CDATA[<p>Sometimes when I&#8217;m trying to get my head around something complex, I suddenly feel overwhelmed and my head starts to feel like it&#8217;s about to explode. I realize that there are at least a dozen cases which I&#8217;ve failed to consider so far. All the thoughts I was trying to keep track of just runs off in every possible direction and I can&#8217;t chase them all. Despair overwhelms me. Then I have to close my eyes, take a deep breath, hold it for a second, and let it go slowly. Then start over, think it through one more time.</p>

<p>This procedure is typically repeated a whole bunch of times. Thus, my thought process is a very iterative one. Unfortunately, I&#8217;m not in charge of the iterations. They usually end not because I&#8217;ve reached a new milestone, but because I&#8217;ve realized I&#8217;m hopelessly lost and need to go back to the beginning. Somehow still, (on good days) each iteration seems to make things at least a little bit clearer. Or at least every other iteration or so. Some of them just end in a big hopeless sigh.</p>

<div class="images"><img src="http://henko.net/wp-content/uploads/2006/09/dandelion.jpg" alt=" (Copyright 2006 Göran Axelsson.)" title=" (Copyright 2006 Göran Axelsson.)" /></div>

<p>Anyway, I finally either realize that I just can&#8217;t get it right, or I find a solution. If the latter, the solution typically has very little resemblance to my starting ideas. My thoughts have been distilled and refined over and over, and my initial assumptions have been overturned more or less completely. Actually, the solution typically is far more elegant and simple(!) than what I started with.</p>

<p>So why am I telling you this? Well, I&#8217;m not sure (still trying to get my head around that one <img src='http://henko.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ). But somewhere in the back of my head I wonder if this is not how I ought to develop software as well. Not that all iterations end in catastrophy, but that whenever I&#8217;m not quite sure of what I&#8217;m doing, I should throw whatever code I&#8217;ve been writing away and start over. Then, finally, the code I end up with will be simple enough for me to grasp in one go and only contains what I&#8217;m sure is absolutely necessary. Then of course, it is very hard to actually throw away code you&#8217;ve written. But maybe it&#8217;s worth it?</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014683" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/take-a-deep-breath/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/take-a-deep-breath/</feedburner:origLink></item>
		<item>
		<title>Non-obvious duplication</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014686/</link>
		<comments>http://henko.net/imperfection/non-obvious-duplication/#comments</comments>
		<pubDate>Mon, 28 Aug 2006 12:22:09 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Imperfection]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/non-obvious-duplication/</guid>
		<description><![CDATA[I just wanted to describe what for me became an "eye-opener" regarding Test-Driven Development; that when you remove duplication, you should look for not only duplication of logic, but also duplication of data.]]></description>
			<content:encoded><![CDATA[<p>I just wanted to describe what for me became an &#8220;eye-opener&#8221; regarding <a href="http://en.wikipedia.org/wiki/Test_driven_development" title="Test-Driven Development">Test-Driven Development</a>. Let&#8217;s begin with a quick recap on TDD.</p>

<ol>
<li>It says that while all tests pass, you&#8217;re not allowed to add new functionality. To do that, you have to add a new test which fails because of the lack of the wanted functionality.</li>
<li>Then you make that test pass in the simplest way you can imagine. In fact, while you have a test which fails, you&#8217;re allowed to do practically anything (possibly except cardinal sins) to make it pass. </li>
<li>After you&#8217;ve made it pass, you can refactor all you want to clean up the existing code, including the lines you just wrote.</li>
</ol>

<p>This is the rhythm of TDD, which is often called red/green/refactor, as a reference to the color of the progress bar most unit testing interfaces use when test fail and pass.</p>

<p>Anyway, back to the eye-opening experience. As an example, lets use the following test, asserting that a method for calculating the sum of two integers is correct.</p>

<pre><code>public void testSum() {
    assertEquals(8, sum(3, 5));
}
</code></pre>

<p>The simplest way I can imagine to make this test pass is the following code is just faking the implementation.</p>

<pre><code>public int sum(int augend, int addend) {
    return 8;
}
</code></pre>

<p>Now, this really feels bad. We know that returning 8 is not a correct solution for all possible parameter values. On the other hand, the test is passing, which is my proof of that the program works. Nevertheless, just faking out the implementation feels like cheating. No matter how many more tests we write for this function we could always just continue faking it by making another special case, ending up with a gigantic <code>switch</code> statement rather than the real and much simpler function (I leave finding the correct function as an exercise for the reader <img src='http://henko.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ).</p>

<p>Now comes what for me was an eye-opener. <a href="http://c2.com/cgi/wiki?KentBeck" title="Kent Beck">Kent Beck</a> in his book <a href="http://www.awprofessional.com/bookstore/product.asp?isbn=0321146530" title="Test-Driven Development">Test-Driven Development</a> describes how to solve this problem nicely. He notices that there is duplication between the test and the implementation; not duplication of logic, but duplication of data. The duplication is also not explicit, but implicit. What <code>return 8;</code> really stands for is <code>return 3+5;</code>. And it is rather obvious to us that <code>3</code> and <code>5</code> really are the same numbers which are given as parameters to the <code>sum()</code> function in the test. In other words, the numbers <code>3</code> and <code>5</code> are duplicated.</p>

<p>To avoid this and remove the duplication, we have to make the function somehow reference the values in the test. In our case, this turns out to be very simple, as they are given to the method as parameters. We refactor the method as follows, and the duplication is gone.</p>

<pre><code>public int sum(int augend, int addend) {
    return augend + addend;
}
</code></pre>

<p>Now look and behold. By removing the duplication, we also made the function work as we wanted.</p>

<p>Lets think again about the rhythm of TDD. Since the test passed with our first <code>return 8;</code> implementation, we were at green bar (all tests passed). And when we&#8217;ve got a green bar, TDD only allows us to refactor the code, not add new functionality. Now, one can argue that the change made to the implementation (changing <code>8</code> to <code>augend + addend</code>) wasn&#8217;t a semantics preserving refactoring at all, but rather adding new functionality. To answer this, let&#8217;s recap on perhaps the most well known definition of refactoring, namely from <a href="http://www.martinfowler.com/" title="Martin Fowler">Martin Fowler</a>s book <a href="http://martinfowler.com/books.html#refactoring" title="Refactoring">Refactoring</a>.</p>

<blockquote>
  <p>A change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its
  observable behavior.</p>
</blockquote>

<p>So, in fact, practically all refactorings change the exact behavior of the code, just not the type we are interested in which is <em>observable behavior</em>. And when we&#8217;re talking Test-Driven Development, what you don&#8217;t have tests for, you can&#8217;t observe. Thus, the modification we made was not changing any observable (i.e. tested) behavior, just untested and therefore invisible behavior.</p>

<p>This might seem to you as either fooling oneself, or as an elegant solution to the problem. I put my vote on the latter.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014686" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/non-obvious-duplication/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/non-obvious-duplication/</feedburner:origLink></item>
		<item>
		<title>Full statement coverage</title>
		<link>http://feeds.feedburner.com/~r/henko/~3/422014689/</link>
		<comments>http://henko.net/imperfection/full-statement-coverage/#comments</comments>
		<pubDate>Tue, 15 Aug 2006 12:22:05 +0000</pubDate>
		<dc:creator>Henrik Jernevad</dc:creator>
		
		<category><![CDATA[Imperfection]]></category>

		<category><![CDATA[Implementation]]></category>

		<guid isPermaLink="false">http://henko.net/imperfection/full-statement-coverage-using-test-driven-development/</guid>
		<description><![CDATA[When I read Ron Jeffries Soduko articles, I was wondering why he was writing such sloppy unit tests. He didn't seem to test even half of the code he wrote. A short email conversation later I had realized that he of course wasn't sloppy, but rather just much more clever than I was (not that surprising, really). ;-)]]></description>
			<content:encoded><![CDATA[<p>When I read <a href="http://www.xprogramming.com/" title="Ron Jeffries">Ron Jeffries</a> <a href="http://search.atomz.com/search/?sp-q=sudoku&amp;sp-a=sp01062000&amp;sp-advanced=1&amp;sp-p=any&amp;sp-w-control=1&amp;sp-d=custom&amp;sp-date-range=-1&amp;sp-start-month=0&amp;sp-start-day=0&amp;sp-start-year=&amp;sp-end-month=0&amp;sp-end-day=0&amp;sp-end-year=&amp;sp-x=title&amp;sp-c=10&amp;sp-m=1&amp;sp-s=0" title="Soduko articles">Soduko articles</a>, I was wondering why he was writing such sloppy unit tests. He didn&#8217;t seem to test even half of the code he wrote. A short email conversation later I had realized that he of course wasn&#8217;t sloppy, but rather just much more clever than I was (not that surprising, really). <img src='http://henko.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<p>If a test exercises method <code>a()</code> which in turn calls <code>b()</code>, then both <code>a()</code> and <code>b()</code> are in fact tested. If <code>b()</code> is changed (in an incorrect way) there is a test which will fail. In other words, he was writing the least amount of test code necessary to get full statement coverage. Pretty smart, if you ask me.</p>

<p>I guess there is nothing wrong in doing extensive testing, besides perhaps that the development moves forward more slowly (at least in a short perspective). TDDers like to say, test until fear turns to boredom. So apparently I wasn&#8217;t bored enough by writing the tests yet.</p>
<img src="http://feeds.feedburner.com/~r/henko/~4/422014689" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://henko.net/imperfection/full-statement-coverage/feed/</wfw:commentRss>
		<feedburner:origLink>http://henko.net/imperfection/full-statement-coverage/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.943 seconds -->
