<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Manuel Klimek &#187; Agile</title>
	<atom:link href="http://klimek.box4.net/blog/category/agile/feed/" rel="self" type="application/rss+xml" />
	<link>http://klimek.box4.net/blog</link>
	<description>Dedicated to Software Development</description>
	<lastBuildDate>Wed, 01 Jul 2009 20:23:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Test Everything That Could Possibly Break &#8211; A Guide To Better Testing</title>
		<link>http://klimek.box4.net/blog/2009/02/09/test-everything-that-could-possibly-break-a-guide-to-better-testing/</link>
		<comments>http://klimek.box4.net/blog/2009/02/09/test-everything-that-could-possibly-break-a-guide-to-better-testing/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 04:43:28 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/?p=105</guid>
		<description><![CDATA[Joe: &#8220;Writing this test will make sure that we find bugs quicker. It will let us change the code without breaking anything and it will help us to write decoupled code.&#8221;
Jim: &#8220;Maintaining this test will be a nightmare. It is tightly coupled to the class we&#8217;re writing and we cannot change anything without changing the [...]]]></description>
			<content:encoded><![CDATA[<p>Joe: &#8220;Writing this test will make sure that we find bugs quicker. It will let us change the code without breaking anything and it will help us to write decoupled code.&#8221;<br />
Jim: &#8220;Maintaining this test will be a nightmare. It is tightly coupled to the class we&#8217;re writing and we cannot change anything without changing the test. It will be a pain.&#8221;<br />
Joe: &#8220;How do you know?&#8221;<br />
Jim: &#8220;Well, how do <em>you</em> know?&#8221;<br />
Joe: &#8220;I have 20 years of experience not writing unit tests.&#8221;</p>
<p><strong>So what?</strong><br />
When I&#8217;m writing new code I am never sure whether I test enough, or if my tests are on the right level of abstraction. For complicated core functionality of a distributed system this is a no-brainer &#8211; I use TDD, which by the very definition gives me 100% code coverage, and add some nice integration and acceptance tests. But there are a myriad of cases where going forward in the baby-step TDD way seems a waste of time, and it would really help me to find some sensible rules to apply.</p>
<p>The simplest and best rule I have found so far is an idea from Extreme Programming:<br />
<strong>Test Everything That Could Possibly Break</strong></p>
<p>Unfortunately this rule is not as simple as it looks. My approach to that is the good old mantra of <em>try-measure-adapt</em>, where <em>try</em> means to just do whatever a randomly selected guy thinks is the new cool-aid, <em>measure</em> means to listen to that whimsical thoughts my brain produces while doing it and <em>adapt</em> means to look at the results and change my behavior.</p>
<p>So here&#8217;s my guide to better testing, from the beginner to the professional level:</p>
<p><strong>Beginner:</strong> Do some unimportant project by following <a href="http://klimek.box4.net/blog/index.php?now_reading_author=kent-beck&#038;now_reading_title=test-driven-development-by-example-addison-wesley-signature-series">the description of TDD</a> step-by-step. Don&#8217;t waste your employers money with that if you don&#8217;t have any idea of how to do it &#8211; the first time you use it will be a disaster. Writing yet another Sudoku solver in your favorite programming language might be a cool idea.<br />
The important part is that you don&#8217;t have an idea of what &#8220;test everything that could possibly break&#8221; means, so your best bet is to assume everything might break. Even those getters and setters over there. Remember that you&#8217;re not allowed to rant about made-up scenarios of why too many tests might be bad if you have never experienced what it means to maintain a program with too many tests. Do that first and come back later and read on.</p>
<p><strong>Advanced:</strong> So you already have some experience doing TDD and know how it feels to write all those little unit tests. You got some feedback on when those tests caught a stupid bug that would have taken an hour to find if you hadn&#8217;t written the test. You now know what the impact of unit tests on your ability to do refactorings is. Now go and break the rules by various degrees. Try to be less exhaustive with your tests and bundle your baby steps into bigger units of work. See how that affects your ability to find bugs. Test your assumptions and be aware of when they break. When you find a new bug that takes some hours to debug, think about what kind of test would have helped you find it quicker and write those tests from now on.</p>
<p><strong>Expert:</strong> If I were an expert I could probably tell you more about what to do in that case. I still hope that repeating the advanced guidelines will finally make me as wise as <a href="http://joelonsoftware.com/items/2009/01/31.html">Joel and Jeff in their discussions</a> or <a href="http://java.dzone.com/articles/thoughts-developer-testing">Jay Fields when he writes about developer tests</a>. Perhaps listening to those guys will enlighten you. You could even take a look at the very interesting discussion of the idea to <a href="http://c2.com/cgi-bin/wiki?TestEverythingThatCouldPossiblyBreak">test everything that could possibly break</a>.</p>
<p>In a nutshell:</p>
<ul>
<li>Start by testing everything, even if it looks stupid (don&#8217;t do it at work).</li>
<li>Do slightly bigger steps and see what happens.</li>
<li>Adapt whenever you experience a situation in which different behavior would have made more sense.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2009/02/09/test-everything-that-could-possibly-break-a-guide-to-better-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leaving the Comfort Zone</title>
		<link>http://klimek.box4.net/blog/2008/12/22/leaving-the-comfort-zone/</link>
		<comments>http://klimek.box4.net/blog/2008/12/22/leaving-the-comfort-zone/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 21:02:43 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/?p=104</guid>
		<description><![CDATA[A week ago I held my first talk since university. It was the first talk in my life I held in English, and I was scared like hell. It felt like living through those exam days back at school all over again &#8211; just that this time I thought I&#8217;m old enough to realize that [...]]]></description>
			<content:encoded><![CDATA[<p>A week ago I held my first talk since university. It was the first talk in my life I held in English, and I was scared like hell. It felt like living through those exam days back at school all over again &#8211; just that this time I thought I&#8217;m old enough to realize that it&#8217;ll all be okay. I&#8217;m obviously not.</p>
<p>I acted just like I did back in school. Or worse. I waited for the last possible moment before I started preparing the talk. When I finally started with the slides, a little perfectionist devil Manuel sat down leisurely on my left shoulder, telling me that this crap is just not up to my own standards. I worked long hours the night before the big day, and woke up early just to be able to rehearse the whole play before entering the stage.</p>
<p>Of course everything worked out just fine. Well, besides me saying basic-a-lly all the time. So why was I so freaked out? Well, I was obviously leaving my comfort zone.</p>
<p>Now the interesting thing beneath all that personal drama I&#8217;m ranting about is that I suddenly realized for how long I did not really step out of my safe little comfort zone. Granted, applying at Google is not the most un-stressful experience I ever had. And obviously starting a new job with all those bright people around me did not exactly make me fell warm and cozy.</p>
<p>But at that very moment I stood there, my peers gazing absent-mindedly into their laptops, my hands slightly sweating, I suddenly realized that ever since I started working I was doing everything exactly in the way I was most comfortable with. And that was kind of a shock.</p>
<p>Of course after giving the talk I felt great. I had known that in advance, but I realized that without being nudged enough I&#8217;d probably have tried to wiggle out somehow. </p>
<p>Lessons learned:</p>
<ol>
<li>It&#8217;s easier to step out of the comfort zone when somebody kicks your ass.</li>
<li>It&#8217;s a long way from leaving your comfort zone once to <a href="http://www.ibm.com/developerworks/rational/library/nov07/pollice/index.html">real change</a>.</li>
<li>I must learn how to leave my comfort zone on my own.</li>
</ol>
<p>Do you know tricks that make it easier to leave the comfort zone?</p>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2008/12/22/leaving-the-comfort-zone/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>An Editor Independent Unittest Executor</title>
		<link>http://klimek.box4.net/blog/2008/03/11/an-editor-independent-unittest-executor/</link>
		<comments>http://klimek.box4.net/blog/2008/03/11/an-editor-independent-unittest-executor/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 21:46:25 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/2008/03/11/an-editor-independent-unittest-executor/</guid>
		<description><![CDATA[Since I got test infected I&#8217;m somehow unable to write a single line of untested code without feeling uneasy. When I just want to write a tiny script containing a few lines of code in whatever text editor is installed in a system, it seems to be a daunting task to set up a programming [...]]]></description>
			<content:encoded><![CDATA[<p>Since I got test infected I&#8217;m somehow unable to write a single line of untested code <a href="http://klimek.box4.net/blog/2007/11/01/fasten-your-seat-belts-chances-and-pitfalls-of-test-driving-your-development/">without feeling uneasy</a>. When I just want to write a tiny script containing a few lines of code in whatever text editor is installed in a system, it seems to be a daunting task to set up a programming environment that allows you to execute unit tests with a single click. But this single click is what makes writing unit tests unobtrusive enough to keep doing it.</p>
<p>So I&#8217;m quite fond of using a simple script to execute my script&#8217;s unit tests whenever I save it. This concept is not new, and certainly not an original idea in itself, but the simplicity of an editor independent unit test executor in 10 lines of code has a certain appeal for me:</p>
<pre class="code">
#!/bin/bash
stat_command="stat -c '%Y'"
file_name=$1
last_modification=""
while true; do
  current_modification=$( $stat_command $file_name )
  if [ "$current_modification" != "$last_modification" ]; then
    clear
    $file_name --test
    last_modification=$current_modification
  fi
  sleep 1
done
</pre>
<p>This script stats the script file until it detects a change. Whenever a change is detected, the script is called with <i>&#8211;test</i>, which is my personal way to tell a script that it should just execute it&#8217;s unit tests and exit. See my blog post about <a href="http://klimek.box4.net/blog/2008/02/04/integrating-unit-tests-in-ruby-scripts/">integrating unit tests in Ruby scripts</a> to learn how this can be done in Ruby. A very similar approach is possible for Python:</p>
<pre class="code">
#!/usr/bin/python
import unittest
import sys

if sys.argv.count("--test") > 0:
  sys.argv.remove("--test")
  unittest.main()
</pre>
<p>Now I can simply call the test bash script, giving it the script under test as parameter:</p>
<pre class="code">
./run_tests.sh ./script_under_test.py
</pre>
<p>The beauty lies in the simplicity of the solution: Even when I remote edit a script on some server with vi, I can simply launch a new console and execute run_tests.sh, watching the test results whenever I type &#8220;:w&#8221;. </p>
<p><b>Update: The &#8220;sleep 1&#8243; really helps to keep I/O load down. Thanks to Philip for pointing this out. And yet another nice example of how hard it is to write 10 lines of bugfree code without a test.</b></p>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2008/03/11/an-editor-independent-unittest-executor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XPDays Germany 2007 &#8211; Ideas Going Mainstream</title>
		<link>http://klimek.box4.net/blog/2007/11/25/xpdays-germany-2007-ideas-going-mainstream/</link>
		<comments>http://klimek.box4.net/blog/2007/11/25/xpdays-germany-2007-ideas-going-mainstream/#comments</comments>
		<pubDate>Sun, 25 Nov 2007 16:28:57 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/2007/11/25/xpdays-germany-2007-ideas-going-mainstream/</guid>
		<description><![CDATA[I had the opportunity to take part in the XPDays Germany last week.  The company I work for enabled Uwe, our project lead, Holger and me to participate. It all started with a three and a half hour ride from Munich to Karlsruhe where we heroically overcame a nearly empty tank, a shaking car [...]]]></description>
			<content:encoded><![CDATA[<p>I had the opportunity to take part in the <a href="http://xpdays.de/2007/de/index.html">XPDays Germany</a> last week.  The company I work for enabled Uwe, our project lead, Holger and me to participate. It all started with a three and a half hour ride from Munich to Karlsruhe where we heroically overcame a nearly empty tank, a shaking car that felt like it just drank the wrong kind of gas and my own card reading skills &#8211; or lack thereof. </p>
<h3>Day 1</h3>
<p>In the end we arrived on time for a <a href="http://en.wikipedia.org/wiki/Randori">Randori</a> session by Dave Nicolette and Rod Coffin. From the moment I learned of this <a href="http://xpdays.de/2007/sessions/TDD-Randori-and-Fishbowl.html">experimental learning session</a> where two people sit in front of a computer and test drive a piece of code while the whole audience is throwing in questions, I was kind of scared of the prospect of being watched while writing code by a hundred people &#8211; which is probably kind of normal, given that some people even <a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&#038;f=42&#038;t=000931">dislike being watched while pair programming</a>.</p>
<p>The session turned out to be very interesting. One of the key elements of this style of learning is that the audience&#8217;s energy level stays high for a long time &#8211; you have to pay close attention, since due to the random selection of the next person to come to the front you could always be this person. And since you don&#8217;t want to look like a fool when doing stuff in front of a hundred people (um, what was the problem, again?) my adrenaline level alone was enough to keep me awake.</p>
<p>The other thing I learned from this experience besides a new way to coach technical stuff is that there is a very good reason we do &#8220;pair programming&#8221; and not &#8220;group programming&#8221;. Throwing two brains at a problem can be a very mighty tool to solve programming tasks, but in some situations throwing a hundred brains onto a very simple programming example felt like sitting in one of Dilbert&#8217;s most unproductive meetings:</p>
<p>&#8220;So we add the game to the character: character.addGame(game)&#8221;<br />
&#8220;But why don&#8217;t you add the character to the game?&#8221;<br />
&#8220;I see duplication, I see duplication!&#8221;<br />
&#8220;But isn&#8217;t this, um, less expressive?&#8221;<br />
&#8220;Duplication is bad!&#8221;<br />
&#8220;Why do you assign null to a variable, this is done automatically&#8221;</p>
<p>After some time of silent observation I realized that sometimes I am exactly like this! So to all of you who have to cope with me on a daily basis: just hit me on the head with a big club from time to time.</p>
<p>The next session was a series of &#8220;lightning talks&#8221; about all kind of Agile topics where I learned about <a href="http://alistair.cockburn.us/index.php/Crystal_methodologies_main_foyer">Alistair Cockburn&#8217;s Crystal</a>, which is a set of methodologies built upon the Agile principles and an extreme tailoring approach.</p>
<h3>Day 2</h3>
<p>Despite the enormous amount of a whole liter of &#8220;badisches Helles&#8221; I had in the evening I was wide awake and ready to suck in new ideas during the conference&#8217;s main part. The day started with an interesting presentation by Dave Nicolette about how to communicate TDD and design debt to your management. I was particularly stunned by the fact that he did talk about the cost of design debt and the refactoring part in the TDD cycle for a very long time without mentioning the cost of fixing an error in terms of when it is found and the shortened feedback cycles that TDD provides.</p>
<p>The next presentation was titled &#8220;why Agile projects fail&#8221;, but turned out to be about why projects fail in general and provided some insight into the ideas of root cause analysis (<a href="http://www.isixsigma.com/library/content/c020610a.asp">5 Why</a>), the dimensions in which failure can occur (<a href="http://www.ambysoft.com/essays/brokenTriangle.html">The Broken Triangle</a>), and the psychological factors that are the real cause of ineffective development practices.</p>
<p>After lunch the keynote by &#8220;Dark Side&#8221; Rod Austin from HBS showed how Agile development fits the icy wind of change that swirls today&#8217;s leading companies in the world from a cost competitive to an innovative business model. After all, who doesn&#8217;t want a <a href="http://www.myvipp.com/">designer trash bin</a>?</p>
<p>Stfan Roock&#8217;s talk on &#8220;Simplicity in Software Projects&#8221; was a very entertaining lecture on how easy it is to get so accustomed to complexity that you don&#8217;t even realize how simple things could be. Well, that and that the Borg are the only entities in the universe who understand that when you travel through space <a href="http://en.wikipedia.org/wiki/Image:Borg_Cube_Model_1.JPG">aerodynamics is pointless</a>.</p>
<p>In the end it was very interesting to see big German companies like SAP, EADS and Siemens to take interest in extreme programming. Looks like those ideas are finally going mainstream.</p>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2007/11/25/xpdays-germany-2007-ideas-going-mainstream/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Does &#8220;Test After&#8221; Work For You?</title>
		<link>http://klimek.box4.net/blog/2007/11/17/does-test-after-work-for-you/</link>
		<comments>http://klimek.box4.net/blog/2007/11/17/does-test-after-work-for-you/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 22:26:29 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/2007/11/17/does-test-after-work-for-you/</guid>
		<description><![CDATA[&#8220;Why not write a test for this?&#8221;
&#8220;Why should I, it works&#8230;&#8221;
The idea of Test-After Development is to write a set of automated white-box tests after writing your production code. Since probably every CS student in the world has learned that unit tests are a good idea, you&#8217;d expect unit testing to be an industry state [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Why not write a test for this?&#8221;<br />
&#8220;Why should I, it works&#8230;&#8221;</p>
<p>The idea of Test-After Development is to write a set of automated white-box tests after writing your production code. Since probably every CS student in the world has learned that unit tests are a good idea, you&#8217;d expect unit testing to be an industry state standard for quite a while now. Interestingly the idea of automated unit and integration test is lately becoming more popular due to the widespread use of Test-Driven Development.</p>
<p>So why do we need Test-Driven Development to be able to efficiently write automated unit tests?</p>
<ul>
<li>If you write your code first and don&#8217;t think about how to test the code, the code will not be testable. Thus testing becomes expensive and frustrating. Test-Driven Development will guide your software design by the old mantra of &#8220;how-do-I-want-to-use-this-class&#8221;, leading to a highly decoupled design.</li>
<li>When you write your tests, you&#8217;ll discover a lot of errors. But instead of the red bar in Test-Driven Development, which you <em>expect</em>, the red bar in Test-After Development is the demotivating sword of reality.</li>
<li>The most important reason why I have never seen Test-After Development work, is that developers just don&#8217;t believe in errors once they wrote the code. This seems to be an eternal wisdom of software development psychology: once the code works, why bother testing it? Let&#8217;s just implement the next feature.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2007/11/17/does-test-after-work-for-you/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fasten Your Seat Belts! &#8211; Chances And Pitfalls Of Test Driving Your Development</title>
		<link>http://klimek.box4.net/blog/2007/11/01/fasten-your-seat-belts-chances-and-pitfalls-of-test-driving-your-development/</link>
		<comments>http://klimek.box4.net/blog/2007/11/01/fasten-your-seat-belts-chances-and-pitfalls-of-test-driving-your-development/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 22:32:23 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/2007/11/01/fasten-your-seat-belts-chances-and-pitfalls-of-test-driving-your-development/</guid>
		<description><![CDATA[Ten years ago I had a rendezvous with a beautiful girl, and at the end of the evening I gave her a ride home. Back than I thought playing the gentleman to be posh, so I opened the door for her. She slid with one elegant movement into her seat and I paced around the [...]]]></description>
			<content:encoded><![CDATA[<p>Ten years ago I had a rendezvous with a beautiful girl, and at the end of the evening I gave her a ride home. Back than I thought playing the gentleman to be posh, so I opened the door for her. She slid with one elegant movement into her seat and I paced around the car and folded my wiry frame behind the steering wheel. I looked at her.</p>
<p>&#8220;Don&#8217;t you want to start?&#8221;, she asked and watched me curiously. &#8220;Um&#8221;, I said, obviously always finding the right words at the right moment. &#8220;Um. &#8211; Not before you buckle up&#8230;&#8221;. She frowned at me: &#8220;But I never buckle up&#8221;. I replied &#8220;Well, if you don&#8217;t buckle up, we&#8217;re not gonna go anywhere tonight&#8221;. &#8220;Oh come on!&#8221;, she now somewhat furiously stated. &#8220;Nope!&#8221; I insisted eloquently, finally feeling her shield of stubborn resistance falter. It took a few seconds before she realized that I really wouldn&#8217;t drive her home without her being properly protected from falling through the windshield and decomposing her pretty head by hitting the next best fireplug. So she buckled up.</p>
<p>Even back than I was so used to the secure feeling of the protective belt that just thinking of driving unbelted drove an uneasy quiver through my guts. This feeling is so strong that if I don&#8217;t drive strapped when moving the car just a few inches there&#8217;s always a sense of awareness that makes me want to fasten the seat belt immediately.</p>
<p>Today I felt exactly the same way while writing code.</p>
<h3>The path of the test</h3>
<p>At the beginning of the last iteration we identified a story that affected some legacy modules in our code base. When we recognized that the changes we needed to make would touch more code than we had thought, so we decided to try to test drive a part of the system from scratch to replace the tangled old code. So Richard, Reinhard and myself started to pair on the story alternately. Besides some private experiments with a Sudoku solver in Java this was the first time I was doing real full time TDD pair programming for a couple of days. Aside from some initial irritation and the constant realization that pair programming is hard to learn I was quickly pulled into the red-green-refactor cycle, as usual. But this time I held the pace for longer than ever. And was pulled into the cycle deeper and deeper. Write a test, make it work, look for redundancy. Write a test, make it work, look for redundancy. Write a test&#8230;</p>
<p>Today I wanted to quickly integrate the changed interface into an existing module. I didn&#8217;t have a test yet. The cpp file was readily opened in my editor. Just a quick edit, nothing more than integrating this interface. A few simple edits. Only three lines or something. And suddenly a nagging question materializing in my head:</p>
<p><b>How can I make sure this works?</b></p>
<p>At this moment I felt like driving unbuckled. I felt unsafe. I wanted my cozy safety net back. Like an addict I went for the next test.</p>
<h3>What use is a seat belt when you hit a tree at 200 MPH?</h3>
<p>Since I&#8217;m the one driving the adoption of XP in our company, I wanted to try TDD for myself on a save playground to learn more about the ins and outs before applying it at work. Since Java has really nice tools for TDD, I started test driving a small Sudoku solver in Java. This was my first real test driven code and I often wondered about how nicely the test suite covered my errors. Spirited in the Agile fashion, I began with a really straight forward brute force implementation. Everything went a lot more smoothly than I had expected and after some coding I had a simple solution that needed over 90 seconds for one simple Sudoku.</p>
<p>After a while I wanted to optimize the runtime. So I introduced some caching variables. I struggled with the failing tests as my solution grew more and more sophisticated, but the tests helped me to get to a deeper understanding of the real problem. Finally I arrived at a point where the algorithm managed to work through 1400 Sudokus in less than a second. I was thrilled. And I wanted more. So I installed a profiling framework to find out where the next optimization sweet spot would be hidden. When I browsed the profiling data I realized that the real solver didn&#8217;t even <em>call</em> the algorithm. So I had benchmarked a program that didn&#8217;t solve any Sudoku at all.</p>
<p><b>At this moment I felt like hitting a tree with 200 MPH, suddenly realizing that it is not a good idea to drive that fast into a 90-degree turn on a wet street, even if you have a seat belt.</b></p>
<p>After the blood had returned to my head on it&#8217;s way to my brain I implemented a test into the main program to check every solution with a simple algorithm before claiming to have solved anything. In the meantime I have a solution that runs 1400 Sudokus in 6 seconds on my core 2 notebook. I&#8217;m even quite convinced that I got the solution part correct&#8230;</p>
<h3>Do I get my driver&#8217;s license?</h3>
<p>So, here&#8217;s the lesson I learned on this journey on my path to the test:</p>
<ul>
<li><b>Don&#8217;t rely on your tests too quickly.</b><br />
If you want to heed the XP advice to &#8220;test everything that can possibly break&#8221;, be aware that it&#8217;s often the things of which you think that they can&#8217;t break that finally break.
</li>
<li><b>Use a healthy mixture of tests on all abstraction levels.</b><br />
Unit and functional tests are orthogonal &#8211; they cover different aspects of the code. But of course you&#8217;ll already have a lot of unit <em>and</em> functional tests if you don&#8217;t rely on your tests too quickly.
</li>
<li><b>Buckle up!</b><br />
The unsafe feeling while trying to modify code without having a test was a very impressive experience for me. I know that from now on I&#8217;ll fasten my code&#8217;s seat belt.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2007/11/01/fasten-your-seat-belts-chances-and-pitfalls-of-test-driving-your-development/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Big Design Up Front vs. Just Enough Design Initially</title>
		<link>http://klimek.box4.net/blog/2007/10/20/big-design-up-front-vs-just-enough-design-initially/</link>
		<comments>http://klimek.box4.net/blog/2007/10/20/big-design-up-front-vs-just-enough-design-initially/#comments</comments>
		<pubDate>Sat, 20 Oct 2007 12:40:12 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/2007/10/20/big-design-up-front-vs-just-enough-design-initially/</guid>
		<description><![CDATA[Software is complicated. More often than not it&#8217;s a complicated mess. Sometimes even a tangled complicated mess. And wherever you look all you see is tradeoffs. There are no easy solutions &#8482;. The dll hell is replaced by the side-by-side hell. Emacs is better than Vim, Vim is better than the Visual Studio editor and [...]]]></description>
			<content:encoded><![CDATA[<p>Software is complicated. More often than not it&#8217;s a complicated mess. Sometimes even a tangled complicated mess. And wherever you look all you see is tradeoffs. There are no easy solutions &#8482;. The <a href="http://en.wikipedia.org/wiki/DLL_hell">dll hell</a> is replaced by the side-by-side hell. Emacs is better than Vim, Vim is better than the Visual Studio editor and the Visual Studio editor is better than Emacs. The Visual Studio editor even has a kill-ring (Ctrl-Shift-Ins). But Emacs has a web-browser. Vim is way cooler because I can&#8217;t remember the commands, even though they&#8217;re orthogonal. To what? Why not write a new editor in Erlang. Well, no, not me, I just want an editor that has all the features of Emacs, Vim and Visual Studio. Now. But without the bloat of Emacs. Or Visual Studio. More slick, just like Vi.</p>
<p>Since the early days of computer science, when software developers still had to wear suits at work and wrote A.I.s in Cobol, um, COBOL, with their feet, people tried to find out how software development could be made less complicated. And they soon discovered that the secret sauce is <a href="http://en.wikipedia.org/wiki/Abstraction">abstraction</a>. </p>
<h3>Abstraction</h3>
<p>Layers. Components. Modules. Interfaces. Design. Architecture. It&#8217;s so easy: define an architecture, think of layers, interfaces, modules. Create a nice design that meets this architecture&#8217;s goals. Hire a bunch of developers to implement the components. </p>
<p>From this level of abstraction it really sounds easy. This is why it&#8217;s called abstraction: it hides the complicated details. The good thing is that as long as you work on this level of abstraction, it&#8217;s cheap to change your concept. Or as Joel Spolsky says:</p>
<blockquote cite="http://www.joelonsoftware.com/items/2007/09/06.html"><p>Designing a feature by writing a thoughtful spec takes about 1/10th as much time as writing the code for that featureâ€”or less.</p></blockquote>
<p>Well, than it&#8217;s obviously a very good idea to do all the design first. After all, if you change your design, you&#8217;ll have to change your implementation. As long as you didn&#8217;t start writing code, changing your design is easy. Or even better, start at the architecture level. Hire the best consultants to create the perfect architecture. Hire some really bright guys to do your design. In the end, a bunch of monkeys can do the implementation. The dream of the pointy-haired boss came true!</p>
<p>&#8220;Um. Sounds easy. So, how do we know that our design is good?&#8221;<br />
&#8220;This is easy: experience.&#8221;<br />
&#8220;But to get experience I&#8217;d have to actually <em>try</em> the design, won&#8217;t I?&#8221;<br />
&#8220;Yes, of course.&#8221;</br><br />
&#8220;So, if my design is not perfect in the first place, I&#8217;ll learn this only when I try to implement it?&#8221;</br><br />
&#8220;Well, yes, come to the point.&#8221;</br><br />
&#8220;Then how can I finish my design before the implementation phase?&#8221;</br><br />
&#8220;Um. Well. You just do iterations. Big iterations, I guess, because design is so much easier to change.&#8221;</br><br />
&#8220;So I work for months on a design of which I don&#8217;t even know that I will be able to implement it?&#8221;</br><br />
&#8220;Perhaps&#8230; easier to. Um, change&#8230;&#8221;<br />
&#8220;And when I finally find out that my design was crap, I&#8217;m in the implementation phase, a deadline looming on the horizon and no time to change the design and all the code that was already written?&#8221;<br />
&#8220;&#8230; &#8211; well, is there a different way?&#8221;</p>
<h3>Feedback</h3>
<p>Tradeoffs again. Working with abstractions means to get less feedback. &#8220;I&#8217;ll take the chair and hit the sentinel&#8221; will be a hard job if the chair turns out to weight a hundred pounds. </p>
<p>And feedback is important. One of the laws of software development is:<br />
<b>The longer it takes until you find out that you made an error, the more costly it is to fix that error.</b></p>
<p>This means that you should try to find your errors as quickly as possible. But when you&#8217;re working on a high abstraction level, you just don&#8217;t know all the complicated details because, well, that&#8217;s why you&#8217;re working on that high abstraction level, isn&#8217;t it? So you&#8217;ll find out that your design is crap when you&#8217;re in the &#8220;implementation phase&#8221;, at which point nobody has time to change the design. So you just live with the crappy design and run around cursing the designer and hating your job.</p>
<h3>Fail!</h3>
<p>One solution to discover your errors early, is to do <q>Ultra Extreme Elite Programming</q> (Joel Spolsky). Design just enough up front that you get an idea of where you&#8217;re going, write the target down as a test and sit down with a colleague to find a redundancy-free implementation. When you find out that your initial design is crap, which you&#8217;ll do very quickly, rely on your tests to help you refactor your code to a better design. Of course, as Joel puts it so beautifully, this is like <q>driving around with the handbrakes on</q>.</p>
<p>The question is whether driving around with the handbrakes on is really slower than driving at full speed with closed eyes and a plan. I think it mostly depends on where you want to end.</p>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2007/10/20/big-design-up-front-vs-just-enough-design-initially/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Defects On Sale!</title>
		<link>http://klimek.box4.net/blog/2007/08/28/defects-on-sale/</link>
		<comments>http://klimek.box4.net/blog/2007/08/28/defects-on-sale/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 15:13:05 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/2007/08/28/defects-on-sale/</guid>
		<description><![CDATA[Today after our planning game I did a short poll on how the guys perceive test driven development and pair programming. We&#8217;re trying to do both for some time now, and since I take the blame for introducing both practices, I feel I&#8217;m somewhat &#8211; um &#8211; preoccupied on that matter. A few days ago, [...]]]></description>
			<content:encoded><![CDATA[<p>Today after our planning game I did a short poll on how the guys perceive test driven development and pair programming. We&#8217;re trying to do both for some time now, and since I take the blame for introducing both practices, I feel I&#8217;m somewhat &#8211; um &#8211; preoccupied on that matter. A few days ago, I was caught totally off guard when Richard told me that, well, he doesn&#8217;t believe programming in pairs is more productive. Bummer. And I had believed my show to be grand circus.<br />
<span id="more-70"></span></p>
<p>Coming down to earth from my alien space shuttle of imaginative knowledge in the face of uncertainty I realized that I didn&#8217;t really have a clue what my teammates thought about our recent process improvement tactics. I figured the easiest way to find out would be to ask them. So I did a short poll. There were six people. Including me. I asked four questions:</p>
<table border="0" cellspacing="3" width="100%">
<tr>
<td>Question</td>
<td>Yes!</td>
<td>No!</td>
</tr>
<tr>
<td><em>Do you think TDD makes you more productive?</em></td>
<td>3</td>
<td>3</td>
</tr>
<tr>
<td><em>Do you think TDD leads to better quality?</em></td>
<td>6</td>
<td>0</td>
</tr>
<tr>
<td><em>Do you think pair programming makes you more productive?</em></td>
<td>3</td>
<td>3</td>
</tr>
<tr>
<td><em>Do you think pair programming leads to better quality?</em></td>
<td>6</td>
<td>0</td>
</tr>
</table>
<p>Now this is an interesting bite from the apple of knowledge: while we all seem to agree that pair programming and TDD increase code quality, half of the guys thinks that this raise in quality comes with a cost in overall productivity. Unfortunately shooting them with my nerf gun didn&#8217;t help to teach them reason, so I concluded that the half I am in may be wrong. Perhaps.</p>
<p>But since I usually don&#8217;t give in that fast I pondered over this anomaly of perception during our two-years-wedding-anniversary-dinner. While I munched down a deliciously flavorsome tenderloin, Anna proposed that maybe if you believe that TDD and pair programming don&#8217;t increase productivity you don&#8217;t expect to make any errors. While the implication would be true, the poll&#8217;s data seems to suggest that <em>all</em> of the guys think that the practices improve quality &#8211; which implies that they expect to make errors.</p>
<p>So when we arrive at a point where we are self-conscious enough about our code to expect ourselves to err frequently, a simple question remains:</p>
<p><b>What Is The Relation Between Quality And Effort?</b></p>
<p>This is where a little math may help&#8230; Let&#8217;s define the overall effort of a feature as the effort it takes to produce a certain function in lines of code (how crude!) plus the effort to fix the expected errors. The oversimplified measure of programming tasks in lines of code is, of course, questionable to the degree of calling it excrement of horned mammals. On the other hand it allows me to do a quick-and-dirty wort-case pi times thumb calculation.</p>
<pre class="code">
effort(feature) ->
    codingEffort(linesOfCode(feature)) +
    expectedFixingEffort(linesOfCode(feature))
</pre>
<p>Let&#8217;s further simplify (yuk) that the coding effort is defined as directly proportional to the lines of code of the feature:</p>
<pre class="code">
codingEffort(numberOfLines) ->
    codingEffortPerLine * numberOfLines
</pre>
<p>Excessive googling (and IEEEing) informs us that the defect rate is normally defined as <em>defects per thousand lines of code</em>. So without test driving my functions I&#8217;d expect the expected fixing effort to be something along the lines of:</p>
<pre class="code">
expectedFixingEffort(numberOfLines) ->
     fixingEffortPerDefect * (defectRate / 1000) * numberOfLines
</pre>
<p>But where does this lead? Good question. My answer is even more assumptions: Perhaps we can agree that if we make errors (and we do, don&#8217;t we) introducing practices that increase quality allows us to exchange coding effort (up-front-effort) with fixing effort. If you read carefully, perhaps you ask whether I may exchange effort for cost arbitrarily&#8230; well, technically, no, but since I&#8217;m a software developer the Flying Spaghetti Monster may smile forgivingly onto my unworthy soul.</p>
<p>For example, when I do pair programming and my partner finds an error that I didn&#8217;t see, the effort of this lapse is about:</p>
<ol>
<li>&#8220;hey, shouldn&#8217;t that read &#8216;>=&#8217; instead of &#8216;>&#8217;?&#8221;</li>
<li>&#8220;oh, yeah, &#8216;course&#8221;</li>
<li>*clickety-click*</li>
</ol>
<p>&#8211; 3 seconds &#8211;</p>
<p>When such a defect is not found until the product is in the field, the effort of fixing the error is:</p>
<ol>
<li>Cost of the error for the customer (lost money, lost customers, being angry, beating up the pup)</li>
<li>Reporting the error to the provider</li>
<li>Checking the error logs and dealing with the customer</li>
<li>Reporting the error to our hotline</li>
<li>Checking the error at our site and finding out what the error really is</li>
<li>Reporting the error to our development</li>
<li>Prioritizing the error</li>
<li>Trying to reproduce the error and find out what the customer <em>really</em> did</li>
<li>Finding the error</li>
<li>Fixing the error</li>
<li>Building a new patch-release</li>
<li>Testing the patch-release</li>
<li>Getting the patch-release approved by the customer</li>
<li>Updating the life-units with a certain probability of update-death</li>
<li>(More indirect cost due to loss of trust, etc)</li>
</ol>
<p>&#8211; um, more than 3 seconds, definitely &#8211;</p>
<p>I think it is not presumptuous to claim that increasing quality <em>may</em> also increase overall productivity if the expected effort to fix an error is high enough with regards to the expected decrease of errors due to better quality. The refined question is</p>
<p><b>What does a worst case error effort scenario look like in the break-even point of quality against productivity?</b></p>
<p>Let&#8217;s assume we know a practice that increases our coding effort by a factor (additionalEffort > 1) and improves our error rate by a different factor (defectRateImprovement in [0;1[). For the practice to be effort efficient the overall effort without implementing this practice must be greater than the overall effort when using the practice. Using the already defined formulas this yields:</p>
<pre class="code">
(codingEffortPerLine * numberOfLines) +
(fixingEffortPerDefect * (defectRate / 1000) *
    numberOfLines)
>
(additionalEffort * codingEffortPerLine * numberOfLines) +
(fixingEffortPerDefect *
    (defectRate * defectRateImprovement / 1000) *
    numberOfLines)
</pre>
<p>Tackling this equation with a load of 7-th grade mathematics gives:</p>
<pre class="code">
fixingEffortPerDefect * (defectRate / 1000) *
    (1 - defectRateImprovement)
>
codingEffortPerLine * (additionalEffort - 1)
</pre>
<p>Should this innocent looking inequation be close enough to reality to make any sense, we could conclude that</p>
<ul>
<li>After you cut down the defect rate by a factor of two, cutting it by yet another factor of two would require twice the opportunity cost. Which means that halving your defect rate gets more and more expensive with regards to the opportunity cost of letting the defect go wild.</li>
<li>If you know your current defect rate and your current price per defect, you can guess whether <em>the defect reducing effort</em> spent for a certain practice will be cost efficient. Of course a practice may and probably will have other impacts. But that&#8217;s a different bed-time story. Featuring a hungry gorilla and a beautiful princess.</li>
</ul>
<p>Now that we&#8217;ve got a nice equation we can torment it with some values, fed to our greedy mouths by the power of the Flying Spaghetti Monster. Let&#8217;s assume that we have a defect rate of 20 defects per 1000 lines of code (which a google search reveals to be considered somewhat &#8220;normal&#8221;). Let&#8217;s now assume that our practice increases coding effort by a factor of 2 (which is the worst case for pair programming, obviously). Let&#8217;s further assume that this will find one tenth of all errors directly when they&#8217;re implemented (fixing the errors in this phase is covered easily by the effort factor of 2). Watch and behold 3rd grade maths:</p>
<pre class="code">
fixingEffortPerDefect * (20 / 1000) * (1 - 0.9)
>
codingEffortPerLine * (2 - 1)
</pre>
<p>&#8230; or &#8230;</p>
<pre class="code">
fixingEffortPerDefect > codingEffortPerLine * 500
</pre>
<p>This means that for a defect rate of 20 errors per 1000 lines of code using a practice that doubles your coding effort and finds a tenth of the errors during coding will save you some bucks if the expected effort of fixing an error is more than 500 times the effort of writing a single line of code.</p>
<p>If you want even more numbers, let&#8217;s further assume that <a href="http://www.qsm.com/FPGearing.html">in C++ you need 60 lines of code per function point</a> (now we get really braggy) and that you can somehow earn $200 per function point, this means that our practice lowers overall cost if the expected price per defect is greater than about $1600.</p>
<p>It all boils down to this: If you work in an environment where the average price per defect found outside the holy halls of your development  team is greater than 2000 bucks, introducing a technique that doubles the coding effort to prevent a tenth of the errors will reduce development cost and thusly increase productivity. Well, if I really did a worst case analysis and didn&#8217;t mess up the seventh grade maths up there, that is. </p>
<p>Do you think a total expected cost of $2000 per defect is a lot? Does this apply to your work environment? Do you actually have any clue how much your favorite defect is today?</p>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2007/08/28/defects-on-sale/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How You Can Start Improving Your Software Process Today</title>
		<link>http://klimek.box4.net/blog/2007/06/29/how-you-can-start-improving-your-software-process-today/</link>
		<comments>http://klimek.box4.net/blog/2007/06/29/how-you-can-start-improving-your-software-process-today/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 21:23:34 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/2007/06/29/how-you-can-start-improving-your-software-process-today/</guid>
		<description><![CDATA[Are you a developer who dreams about a better software development process in the organization you work for? Maybe you read something about fancy practices on your favorite blog or mayhap you even touched one of those old-style paper collections called books? Do you have some concrete ideas on how to improve, but don&#8217;t know [...]]]></description>
			<content:encoded><![CDATA[<p>Are you a developer who dreams about a better software development process in the organization you work for? Maybe you read something about fancy practices on your favorite blog or mayhap you even touched one of those old-style paper collections called books? Do you have some concrete ideas on how to improve, but don&#8217;t know how to start? I was in the same situation a year ago. Here&#8217;s what I did and what I would do differently today.</p>
<p><span id="more-66"></span></p>
<p>One of the big obstacles when trying to implement change is your own doubt. When you&#8217;ve still got some sense left you&#8217;ll be very insecure about things you didn&#8217;t even try yet. Perhaps you even mentioned your idea already to some team members or a project lead, but all you got is skepticism. This is the point where it is easy to give up. How can you as a mere team member introduce any big change without the full support of the team and your management? The answer is simple: you can&#8217;t. At least not in one fell swoop.</p>
<p>For me doing nothing is not an option when I see the opportunity to improve. So how can you introduce a big change in small, safe steps and more importantly how can you convince your team members and management to try out your proposed changes? </p>
<h3>First: How do you measure up?</h3>
<p>The practice I expected to be the hardest to implement proved to be a fast-selling item: the story board. This is why I would aim for this target first. The story board will not only make your development process more transparent, it will also provide a simple process metric, your <i>velocity</i>.</p>
<p>To set up a story board is not that hard. Get a pin board, write your requirements and the predicted effort on small paper cards and pin all the cards you plan to finish within a fixed time (we use two weeks) to the board in a column headed &#8220;todo&#8221;. Whenever you start to work on an item, move the card to a column labeled &#8220;in progress&#8221; and when your task is done (<i>really</i> done) hang it over to the other finished cards where it can happily indulge in self-display.</p>
<p>After a fixed amount of time you take all the cards that are finished and count the effort you managed to implement. This is your velocity. Simple, easy, and hard to game. If you want to learn more about it, there&#8217;s an excellent <a href="http://www.xprogramming.com/xpmag/jatRtsMetric.htm">article by Ron Jeffries about the metric of &#8220;running, tested features&#8221;</a>.</p>
<p>But wait, isn&#8217;t measuring the software process <a href="http://www.joelonsoftware.com/items/2006/11/10b.html">what evil consultants do to make huge amounts of money by playing with fear</a>? Yes, it is. Then again, no, it&#8217;s not. It depends on what you do with the data. <a href="http://klimek.box4.net/blog/2006/12/28/review-object-oriented-metrics-in-practice/">Metrics are a two-edged sword</a>. You can use them to learn or to judge. Never do the latter.</p>
<p>Introducing the story board is not hard. I did it without asking anybody for permission. I just organized the pin board and started to pin up stories I worked on. It doesn&#8217;t take a lot of time, so it&#8217;s not too hard to get your team members to buy in. When you show your management that you finally managed to produce an easy, transparent metric they&#8217;ll find it useful, too.</p>
<h3>Second: The problem with problems.</h3>
<p>If you want people to change you&#8217;ll have to come up with a good reason. Change is never easy, so you have to convince people that you&#8217;re going to scratch <i>their</i> itches. To identify problems and assets you can use a <i>retrospective</i>. Propose a meeting where you discuss what runs smoothly, what runs not totally perfect and how to improve. Try to get the commitment to do this on a regular basis. </p>
<p>This should not be to hard to implement, either. From what I&#8217;ve heard management people usually don&#8217;t object to process improvement loop. And why should they? But what about your team mates? Do you think they will let the opportunity slip to vent their anger?</p>
<h3>Third: The solution.</h3>
<p>Now the really hard part begins: the actual change. The first two steps will make introducing the change easier since they provide a platform to introduce a change as a solution to a real problem and safeguard the change by measuring it&#8217;s outcome.</p>
<p>The platform is the retrospective. Let your team mates say what bothers them. If your observation of your development process was correct, they&#8217;ll bring up the same issues you already identified. After the rumble dies down, propose your change or set of changes as a possible solution. Now you have to face the storm.</p>
<p>But we have the velocity metric as a safe guard. Propose to try your improvement and see how it affects productivity. You can simply try it until the next retrospective and judge based on more experience than. This makes it easier for your management to support the idea, too, since it is clear that the final decision is yet to make.</p>
<h3>Steering your development process.</h3>
<p>If you are familiar with the concept of <a href="http://en.wikipedia.org/wiki/Test-driven_development">Test Driven Development</a> you know the concept of <i>steering</i> your own design. The same principle is used in Extreme Programming on a higher level to steer the product features by the planning game. The key principle is that each day you gain experience and are able to make better decisions based on your expanded knowledge.  Or, as Ron Jeffries likes to put it: Today is the dumbest day of the rest of your life.</p>
<p>Using a simple meta process you are able to steer your development process. Identify a problem, try a solution, measure the outcome, inspect what you learned. Redo from start. It&#8217;s not easy. In fact, it takes a lot of work to keep yourself and your environment self-aware and open to change since people seem to avoid change &#8211; it always means risk and effort. But using the same methods I used it&#8217;s not impossible, either. Taking the test driven way to process improvements will force you to make baby steps &#8211; sometimes you&#8217;ll hardly recognize movement, and this can drive you up the wall. But I&#8217;m still idealistic enough to believe that those baby steps will sum up and in the end you&#8217;ll reach the sun. Wherever that is.</p>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2007/06/29/how-you-can-start-improving-your-software-process-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Today The Test Suite Broke</title>
		<link>http://klimek.box4.net/blog/2007/06/12/today-the-test-suite-broke/</link>
		<comments>http://klimek.box4.net/blog/2007/06/12/today-the-test-suite-broke/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 21:26:07 +0000</pubDate>
		<dc:creator>klimek</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://klimek.box4.net/blog/2007/06/12/today-the-test-suite-broke/</guid>
		<description><![CDATA[When I arrived at work today I fired up Outlook and checked my mail. I found five mails from our auto-build server telling me that the build broke. Since we introduced test driven development and continuous integration only a short time ago this was not out of nowhere &#8211; the build usually breaks at least [...]]]></description>
			<content:encoded><![CDATA[<p>When I arrived at work today I fired up Outlook and checked my mail. I found five mails from our auto-build server telling me that the build broke. Since we introduced test driven development and continuous integration only a short time ago this was not out of nowhere &#8211; the build usually breaks at least once a day.</p>
<p>But today was the first day a <em>unit test</em> broke since we introduced TDD and CI.<br />
<span id="more-64"></span></p>
<p>At first I thought that perhaps somebody checked in a broken test yesterday evening. But then I dug into the whole thing and found out that yesterday the build was perfect. Somewhat bewildered I got myself a nice cup of hot, steaming coffee, started Visual Studio and tried to find the reason for the failed test. Since there was some cryptography involved and I didn&#8217;t know the ins and outs of this particular part of the system I asked the pair that wrote the code for help and we began a thorough debugging session.</p>
<p>As you can probably already imagine it was a date problem. A part of the systems cryptography was dependent on the system time and one of the algorithms broke <em>today</em>. We extracted a small mock-up that enabled us to simulate an arbitrary date as system date for the algorithm and found that this particular error would show up on two of 500 days since January the 1st.</p>
<p>So today was a 1:250 chance day.</p>
<p>What would have happened if this part of the code had no unit test. Well, most likely at some day in the future there would have been a bug report stating that the key that was entered by the service technician wasn&#8217;t accepted. Since at that point the same procedure would have worked a thousand times we&#8217;d probably blamed the poor technician and told ourselves that this &#8220;can&#8217;t possibly happen&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://klimek.box4.net/blog/2007/06/12/today-the-test-suite-broke/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
