<?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>brain driven development &#187; development</title>
	<atom:link href="http://gleichmann.wordpress.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://gleichmann.wordpress.com</link>
	<description>a development driven blog</description>
	<lastBuildDate>Wed, 21 Oct 2009 18:45:43 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='gleichmann.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/471b116f17b3834243906296b3ae9511?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>brain driven development &#187; development</title>
		<link>http://gleichmann.wordpress.com</link>
	</image>
			<item>
		<title>Scala in practice: Composing Traits &#8211; Lego style</title>
		<link>http://gleichmann.wordpress.com/2009/10/21/scala-in-practice-composing-traits-lego-style/</link>
		<comments>http://gleichmann.wordpress.com/2009/10/21/scala-in-practice-composing-traits-lego-style/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 18:44:29 +0000</pubDate>
		<dc:creator>Mario Gleichmann</dc:creator>
				<category><![CDATA[Scala]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://gleichmann.wordpress.com/?p=267</guid>
		<description><![CDATA[As a kid, i loved to play with Lego bricks, especially to build freaky spacecrafts.
At that time it was easy to let my phantasy go (where noone has gone before) and build completely new models simply by composing some standard bricks. Those bricks weren&#8217;t too specialized, meaning that there weren&#8217;t too many constraints on how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=267&subd=gleichmann&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As a kid, i loved to play with Lego bricks, especially to build freaky spacecrafts.</p>
<p><img class="alignleft size-full wp-image-268" title="spacecraft" src="http://gleichmann.files.wordpress.com/2009/10/spacecraft.jpg?w=219&#038;h=189" alt="spacecraft" width="219" height="189" />At that time it was easy to let my phantasy go (where noone has gone before) and build completely new models simply by composing some standard bricks. Those bricks weren&#8217;t too specialized, meaning that there weren&#8217;t too many constraints on how to combine them. On the other side you always had to compose a new spacecraft from the very ground up as there weren&#8217;t some more higher organized units like engines or control cabins.</p>
<p>Nowadays, you&#8217;ll find such units. There are engines, control cabins or a whole commando bridge, Wings, Field Generators and so on &#8211; a whole set of higher organized units whithin a single domain. On the other side, you can&#8217;t combine every unit with an arbitrary other unit within that domain since there are some &#8216;constraints&#8217;  that will prohibit some unsound combinations.</p>
<p>Now you may ask how that cute childhood story relates to Scala?<br />
You may have seen already some similarities to the field of software development where you also want to compose some higher organized building blocks within a certain domain, enforcing that they are only combined in a proper way. It turns out, that Scala&#8217;s concept of traits provide some mechanisms of &#8216;mixin&#8217; them together while enforcing the compliance of some constraints. This may sound too abstract at that point, but hold on &#8211; we&#8217;ll build some spacecrafts in the above mentioned way and things will get clearer.</p>
<h3>Look, it&#8217;s a spacecraft</h3>
<p>Let&#8217;s start with a hull for our spacecraft. To keep things simple and to focus on the core idea of constrained<br />
composition, the spacecraft&#8217;s hull will only provide one abstract method <em>engange</em> to start the craft:</p>
<pre class="brush: java;">
abstract class Spacecraft{

    def engage
}
</pre>
<p>As you can see, method <em>engage </em>and therefore the whole class is abstract, so you can&#8217;t instantiate a pure hull<br />
of a spacecaft. So whenever we want to build a full fledged craft, we may have to &#8216;add&#8217; (or mix in) a component<br />
that knows how to engage that craft.</p>
<h3>Captains place</h3>
<p>Typically, a spacecraft possess a kind of &#8216;control center&#8217; which is normally well suited for initiating the<br />
start of a craft, hence should provide an implementation for method engage. There may be different kinds of<br />
control centers that could be used for building your own, customized spacecraft &#8211; e.g. a whole commando bridge for<br />
those big deep space crafts or a small control cabin for those little crafts mainly maneuvering near the orbit.</p>
<pre class="brush: java;">
 trait CommandoBridge{

def engage { for( _ &lt;- 1 to 3 ){ speedUp } }

    def speedUp
}
</pre>
<p>Now we see what it means to engage (a Spacecraft) if composing a commando Bridge to the hull. We simply speed up that craft 3 times.<br />
But hold on &#8211; although we know what it means to engage that craft, speeding up that craft is not in the responsibility of the commando bridge, since <em>speedUp </em>is left abstract (speeding down is omitted since it follows the same mechanism &#8211; you get the idea).</p>
<h3>Re-calibrating all Dilithium crystals</h3>
<p>So the spacecraft seems to be incomplete without a unit to speed it up &#8211; let&#8217;s call such a unit &#8216;engine&#8217;.  Again, there may be different kinds of engines we could select from to assemble our craft.<br />
Let&#8217;s say there is a Pulse-Engine that directly supports the command of speeding up:</p>
<pre class="brush: java;">
trait PulseEngine{

    val maxPulse: Int

    var currentPulse = 0;

    def speedUp { if( currentPulse &lt; maxPulse ) currentPulse += 1  }
}
</pre>
<p>As you can see, a <em>PulseEngine </em>is able to speed up until a maximum pulse rate. In order to &#8216;produce&#8217; different pulse engines (supporting different maximum pulse rates for different types of crafts), the field is again left abstract.<br />
Now we could create our first spacecraft, using a commando bridge and a pulse engine (let&#8217;s say that&#8217;s all you need for building a full fledged spacecraft).</p>
<pre class="brush: java;">
class StarCruiser extends Spacecraft with CommandoBridge with PulseEngine{

    val maxPulse = 200
}
</pre>
<p>As you can see, we&#8217;ve created a new (Sub-)Type of a spacecraft and mixed in both Traits, obtaining a commando bridge (that knows how to engage the whole craft) and an engine (that knows how to get the craft into speed when engaging the craft).<br />
The only thing left is to define the maximum pulse rate our <em>StarCruiser </em>is able to achieve.</p>
<h3>Wiring</h3>
<p>In the above case, all units fitted together smoothly. For example, a pulse engine provided exactly the &#8216;interface&#8217; (<em>speedUp</em>) that was needed by a commando bridge, so you could compose both without additional work. Let&#8217;s take a look at another control center, that we could apply to our craft, that may offer an incompatible &#8216;interface&#8217; :</p>
<pre class="brush: java;">
trait ControlCabin{

    def engage = increaseSpeed

    def increaseSpeed
}
</pre>
<p>This time we need to do some additional wiring, if we want to compose a new type of craft using a control cabin and a pulse engine, since both units don&#8217;t fit together directly (the dependency needed by <em>ControlCabin </em>(<em>increaseSpeed</em>) isn&#8217;t directly fulfilled by <em>PulseEngine</em>)</p>
<pre class="brush: java;">
class Shuttle extends Spacecraft with ControlCabin with PulseEngine{

    val maxPulse = 10

    def increaseSpeed = speedUp
}
</pre>
<p>As you can see, we have to wire together the control cabin with the pulse engine in order to let them cooperate.<br />
In the same way, we could think of another kind of engine which offers a completely different &#8216;interface&#8217;:</p>
<pre class="brush: java;">
trait WarpEngine extends Engine{

    val maxWarp: Int

    var currentWarp = 0;

    def toWarp( x: Int ) { if( x &lt; maxWarp ) currentWarp = x }
}
</pre>
<p>Again, we need to wire together the concrete control center with the <em>WarpEngine</em>, depending on their incompatible &#8216;interfaces&#8217;.</p>
<p>Let&#8217;s compose a craft, using a commando bridge and a warp engine.<br />
Firstly, we are forced to define a maximum warp level, since it&#8217;s an abstract field of <em>WarpEngine</em>. Secondly we have to wire together the commando bridge with the warp engine, that is to &#8216;route&#8217; the commando bridge&#8217;s method <em>speedUp </em>to the warp engines &#8216;interface&#8217; <em>toWarp </em>with an appropriate implementation:</p>
<pre class="brush: java;">
class Explorer extends Spacecraft with CommandoBridge with WarpEngine{

    val maxWarp = 10

    def speedUp = toWarp( currentWarp + 1 )
}
</pre>
<p>Alternatively, we could also use a simple control cabin for another type of spacecraft. Again we have to link the contol cabins commands (<em>increaseSpeed</em>) to the warp engines &#8216;interface&#8217;:</p>
<pre class="brush: java;">
object Defiant extends Spacecraft with ControlCabin with WarpEngine{

    val maxWarp = 20 // claimed by WarpEngine

    def increaseSpeed = toWarp( 10 ) // claimed by ControlCabin
}
</pre>
<h3>Restricted Access</h3>
<p>Until now, we only applied a control center or engines to spacecrafts. But nothing would restrict us to use those units in other domains so far. Say we want to build a certain airplane and apply a warp engine.</p>
<pre class="brush: java;">
class Jet extends Airplane with WarpEngine{

    val maxWarp = 5
}
</pre>
<p>It&#8217;s propably not the best idea to equip a Jet with a warp engine, since this seems to be a bit oversized for an airplane. We need a way to restrict the usage of warp engines &#8211; they should be only applied to spacecrafts. Fortunately we can express this kind of constraint, using Scala&#8217;s self type annotation. Included within a trait, it&#8217;s like saying &#8216;<em>this trait is only allowed to be mixed into a type of x</em>&#8216; (in our case &#8216;<em>Spacecraft</em>&#8216;):</p>
<pre class="brush: java;">
trait WarpEngine extends Engine{

    this: Spacecraft =&gt;
    ...
}
</pre>
<p>As you can see, we used the <em>WarpEngine</em>s self type to restrict its appliance only to spacecrafts. In all other cases, Scala&#8217;s compiler will complain about an unsound mixin.</p>
<h3>What makes a spacecraft a spacecaft ?</h3>
<p>With selftypes, we now have an instrument to restrict the usage of a trait to be mixed in only to a certain Type.<br />
On the other side, we aren&#8217;t forced to use a control center or an engine at all if creating a new spacecraft, since we could provide an implementation of the spacecrafts abstract methods directly within a subtype. That may be fine in some cases, but what if we want to state that a spacecraft has to be composed of at least a certain type of control center and a certain type of engine? Again, we can use the service of the self type annotation, this time applied to our abstract class spacecraft, stating that a spacecraft should at least be compound of a control center and an engine:</p>
<pre class="brush: java;">
abstract class Spacecraft{

    this: ControlCenter with Engine =&gt;
    ...
}
</pre>
<p>The only thing left is to provide an appropriate type <em>ControlCenter </em>resp. <em>Engine </em>and the correct classification of those concrete units (e.g. <em>&#8216;CommandoBridge is a</em> <em>ControlCenter</em>&#8216;)</p>
<pre class="brush: java;">
 trait ControlCenter

 trait CommandoBridge extends ControlCenter{ ... }

 trait ControlCabin extends ControlCenter{ ... }

 trait Engine

 trait PulseEngine extends Engine{ ... }

 trait WarpEngine extends Engine{ ... }
</pre>
<h3>Summary</h3>
<p>Abstract methods and self type annotations are two powerful tools which help to guide or constrain the composition of traits.<br />
You may use abstract methods and abstract fields to enforce a kind of &#8216;wiring&#8217; between multiple units or at least to force the definition of some concrete information.<br />
You may use a self type annotation to restrict the appliance of a trait, so that it can only be mixed in to a certain type (or subtypes). On the other side, you&#8217;re able to enforce that a certain trait (or subtype) have to be mixed in to a certain type, again by using a self type annotation.<br />
In all cases, the &#8216;composer&#8217; of those units will be guided by the compiler &#8211; you can&#8217;t forget to give a definition for an abstract method or arrange an unsound composition, since all those &#8216;constraints&#8217; are based on Scala&#8217;s statically typed Type system.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gleichmann.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gleichmann.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gleichmann.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gleichmann.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gleichmann.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gleichmann.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gleichmann.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gleichmann.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gleichmann.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gleichmann.wordpress.com/267/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=267&subd=gleichmann&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gleichmann.wordpress.com/2009/10/21/scala-in-practice-composing-traits-lego-style/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mario.gleichmann</media:title>
		</media:content>

		<media:content url="http://gleichmann.files.wordpress.com/2009/10/spacecraft.jpg" medium="image">
			<media:title type="html">spacecraft</media:title>
		</media:content>
	</item>
		<item>
		<title>Talking about Scala</title>
		<link>http://gleichmann.wordpress.com/2009/09/21/talking-about-scala/</link>
		<comments>http://gleichmann.wordpress.com/2009/09/21/talking-about-scala/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 19:52:00 +0000</pubDate>
		<dc:creator>Mario Gleichmann</dc:creator>
				<category><![CDATA[Scala]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://gleichmann.wordpress.com/?p=249</guid>
		<description><![CDATA[

I will talk about Scala at the XPUG Rhein/Main (in Frankfurt / Germany) Meeting on October 6, 2009.
Beside a general introduction, we&#8217;ll take a closer look at some of the new possibilities that come along with the fusion of object oriented concepts and the ideas of functional programming, trying to widen the horizon esp. for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=249&subd=gleichmann&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div>
<div>
<p><img class="size-full wp-image-252 alignleft" title="scala-logo" src="http://gleichmann.files.wordpress.com/2009/09/scala-logo.png?w=73&#038;h=73" alt="scala-logo" width="73" height="73" />I will talk about <a title="Scala" href="http://www.scala-lang.org/" target="_blank">Scala</a> at the XPUG Rhein/Main (in Frankfurt / Germany) Meeting on October 6, 2009.</p>
<p>Beside a general introduction, we&#8217;ll take a closer look at some of the new possibilities that come along with the fusion of object oriented concepts and the ideas of functional programming, trying to widen the horizon esp. for imperative thinking &#8216;brains&#8217; &#8230;</p>
<p>Come along and feel welcome if you want to know more about functions as first class objects, Pattern Matching, Mixins or how to write your own custom control structures, making Scala a truly <em>SCA</em>lable <em>LA</em>nguage (and may want to discuss about afterwards).</p>
<p>Just give me a note at <em>mario.gleichmann@mg-informatik.de</em> if you’re interested to attend and i’m up for sharing further contact / meeting infos with you (talk will be in german, slides will be in english).</p>
<p>Entrance is free!</p></div>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gleichmann.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gleichmann.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gleichmann.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gleichmann.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gleichmann.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gleichmann.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gleichmann.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gleichmann.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gleichmann.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gleichmann.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=249&subd=gleichmann&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gleichmann.wordpress.com/2009/09/21/talking-about-scala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mario.gleichmann</media:title>
		</media:content>

		<media:content url="http://gleichmann.files.wordpress.com/2009/09/scala-logo.png" medium="image">
			<media:title type="html">scala-logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Did you really get Behaviour Driven Development?</title>
		<link>http://gleichmann.wordpress.com/2008/10/22/did-you-really-get-behaviour-driven-development/</link>
		<comments>http://gleichmann.wordpress.com/2008/10/22/did-you-really-get-behaviour-driven-development/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 22:12:29 +0000</pubDate>
		<dc:creator>Mario Gleichmann</dc:creator>
				<category><![CDATA[bdd]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://gleichmann.wordpress.com/?p=66</guid>
		<description><![CDATA[You maybe have noticed some new articles and product announcements recently, that turn themself in the &#8216;tradition&#8217; of Behaviour Driven Development (BDD).
Most of them mainly concentrate on the introduction of a new vocabulary in order to get rid of the test centric terminology. Some of them even suggest to stick with the well known xUnit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=66&subd=gleichmann&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>You maybe have noticed some new articles and product announcements recently, that turn themself in the &#8216;tradition&#8217; of Behaviour Driven Development (BDD).<br />
Most of them mainly concentrate on the introduction of a new vocabulary in order to get rid of the test centric terminology. Some of them even suggest to stick with the well known xUnit test frameworks and mainly kind of change their test method names (if only they contain the now famous word &#8217;should&#8217;) and think they&#8217;re done &#8230; really?<span id="more-66"></span></p>
<h3>Language is not THE Key</h3>
<p>Well, of course BDD is also about using the right Language (according to the linguistic theory of Sapir-Whorf), but this is only &#8216;one&#8217; legitimate instrument leveraging BDD, not the final goal! Furthermore, you won&#8217;t do BDD only by changing your vocabulary and continue to test the correctness of your traditional units (like classes or methods), only using another weapon.</p>
<p>So even you&#8217;ll use no test centric terms any longer, as long as you still use any kind of Language in order to verify that your code works appropriate (in the sense of &#8216;<em>i got some piece of code here and now have to find out if it works properly</em>&#8216;), we do not talk about BDD!</p>
<h3>Documentation is not THE Goal</h3>
<p>Yes, BDD emphasizes the value of comprehensible documentation. And yes, having an appropriate Language that makes it easy to produce readable &#8216;verifications&#8217; is of great value (at least if you want to learn something about the code that get&#8217;s verified or in case a verification fails and you have to identify the cause respectively the intended behaviour of the code)!</p>
<p>But that&#8217;s only a side effect, since it can also be achived with &#8216;ordinary&#8217; unit tests that act as so called documentation tests!So under the view of achieving communicating verifications, BDD doesn&#8217;t really differ from the usual way of TDD. It&#8217;s considered important for supporting the main Goal, but it isn&#8217;t THE Goal of BDD.</p>
<h3>Still testing units ?</h3>
<p>Most of those new tools still stick to the idea to center their &#8216;verifications&#8217; around the traditional units, like classes or methods. That said, the structure of your verification code mostly reflects the technical structure of your production code (this will often result in very brittle tests, where your verification implementation is tightly coupled to the implementation of the code being verified. This fact will increasingly set a constraint on refactoring code rather than enabling it, because it requires altering the tightly coupled verification logic as well and so becomes both time-consuming and error-prone).</p>
<p>In effect, instead of looking at a piece of behaviour under a certain context (no matter if this is achieved by a single class or a group of collaborators) you still look at a certain method and verify that it behaves correctly under a range of conditions. So the focus is still mainly on methods on single classes instead of pieces of behaviour.</p>
<h3>Still testing state ?</h3>
<p>If you are looking at a single unit (e.g. looking at a single class) you are really tempted to mainly make assertions about the state of that unit (for example before and after a method was called), mainly that&#8217;s because it&#8217;s more or less the only area you can make assertions about when looking at a single class. While a class may be a valid building block for some behaviour you&#8217;re interested in, it might prevents you from looking at behaviour that&#8217;s only achieved by a set of collaborators.</p>
<p>In addition to that, since you&#8217;re mainly focussed to some state of a single unit, you won&#8217;t be looking about the collaboration between multiple &#8216;units&#8217;. So the behaviour, that manifests in the interaction between those units is mostly disregarded.</p>
<h3>No emphasis on Interactions</h3>
<p>As said, some tools don&#8217;t regard most of the behaviour by not looking at interactions. In BDD, Mock objects are considered as an appropriate way to look at interactions, so a tool in the sense of BDD should offer a smooth inegration of a mocking framework or at least provide some mechanics to express expected behaviour in form of interactions. Having the focus on interactions i could really start looking at behaviour in the sense of <em>what </em>a building block does instead of <em>how </em>it does some functionality (like with state based testing).</p>
<h3>It&#8217;s NOT about verification</h3>
<p>Granted, using a test centric Language might head to some misconceptions and mistakes because we might think it&#8217;s about testing. Admitted, the current TDD vocabulary shapes a mindset that might takes us in a (wrong) direction, but as mentioned above, Language alone is not the Key to BDD, as long as you still think about verifying the state of single units at the core in a comprehensible way.</p>
<p>Not thinking about testing is a major statement of BDD: TDD is not a verification method but a design process &#8211; and BDD tries to highlight this fact, not by introducing a completely new method but by readjusting the focus &#8211; away from making assertions (proofing the correctnes of our code) towards expressing expectations about the behaviour of our code!</p>
<h3>It&#8217;s about Specification</h3>
<p>So if you write down expectations of what your code will have to do, your mindset will (hopefully) change slightly: You no longer write (unit) tests, but specifications of expected behaviour.<br />
So what&#8217;s the difference you may ask. Verification (aka testing) is all about making sure (i.e. proofing)<br />
that your code functions correctly while a specification is all about defining what it means for your code to function correctly&#8217; (Uncle Bob)!</p>
<p>So what we need is in fact a specification framework (instead of a test framework) that may provide a specification oriented language. But that&#8217;s not enough. As long as we stick to some ideas (like units or looking at state instead of interactions aka behaviour) that easily lead to proofing code instead of looking at expected behaviour, we won&#8217;t do TDD in the sense of BDD.</p>
<p>Far more important than any framework is the change of your mindset! It&#8217;s about a design process centered around readable (and as a side effect executable) specifications that will drive the design of your system. And any Article or tool that will guide you in this direction is of great help and truely in the tradition of BDD.</p>
<p>So think about Specification, not Verification &#8211; that&#8217;s what it&#8217;s all about.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gleichmann.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gleichmann.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gleichmann.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gleichmann.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gleichmann.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gleichmann.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gleichmann.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gleichmann.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gleichmann.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gleichmann.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=66&subd=gleichmann&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gleichmann.wordpress.com/2008/10/22/did-you-really-get-behaviour-driven-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mario.gleichmann</media:title>
		</media:content>
	</item>
		<item>
		<title>Yet another Book Recommendation List &#8211; Software development</title>
		<link>http://gleichmann.wordpress.com/2008/09/19/yet-another-book-recommendation-list-software-development/</link>
		<comments>http://gleichmann.wordpress.com/2008/09/19/yet-another-book-recommendation-list-software-development/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 10:06:42 +0000</pubDate>
		<dc:creator>Mario Gleichmann</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://gleichmann.wordpress.com/?p=51</guid>
		<description><![CDATA[There were surely a couple of books along your way as a software developer that influenced your mindset the most. That may be those books, that you&#8217;ve read quite some times ago but you still refer to those books in one or the other way (discussions, documentation, presentations, &#8230;) or at least still have effect [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=51&subd=gleichmann&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There were surely a couple of books along your way as a software developer that influenced your mindset the most. That may be those books, that you&#8217;ve read quite some times ago but you still refer to those books in one or the other way (discussions, documentation, presentations, &#8230;) or at least still have effect on how you see the world of software development and act within it, influencing a good part of your decisions and overall thinking in your every day job &#8211; those books that may be at the top of your shelf, because it&#8217;s always a good feeling to grab some of them every now and then again and re-read &#8230;<span id="more-51"></span></p>
<p>The following section presents some books that influenced the shaping of my mindset very strongly (and therefore is surely not representative for others or THE ONLY List of books for effectively shaping your way of thinking, nor is it complete in respect to any kind of criteria), along with a short reasoning about it&#8217;s impacts on me (means, it may not have the same impacts on you).</p>
<p>Please note, that the books are presented in no specific order &#8211; they were all important for me, getting new insights, each emphasizing quite different aspects. While those books provide a far wider range of knwowledge and insights than mentioned below, i&#8217;m only focussing on those main aspects that formed my overall understanding in the general field of software development.</p>
<h3><a title="The Pragmatic Programmer" href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X" target="_blank">The Pragmatic Programmer </a></h3>
<p>Regrettably, i read this book very late in my present career. It was recommended by a good friend of mine (THANK YOU SO MUCH Bastiaan !!!) and it hit me like a bomb when i first read it. This book was and still is one of the biggest sources of motivation for me, encouraging to invest in yourself, invest in your knowledge and staying curious, all written in a way that&#8217;s very fun to read (i had to think back to some of my previous projects with a big smile on my face more than once).<br />
If you would ask me about one single, recapitulatory advice, that stick the most to my mind, than it should be: don&#8217;t turn of your brain !!!<br />
At least, it&#8217;s the overall philosophy (a kind of zen) of that book that had and still have a great impact on me &#8211; and the title couldn&#8217;t be selected better. It&#8217;s truely a guide for becoming a pragmatic programmer.</p>
<h3><a title="Systems Thinking" href="http://www.amazon.com/Introduction-General-Systems-Thinking-Anniversary/dp/0932633498/" target="_blank">An Introduction to General Systems Thinking </a></h3>
<p>Once a prof at my university said, that every student should have deep knowledge in systems theory. I didn&#8217;t understand the importance of his words until i read this book! It showed me in a very funny way the obstacles of human thinking, especially related to complex systems. It&#8217;s a guide to &#8216;organize&#8217; your own thinking when it comes to problem analysis and problem solving (not only related to the field of software development).<br />
For me it opened my mind to a more sensible view of how we think and how we make decisions. It sharpened my cognition to a more holistic approach for looking at systems of any kind.<br />
This classic is truely one of the books that can make you see the world with different eyes after reading it.</p>
<h3><a title="Domain Driven Design" href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215" target="_blank">Domain Driven Design</a></h3>
<p>I stumbled upon this book by chance, but it affects the way how i think about designing enterprise systems up to this day.<br />
I think the mentioned ideas and concepts from within this book are one of the most i refer to in discussions or design sessions. If you think that the underlying technology isn&#8217;t the problem (or at least shouldn&#8217;t be the main problem, oftentimes responsible for bringing complexity into a system) and that&#8217;s the business that matters, even to the bones of your software, than this is the book for you!<br />
Beside that, it&#8217;s an easy agreeable advocator for bringing back the emphasis to the good old school of pure object oriented design.</p>
<h3><a title="J2EE Design and Development" href="http://www.amazon.com/Expert-One-Design-Development-Programmer/dp/0764543857" target="_blank">J2EE Design and Development</a></h3>
<p>I remember that i read this book while being on a project that heavily relied on the usage of EJB &#8211; Session AND Entity Beans (i think it was in the beginning of 2.0). I thought to get some more tips on how to apply the J2EE stack to my project the right way (yes, we had some &#8216;issues&#8217;, especially with Entity beans &#8230;).<br />
Instead, this book teached me not too much about a specific technology but rather about alternative forms of building enterprise systems. In a way, it opened my eyes for not to be too focussed on a certain stack of hyped technologies and dogmas but instead to stay curious and not to blindly belief any marketing statements.<br />
Don&#8217;t read this book if you search for excuses not to build your own opinion and looking behind the surface.</p>
<h3><a title="Agile Software Development" href="http://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445" target="_blank">Agile Software Development, Principles, Patterns, and Practices</a></h3>
<p>Well, i simply like the way &#8216;Uncle Bob&#8217; demonstrates the cornerstones and obstacles of designing and structuring a software system in an object oriented way.<br />
The &#8216;Agility&#8217; he refers to is mainly related to a more &#8216;technical&#8217; view (not commiting to a certain agile process model) in order to end up with a system that quickly responds to a set of specific needs (depending on the given environment). Along the way, you learn a lot about the core principles of Object Orientation (like Dependency Inversion Principle, Open Closed Priciple, &#8230;) &#8211; a sound foundation for building systems in an OO style. If you deeply wan&#8217;t to learn about the what i would call &#8216;common sense of OO&#8217; and the reasons that directly leads to the background of many well known Design Patterns, then this book might be for you.</p>
<h3><a title="My Job Went to India" href="http://www.amazon.com/Job-Went-India-Pragmatic-Programmers/dp/0976694018" target="_blank">My Job Went to India</a></h3>
<p>This book teached me in a very amusing way, that technical knowledge isn&#8217;t everything you need in your career.<br />
More than that, this book teached me humility &#8211; after reading, you know that you aren&#8217;t the best (not even one of the best in my case), but that there are many chances to improve every day, not only in the technical area of your profession to stay up to date.<br />
For example, even if you gained some experiance and knowledge, nobody will take notice, until you market yourself &#8211; this demands for a completely different set of skills and an appropriate volition.<br />
It&#8217;s a big motivation to look beyond one&#8217;s own nose (going beyond the skills of core software development).</p>
<h3><a title="Peopleware" href="http://www.amazon.com/Peopleware-Productive-Projects-Teams-Second/dp/0932633439" target="_blank">Peopleware </a></h3>
<p>I think this is one of the classics. If you haven&#8217;t participated in some bigger projects so far, you start to become a clue of how difficult it might be to collaborate within a software development project by reading this book. It&#8217;s still the people that participate to the success of a project and it&#8217;s essential to understand their motivations and interactions (who said &#8216;it&#8217;s the people, stupid&#8217; again?).<br />
This book highly emphasises the value of every single person in a project and of course the value of real teams (along with all its difficulties) &#8211; it deeply teached me respect and the right sensibility for collaboration and open mindedness, when trying to become a better team player.<br />
If you want to know more about the background of the agile principle &#8216;Individuals and interactions over processes and tools&#8217;, than you may find many of the pioneering groundwork in this book.</p>
<h3><a title="Pickaxe" href="http://www.amazon.com/Programming-Ruby-Pragmatic-Programmers-Second/dp/0974514055" target="_blank">Programming Ruby (the &#8216;Pickaxe&#8217;)</a></h3>
<p>This book acts as a kind of representative (i also could have mentioned &#8216;Groovy in Action&#8217; or some other books). For this was one of the first language books i bought within a very long period not being related to my &#8216;home language&#8217;, i chose this one. For me, reading this book made up my mind, showing you that there&#8217;s not only one language in the world. By learning another language you may get inspired by concepts and new solutions to some old problems. You may get a completely new viewpoint to a certain problem space and might carry new ideas over to your every day work.<br />
Beside the main fact that it widens your mind for new ideas and maybe other useful paradigms, it&#8217;s a good motivation or starting point for engaging in functional programming, dynamic languages, metaprogramming, &#8230;</p>
<p>I&#8217;ve surely forgotten some of the books that influenced me on my way. And of course we all know, that reading books alone isn&#8217;t enough. It won&#8217;t replace the experiance you&#8217;ll gain from &#8216;practicing software development&#8217; on an every day basis. At the end, i think it&#8217;s a good mix of both &#8211; you only have to find the right balance &#8230;</p>
<p>And you? What&#8217;s on top of your book shelf?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gleichmann.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gleichmann.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gleichmann.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gleichmann.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gleichmann.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gleichmann.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gleichmann.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gleichmann.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gleichmann.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gleichmann.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=51&subd=gleichmann&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gleichmann.wordpress.com/2008/09/19/yet-another-book-recommendation-list-software-development/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mario.gleichmann</media:title>
		</media:content>
	</item>
		<item>
		<title>Test Driven Development and Design By Contract &#8211; friend or foe?</title>
		<link>http://gleichmann.wordpress.com/2007/12/09/test-driven-development-and-design-by-contract-friend-or-foe/</link>
		<comments>http://gleichmann.wordpress.com/2007/12/09/test-driven-development-and-design-by-contract-friend-or-foe/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 21:23:30 +0000</pubDate>
		<dc:creator>Mario Gleichmann</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/12/09/test-driven-development-and-design-by-contract-friend-or-foe/</guid>
		<description><![CDATA[in this post i&#8217;ll try to answer a legitimate question, relating to a comment due to my last statement that interfaces are poor contracts: why do we need contracts (in the sense of invariants, pre- and postconditions) when we&#8217;ve got unit tests right at hand, that could also test the stated conditions?
in fact, it&#8217;s very [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=24&subd=gleichmann&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>in this post i&#8217;ll try to answer a legitimate question, relating to a comment due to my last statement that interfaces are poor contracts: why do we need contracts (in the sense of invariants, pre- and postconditions) when we&#8217;ve got unit tests right at hand, that could also test the stated conditions?</p>
<p>in fact, it&#8217;s very tempting to see unit tests as an all-embracing instrument to check and show that a class will behave correctly, making contracts kind of unnecessary.<br />
i&#8217;ll try to show you that unit tests (as an instrument for test driven development) and contracts (as an instrument for Design By Contract) indeed share the same goals but aren&#8217;t competing techniques, rather than methods that could complement each other.<span id="more-24"></span></p>
<h2>it&#8217;s not about verification &#8211; it&#8217;s about specification</h2>
<p>first of all, we have to clarify a potential misconception: unit tests as an instrument in the sense of Test Driven Development (TDD) aren&#8217;t that much about verification of a correct implementation rather than about a specification of how a unit should behave. in fact, it&#8217;s the specification (not the verification), that will drive development. you can see the comeback of this core idea in the rise of <a href="http://behaviour-driven.org/" title="behaviour driven development" target="_blank">Behaviour Driven Development</a> (BDD) that mainly tries to find an adequate vocabulary to write down specifications (that of course can be verified automatically) in an easy natural way, refocussing on how a component should behave under certain conditions.</p>
<p>on the other side, <a href="http://en.wikipedia.org/wiki/Design_by_contract" title="Design by Contract" target="_blank">Design by Contract</a> is also about specifying the design, in terms of the behaviour of your components. a contract asserts truths about the design of your code in the form of runtime tests placed within the contracted units itself. these assertions will be checked as the thread of execution passes through the parts of those components, and will fire if they don&#8217;t hold.</p>
<p>that said, both methods share the same main incitement &#8211; the specification of a system that will drive its design.</p>
<h2>don&#8217;t bear away</h2>
<p>as said, the goal of bdd is to reconcentrate on the specification of a component. the other way around, it means that it might be easy to loose direction within tdd, risking to set focus on testing and verification. i have to admit, that i walked into this trap more than one time in the past. of course the whole vocabulary (test, testcase, testsuite, &#8230;) makes you believe that it&#8217;s about testing. it&#8217;s easy to become addicted to this idea, so even writing tests after implementation seems pretty ok in this sense. that&#8217;s no longer possible if you see tests as specification: you firstly have to have a specification on what a component is intented to do &#8211; you can&#8217;t start with an implemenation until that specification exist.<br />
is the same true for Design by Contract? is the contract metaphor misleading? of course you could also define your contract afterwards, so again development of a component isn&#8217;t driven by it&#8217;s specification. but the contract metaphor uses a more appropriate vocabulary. with invariants, pre- and postconditions it&#8217;s clearly about the specification of the intended behaviour &#8211; the risk of seeing a contract as tool for verification might be much lesser.</p>
<h2>collaboration includes clients and supplier</h2>
<p>there&#8217;s a special area, where contracts are able to provide real benefits in regard to unit tests: oftentimes unit tests specify only the behaviour of a component as a supplier, that means the test asserts mostly the stated effects (the postconditions of a method). that&#8217;s perfectly legal: most of the prospective clients may be unknown to the designer of the component or doesn&#8217;t exist yet. since the client is responsible for the adherence of preconditions it even should not be the in the job of the supplier.<br />
a contract on the other side also specifies the constraints under which it&#8217;s legal to call a method (the precoditions). since contracts act on runtime, those preconditions will also be regarded when it comes to collaboration between an arbitrary client and the supplier component. the following points show some aspects of this holistic view:</p>
<h3>reliance on a proper context</h3>
<p>most developers (including me) tend to insert guard clauses in their code despite having unit tests. they don&#8217;t seem to trust about the context in which the method get&#8217;s called (that&#8217;s of course a good idea if the context can&#8217;t be foreseen). but you&#8217;ll even find this fact in environments, where the whole context is controlled by the same team. that may be also because of the before mentioned lack of knowledge about all clients that may call your component, especially in teams with limited communication. another one might be the local (specification / test in a different file than the component) and the temporal (tests at design time &#8211; collaboration at runtime) &#8216;distance&#8217; between the code and the test.<br />
having contracts aside the code (as part of the public interface of a component) you can rely on at runtime, seems to increase trustability in the running context. This may be because of &#8230;</p>
<h3>support of defensive programming</h3>
<p>with Design by Contract, contrats automatically protect methods from inproper usage, like illegal arguments (in the simplest case) in the real hard world, checking potentially a wider range of collaborations than a test ever can do (tests cannot show the absence of defects, it can only show that defects are present). like Bertrand Meyer said: a test checks one (or a limited set of) cases. a contract describes the abstract specification for all cases.<br />
that said, preconditions that will work at runtime, making guard clauses in a way redundant, because the method can rely that it&#8217;s called in a proper way. that&#8217;s a runtime feature you can&#8217;t achive with unit tests. they could only check or specify how a component should behave if it&#8217;s called in an inproper way (for example by expecting to throw an exception, which becomes a postcondition). but this one wouldn&#8217;t free you to write additional guard clauses.</p>
<h3>clear reliable documentation</h3>
<p>while tests can be seen as an additional artifact that specifies the expected behaviour of a component, contracts form part of the public (client-) view of a class &#8211; they are part of the public interface. personally, i&#8217;m lazy &#8211; i want to recognize the core behaviour of a building block by looking at its interface / signature, not studying an amount of code be it the building block itself or a test &#8211; but of course there are also other preferences that prefer a split between specification and implementation.<br />
of course those contracts are more than documentation, since assertions are checked at runtime, thereby testing that the stated contracts are consistent with what the routines actually do.</p>
<h3>integration &#8216;tests&#8217; for free</h3>
<p>this one follows directly from the initial point, when regarding collaboration between clients and suppliers: having contracts that can be turned on and off makes it very easy to test and retest parts of a program. it allows you for instance to continue to test class A while you are working on class B, in case there are any interactions you did not foresee. of course, this is kind of integration &#8216;testing&#8217; &#8211; it&#8217;s not about the specification of the behaviour of a single component but more about collaboration between a set of components and most of time not in the scope of unit tests.</p>
<h3>clear Design</h3>
<p>a contracts condition is an equivalent description of the algorithm used in a function, but written in an orthogonal manner, so thinking about such matters as pre-, postconditions and invariants help to make the concept of a class more explicit. it might encourage you to think about the conceptional model of a building block. that might lead to a clear design: obligations and benefits are shared between client and supplier and are clearly stated.<br />
the limitations on the use of a method are clearly expressed and the consequences of calling it illegally are clear, so programmers are encouraged not to build routines that are too general, but to design classes with small single-purpose routines. while TDD guides you more towards loosely coupled building blocks (because it hurts when trying to test a tightly coupled component in isolation), DBC guides you more towards smaller building blocks with a clear resoponsibility (because it hurts to write invariants of classes with more than one responsibility or write pre- and postconditions for methods with more than one task).</p>
<h3>&#8216;debugging&#8217;</h3>
<p>contracts can take part in &#8216;real life&#8217;, that means under real runtime conditions, maybe during development and user acceptance test &#8211; they take effect under real circumstances while &#8216;real&#8217; clients (no mocks) and real collaborators (maybe also contracted) interoperate with each other. so contracts also guarding the collaboration of muliple building blocks forcing to fulfill a collective adduced goal due to a specification. having clear sound messages that state the cause of a contract violation, helps locating where the fault lies semantically: it&#8217;s very easy to find the reason of a misbehaviour within a specific interaction, pointing directly to it&#8217;s origin (if a precondition is violated, than it&#8217;s the fault of the client, if an invariant or a postcondition is violated, than it&#8217;s the fault of the supplier)</p>
<h3>reuse</h3>
<p>for library users (where tests may not be accessible), contracts clearly explain what library classes do and what constraints there are on using them. they provide feedback to someone learning to use other peoples classes: sometimes you only know the interface to operate with &#8211; the implementing class is unknown. having contracts on that interface gives you a clear, sound concept of the limitations and relevant effects in programming against that interface in a proper way.</p>
<h3>open close principle compliance</h3>
<p>while tests usually test a single unit, DBC handles inheritance in a broader way, supporting also inheritance of contracts to subclasses and therefore forcing to adhere to the claimed behaviour, stated in contracts of a superclass or interface. this goes hand in hand with the Liskov Substitution Principle.</p>
<h2>conclusion</h2>
<p>as you might have seen &#8211; Design by Contract is contributing some mind alluring features and &#8216;drivers&#8217; when it comes to the specification of the intented behaviour of a component or even a whole system of interacting objects. as seen, contracts also regard the proper collaboration between clients and suppliers &#8211; a feature that&#8217;s mostly not in the scope of unit tests.<br />
those new drivers fit very nicely with the strengths of unit tests (not all mentioned here), making them a perfect team for a &#8217;specification driven development&#8217;.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gleichmann.wordpress.com/24/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gleichmann.wordpress.com/24/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gleichmann.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gleichmann.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gleichmann.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gleichmann.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gleichmann.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gleichmann.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gleichmann.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gleichmann.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gleichmann.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gleichmann.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=24&subd=gleichmann&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gleichmann.wordpress.com/2007/12/09/test-driven-development-and-design-by-contract-friend-or-foe/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mario.gleichmann</media:title>
		</media:content>
	</item>
		<item>
		<title>is it about fancy titles in software development? no! it&#8217;s about your attitudes!</title>
		<link>http://gleichmann.wordpress.com/2007/11/22/is-it-about-fancy-titles-in-software-development-no-its-about-your-attitudes/</link>
		<comments>http://gleichmann.wordpress.com/2007/11/22/is-it-about-fancy-titles-in-software-development-no-its-about-your-attitudes/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 21:06:47 +0000</pubDate>
		<dc:creator>Mario Gleichmann</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/11/22/is-it-about-fancy-titles-in-software-development-no-its-about-your-attitudes/</guid>
		<description><![CDATA[I&#8217;ve read some articles in the past that discuss the importance and hence difference between some titles or roles which are involved in software development. Whether it&#8217;s the discussion of &#8216;Programmer vs. Developer&#8217;, &#8216;Developer vs. Designer&#8217; or &#8216;Designer vs. Architect&#8217; &#8211; all those essays contain not more than hollow words to me, since they first [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=20&subd=gleichmann&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve read some articles in the past that discuss the importance and hence difference between some titles or roles which are involved in software development. Whether it&#8217;s the discussion of &#8216;Programmer vs. Developer&#8217;, &#8216;Developer vs. Designer&#8217; or &#8216;Designer vs. Architect&#8217; &#8211; all those essays contain not more than hollow words to me, since they first of all argue about nifty titles.</p>
<p>In fact, when it comes down to the core of software development &#8211; it&#8217;s the value we create for our customers that counts, no matter if we&#8217;re called an architect or designer. questions like &#8216;are you a programmer or developer&#8217; are completely irrelevant, as it doesn&#8217;t matter if we don&#8217;t take responsibility for what we&#8217;re &#8216;producing&#8217;.<span id="more-20"></span>given a sound technological background &#8211; compare an &#8216;architect&#8217; who doesn&#8217;t take care about the projects progress (i&#8217;ve seen some of them which seem to be interested in the more funny things &#8211; building a technical prototype and leaving the project prematurely without taking care about the shortcomings of their consigned &#8216;architecture&#8217;) and a &#8216;developer&#8217; who&#8217;s all in all interested in the quality of her results. which of those will give more value to the overall goals of a project?</p>
<p>do we really add value in respect to our customers needs at everyday work? do we take responsibility in your professional environment?<br />
independent of a particular functioning within a project, the following attitudes are considered essential when we want to take care about the long term value of our work.</p>
<h2>passion</h2>
<p>passion drives us to the limit. we don&#8217;t settle for a half baked solution.<br />
for example, we don&#8217;t want a solution (even in the small) not only to work as required, but also in conjunction with the projects goals, that may be code that&#8217;s easy to refactor or readable and easy to maintain (as Martin Fowler said: &#8216;any fool can write code that works &#8230;&#8217;).<br />
accepting the surrounding forces, we want to get the job done in the best way that is satisfactory for all participants.</p>
<h2>empathy</h2>
<p>we not only produce artifacts. we also produce means that will help others to get their job done, too (be it the end user or our very next team mate, who&#8217;s efforts are based on our products).<br />
for example, we not only want to write code that is somehow well structured, but code that is comprehensable to other developers, giving them orientation, i.e. helping to maintain or evolve the code.<br />
we not only think about getting a job done, but getting it done in a way that will provide meaning or at least support for others, helping the project to progress.</p>
<h2>curiosity</h2>
<p>we not only work with our brain turned of, but strive for knowledge that will help to produce solutions that are in conjunction with the needs of our clients.<br />
for example we not only implement relayed requirements blindly, but want to give productive feedback when recognizing contradictions, inconsistencies or incomplete specifications.<br />
we not only will produce only as much as mandated to accomplish a single task but also use our head and/or question until we understand in order to produce solutions that are truely essential to our customers.</p>
<h2>communicative</h2>
<p>we share our insights, giving others the chance to evolve or at least avoiding to make mistakes (may the ones that we&#8217;ve encountered the hard way).<br />
for example, we not only want to give documentation but to ensure that others understand our results in the right way.<br />
we not want to fight a one-man-show for others, but know that the whole team is essential to progress and hence help among each other by passing relevant knowledge.</p>
<h2>courage</h2>
<p>we adress problems, even if they are uncomfortable for us or the team in the short term, but to avoid greater damage in the long run when concealing it.<br />
for example, if we encounter a design flaw that we can bypass in order to get our current task done, we even adress the problem officially, giving the chance for a decision towards a more expensive solution.<br />
we aren&#8217;t keeping quiet about problems, giving the customer the chance to react, even if such problems are unpleasant for all participants.</p>
<h2>pride</h2>
<p>we are proud about the products we create. those pride is expressed in the achievable quality of our products under the given circumstances.<br />
for example we we&#8217;re willingly &#8217;sign&#8217; a class or component with our name, giving others the chance for feedback or questions. We stand to the code that we&#8217;ve produced.<br />
we&#8217;re not proud of the title we&#8217;ve received within a project. we&#8217;re rather proud of what we&#8217;re contributed to the overall goals of the project!</p>
<h2>what&#8217;s real important</h2>
<p>so what&#8217;s the bottom line?</p>
<p>the importance of our role in a software development project doesn&#8217;t come with an official title. It&#8217;s more about how much we&#8217;ll take care about the projects goals, feeling responsible about what we are contributing to the project in the long term!</p>
<p>it&#8217;s time to get &#8216;titled&#8217; by the real value you&#8217;ll produce for the project and your customer in the end, than by some official role names.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gleichmann.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gleichmann.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gleichmann.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gleichmann.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gleichmann.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gleichmann.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gleichmann.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gleichmann.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gleichmann.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gleichmann.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gleichmann.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gleichmann.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=20&subd=gleichmann&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gleichmann.wordpress.com/2007/11/22/is-it-about-fancy-titles-in-software-development-no-its-about-your-attitudes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mario.gleichmann</media:title>
		</media:content>
	</item>
		<item>
		<title>clipboard considered harmful &#8211; a funny look at developers &#8216;laziness&#8217;</title>
		<link>http://gleichmann.wordpress.com/2007/11/21/clipboard-considered-harmful-a-funny-look-at-developers-laziness/</link>
		<comments>http://gleichmann.wordpress.com/2007/11/21/clipboard-considered-harmful-a-funny-look-at-developers-laziness/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 20:52:38 +0000</pubDate>
		<dc:creator>Mario Gleichmann</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://gleichmann.wordpress.com/2007/11/21/clipboard-considered-harmful-a-funny-look-at-developers-laziness/</guid>
		<description><![CDATA[software developers are lazy &#8230; by nature.
well, not all of them are lazy. but most of us are tempted to avoid unnecessary efforts (this seems to be a good attitude, normally). for example, we all don&#8217;t want to write boilerplate code &#8211; just stuff, no fluff &#8230;
one of the most dangerous challenges in this regard [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=8&subd=gleichmann&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>software developers are lazy &#8230; by nature.<br />
well, not all of them are lazy. but most of us are tempted to avoid unnecessary efforts (this seems to be a good attitude, normally). for example, we all don&#8217;t want to write boilerplate code &#8211; just stuff, no fluff &#8230;</p>
<p>one of the most dangerous challenges in this regard (because of its easy adoption and therefore such attractive) is the usage of the clipboard. clipboard enables us to comply to our laziness in a &#8216;wrong&#8217; way. it&#8217;s easy to duplicate code via copy n paste, to often only to alter the copied code marginally afterwarts in order to adapt it&#8217;s behaviour to the new specific area.<span id="more-8"></span></p>
<p>for what reasons?<br />
is it because we don&#8217;t have enough confidence in the existing code so we don&#8217;t dare refactoring? don&#8217;t we have a sufficient test base so we dont dare refactoring? do we have to little knowledge about the domain in order to be able to abstract and therefore don&#8217;t dare refactoring? beside of the violation of DRY you should ask yourself if it could be because of what we may call a <em>smell of uncertainty</em> (that would be an issue for a post of its own).</p>
<p>back to the clipboard. maybe we should deactivate clipboard in our IDE generally? &#8230; don&#8217;t offer clipboard to a developer in principle, never &#8230; ever.<br />
if we could&#8217;nt fall back to the clipboard, we would be forced to &#8230; copy the code by hand (of course we have no alternative to duplicate code, have we? time is short and who cares about DRY anyway &#8230; ;o)).<br />
but now we are in a situation, where it will come to a natural selection:</p>
<p>the evil developer maybe would in fact copy the code by hand! this developer would take an unreasonable amount of time completing his task and therefore have to live with a higher risk to get the push (this very seldom occuring scenario would also be worth another post). a special kind of darwin award, developers only.</p>
<p>the good developer would be (hopefully) again to lazy to copy manually and maybe would start to reflect how to avoid this boring activity to type the code by hand. that is our chance to eliminate code duplication and instead searching for alternatives. maybe we could factor out the needed code and reuse it in different areas. maybe we have to abstract from one conrete context and look behind the curtains to recognize the core intention &#8211; object orientation offers some options, such as template method, strategy, polymorphism, &#8230;<br />
perhaps we have to deal with foreign code or &#8211; even worse &#8211; with some concepts of the domain. don&#8217;t worry &#8230; this is a chance to get over the smell of uncertainty (otherwise it&#8217;s maybe someone other who smells &#8230; ;o))!</p>
<p>now lets get philosophical. lets ask why everyone of us has used clipboard in the past (me too, i have to admit &#8211; what&#8217;s about you?) but maybe we should better ask instead why we sometimes consciously violate DRY?</p>
<p>apart from the harmless cases where we slothfully use the clipboard to virtually transport data from one place to another, what&#8217;s about the real risky cases where we are temped to copy and vary methods or whole classes?<br />
it seems that most of us are anthropological influenced. we like to keep control over situations (in the good old subject-object-relationship, we want to be the subject), more than ever when we act in an uncertainty context.</p>
<p>whenever we act in such an partly unfamiliar context, it seems that control slips away, because we don&#8217;t know all influencing factors (now subject &#8211; object &#8211; relationship has turned. it looks like the context is driving us and thats a situation we are a little concerned of). if we have not captured the whole situation mentally, we tend to reinvent the wheel again. starting over from scratch lets us keep control because it seems that we know how things work from ground up. building my own class bottom up reduces the risk to destroy the behaviour of these other class which seems to be pretty similar &#8230; lets simply copy most of&#8217;em and adapt to my own needs. hello broken window &#8230;</p>
<p>so how to escape from this state of fear?<br />
simply dismissing clipboard is probably not the best pill in this case.<br />
most of time the root of all evil is very clear: immoderate code complexity, as Eric Evans (domain driven design) says: &#8216;when complexity goes out of hand, developers can no longer understand the software well enough to change or extend it easily and safely. there comes most of the uncertainty. if you don&#8217;t understand it, you don&#8217;t want to touch it &#8230; and once again: don&#8217;t be lazy &#8211; but this time on a different level: try to understand the domain you are designing for and write expressive code that reflects the core of the business domain. if you&#8217;re in the code &#8211; you&#8217;re in the business &#8230;<br />
key to refactoring is trusting your code. trusting your code is recognizing the functionality in your code. recognizing the right functionality is knowing the business. knowledge of the business is best expressed in code itself and tests that checks the code.</p>
<p>modeling the code as a rich source of business knowledge brings other advantages. because developers like best to deal with code rather than external documentation, this kind of laziness is no problem since the code documents the domain in a clear, significant way. it&#8217;s also easier to share common concepts and design decisions when the code represents this one to one. you can transfer the meaning of new code in a really plain way &#8230; but please not via clipboard ;o)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gleichmann.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gleichmann.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gleichmann.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gleichmann.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gleichmann.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gleichmann.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gleichmann.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gleichmann.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gleichmann.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gleichmann.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gleichmann.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gleichmann.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gleichmann.wordpress.com&blog=2165876&post=8&subd=gleichmann&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://gleichmann.wordpress.com/2007/11/21/clipboard-considered-harmful-a-funny-look-at-developers-laziness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mario.gleichmann</media:title>
		</media:content>
	</item>
	</channel>
</rss>