<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Stefan Hendriks&#039; Blog</title>
	<atom:link href="http://stefanhendriks.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefanhendriks.wordpress.com</link>
	<description></description>
	<lastBuildDate>Fri, 13 Jan 2012 21:09:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='stefanhendriks.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Stefan Hendriks&#039; Blog</title>
		<link>http://stefanhendriks.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://stefanhendriks.wordpress.com/osd.xml" title="Stefan Hendriks&#039; Blog" />
	<atom:link rel='hub' href='http://stefanhendriks.wordpress.com/?pushpress=hub'/>
		<item>
		<title>First coderetreat of 2012 in Amsterdam &#8211; Retrospective</title>
		<link>http://stefanhendriks.wordpress.com/2012/01/12/first-coderetreat-of-2012-in-amsterdam-retrospective/</link>
		<comments>http://stefanhendriks.wordpress.com/2012/01/12/first-coderetreat-of-2012-in-amsterdam-retrospective/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 20:27:30 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Craftmanship]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[coderetreat]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[practice]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=502</guid>
		<description><![CDATA[At the end of 2011 I started organizing a coderetreat. It started on twitter around October. I&#8217;ve also posted about it in my last mini blog. The original event can be found here. If anyone was interested, they could sign up (max 25 people) for free. All you needed to do was bring your best [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=502&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At the end of 2011 I started organizing a coderetreat. It started on twitter around October. I&#8217;ve also posted about it in my <a href="http://stefanhendriks.wordpress.com/2011/12/23/merry-christmas-a-happy-new-year-and-a-coderetreat/">last mini blog.</a> The original event <a href="http://coderetreat.org/events/coderetreat-amsterdam">can be found here</a>.</p>
<p>If anyone was interested, they <a href="http://coderetreat.org/events/coderetreat-amsterdam">could sign up (max 25 people) for free</a>. All you needed to do was bring your best humor and if possible a laptop with your preferred dev environment set up. (Its not hard to organize one, <a href="http://coderetreat.org/hosting">check here if you&#8217;re interested</a>)</p>
<p>If you want to know more about what a coderetreat is, <a href="http://coderetreat.org/about">click here</a>. Even better: <a href="http://coderetreat.org/events">join a coderetreat</a> somewhere near you and <em>experience</em> it. It is way better than just reading about it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="attachment_515" class="wp-caption aligncenter" style="width: 790px"><a href="http://stefanhendriks.files.wordpress.com/2012/01/20110203212352-prakash.png"><img class="size-full wp-image-515" title="coderetreat-logo" src="http://stefanhendriks.files.wordpress.com/2012/01/20110203212352-prakash.png?w=780&#038;h=168" alt="Honing the craft together" width="780" height="168" /></a><p class="wp-caption-text">Coderetreat</p></div>
<p>Lets start with a management summary:</p>
<p><em><strong>It was awesome!</strong></em></p>
<p>It reminded me of <a href="http://stefanhendriks.wordpress.com/2011/09/18/experiencing-a-code-kata-become-a-better-developer-while-having-fun/">my experience with the bowling game kata</a> last year. Since you&#8217;re repeating the exercise over and over again, you will find different approaches. Even better, because you&#8217;re switching pairs, you will have a different mindset literally to approach the problem presented by the coderetreat. Instead of writing a bowling game, you will be working on Conway&#8217;s <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life">Game Of Life</a>.</p>
<p>The most notable things of that day where:</p>
<ul>
<li>In the very first session we where let &#8216;free&#8217;. We could approach this problem how we wanted. Me and my pair where able to implement the first three rules. However we where not able to implement the fourth rule. Our design was not easy enough to revive dead cells. (gosh, this reminds me of the bowling game code kata first attempt&#8230;)</li>
</ul>
<ul>
<li>The second session we got to choose from different constraints. I picked the &#8220;no conditionals&#8221; one, because I can get my methods under 4 lines without pain. Programming without no conditions is a whole different story though.</li>
</ul>
<ul>
<li>The third session with &#8216;only check in within 2 minutes, else revert everything&#8217; was an eye opener! It really forced you into thinking how to make all (baby) steps. Hence, I am using this at work now and it really works. I commit 10 times more often. Although I don&#8217;t make the 2 minute mark yet at work (5 minutes is easy though now).</li>
</ul>
<ul>
<li>The fourth session was fun, as we where able to implement *all rules* (opposed to the first session), but without the code we had implemented in the first session! We totally isolated the behaviour (this session was called &#8220;tdd as if you meant it&#8221;) and it blew our minds.</li>
</ul>
<p>Will I attend more coderetreats? You bet! Just need to take a look at <a href="http://coderetreat.org/events">the list of events</a> and pick an appropiate one. If I attend one, I will let you know (on twitter surely, perhaps on this blog).</p>
<p>If you want to know how it looked like, <a href="http://coderetreat.org/photo/photo/slideshow?albumId=6456126:Album:7006">click here to see som pictures</a> of the coderetreat.</p>
<p>I loved the coderetreat, and I&#8217;ll surely organize one again in the future. I would recommend anyone who loves his profession to join a coderetreat and practice. You&#8217;ll learn new things for sure!</p>
<p>How hard can it be, right? <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/502/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/502/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/502/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=502&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2012/01/12/first-coderetreat-of-2012-in-amsterdam-retrospective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>

		<media:content url="http://stefanhendriks.files.wordpress.com/2012/01/20110203212352-prakash.png" medium="image">
			<media:title type="html">coderetreat-logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Merry Christmas, a Happy new year and a coderetreat!</title>
		<link>http://stefanhendriks.wordpress.com/2011/12/23/merry-christmas-a-happy-new-year-and-a-coderetreat/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/12/23/merry-christmas-a-happy-new-year-and-a-coderetreat/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 12:37:05 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=478</guid>
		<description><![CDATA[I probably won&#8217;t be blogging some tech articles this year. So let me say it already: Merry christmas and a happy new year! Coming in 2012: Want to do some cool coding, and you&#8217;re nearby Amsterdam? Check out the code retreat I am organizing at 7th of january in 2012! And join it!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=478&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I probably won&#8217;t be blogging some tech articles this year. So let me say it already: </p>
<p><em>Merry christmas and a happy new year!</em></p>
<p><strong>Coming in 2012:</strong><br />
Want to do some cool coding, and you&#8217;re nearby Amsterdam? <a href="http://coderetreat.org/events/coderetreat-amsterdam">Check out the code retreat I am organizing at 7th of january in 2012! And join it!</a> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/478/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/478/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/478/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=478&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/12/23/merry-christmas-a-happy-new-year-and-a-coderetreat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>
	</item>
		<item>
		<title>Challenges when deploying your webapp, with multiple dependencies using Continous Integration. (Jenkins)</title>
		<link>http://stefanhendriks.wordpress.com/2011/12/17/challenges-when-deploying-your-webapp-with-multiple-dependencies-using-continous-integration-jenkins/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/12/17/challenges-when-deploying-your-webapp-with-multiple-dependencies-using-continous-integration-jenkins/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 19:28:18 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[deployment strategy]]></category>
		<category><![CDATA[hudson]]></category>
		<category><![CDATA[jenkins]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[webapp]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=416</guid>
		<description><![CDATA[Recently I&#8217;ve encountered a problem when deploying a web application using our CI environment. The probl&#8230; challange Sometimes the deployed website was not the latest version (with latest changes). I hope this blog post can save you some time, while figuring out what went wrong. A little background In this case, our CI environment is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=416&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve encountered a problem when deploying a web application using our CI environment.</p>
<p><strong>The probl&#8230; challange</strong><br />
Sometimes the deployed website <em><strong>was not the latest version (with latest changes)</strong></em>.</p>
<p>I hope this blog post can save you some time, while figuring out what went wrong.</p>
<p><strong>A little background</strong><br />
In this case, our CI environment is <a href="http://jenkins-ci.org/">Jenkins</a>, running on a Windows server. The artifact produced (a WAR) is uploaded to a Linux server where a deploy script is being ran, taking care of shutting down tomcat&#8217;s, cleaning work directories, and eventually copy the new WAR, then start everything again.</p>
<p><strong>First checks</strong><br />
First thing I have checked: Do my dependencies compile at the right order? Are they being deployed into our own artifactory? Is the task, responsible for creating the WAR, using the latest dependencies?</p>
<p>All these things where setup ok.</p>
<p>So why does it go wrong?</p>
<p><b>Deployment strategy</b><br />
In our case, we use the <a href="http://subversion.tigris.org/">SVN</a> revision nr as a version for our webapp. It is used by the deployment script, and by the uploading scripts as well. So this means, that when we are deploying revision 1000 of the website, a directory is created like : revision_1000 and the WAR file is uploaded into that directory. After that the deploy script is ran with the revision parameter.</p>
<p>This works well. It is used for several clients, and it has proved its worth thousand times. So this can&#8217;t be the problem right?</p>
<p><b>Branching strategy</b><br />
There are a few <a href="http://www.codinghorror.com/blog/2007/10/software-branching-and-parallel-universes.html">branching strategies</a> you can use within your projects. In this case, there is for each artifact an own trunk/branches/tags. This means that we can develop each component independently from each other. We can also branch versions of components. The website decides which versions of the components it uses.</p>
<p>This has several advantages. This particular website runs against a webservice that could change quite rapidly. We could be developing against version 1.0. Then later it would be 2.0, but when we had to go live we had to switch back to 1.0. Because of the branching strategy we have different branches for each webservice version, this mainly contains generated code from the WSDL&#8217;s and a thin layer. The website could easily switch between versions. Since we&#8217;re using <a href="http://maven.apache.org/">Maven</a> it was a matter of changing a version number of the dependency in the <a href="http://maven.apache.org/guides/introduction/introduction-to-the-pom.html">POM</a>.</p>
<p><a href="http://stefanhendriks.files.wordpress.com/2011/09/blog_stefan_branching_policy.png"><img src="http://stefanhendriks.files.wordpress.com/2011/09/blog_stefan_branching_policy.png?w=780" alt="Example" title="Branching Policy"   class="aligncenter size-full wp-image-433" /></a></p>
<p><b>So everything went fine, but it still did not work? How is that possible?</b><br />
Well.. thats where the real digging begins. It seemed that Jenkins reported that the task has completed with succes. However, when looking at the log, the script seemed to have failed. It failed because it could not create the revision folder to upload the WAR file to.</p>
<p>But how is that possible?</p>
<p>In this case, it is because of the <em>branching policy</em>.</p>
<p><b>The effect of the used branching policy</b><br />
Given each module a seperate trunk/branches/tags. When a change is made at component A, then it will <strong>not</strong> automatically raise the revision nr in component B. Only when a change is made at component A again, the revision will be raised there.</p>
<p>Meaning. When website (component A), is at revision 1000. And it uses a dependency (Component B), at revision 999. When deploying the website, a revision_1000 directory is created. </p>
<p><b>The culprit</b><br />
When a bug is found in Component B, and it is fixed. This will make Component B revision 1001. However, the website remains revision 1000. When the deploy task is checking out the website repository, it will find that the current revision is 1000 for that trunk. And, it will work from there. The deploy script wants to create a directory revision_1000 again, which will fail and will abort the script. It does  use the latest dependency though, but since the creation of the deploy directory failed, it never uploaded the latest WAR (it did not overwrite this). </p>
<p><b>&#8220;The&#8221; fix</b><br />
I see two ways to get out of this situation. Fix the deploy script, or change the branching policy. </p>
<p><b>Fixing the script&#8230;?</b><br />
Some may argue that it is correct, that the revision remains unchanged for the website, and that the deploy script should know how to deal with this. One way would be to not only use the revision number as deploy directory, but also a timestamp. Ie, revision_1000_DD-MM-YYYY-HH-MM. For instance: revision_1000-12-1-2011-21. </p>
<p><b>Change the branching policy</b><br />
Another way of fixing this issue, is to make sure that every time a change is made the revision number is being raised. The only way to be able to do this, is to let every component be beneath a branch or trunk, instead of having their own branches.</p>
<p>The components that are bound to the 3rd party webservices remain their branching policy. The downside would be that any fixes in these components still have this issue, but this time deliberately. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/416/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/416/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/416/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=416&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/12/17/challenges-when-deploying-your-webapp-with-multiple-dependencies-using-continous-integration-jenkins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>

		<media:content url="http://stefanhendriks.files.wordpress.com/2011/09/blog_stefan_branching_policy.png" medium="image">
			<media:title type="html">Branching Policy</media:title>
		</media:content>
	</item>
		<item>
		<title>Retrospective : JFall 2011</title>
		<link>http://stefanhendriks.wordpress.com/2011/11/07/retrospective-jfall-2011/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/11/07/retrospective-jfall-2011/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 20:34:16 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Craftmanship]]></category>
		<category><![CDATA[JFall]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[conference]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=437</guid>
		<description><![CDATA[I&#8217;ve visited JFall, a conference held by the NLJUG (Dutch Java User Group), at 2 november 2011. In this blog I&#8217;d like to share my experiences of this conference. This was my first time at this conference and I pretty much had no expectations. There was a lot to go to; I have visited the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=437&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve visited <a href="http://www.nljug.org/pages/events/content/jfall_2011/">JFall</a>, a conference held by the <a href="http://www.nljug.org/">NLJUG (Dutch Java User Group)</a>, at 2 november 2011. In this blog I&#8217;d like to share my experiences of this conference. This was my first time at this conference and I pretty much had no expectations.</p>
<div id="attachment_466" class="wp-caption aligncenter" style="width: 610px"><a href="http://stefanhendriks.files.wordpress.com/2011/11/jfall2011.jpg"><img src="http://stefanhendriks.files.wordpress.com/2011/11/jfall2011.jpg?w=780" alt="" title="jfall2011"   class="size-full wp-image-466" /></a><p class="wp-caption-text">My pass for JFall 2011</p></div>
<p>There was <a href="http://www.nljug.org/pages/events/content/jfall_2011/sessions/?template=showprogram.html&amp;fs=1">a lot to go to</a>; I have visited the following seemingly interesting topics:</p>
<p>- <a href="http://www.nljug.org/pages/events/content/jfall_2011/sessions/00025/">Keynote &#8211; Java 7 Directors Cut</a><br />
- <a href="http://www.nljug.org/pages/events/content/jfall_2011/sessions/00043/">Overthere &#8211; Design and implementation of a Java Remote File and Execution framework</a><br />
- <a href="http://www.nljug.org/pages/events/content/jfall_2011/sessions/00034/">Hands on lab &#8211; Clojure &#8211; A gentle introduction to a brilliant language</a><br />
- <a href="http://www.nljug.org/pages/events/content/jfall_2011/sessions/00071/">Keynote &#8211; Building Highly Scalable Java Applications on Windows Azure</a><br />
- <a href="http://www.nljug.org/pages/events/content/jfall_2011/sessions/00053/">Migrating Spring to Java EE 6</a><br />
- <a href="http://www.nljug.org/pages/events/content/jfall_2011/sessions/00030/">Hands on lab &#8211; Whats that smell? &#8211; Refactor away that nasy odor</a></p>
<p><strong>Its completely personal</strong><br />
For each topic I will write down my personal experiences. They are by no means complete. In fact they are completely biased. If you also have visited the JFall conference and you feel different about one of the topics; let me know in the comments below.</p>
<p><strong>Keynote &#8211; Java 7 Directors Cut</strong><br />
The keynote consisted of two parts: The first part was about Oracle; how they are not that bad and how they had a rough year in 2010. All I was thinking was : &#8220;<em>get on with it</em>&#8220;. The second part was about Java 7. It took quite some time before Java 7 was released. (yes <a href="https://blogs.oracle.com/javase/entry/java_7_has_released">Java 7 is released already</a>). In this part it was explained <a href="http://www.infoq.com/news/2009/03/java7_update">why it took so long</a> and how Oracle played a role in getting it released. </p>
<p><strong>Overthere &#8211; Design and implementation of a Java Remote File and Execution framework</strong><br />
This one was actually quite interesting. The talk was about a remote execution framework. Roughly said you could connect to a remote machine via this API, and then execute commands there. Its main goal is to make automated deployment easier. What I missed is they &#8220;why&#8221; part. Why is this framework built in the first place? What kind of trouble was this framework meant to solve primarily?</p>
<p><strong>Hands on lab &#8211; Clojure &#8211; A gentle introduction to a brilliant language</strong><br />
Although the start of this session was a bit clumsy; it was really <em>hands on</em>. We did a lot of practice stuff, but also here I did not get any answer to why and when I should use <a href="http://clojure.org/">Clojure</a> in the first place. Someone asked if it was used within webapplications. But it seems it is not used that much at all within webapps. (is this so?) The language itself is something to get used to, and 50 minutes was really too short for this. It did spark interest a bit. What I found most intriguing is that using Clojure it forces you to think differently about solving problems. I found that very valuable.</p>
<p><strong>Keynote &#8211; Building Highly Scalable Java Applications on Windows Azure</strong><br />
Microsoft presenting at a Java conference, who would have thought that? I think this actually was a great way for Microsoft to show how their attitude towards the Java community has changed. And for good reason. There are tons of Java powered (web) applications and <a href="http://www.microsoft.com/windowsazure/">Windows Azure</a> is a platform capable of running them. </p>
<p>The keynote was given at a high speed; and it had (very daring) a live demo. <a href="http://en.wikipedia.org/wiki/Murphy%27s_law">Of course something went wrong</a>, but in the end things did work. Also everybody could get a 30 day free trial of Windows Azure. The presentation concentrated about the effort needed to run Java based applications into Windows Azure. Also, it showed what configuration was needed to actually deploy an application. Aside the Java &#8216;support&#8217; at Windows Azure, some architect schema&#8217;s where shown of well known websites (Flickr, Twitter, etc) and the match with Windows Azure was made. (Like: Yes you can do all these things with Windows Azure).</p>
<p><strong>Migrating Spring to Java EE 6</strong><br />
This show starts with a big disclaimer, in the form of 3 slides and lots of talking about that &#8220;this presentation is not a shoot out&#8221;. I was wondering why, but the reason became clear after a few slides after that. In short, it was all the way &#8220;Spring Bashing&#8221; all the time. The use-case was that there was an old Spring application (what is old anyway?). And that you somehow must migrate. You have two options:<br />
A) Migrate to a new <a href="http://www.springsource.org/">Spring</a> version.<br />
B) migrate to <a href="http://www.oracle.com/technetwork/java/javaee/tech/index.html">Java EE 6</a>. </p>
<p>Since we both know the subject of this presentation we are *not* choosing option A. Then the &#8216;fun&#8217; part begins. The reasons given to use Java EE is mostly &#8220;because it is the standard&#8221;. I always get the chills of such comments. <a href="http://blog.codecentric.de/en/2011/03/java-ee-vs-spring-or-what-is-a-standard/">What is the standard anyway</a>? </p>
<p>Its a pitty, because the reason that Spring is <a href="http://www.mularien.com/blog/2008/09/19/how-open-source-is-spring-an-analytical-investigation/">propriety software</a> is actually <a href="http://www.theserverside.com/news/thread.tss?thread_id=50727">valid</a>. However, <a href="http://en.wikipedia.org/wiki/Technical_standard">it just won&#8217;t cut it</a> when yelling &#8220;<a href="http://en.wikipedia.org/wiki/De_facto_standard">its the standard</a>&#8220;. </p>
<p>Then it begins, the migration path. And guess what the first step is: <strong>Update to the latest spring version</strong>. The reason is that Spring has a great backwards compatibility. One would wonder why to migrate further away from Spring from that point. Basically migrating to the latest Spring version would be easier, painless and won&#8217;t cost your business that much.</p>
<p>Something different that struck me was an example of how Spring is unable to render objects given by a (JDBCTemplate) DAO as you will be presented with a LazyInitializationException. So the solution in Java EE is that you put an anotation that says the bean scope is &#8220;Request&#8221;. Apart from the fact that Spring can do this too, it is also in my opinion (in Java EE and in Spring) <a href="http://en.wikipedia.org/wiki/Model_View_ViewModel">a bad practice</a>. I think that objects returned by DAO&#8217;s should *never* be used in the view. They are not the same thing, so don&#8217;t even try it. If you do you&#8217;re being lazy.</p>
<p>I think the presentation would be much better if the starting point would be an assignment like &#8220;build a web application&#8221;. Then you could argue if you would need Spring and why not (since it would be about Java EE 6). Then, you could show everybody how Java EE 6 is capable of doing things Spring can do and how much it has been improved. This would probably be much better than bashing into an existing (older) Spring application and telling everybody to migrate just for the sake of standards. I don&#8217;t think any customer would be willing to pay that bill.</p>
<p><strong>Hands on lab &#8211; Whats that smell? &#8211; Refactor away that nasy odor</strong><br />
I love refactoring, so this one was more of a nice way to close the day. To me it was more like a rehearsal and getting the vocabulary right. I actually found that quite a positive side. Too bad it only lasted 50 minutes, which was way too short. The introduction was also a bit too long so the actual development time was not that long. </p>
<p><strong>In overall</strong><br />
It was big. It was busy. It was very nice to experience. Often I wanted more, more in depth, more time. I see that as a good thing <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . On the other hand, I think the NLJug should consider to spread JFall over two days. This way people can choose between several sessions, and the sessions given can be longer and allowed to be more in depth. Especially if the program has some repitition in it, I could choose to visit some workshops on day one, and then watch the presentations at day two which I would have missed at day one. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/437/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=437&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/11/07/retrospective-jfall-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>

		<media:content url="http://stefanhendriks.files.wordpress.com/2011/11/jfall2011.jpg" medium="image">
			<media:title type="html">jfall2011</media:title>
		</media:content>
	</item>
		<item>
		<title>Experiencing a Code Kata &#8211; Become a better developer while having fun!</title>
		<link>http://stefanhendriks.wordpress.com/2011/09/18/experiencing-a-code-kata-become-a-better-developer-while-having-fun/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/09/18/experiencing-a-code-kata-become-a-better-developer-while-having-fun/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 08:45:25 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Code Katas]]></category>
		<category><![CDATA[Craftmanship]]></category>
		<category><![CDATA[Quality]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[code kata]]></category>
		<category><![CDATA[tdd]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=351</guid>
		<description><![CDATA[Recently I have been experimenting with a Code Kata, and in this post I&#8217;d like to share my experiences with it. Code Kata? Code Kata&#8217;s have been around for a while, but it really came into my attention while reading Chapter 6 from the book The Clean Coder by Robert C Martin. This chapter makes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=351&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I have been experimenting with a Code Kata, and in this post I&#8217;d like to share my experiences with it.</p>
<h3>Code Kata?</h3>
<p>Code Kata&#8217;s have been around for a while, but it really came into my attention while reading Chapter 6 from the book  <a href="http://www.amazon.com/Clean-Coder-Conduct-Professional-Programmers/dp/0137081073">The Clean Coder by Robert C Martin</a>. This chapter makes an anology that at your work you&#8217;re a performer like a musician and outside work you (should be, like a musician) practicing. (Of course, you <em>will</em> learn while at work, but that is not the point).</p>
<h4>But what is a Kata?</h4>
<p>I have played the piano for around 6 years (followed lessons) and played it much less after that (in fact, I don&#8217;t really play at all anymore). In those six years I had to practice <a href="http://en.wikipedia.org/wiki/%C3%89tude">etudes</a> as well as more famous pieces. I did not understand why I had to practice Etudes, until much later. </p>
<p>So what has an Etude to do with Kata&#8217;s? Lets look at the description of an Etude (at wikipedia): </p>
<blockquote><p>&#8220;an instrumental musical composition, most commonly of considerable difficulty, usually designed to provide practice material for perfecting a particular technical skill&#8221;</p></blockquote>
<p>Without going into detail of a Kata <a href="http://en.wikipedia.org/wiki/Kata">itself</a>, it is used to practice and perfect a set of techniques. Repetition and practice until you&#8217;re able to perfectly perform a Kata (or an Etude if you will) will help you further when you need to improvise or apply it in different forms. A lot of Etudes, techniques, are used in real pieces. A lot of Code Kata&#8217;s are actually dealing with real world problems.</p>
<h4>Its not all about the solution!</h4>
<p><em>So if I practice enough code kata&#8217;s I will become good at any problem I might face when writing software?</em> </p>
<p>Not quite. </p>
<p>Code Kata&#8217;s are flexible; meaning you must set yourself a goal you want to achieve by doing a kata. When doing an etude you don&#8217;t have a lot of options. Your main goal is getting better with your fingers to play a series of notes or transitions. With a Code Kata you could practice your typing. Or perhaps practice all short-cuts of your IDE. Or heck, learn a new IDE while doing one. Perhaps you want to learn a new language. Perhaps you want to get better at TDD. Or you simply want to get to the solution and find the most efficient way to do so.</p>
<p>Atleast, I found doing a code kata <em>much more fun than doing an etude</em> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Bowling Game Kata</h3>
<p>The <a href="http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata">Bowling Game Kata</a> is a Kata that challanges you to write a class (Game) that simulates a bowling ball game. You can roll balls and give the amount of pins knocked down. At the end you can call the score() method and you should get the correct score. It takes all rules into account, gutter, spares, strikes and the tenth frame where you can have 3 rolls instead of 2. The perfect game has 300 points. The worst game 0.</p>
<p>My initial thought: <em>How hard can this be</em>? I mean come on, I&#8217;ve dealt with harder things than a bowling game scoring system. Since I did not do any Code Kata before I set my goal to find the solution to this kata while doing TDD. I also did not want to look too much ahead in Uncle Bob&#8217;s (very nice) <a href="http://butunclebob.com/files/downloads/Bowling%20Game%20Kata.ppt">presentation</a> (with solution). So I stopped when the game interface was given (roll() and score()) and I went ahead. Again, <strong>how hard could it be</strong>?</p>
<p>I have tried this Bowling Game Kata three times, and for each attempt I have written my experiences. All in all it was a very good experience and I recommend to try it out yourself. I believe if you want to get better, you need to practice. And only if you tried this multiple times, only then you know how it is. </p>
<p>So instead of talk the talk, let me walk the talk&#8230; </p>
<h4>First attempt &#8211; Deception</h4>
<p><strong>Goal:</strong> Get it working, while doing TDD.</p>
<p>I set up a simple project and started with the GameTest. The first two tests where easy to do (0 pins, and all ones). But as soon as I got into Spares my first thought was to create a Frame class. Because a Frame represents a &#8216;turn&#8217; where you can only roll 2 balls. The Frame class was born, along with its unit test. And I thought it felt good. I even added more &#8216;cheating&#8217; detection. So you cannot roll 3 balls in one frame, or you cannot say you rolled 2 pins and then 9 (making 11 in one frame). I felt great and got unit tests working like nothing could stop me. Until the &#8216;perfect game&#8217; test came around and my model just fell apart. </p>
<p>There was no way I could make it fit, without bending my entire model/solution.</p>
<p>So there I was, totally excited and thinking &#8220;just one more test and I&#8217;m done&#8221;.. and I got this. </p>
<p>Eventually I fixed it, I made my Frame class more flexible so I could set the maximum rolls and added flags. I then could create a TenthFrame class and set its flags so it would score differently. I also had created tests for the TenthFrame and even used an Abstract test class so I did not have duplicate code. Even so, I felt like this was wrong. I was bending my design just to work for one exception in the rules. </p>
<p>When I got all my unit tests passing, even the perfect score game, I just felt a great deception. My design sucked. Also, it took me almost 4 to 6 hours to get it working. Way too long for a code kata right?</p>
<p><strong>Lessons learned</strong><br />
- TDD cycles where not strict enough; so&#8230;<br />
- TDD cycles where slow, I had to switch mouse/keyboard to rerun the unit test(s)<br />
- I made design decisions too early and later got &#8216;stuck&#8217; and had to bend the design to make it work completely<br />
- Finding the solution the first time takes time<br />
- I made much more stuff than I had to (over-engineering?)</p>
<p><strong>Trivia</strong><br />
- Time taken: roughly 6 hours.<br />
- Amount of unit tests: 33 </p>
<h4>Second attempt &#8211; No need to bend the universe</h4>
<p><strong>Goal:</strong> Get it working, while doing TDD. Take lessons learned from first attempt. Aka: Tighter TDD cycles, get faster at TDD cycles, etc.</p>
<p>I started this kata late in the evening. I spent a fraction of the time compared to the first attempt: ~ 45 minutes(!).  The later half hour mainly refactoring and keeping green bars. The actual solution was there within an hour. I did not have to bend my design, I could keep everything within the Game class!</p>
<p>Something little, but practical I learned about the IDE I used (Eclipse) is to short-key the &#8216;rerun last test&#8217;, so my TDD cycles where shorter. </p>
<p>I also noticed I understood the scoring of the bowling game much better. I don&#8217;t play this game very much, and when I do, the computer does all the scoring for me. So I guess the first attempt at the Kata took also longer because I had to understand the scoring rules.</p>
<p>Design wise I found that I still use &#8220;frames&#8221;, but not as a separate class. I do not have any cheating detection (so I can roll 12 pins and it won&#8217;t complain), but the scoring will utterly fail in that respect. Building these checks in would not be a problem though, because the spare/strike detection is now so easy.</p>
<p><strong>Lessons learned</strong><br />
- Faster TDD cycle by using shortcut for re-running tests<br />
- TDD cycles where stricter, but could be even more tightened<br />
- Commenting out tests when more than one breaks really helps you get focussed on getting one thing to work (so leave one test breaking), instead of fixing all tests at once.<br />
- No cheating detection, no over-engineering<br />
- Of the time consumed, I spent more time refactoring relatively to the first attempt, than thinking / finding the solution.<br />
- I could refactor a lot of code, and make it much more cleaner. And safely due the tests.</p>
<p><strong>Trivia</strong><br />
- Time taken: roughly 45 minutes (!!)<br />
- Amount of unit tests: 7</p>
<h4>Third attempt &#8211; The only way to go fast is to go well</h4>
<p><strong>Goal: Tighten the TDD cycle. Get it done in 30 minutes or less.</strong><br />
This time I started fresh on a Sunday morning. Since I know the solution and I knew the design choices I made earlier (I know what works, and what does not work) things went very quick. I finished it within 30 minutes. I had the same amount of unit tests and the greatest thing was that the last test (perfect game) worked immediately. I did not had to change anything to make it work.</p>
<p>Once I had the last test working, I checked the code a bit and called it done. This time I also wanted to check my solution against the original presentation Uncle Bob made, to see if I missed anything or not. I figured that some of my tests where faulty:</p>
<p>- If you roll only ones, you can only roll 20 times and not 21 times. (i had a weird if statement to fix this up, but now it seemed that this was flawed).<br />
- The perfect game was in my case 21 strikes, while you can only roll 12 times in that case. When I changed my test, it still worked. </p>
<p>It struck me that I was approaching this technically (21 rolls is maximum), and not from a functional point of view (ie 20 is max when only ones).</p>
<p>I also found that my TDD cycles where still to wide. I could do run the cycles close to each line of code, but I tend to write 2 or 3 lines before re-running my tests. Especially the first tests where suffering from this, later tests went better.</p>
<p><strong>Lessons learned</strong><br />
- TDD cycles can be shortened<br />
- Functional point of view caught errors in my tests<br />
- Shortest kata ever (under 30 minutes)<br />
- Latest test worked, design was good. Design was even better after fixing the test for &#8216;only ones&#8217;, so I could remove weird if statements.</p>
<p><strong>Trivia</strong><br />
- Time taken: &lt; 30 minutes<br />
- Amount of unit tests: 5</p>
<h4>Retrospective</h4>
<p>So, after 3 attempts, do these Code Kata&#8217;s work for me? It surely learned me a few lessons. In short:<br />
- The first time you do a Kata, it is slow. And you&#8217;re focussed on the solution. This could throw you off, but you have to persist&#8230;<br />
- Later attempts are going much faster, and your focus shifts to other techniques. Mine was mainly speeding up my TDD cycle.<br />
- I have learned a few things to speed up my TDD cycle, which I can apply in real world stuff as well. <em>Which is good</em>!<br />
- Over-engineering <em>will</em> bite you, one way or another. Your design <em>will </em>be toast.<br />
- I have learned that even in my last example I was approaching the solution too technical. As a Developer I still did not approach it entirely functionally. This meant that even though I<strong> thought </strong>I was done, I wasn&#8217;t. I do plan to use Acceptance tests (using JBehave) for this. That will be covered in a next blog.<br />
- Above all, doing a Code Kata<em> is fun</em>!</p>
<p>I would advice to other developers to do Code Kata&#8217;s and get better at what they are doing. There are tons of areas where you can improve. In short, yes I do believe in them and I think you should give them a go, if you haven&#8217;t already!</p>
<p><strong>Find more about Code Kata&#8217;s:</strong><br />
<a href="http://codekata.pragprog.com/">http://codekata.pragprog.com/</a><br />
<a href="http://stackoverflow.com/questions/44533/your-favorite-code-kata">http://stackoverflow.com/questions/44533/your-favorite-code-kata</a><br />
<a href="http://www.codinghorror.com/blog/2008/06/the-ultimate-code-kata.html">http://www.codinghorror.com/blog/2008/06/the-ultimate-code-kata.html</a></p>
<p>If you really want light-weight warm up exercises, you might want to go to: <a href="http://codingbat.com/">http://codingbat.com/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/351/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/351/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/351/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=351&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/09/18/experiencing-a-code-kata-become-a-better-developer-while-having-fun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>
	</item>
		<item>
		<title>Refactoring</title>
		<link>http://stefanhendriks.wordpress.com/2011/09/13/refactoring/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/09/13/refactoring/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 18:42:13 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Craftmanship]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=366</guid>
		<description><![CDATA[In one of my previous posts I blogged about refactoring I did for my hobby project. Robert C Martin has a nice video showing refactoring, using IntelliJ. Watch it here. You can also see why unit testing is so important, as with each change the unit tests are being ran in order to check if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=366&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In one of my previous posts <a href="http://stefanhendriks.wordpress.com/2011/02/20/an-example-of-refactoring/">I blogged about refactoring</a> I did for my <a href="http://dune2themaker.fundynamic.com">hobby project</a>.</p>
<p>Robert C Martin has a nice video showing refactoring, using IntelliJ. <a href="http://tv.jetbrains.net/videocontent/refactoring-in-intellij-idea-live-by-robert-c-martin-uncle-bob">Watch it here</a>.</p>
<p>You can also see why unit testing is so important, as with each change the unit tests are being ran in order to check if anything got broken. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/366/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=366&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/09/13/refactoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>
	</item>
		<item>
		<title>How stackoverflow helps me to solve problems, without posting questions&#8230;</title>
		<link>http://stefanhendriks.wordpress.com/2011/07/01/how-stackoverflow-helps-me-to-solve-problems-without-posting-questions/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/07/01/how-stackoverflow-helps-me-to-solve-problems-without-posting-questions/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 19:11:45 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[stackoverflow]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=346</guid>
		<description><![CDATA[I really love stackoverflow. It brings developers, good ones, together. And because of the community active there, many questions I had where answered. However, I dare to say half of my questions where answered by not posting any question&#8230; The reason why? Its simple. In order to get the answer you seek, you need to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=346&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I really <a href="http://stackoverflow.com/">love stackoverflow</a>. It brings developers, <a href="http://www.codinghorror.com/blog/2011/02/how-to-write-without-writing.html">good ones</a>, together. And because of the community active there, many questions I had where answered.</p>
<p>However, I dare to say half of my questions where answered by <strong>not <em>posting</em> any question</strong>&#8230;</p>
<p>The reason why? Its simple. In order to get the answer you seek, you need to specify the problem <em>precisely</em>. Just posting &#8220;it does not work&#8221; with some vague description is not enough. It really helps to tell how you stepped through the problem, post snippets of code and so forth. If you are able to specify your problem like that, chances are high (at least with me) that the solution comes along with it. A so called &#8220;aha&#8221; moment. To me <a href="http://en.wikipedia.org/wiki/Rubber_duck_debugging">it is like Rubber Ducking</a>. By the time you are half-way through <a href="http://c2.com/cgi/wiki?RubberDucking">writing down the exact problem</a> you probably figured out the problem yourself. </p>
<p><strong>The good news:</strong></p>
<ul>
<li>You probably found 9 out of 10 &#8216;doh ofcourse its so obvious&#8217; issues. Preventing you to post &#8216;stupid&#8217; questions&#8230;</li>
<li>You end up posting really hard questions (making you look so smart).</li>
</ul>
<p><strong>The better news:</strong></p>
<ul>
<li>There are people out there who are even smarter than you! And make you smarter in return!</li>
<li>You do not have to talk to a real rubber duck at your desk, just type your question at stackoverflow. (your co-workers will stop worrying about your mental state, talking to that duck all the time).</li>
</ul>
<p>Its a win <em>win</em> <strong><em>win</em></strong>!</p>
<p>In other words&#8230;<br />
<pre class="brush: java;">
Answer answer = null;
try {
Question question = formulateQuestionPrecisely();
answer = stackOverFlowService.postQuestionAndGetAnswer(question);
} catch (AhaMomentException ame) {
// never mind, found the solution myself!
answer = ame.getAnswer();
}
</pre></p>
<p>Thanks stackoverflow!</p>
<p>(don&#8217;t forget to credit those who give the best answers.. it&#8217;s highly appreciated)</p>
<p>Now I just read that <a href="http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/">posting your question, while you know the answer already, is a good thing</a>. So the next time&#8230; consider that (but make sure your question has not been asked for already <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/346/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=346&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/07/01/how-stackoverflow-helps-me-to-solve-problems-without-posting-questions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>
	</item>
		<item>
		<title>The ten commandments of egoless programming</title>
		<link>http://stefanhendriks.wordpress.com/2011/06/21/the-ten-commandments-of-egoless-programming/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/06/21/the-ten-commandments-of-egoless-programming/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 19:10:11 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[craftmanship]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=338</guid>
		<description><![CDATA[Ever heard of the ten commendments of egoless programming? I came accross them a while ago. I just thought of putting them here for history sake, these ten are actually quite good and should be cached on every search engine&#8217;s server as many times as possible. I really like nr 6 a lot. How about [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=338&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever heard of the ten commendments of egoless programming? <a href="http://www.codinghorror.com/blog/2006/05/the-ten-commandments-of-egoless-programming.html">I came accross them a while ago</a>. I just thought of putting them here for history sake, these ten are actually quite good and should be cached on every search engine&#8217;s server as many times as possible.</p>
<p>I really like nr 6 a lot. How about you?</p>
<p>So, here a recite:</p>
<p><strong>1.	Understand and accept that you will make mistakes. </strong><br />
The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry, so we can, and should, learn, laugh, and move on.</p>
<p><strong>2.	You are not your code.</strong><br />
Remember that the entire point of a review is to find problems, and problems will be found. Don&#8217;t take it personally when one is uncovered.</p>
<p><strong>3.	No matter how much &#8220;karate&#8221; you know, someone else will always know more. </strong><br />
Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it&#8217;s not needed.</p>
<p><strong>4.	Don&#8217;t rewrite code without consultation. </strong><br />
There&#8217;s a fine line between &#8220;fixing code&#8221; and &#8220;rewriting code.&#8221; Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer.</p>
<p><strong>5.	Treat people who know less than you with respect, deference, and patience. </strong><br />
Nontechnical people who deal with developers on a regular basis almost universally hold the opinion that we are prima donnas at best and crybabies at worst. Don&#8217;t reinforce this stereotype with anger and impatience.</p>
<p><strong>6.	The only constant in the world is change.</strong><br />
Be open to it and accept it with a smile. Look at each change to your requirements, platform, or tool as a new challenge, not as some serious inconvenience to be fought.</p>
<p><strong>7.	The only true authority stems from knowledge, not from position. </strong><br />
Knowledge engenders authority, and authority engenders respect—so if you want respect in an egoless environment, cultivate knowledge.</p>
<p><strong>8.	Fight for what you believe, but gracefully accept defeat. </strong><br />
Understand that sometimes your ideas will be overruled. Even if you do turn out to be right, don&#8217;t take revenge or say, &#8220;I told you so&#8221; more than a few times at most, and don&#8217;t make your dearly departed idea a martyr or rallying cry.</p>
<p><strong>9.	Don&#8217;t be &#8220;the guy in the room.&#8221; </strong><br />
Don&#8217;t be the guy coding in the dark office emerging only to buy cola. The guy in the room is out of touch, out of sight, and out of control and has no place in an open, collaborative environment.</p>
<p><strong>10.	Critique code instead of people—be kind to the coder, not to the code.</strong><br />
As much as possible, make all of your comments positive and oriented to improving the code. Relate comments to local standards, program specs, increased performance, etc.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=338&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/06/21/the-ten-commandments-of-egoless-programming/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>
	</item>
		<item>
		<title>Slick java library and 64 bit</title>
		<link>http://stefanhendriks.wordpress.com/2011/03/26/slick-java-library-and-64-bit/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/03/26/slick-java-library-and-64-bit/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 18:53:18 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Game Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[slick]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=324</guid>
		<description><![CDATA[A long while ago I played around with Slick. A game library for Java. It offers easy 2d graphics drawing with the speed of OpenGL (by using LJWGL). It has much more features than that as well.  When I tried it I was running Win XP 32 bit. However, recently I was trying my code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=324&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A long while ago I played around with Slick. A game library for Java. It offers easy 2d graphics drawing with the speed of OpenGL (by using LJWGL). It has much more features than that as well. </p>
<p>When I tried it I was running Win XP 32 bit. However, recently I was trying my code again, this time on Windows 7 64 bit, and I encountered the following error:</p>
<blockquote><p>lwjgl.dll: Can&#8217;t load IA 32-bit .dll on a AMD 64-bit platform
</p></blockquote>
<p>I could not find a decent solution easily, but I fixed it by doing this:<br />
- <a href="http://slick.cokeandcode.com/static.php?page=sourcecode">Get the latest source of Slick</a><br />
- <a href="http://lwjgl.org/download.php">Download the latest LJWGL version</a><br />
- Use the latest LJWGL JAR and DLL files and put them into the latest source code of Slick<br />
- Run &#8220;ant dist&#8221; of Slick</p>
<p>Use the newly generated JAR of Slick and the new DLL files of LJWGL together, and you&#8217;re all set for 32 AND 64 bit!</p>
<p>If you just want to download everything (DLL and JAR&#8217;s), I&#8217;ve made a little archive for Windows users. It is unofficial though, no support given!. <a href="http://www.fundynamic.com/downloads/Slick32And64BitUnofficial.zip">Grab it from here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/324/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=324&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/03/26/slick-java-library-and-64-bit/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>
	</item>
		<item>
		<title>The &#8216;unit&#8217; in unit testing; and kinds of unit tests.</title>
		<link>http://stefanhendriks.wordpress.com/2011/03/21/the-unit-in-unit-testing-and-kinds-of-unit-tests/</link>
		<comments>http://stefanhendriks.wordpress.com/2011/03/21/the-unit-in-unit-testing-and-kinds-of-unit-tests/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 15:21:16 +0000</pubDate>
		<dc:creator>stefanhendriks</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Unit Testing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://stefanhendriks.wordpress.com/?p=301</guid>
		<description><![CDATA[Recently I had the oppertunity to explain some students about what unit testing was. I started off with the question of &#8220;What does unit testing mean?&#8221;. They gave different types of answers. One of them talked about the smallest piece of code. And even though he is &#8216;right&#8217;. I asked him to apply this knowledge [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=301&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I had the oppertunity to explain some students about what unit testing was. I started off with the question of &#8220;What does unit testing mean?&#8221;. They gave different types of answers. One of them talked about the smallest piece of code. And even though he is &#8216;right&#8217;. I asked him to apply this knowledge to his current code where he said &#8220;But I don&#8217;t want to test my get/set methods, that is useless!&#8221;. And so, our definition of &#8216;unit testing&#8217; became unclear again.</p>
<p>So what is a unit test? According to <a href="http://en.wikipedia.org/wiki/Unit_testing">this article on wikipedia</a> <em>&#8220;A unit is the smallest testable part of an application&#8221;</em>. But what does that mean? What is the &#8216;smallest testable part&#8217;? Do you need to test get/set methods? Do you need to test assigning values? Yes and no.</p>
<p>Even though the smallest testable part is related to lines of code, I believe it also is related to behavior. I think a better description for unit testing would be to <strong>test the smallest piece of behavior of an application</strong>. Most of the time you probably will be testing very little pieces of code with it. As long as there is some behavior (context) you want to test.</p>
<p>So do get/set methods fall into this category? Depends&#8230; Get/Set methods in themselves are, without context, useless. Returning a value or setting a value is not much worth of testing. However, if you test a method that calls a get/set method and <em>does something with it</em>, that is another story. When code is executed within a certain context, it is perfectly valid to unit test it. An example: getTotalPrice that just returns a value &#8220;price&#8221; is not worth to be testing. <strong>A getTotalPrice that does some calculation is a good candidate to test</strong>!</p>
<p>With software development, it is the expected behavior of the software that matters. I compare this with designing interfaces (seperating what and how), where you&#8217;re busy thinking what you would expect from a certain object when using it. The behavior of the software; how it presents itself and how the user can interact with it (the <em>how</em>), is different from how the software realizes this behavior (the <em>what</em>). When thinking in terms of behavior when writing code, we force ourselves to think of what the software should be doing, and not *how* it should be coded to do that. Test Driven Development is a way of forcing you to write code that has a good design. It clearly a functional (behavior) point of view. </p>
<p>With that said, a unit test should aim to test the smallest possible piece of <em>behavior</em>. When a total price is shown. There are a few steps taken before it is shown on the screen. One of the important behaviors is that the totalprice is calculated somewhere. Testing the calculation of the totalprice is a unit test. This is a <strong>State based test</strong>. (<em>Does the class give expected output X when using input Y?</em>)</p>
<p>The totalPrice is calculated from certain <em>input</em>. The <em>output</em> is shown on the screen.<br />
A controller class is putting input and output together, making sure the totalPrice is being calculated and pushed to the view. Making sure that the controller uses its collaborators to do that is also a unit test. This is called a <strong>collaboration test</strong>. (<em>Does my class call the collaborators that I expect, with the parameters I expect?</em>, yes you do that by <a href="http://en.wikipedia.org/wiki/Mock_object">Mocking</a>)</p>
<p>Even though with these two tests, you still miss an important type of test. You still need to test if your interfaces behave as they say they should. Should you test interfaces of external (3rd party) API&#8217;s? Probably not. Unless you have a reason to distrust your supplier of the API. Testing interfaces are called <strong>Contract Tests</strong> and look a lot like State based tests. These tests are making sure your expectations about the interfaces are validated! If you don&#8217;t do that you <em>will</em> get defects, even though you test states and behaviors.</p>
<p>Last but not least. It is useful to test broader pieces of behavior. For example, if you use Spring to bootstrap your webapp. You probably need to make sure everything is autowired correctly. That is an integration test. There are multiple types of integration tests. An often used integration test is to connect to a database, put data in, fire up some methods and test their behavior. All of them are integration tests. Hence, even testing whole pages (end-to-end tests) using <a href="http://seleniumhq.org/">Selenium</a>, those are also integration tests, although at a much higher level.</p>
<p>In time I will blog more about the type of unit tests.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stefanhendriks.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stefanhendriks.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stefanhendriks.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stefanhendriks.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stefanhendriks.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stefanhendriks.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stefanhendriks.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stefanhendriks.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stefanhendriks.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stefanhendriks.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stefanhendriks.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stefanhendriks.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stefanhendriks.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stefanhendriks.wordpress.com/301/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stefanhendriks.wordpress.com&amp;blog=6886101&amp;post=301&amp;subd=stefanhendriks&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stefanhendriks.wordpress.com/2011/03/21/the-unit-in-unit-testing-and-kinds-of-unit-tests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/49c2d074f82383efff562d16454a5570?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stefanhendriks</media:title>
		</media:content>
	</item>
	</channel>
</rss>
