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

<channel>
	<title>cwash into software &#187; Software Engineering</title>
	<atom:link href="http://cwash.org/tag/software-engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://cwash.org</link>
	<description>+= construction + craftsmanship;</description>
	<lastBuildDate>Thu, 29 Sep 2011 04:23:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Transactions, Part 1</title>
		<link>http://cwash.org/2010/07/08/transactions-part-1/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=transactions-part-1</link>
		<comments>http://cwash.org/2010/07/08/transactions-part-1/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 14:46:54 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[ACID properties]]></category>
		<category><![CDATA[CapTech]]></category>
		<category><![CDATA[Enterprise Integration]]></category>
		<category><![CDATA[transactions]]></category>
		<category><![CDATA[Transactions Series]]></category>

		<guid isPermaLink="false">http://cwash.org/?p=460</guid>
		<description><![CDATA[Not only are transactions fundamental building blocks of business software, but also modern distributed systems. Transactions are prevalent in the frameworks and tools we use to build, tune, and scale the software we write.  Transactions in software are important when updating shared resources, like a cache, database, or message queue, but also come into play when reading - especially when access must be coordinated across many separate but concurrent workers reading shared data.  Over the course of this series of articles, we'll talk about what concepts you need to know in order to effectively and correctly make use of transactions in your applications.  This series of articles is written as a set of core concepts to understanding the basics of transactions, and is intended for junior to intermediate level developers, but my hope is that others will benefit from this series as well. ]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2010/07/08/transactions-part-1/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><h3>Preface</h3>
<blockquote><p>This work came out of an lack of consistent, cohesive documentation for beginners on transactions.  Similar material does exist, but much of it suffers from either being hard to find, scattered and spotty, or not written at a basic enough level where prerequisite knowledge is not required in order to understand the material covered.  Over the course of this series of articles, we&#8217;ll talk about what concepts you need to know in order to effectively and correctly make use of transactions in your applications.  This series of articles is written as a set of core concepts to understanding the basics of transactions, and is intended for junior to intermediate level developers, but my hope is that others will benefit from this series as well.  As always, feedback is greatly appreciated.</p></blockquote>
<h3>What is a transaction?</h3>
<h4>Etymology</h4>
<p>The word transaction comes from the Latin word transactionem meaning &#8220;an agreement, accomplishment,&#8221; which itself comes from the past participle of the verb transigere, transactus, meaning &#8220;drove or carried through.&#8221;</p>
<h4>Transactions defined</h4>
<p>The word&#8217;s definition is typically related to business or economics, meaning a single business deal, or an exchange of goods between two parties. Most introductions to transactions use an example of debiting one bank account and crediting another.  When we remove funds from one account, we need to make sure that they are deposited into the other.  If something fails (sufficient funds do not exist in the account being debited, or the account being credited has been closed) then both accounts need to be returned to their original state before the exchange began. This is actually a very good example, but how does that apply to software?</p>
<p><span id="more-460"></span></p>
<p>Let&#8217;s back up for a second.  If we focus on what&#8217;s going on, we begin to see there are two distinct activities in play:</p>
<ol>
<li>Grouping a set of multiple changes together that all have been applied successfully, or, in the event of a <em>single</em> failure, that all need to be undone.</li>
<li>Managing (or <em>coordinating</em>) the execution of these changes, when their interactions might interfere with one another.</li>
</ol>
<h4>Examples of Transactional Systems</h4>
<p>Like many other terms in the software lexicon such as &#8220;class&#8221;, &#8220;object&#8221;, &#8220;system&#8221; and &#8220;code&#8221;, the definition of the word &#8220;transaction&#8221; suffers a bit from the word&#8217;s inherent over-abstraction; <!--break-->it is widely applicable to a great many circumstances and situations. But once understood, is easy to spot scenarios where the pattern is used and applied.  Transactions are important in software when updating shared resources, like a cache, database, or message queue, but also come into play when reading &#8211; especially when access must be coordinated across many separate but concurrent workers reading shared data.  We&#8217;ll talk more about this in depth later. Some examples of systems that heavily utilize software transactions are:</p>
<ul>
<li>eCommerce (Shopping-Cart, Billing, Banking) Applications</li>
<li>Relational Databases</li>
<li>Caching Systems</li>
<li>Messaging Systems (Message-Oriented Middleware)</li>
<li>Source Code Management Systems</li>
</ul>
<p>As you can see, not only are these fundamental building blocks of business software, but also modern distributed systems.  Transactions are prevalent in the frameworks and tools we use to build, tune, and scale the software we write.</p>
<h3>Specifying Transactions</h3>
<h4>ACID properties</h4>
<p>A technological definition of the word transaction involves specification of qualities (or &#8220;properties&#8221;) that must be enforced in order for the transaction to be processed successfully.  These properties, the <em>ACID properties</em> as they are known, grow out of our business concept of a transaction (an exchange between two parties).  They exist as conventions that specify or constrain the software that&#8217;s responsible for processing transactions.  Enforcing all four of these properties <em>guarantees</em> the transaction is reliable and therefore viable candidate for successful completion/processing.</p>
<ul>
<li><strong>Atomic</strong> &#8211; When we say transactions need to be atomic, we don&#8217;t mean that they need to be small, though often they are.  What we mean is that <em>you can&#8217;t subdivide a transaction any further</em> &#8211; the group of changes must be viewed as a single set.  When applying that set of changes, it&#8217;s &#8220;all or nothing&#8221; &#8211; that is, each and every individual change processes successfully, or else the entire group is undone completely.  There are no &#8220;partial&#8221; transactions; we can&#8217;t subdivide them further.</li>
<li><strong>Consistent</strong> &#8211; If a system successfully processes a transaction, then all resources involved in the transaction must be consistent afterwords &#8211; whether the transaction processed successfully or not.  For example, if one account is debited and another is credited, the balance of the debited account must be equal to the difference of the original balance and the price of the transaction (and vice-versa for the credited account).  Transactions that do not complete successfully should not have any side-effects to either party involved in the transaction.</li>
<li><strong>Independent</strong> &#8211; Transactions should not interfere with one another, even though they may involve shared resources.  For example, one transaction should not be able to see the work another transaction is currently performing until that transaction has completed.  They should be <em>independent</em> or <em>isolated</em>.  Typically, transaction isolation becomes an issue as transactions being processed become larger: that is, the longer they live or the more resources that they enlist.  Isolation also has performance implications as the amount of load or concurrency increases.  Isolation mechanisms expose either locking or multi-version concurrency control (MVCC, &#8220;diff-ing&#8221; or delta-management).  We will discuss these later when we talk about  <em>concurrency control and isolation</em>.</li>
<li><strong>Durable</strong> &#8211; Systems processing transactions must record successful transactions so that a history of the transactions processed is not lost.  Relevant actions taken are logged for auditing purposes.  This audit trail allows the state of the transactional system to be recreated at any point in time if there is a system failure.  If the information cannot be recorded in this way, we can not say we have a durable transaction, because we won&#8217;t be able to recreate the state of the system if a failure occurs.</li>
</ul>
<p>In a real world business transaction, these conventions are likely enforced by human beings involved in the transaction. If one of these properties were violated during your checkout at a store in the mall, then either you or the clerk would be pretty upset and likely to call in relevant authorities to sort out the matter.  For example, if you bought a shirt but were refused a receipt for the transaction, you would most likely be upset and demand a refund, as the receipt is confirmation of the transaction&#8217;s durability.</p>
<h3>Why Should I Bother Using Transactions?</h3>
<p>As you can see, transactions also provide us with some guarantees about what will happen in the event that something goes wrong during the interactions between shared resources.  These guarantees are very useful to us as software designers and developers, but their benefits may not be intuitively obvious until we consider what our jobs would be like without them.  Transactions give us with a safety net of assumptions; when something goes wrong, we can lean on the transaction&#8217;s guarantee to rollback, or automatically revert all changes from the start of the unit of work.  Imagine if we didn&#8217;t have this guarantee: we would be forced to write code to cleanup the mess we&#8217;ve created, and not only is this code hard to maintain, it&#8217;s hard to write and get correct the first time.  With transactions, we don&#8217;t have to worry about writing extra code to &#8220;cleanup&#8221; the mess we&#8217;ve created, and can instead focus on what the code we&#8217;re writing is actually supposed to do: the business logic.  When something goes wrong, we can safely assume certain scenarios are out of the question by using transactions.  In many circumstances, transactions are key to writing code that is functionally correct, and most of the time make the code cleaner, more robust and maintainable (especially when considering the alternative of coding cleanup logic by hand).</p>
<p>Transactions are fundamentally all about <strong>coordinating access to shared resources</strong>.  A term that can be used interchangeably with the word &#8220;transaction&#8221; is <strong>unit of work.</strong> Transactions are important to software systems because they&#8217;re how we manage interactions with the different systems involved that have access or expose shared resources to clients.</p>
<p>Typically when we work with transactional systems, as application developers we:</p>
<ul>
<li>Write code that explicitly utilizes a transactional API, like JDBC, that will contain the semantics for how to handle the processing of the transaction, <em>or&#8230;</em></li>
<li>Configure a transaction management mechanism, like an EJB container, that can do the processing and coordination work on our behalf based on conventions.</li>
</ul>
<p>The next article in the series will provide examples of both approaches.  Either way, the end result provides a way to keep each unit of work&#8217;s interactions separate from each other, and guarantee that all changes in the set are applied together or undone completely.</p>
<h3>Up Next: <a href="http://cwash.org/2010/07/26/transactions-part-2-writing-data-reliably/">Writing Data Reliably</a></h3>
<ul>
<li>Programming With Transactional Systems</li>
<li>Declarative Transaction Management</li>
</ul>
<h3>Further Reading</h3>
<ul>
<li>http://www.etymonline.com/index.php?term=transaction</li>
<li>http://en.wikipedia.org/wiki/ACID</li>
</ul>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2010/07/08/transactions-part-1/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Transactions%2C+Part+1&amp;link=http://cwash.org/2010/07/08/transactions-part-1/&amp;notes=Not%20only%20are%20transactions%20fundamental%20building%20blocks%20of%20business%20software%2C%20but%20also%20modern%20distributed%20systems.%20Transactions%20are%20prevalent%20in%20the%20frameworks%20and%20tools%20we%20use%20to%20build%2C%20tune%2C%20and%20scale%20the%20software%20we%20write.%20%20Transactions%20in%20software%20are%20important%20when%20updating%20shared%20resources%2C%20like%20a%20cache%2C%20database%2C%20or%20message%20queue%2C%20but%20also%20come%20into%20play%20when%20reading%20-%20especially%20when%20access%20must%20be%20coordinated%20across%20many%20separate%20but%20concurrent%20workers%20reading%20shared%20data.%20%20Over%20the%20course%20of%20this%20series%20of%20articles%2C%20we%27ll%20talk%20about%20what%20concepts%20you%20need%20to%20know%20in%20order%20to%20effectively%20and%20correctly%20make%20use%20of%20transactions%20in%20your%20applications.%20%20This%20series%20of%20articles%20is%20written%20as%20a%20set%20of%20core%20concepts%20to%20understanding%20the%20basics%20of%20transactions%2C%20and%20is%20intended%20for%20junior%20to%20intermediate%20level%20developers%2C%20but%20my%20hope%20is%20that%20others%20will%20benefit%20from%20this%20series%20as%20well.%20&amp;short_link=http://b2l.me/9qk38&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>January 7, 2010 -- <a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/" title="Eliminate Branching (IF Statements) to Produce Better Code">Eliminate Branching (IF Statements) to Produce Better Code</a> (0)</li><li>July 24, 2009 -- <a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/" title="The Elements of Reusable Code">The Elements of Reusable Code</a> (0)</li><li>July 29, 2009 -- <a href="http://cwash.org/2009/07/29/what-id-tell-myself-about-design-if-i-were-just-beginning/" title="What I&#8217;d Tell Myself About Design If I Were Just Beginning">What I&#8217;d Tell Myself About Design If I Were Just Beginning</a> (5)</li><li>June 9, 2009 -- <a href="http://cwash.org/2009/06/09/mocking-with-jmockit/" title="Mocking with JMockit">Mocking with JMockit</a> (5)</li><li>June 3, 2009 -- <a href="http://cwash.org/2009/06/03/what-is-hamcrest/" title="What is Hamcrest?">What is Hamcrest?</a> (0)</li><li>April 15, 2009 -- <a href="http://cwash.org/2009/04/15/osgi-ggity-giggity/" title="OSGi-ggity-Giggity">OSGi-ggity-Giggity</a> (4)</li><li>January 31, 2009 -- <a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/" title="In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel ">In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel </a> (3)</li><li>January 13, 2009 -- <a href="http://cwash.org/2009/01/13/on-software-quality/" title="On Software Quality">On Software Quality</a> (8)</li><li>November 28, 2008 -- <a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/" title="Must Haves/References For Modern Java EE Developers">Must Haves/References For Modern Java EE Developers</a> (1)</li><li>November 19, 2008 -- <a href="http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/" title="Java 6 and Maven 2.0.9 on Leopard">Java 6 and Maven 2.0.9 on Leopard</a> (7)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2010/07/08/transactions-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eliminate Branching (IF Statements) to Produce Better Code</title>
		<link>http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=eliminate-branching-if-statements-to-produce-better-code</link>
		<comments>http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 21:05:46 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Developer Testing]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[CapTech]]></category>
		<category><![CDATA[exercises]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[SOLID]]></category>
		<category><![CDATA[techniques]]></category>

		<guid isPermaLink="false">http://cwash.org/?p=426</guid>
		<description><![CDATA[In a recent tech talk, I watched Miško Hevery propose an interesting challenge to his audience: start a toy project and try to write the code with no if-else or switch blocks at all. None at all?  Before thinking about how to do this, why would you want to do it in the first place?  On the surface, it may seem to the unassuming a bit counter-intuitive.  Comparison-based branching is at the heart of programming, and the concept of an if-else or switch block is almost universal, existing in most every programming language ever devised.  What's Hevery's agenda with this exercise – and what can possibly be gained from trying to write a program without branching entirely?]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><p>In a <a title="The Clean Code Talks -- Inheritance, Polymorphism, &amp; Testing" href="http://www.youtube.com/watch?v=4F72VULWFvc&amp;feature=channel">recent tech talk</a>, I watched Miško Hevery propose an interesting challenge to his audience: start a toy project and try to write the code with no if-else or switch blocks at all. None <em>at all</em>?  Before thinking about how to do this, <em>why</em> would you want to do it in the first place?  On the surface, it may seem to the unassuming a bit counter-intuitive.  Comparison-based branching is at the heart of programming, and the concept of an if-else or switch block is almost universal, existing in most every programming language ever devised.  What&#8217;s Hevery&#8217;s agenda with this exercise – and what can possibly be gained from trying to write a program without branching <em>entirely?</em></p>
<p><em><span id="more-426"></span><br />
</em></p>
<h3>Branching Considered Harmful?</h3>
<p>In 1968, <a title="Dijkstra on Wikipedia" href="http://en.wikipedia.org/wiki/Edsger_Dijkstra">E.W. Diskjstra</a>, famed programmer and author of the shortest-path algorithm, wrote an article to be published in the <em>Communications of the ACM</em> entitled &#8220;A Case Against the GOTO Statement&#8221; that was later renamed &#8220;Goto Statement Considered Harmful&#8221; by the editor.  The phrase has grown into a meme of its own in the CS community, denoting a practice that has fallen from grace and become widely discouraged.</p>
<p>I bring this up not to point out its cultural signficance, but the core of his argument:</p>
<blockquote><p><em>The go to statement as it stands is just too primitive[;] it is too much an invitation to make a mess of one&#8217;s program.</em></p></blockquote>
<p>Essentially, Hevery is making this very point for the if-else statement, 40 years later, but for very similar reasons.  If-else and switch statements easily account for some of the ugliest code that I have seen (and written).  Overuse of if-else blocks can lead to the <a title="The Arrow Antipattern on c2wiki" href="http://c2.com/cgi/wiki?ArrowAntiPattern" target="_blank">arrow antipattern</a>, a scenario where conditional branches are so deeply nested they become unmaintainable.  Too often developers fall into this trap, described aptly by another Dijsktra quote:</p>
<blockquote><p><em>The prisoner falls in love with his chains&#8230;</em></p></blockquote>
<p><em><span style="font-style: normal;">Hevery&#8217;s point is that code without if (or switch) statements is:</span></em></p>
<ul>
<li>Easier to read and understand</li>
<li>Easier to test</li>
<li>Easier to maintain, extend, etc.</li>
</ul>
<p>But how do we write code without branching constructs?   If we are talking about fixing the arrow antipattern, you may know a time when you avoided this antipattern by using separation of concerns, for example, the MVC pattern instead of a monolithic servlet.</p>
<h3>Hevery&#8217;s Suggestions</h3>
<p>Hevery goes on to explain how good OO design can eliminate the need to explicitly code the most egregious uses of branching, by instead favoring dependency injection and <a title="Polymorphism on Wikipedia" href="http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming">polymorphism</a>.  But this technique is only really useful where we can create methods and objects that are <a title="Cohesion on Wikipedia" href="http://en.wikipedia.org/wiki/Cohesion_(computer_science)#High_cohesion">cohesive</a> and <a title="loose coupling on wikipedia" href="http://en.wikipedia.org/wiki/Loose_coupling" target="_blank">loosely coupled</a>.</p>
<blockquote><p><em>With polymorphism, you dispatch into a method whose binding is not known at compile-time but determined at runtime.</em></p></blockquote>
<p>This is the weapon of choice when we are working on code that is highly procedural and there is a bad OO-design smell.  But it is far from a one-size-fits-all solution.  If we were to transform every branch in our program by instead using polymorphism, it would be a tangle of incohesive objects that would likely be harder to maintain than the original procedural code.  Luckily, there are other techniques that are more appropriate in certain circumstances.</p>
<p>Hevery continues: certainly, primitive comparisons are going to be the most difficult to eliminate, but shouldn&#8217;t happen very often.  So we reluctantly allow these to stick around.  Another class of if statements exist to check against nulls.  Hevery explains how null pointer dereference checks quickly become pandemic, occurring every time a member of an object is referenced.  This should largely be a non-issue, and is only a problem because code is allowing nulls to be returned.  The semantics/method contract of most methods can easily be changed to prohibit the return of nulls.  (This is only really difficult when recursion is used.)  Developers, as it turns out, don&#8217;t have to return null values.  This is particularly true with collections, and warranted a section in Joshua Bloch&#8217;s <a title="Effective Java on Safari" href="http://my.safaribooksonline.com/9780137150021">Effective Java</a>.  Instead return an empty collection can be returned, or you can implement the <a title="Null Object Pattern on Wikipedia" href="http://en.wikipedia.org/wiki/Null_Object_pattern">null object pattern</a> (e.g., a no-op logger).  Hevery finally rallies for ditching using return codes in favor of throwing relevant exceptions.</p>
<p><em>Note: I encourage you to watch the talk, as he continues talking about how specifically you can use inheritance and polymorphism to remove branching. The rest of this article will talk about <strong>other strategies to remove unnecessary branches</strong>.</em></p>
<h3><strong>Remove Copy-Pasted Loops And Conditionals: Introduce Enumerable Operations</strong></h3>
<p><strong> </strong>Many languages contain an enumerable construct that includes &#8220;higher order&#8221; looping operations that can eliminate the need for many specialized cases that are usually solved by a foreach loop with an embedded conditional check of some sort.  This type of construct can be traced back to Smalltalk, and exists in most modern dynamic languages such as Ruby, Groovy, Python, and provided by a number of Javascript libraries.  Getting this to work in Java is a bit of a challenge because there is no mechanism for closures (yet) but some partial solutions do exist (they lack the full power of true closures, but overusing true closures can break down OO-style constructs).  For further information, take a look at <a title="LambdaJ on Google Code" href="http://code.google.com/p/lambdaj/">lambdaj</a>, Adrian Kuhn&#8217;s <a title="Adrian Kuhn: Pimp My Foreach" href="http://www.iam.unibe.ch/~akuhn/blog/2008/pimp-my-foreach-loop/">Pimp My Foreach</a> and <a title="Google Collections Iterators Javadoc" href="http://google-collections.googlecode.com/svn/trunk/javadoc/index.html?com/google/common/collect/Iterators.html">Google Collections&#8217; Iterators</a>.</p>
<p>Here is an example of the types of things this style of programming can fix.</p>
<pre>List&lt;Integer&gt; numbers = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
List&lt;Integer&gt; oddNumbers = new ArrayList&lt;Integer&gt;();

for (Integer check : numbers) {
    if (check % 2 != 0) {
      oddNumbers.add(check);
    }
}</pre>
<p>In the case of the Google Collection, they call their enumberable construct a &#8220;Iterable&#8221; and the closure construct a &#8220;Predicates,&#8221; we&#8217;ll be able to replace the above code with this:</p>
<pre>Predicate&lt;Integer&gt; oddIntegerPredicate = new Predicate&lt;Integer&gt;() {
    public boolean apply(Integer input) {
        return input % 2 != 0;
    }
};

Iterable&lt;Integer&gt; oddNumbers = Iterables.filter(numbers, oddIntegerPredicate);</pre>
<p>LambdaJ, and Kuhn&#8217;s solution work in a similar fashion.  While syntactically not as pretty as the dynamic languages, these constructs are functionally equivalent and arguably no more painful than the original code.  In many cases of deeply nested for-if-for-ifs, it significantly reduces the cyclomatic complexity).  This style of programming, once everyone on the team has become familiar with it, can reduce often copy-and-pasted looping code to one liners, removing some really ugly duplication and the potential for those hard-to-spot copy and paste errors.</p>
<h3>Lookout for Train Wrecks: Obey the Law (of Demeter &#8211; and other SOLID Principles).</h3>
<p>Steve Freeman and Nat Pryce describe &#8220;train wreck&#8221; code in their new book <a title="Growing OO Software Guided by Tests on Safari" href="http://search.safaribooksonline.com/9780321574442">Growing Object Oriented Software Guided By Tests</a> as chained &#8220;getter&#8221; method calls, linked together like train cars.  The authors call them &#8220;wrecks&#8221; because the code is essentially an egregious violation of the Law of Demeter.  One of Nat&#8217;s examples:</p>
<pre>employee.getJobDescription().getResponsibilities().add(new ManagementResponsibility(employee.getDepartment()));</pre>
<p>The problem is that this style of programming destroys all encapsulation and information hiding concepts in code.  Train wrecks can become pandemic as well because instead of using an object-oriented style of programming that passes messages between objects to perform work, we essentially allow objects to know too much about their collaborators and details.  Another way this has been said is &#8220;talk only to your friends&#8221; or &#8220;ask, don&#8217;t tell.&#8221;  A client object <em>asks</em> other objects what their state is, and uses an if statement to perform an action, instead of <em>telling</em> the collaborating object what it wants done, and letting that object figure it out.  Instead of the train wreck, we should extract the behavior to a method that allows us to tell our collaborator what we want done:</p>
<pre>employee.promoteToManager();</pre>
<p>Complex conditional &#8220;train wrecks&#8221; can often be extracted in the same way.  Quite often these types of objects are really just procedural code masquerading as a class, and will be in violation of other SOLID-principles such as the Single Responsibility principle.  Making this code more &#8220;SOLID&#8221; will make it easier to test and maintain.</p>
<h3><strong>The Bigger Picture: Well Designed, Testable Code</strong></h3>
<p>Remember, this exercise in design (by removing ugly branching) is not just for aesthetics.  There is a very legit reason to try these techniques: writing testable code.  Hevery&#8217;s talk (and his other talks) are essentially about how to write code that is testable.  Freeman and Pryce&#8217;s book is about the very close relationship between testability and OO-design.</p>
<p>If you like these ideas, you might be interested to try the <a title="TDD As If You Meant It" href="http://gojko.net/2009/08/02/tdd-as-if-you-meant-it-revisited/">TDD As If You Meant It</a> exercise as well.  This is an exercise that will show you how to listen to test code to drive adding features that are driven out by tests into your production codebase by implementing them first in the test class.  This is the ultimate way to ensure that your production code contains only what it needs and nothing more, and that code is adequately covered by tests!  Remember, the more code you write into production code, the more you&#8217;re going to need to maintain it, and the more skeptical you should be about how readable and well designed it is.  These techniques and exercises may seem silly on the surface, but if you explore them I am confident they will help you write better code!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Eliminate+Branching+%28IF+Statements%29+to+Produce+Better+Code&amp;link=http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/&amp;notes=In%20a%20recent%20tech%20talk%2C%20I%20watched%20Mi%C5%A1ko%20Hevery%20propose%20an%20interesting%20challenge%20to%20his%20audience%3A%20start%20a%20toy%20project%20and%20try%20to%20write%20the%20code%20with%20no%20if-else%20or%20switch%20blocks%20at%20all.%20None%20at%20all%3F%20%20Before%20thinking%20about%20how%20to%20do%20this%2C%20why%20would%20you%20want%20to%20do%20it%20in%20the%20first%20place%3F%20%20On%20the%20surface%2C%20it%20may%20seem%20to%20the%20unassuming%20a%20bit%20counter-intuitive.%20%20Comparison-based%20branching%20is%20at%20the%20heart%20of%20programming%2C%20and%20the%20concept%20of%20an%20if-else%20or%20switch%20block%20is%20almost%20universal%2C%20existing%20in%20most%20every%20programming%20language%20ever%20devised.%20%20What%27s%20Hevery%27s%20agenda%20with%20this%20exercise%20%E2%80%93%20and%20what%20can%20possibly%20be%20gained%20from%20trying%20to%20write%20a%20program%20without%20branching%20entirely%3F&amp;short_link=http://bit.ly/aGPtFg&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>July 8, 2010 -- <a href="http://cwash.org/2010/07/08/transactions-part-1/" title="Transactions, Part 1">Transactions, Part 1</a> (0)</li><li>July 24, 2009 -- <a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/" title="The Elements of Reusable Code">The Elements of Reusable Code</a> (0)</li><li>July 29, 2009 -- <a href="http://cwash.org/2009/07/29/what-id-tell-myself-about-design-if-i-were-just-beginning/" title="What I&#8217;d Tell Myself About Design If I Were Just Beginning">What I&#8217;d Tell Myself About Design If I Were Just Beginning</a> (5)</li><li>June 9, 2009 -- <a href="http://cwash.org/2009/06/09/mocking-with-jmockit/" title="Mocking with JMockit">Mocking with JMockit</a> (5)</li><li>June 3, 2009 -- <a href="http://cwash.org/2009/06/03/what-is-hamcrest/" title="What is Hamcrest?">What is Hamcrest?</a> (0)</li><li>April 15, 2009 -- <a href="http://cwash.org/2009/04/15/osgi-ggity-giggity/" title="OSGi-ggity-Giggity">OSGi-ggity-Giggity</a> (4)</li><li>January 31, 2009 -- <a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/" title="In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel ">In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel </a> (3)</li><li>January 13, 2009 -- <a href="http://cwash.org/2009/01/13/on-software-quality/" title="On Software Quality">On Software Quality</a> (8)</li><li>November 28, 2008 -- <a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/" title="Must Haves/References For Modern Java EE Developers">Must Haves/References For Modern Java EE Developers</a> (1)</li><li>November 19, 2008 -- <a href="http://cwash.org/2008/11/19/java-6-and-maven-209-on-leopard/" title="Java 6 and Maven 2.0.9 on Leopard">Java 6 and Maven 2.0.9 on Leopard</a> (7)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Elements of Reusable Code</title>
		<link>http://cwash.org/2009/07/24/the-elements-of-reusable-code/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=the-elements-of-reusable-code</link>
		<comments>http://cwash.org/2009/07/24/the-elements-of-reusable-code/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 19:35:49 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[CapTech]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[DRY]]></category>
		<category><![CDATA[osgi]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://cwash.org/?p=66</guid>
		<description><![CDATA[It's easier to make progress on large-scale problems by breaking them down, and making a habit of looking for patterns and ways to combine, compose and chain smaller solutions.  Like we do with Agile problem solving approaches.  Can't we do that for the hairy reuse problem?]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2009/07/24/the-elements-of-reusable-code/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><p>Back in April, there was an interesting article quoting Ron Jeffries et al on InfoQ looking at <a href="http://www.infoq.com/news/2009/04/agile-code-reuse" target="_new">code reuse from an agile perspective</a>. The conversation steered toward explaining reuse as a concern that is very expensive, looking at it from a top-down, &#8220;enterprise&#8221;-wide lens.</p>
<p>But is code reuse a black and white issue?  My contention is there are varying degrees of reuse that are often neglected on a microscale within an even moderately-sized project.  If the code you produce isn&#8217;t going to be reused, is it even going to be looked at?  These are similar problems with similar solutions.<span id="more-66"></span></p>
<p>As far as producing reusable code, I believe there is a medium of full-fledged, framework or API degree of reuse and also a &#8220;just enough&#8221; degree of reuse.  The article touched on a similar concept:</p>
<blockquote><p>Adam Sroka called this &#8216;emergent reuse&#8217; and noted that this seemed more efficient than the &#8216;design for reuse&#8217; approach. A poster named Tim explains it to his business people this way: &#8220;The first time you have to pay for it to be coded, the second time you have to pay for it to be reusable, the third time it&#8217;s free.&#8221;</p></blockquote>
<p>A higher degree of reuse requires more of an investment in these principles and practices.  What&#8217;s more, I think the article fails to draw a distinction between the roles (or competing concerns) involved in reuse: not only should we be worried about reusing code we produce, but often we are presented with a very real problem that wasn&#8217;t talked about in the article which is how we <em>consume code</em> that we choose to reuse.</p>
<p>A project is itself a consumer of its own code, and many times you&#8217;ll find a codebase is not even internally consistent in how it reuses code within itself.  Quite often consumer-reuse happens in the form of depending on third party libraries, open source frameworks or APIs.  In this sense, reuse becomes an issue of code quality, or more aptly, <a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882">code cleanliness</a>.  It&#8217;s hard to come up with solutions to big problems by just thinking about an ideal solution, and even if you are able to do it, odds are your solution will probably be rather academic.  It&#8217;s easier to make progress on large-scale problems by breaking them down, and making a habit of looking for patterns and ways to combine, compose and chain smaller solutions.  Like we do with Agile problem solving approaches.  Can&#8217;t we do that for the hairy reuse problem?</p>
<h3>Decomposing the Problem</h3>
<p>Code reuse is a tough problem to nail down, because it&#8217;s a high-level view composed of a whole host of smaller concerns.  With a nod to <a href="http://en.wikipedia.org/wiki/Separation_of_concerns" target="_new">separation of concerns</a>, I&#8217;ve tried to decompose these competing factors into their own categories and make some suggestions of things to look at if you&#8217;d like to have a higher degree of reuse within your team or code base.</p>
<h3>Communication Concerns</h3>
<h4>Communication Saturation</h4>
<p>Last night I listened to an Agile Richmond talk by Jeff Sutherland espousing the ideal of communication saturation.  Jeff was talking about Scrum, and wanted to draw a strong correlation between this saturation and &#8220;hyper-productive&#8221; teams.  The key, Jeff said, was the ability of the group to recognize what is the next most important thing to work on and come to a collective decision about it.  This resonated with my experience with agile.  Our group was able to defer stories where we saw reuse was going to be apparent in the future, and this not only did this save us time in the long run, but it made the problem of &#8220;discovery&#8221; and consumption a no brainer.  Everyone on the team knew a component we delivered one release was to be reused in future releases, even if we weren&#8217;t involved in developing it.  This, coulped with the idea of collective code ownership, opens all the right communication channels for a software development project in my opinion.</p>
<h4>Value cross training</h4>
<p>Don&#8217;t be afraid to ask for help or give it if you can provide help.  <em>Educate yourself and teach others</em>.  You&#8217;ll find that successful teams do this naturally through many different ways.  If it seems tough to approach individuals, a better course of action may be to schedule a weekly development meeting to discuss hard problems and solutions to those problems.  Record topics that come up regularly.  An informal retrospective after a release or milestone can go a long way to correcting the course of the ship.</p>
<h3>Design Concerns</h3>
<h4>Cross cutting concerns</h4>
<p>A whole class of reuse problems can be boiled down to <em>reinventing the wheel</em> instead of solving core business problems.  If you&#8217;re solving a technical problem, is it a cross-cutting concern?   If you can identify a problem that has been solved in more than one way, it&#8217;s a good idea to pull the team together and talk about a good way to solve it moving forward.</p>
<h4>Refactor mercilessly to remove duplication</h4>
<p>Refactoring to remove duplication is a skill that takes practice and diligence to do well.  But it&#8217;s often a quick win to spot and remove duplication; <em>Don&#8217;t Repeat Yourself</em> will go a long way to improving the quality of the code your team produces by coercing the design of the code into something more fundamentally sound and amenable to larger scale refactoring later.</p>
<p>Reuse problems are often a manifestation of not having &#8220;everything in its right place.&#8221; If you always know where to go to get a hammer, then the problem is reduced to that hammer being there when you go to get it.  The bigger problem is (rightfully so, now) knowing when you need that a hammer.  This is not necessarily going to solve the problem of discoverability or consumption for you (communication is needed for that), but it will help with organization tremendously.  Whether or not you achieve an enterprise degree of reuse may be a horse of a different color and have a lot to do with communication, but in the microscale refactoring is the weapon of choice.</p>
<h4>Names Matter</h4>
<p>If you are able to refactor using <a href="http://c2.com/ppr/wiki/WikiPagesAboutRefactoring/ComposedMethod.html" target="_new">composed methods</a>, naming becomes a lot easier.  Each method will aim to solve one single &#8220;atomic&#8221; concern, and larger methods will become more readable and logical as they get shorter and more maintainable.</p>
<h3>Technical Concerns</h3>
<h4>Know the language and learn standard APIs<em> </em></h4>
<p><em>Unit testing</em> can help you learn a new API fairly quickly and document some hard-earned pieces of knowledge going forward.  A handy construct that is available in many languages is a <em>shell interpreter</em> like IRB or BeanShell, which can be invaluable in helping to pick up the syntax and semantics of a language.  <a href="http://en.wikipedia.org/wiki/Shell_(computing)#Shells_for_programming_languages" target="_new">Wikipedia has a list</a> of interactive programming language shells.</p>
<h4>Modularize your code</h4>
<p>Modularization is important.  Few languages support full modularization OOTB.  At the base level, you need to be able to encapsulate your code and also package or namespace it.  This is all you really get OOTB in most languages.  Ideally, full modularization would provide you with the ability to bundle together code and provide a mechanism to have the code installed or uninstalled dynamically at runtime &#8211; in order to achieve this you often have to specify dependencies between modules and declare a version for your bundle.  (OSGi aims to do this in Java, and is definitely worth a look).</p>
<p>Modularization is important to code reuse because it presents a barrier to someone else using your code.  If I want to use a particular component or method that exists in your library, that means I am fundamentally absorbing the lowest-level dependencies that you have.  If your project is not properly modularized, I may have to eat all of your dependencies.  The larger your component is, the more complexity any consumer must absorb to reuse your code.  Modularization should help with this problem.</p>
<p>SOA was supposed to have solved this problem, right?  At least a subset of reuse problems – iteroperability.  We&#8217;ve found it&#8217;s a lot harder in practice than it is in theory.  You have to version services, and use some registry to look up and discover a version.  Not to mention the governance issues involved.  This is why I&#8217;m so excited about <a href="http://cwash.org/2009/04/15/osgi-ggity-giggity/">OSGi</a>.  This might be the way to take your microscale reuse to the enterprise, and the model (in practice, and arguably theory) is a good deal simpler than SOA, too.</p>
<h4>Documentation Matters?</h4>
<p>If you are writing an API or framework, you can&#8217;t argue that documentation will be incredibly important to the success of your project. Note, I&#8217;m not talking necessarily here about Java-doc style-documentation; rather, I&#8217;m talking about providing a would be <em>reuser</em> of your code with enough support to make them successful.  Sometimes that means concise, well written and up-to-date API documentation.  Quite often this will come in the form of a user or developer&#8217;s guide with a more narrative style or structure.  FAQs or troubleshooting guides are often very important tools.</p>
<blockquote><p>Reuse is something that is far easier to say than to do. Doing it requires both good design and very good documentation. Even when we see good design, which is still infrequently, we don&#8217;t see the components reused without good documentation.</p>
<p>-D.L. Parnas, Software Aging. <em>Proceedings of the 16th International Conference on Software Engineering, 1994</em></p></blockquote>
<h3>Going Forward</h3>
<p>We all know waste is a thief.  Rework is wasteful.  Solving the problem of reuse on a grand scale may seem intractible, but I think it&#8217;s just another problem, and arguably not even the hardest one we have to contend with in software development.  If we can break the reuse problem down from its mighty enterprise-wide incarnation into smaller, more digestable reuse problems, it becomes a lot easier to make progress.  And maybe one day we&#8217;ll find a way to get to that enterprise-wide reuse that may seem too good to be true at the moment.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=The+Elements+of+Reusable+Code&amp;link=http://cwash.org/2009/07/24/the-elements-of-reusable-code/&amp;notes=It%27s%20easier%20to%20make%20progress%20on%20large-scale%20problems%20by%20breaking%20them%20down%2C%20and%20making%20a%20habit%20of%20looking%20for%20patterns%20and%20ways%20to%20combine%2C%20compose%20and%20chain%20smaller%20solutions.%20%20Like%20we%20do%20with%20Agile%20problem%20solving%20approaches.%20%20Can%27t%20we%20do%20that%20for%20the%20hairy%20reuse%20problem%3F&amp;short_link=http://bit.ly/akyatS&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>August 2, 2008 -- <a href="http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/" title="How I Escape the &#8220;Reuse Trap&#8221;">How I Escape the &#8220;Reuse Trap&#8221;</a> (0)</li><li>July 8, 2010 -- <a href="http://cwash.org/2010/07/08/transactions-part-1/" title="Transactions, Part 1">Transactions, Part 1</a> (0)</li><li>January 7, 2010 -- <a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/" title="Eliminate Branching (IF Statements) to Produce Better Code">Eliminate Branching (IF Statements) to Produce Better Code</a> (0)</li><li>July 29, 2009 -- <a href="http://cwash.org/2009/07/29/what-id-tell-myself-about-design-if-i-were-just-beginning/" title="What I&#8217;d Tell Myself About Design If I Were Just Beginning">What I&#8217;d Tell Myself About Design If I Were Just Beginning</a> (5)</li><li>April 15, 2009 -- <a href="http://cwash.org/2009/04/15/osgi-ggity-giggity/" title="OSGi-ggity-Giggity">OSGi-ggity-Giggity</a> (4)</li><li>June 9, 2009 -- <a href="http://cwash.org/2009/06/09/mocking-with-jmockit/" title="Mocking with JMockit">Mocking with JMockit</a> (5)</li><li>June 3, 2009 -- <a href="http://cwash.org/2009/06/03/what-is-hamcrest/" title="What is Hamcrest?">What is Hamcrest?</a> (0)</li><li>January 31, 2009 -- <a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/" title="In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel ">In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel </a> (3)</li><li>January 13, 2009 -- <a href="http://cwash.org/2009/01/13/on-software-quality/" title="On Software Quality">On Software Quality</a> (8)</li><li>December 1, 2008 -- <a href="http://cwash.org/2008/12/01/24ways/" title="24ways">24ways</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2009/07/24/the-elements-of-reusable-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel</title>
		<link>http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel</link>
		<comments>http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 01:16:05 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Meta/Blog]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blog fight]]></category>
		<category><![CDATA[Bob Martin]]></category>
		<category><![CDATA[Cal Henderson]]></category>
		<category><![CDATA[Cedric Beust]]></category>
		<category><![CDATA[Clean Code]]></category>
		<category><![CDATA[creativity]]></category>
		<category><![CDATA[development practices]]></category>
		<category><![CDATA[Gavin King]]></category>
		<category><![CDATA[Hanselminutes]]></category>
		<category><![CDATA[Jared Richardson]]></category>
		<category><![CDATA[Jeff Atwood]]></category>
		<category><![CDATA[Jim Coplien]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[pragmatic]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[stackoverflow]]></category>
		<category><![CDATA[technical debt]]></category>
		<category><![CDATA[testng]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://cwash.org/?p=107</guid>
		<description><![CDATA[Weighing in on the recent ideological classes between Stackoverflow's recent podcast with Jeff Atwood and Joel Spolsky in which they call out Robert "UncleBob" Martin on his views of Unit Testing and his SOLID principles.]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><div class="content">
<p><strong>Update:</strong> Robert Martin is scheduled to appear on the Feb 10 episode of the SO Podcast.  Should be interesting to see where things go.  Also, Jay Fields has <a href="http://blog.jayfields.com/2009/02/thoughts-on-developer-testing.html">weighed in on the topic</a>.</p>
<p><strong>Update #2:</strong> Listened to the new SO podcast and am working on a short followup post.  I just met another local boy and kindred spirit in <a href="http://www.codethinked.com/">Justin Etheredge who has also had a few things to say</a> about this whole debacle.</p>
<p>I wanted to add my two cents to this philosophical, in my view very important, but not very pragmatic debate. For the uninitiated, the argument begins with the <a href="http://blog.stackoverflow.com/2009/01/podcast-38/">Stackoverflow Podcast Episode #38</a> which is a discussion between Joel Spolsky and Jeff Atwood.  They discussed, among many other topics, some of &#8220;UncleBob&#8221; Martin&#8217;s recent material found in his book <em><a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882">Clean Code</a></em>, (actually, Spolsky cited Martin&#8217;s appearance on <a href="http://www.hanselminutes.com/default.aspx?showID=163">Hanselminutes</a> as the spark to his comments), which Martin responded to with a number of tweets and a <a href="http://blog.objectmentor.com/articles/2009/01/31/quality-doesnt-matter-that-much-jeff-and-joel">blog post</a>.<span id="more-107"></span></p>
<p><a href="http://agileartisans.com/main">Jared Richardson</a> introduced me to the idea of <strong>technical debt</strong>, (term was coined, like so many other terms, by Ward Cunningham) which I think is a pragmatic way to cut through the philosophical differences in this argument.  But in the interest of carrying on the debate, and because it&#8217;s the weekend, I&#8217;ve decided to (perhaps) add some fuel to the fire.  Please don&#8217;t read this at work.</p>
<p>The gist of the argument is about how much emphasis you should focus on robustness/code hygiene/maintainability in your code, even if it is unclear there is much business value in doing so.  Essentially, if we consider impacts to budgets, deadlines, etc., and even in terms of its impact to your code (see Antipattern: &#8220;Yet Another Useless Layer&#8221;) &#8212; is it worth it?  It&#8217;s very much a discussion of what software quality is and why is it important, which raises questions like:</p>
<ul>
<li>Are robustness and business value mutually exclusive?</li>
<li>Does quality require rigor and conceptual cleanliness?</li>
<li>Is code hygiene a purely academic pursuit, or is there intrinsic value in it?</li>
</ul>
<p>These are interesting questions.  Atwood and Spolsky take what they feel is a more pragmatic position; Atwood explaining quality in terms of a Frank Zappa quote [paraphrasing] &#8220;Nobody gives a crap if we&#8217;re great musicians,&#8221; meaning that what matters is ultimately what is delivered to the customer. He explains further that &#8220;Quality is just another axis&#8221; &#8212; another set of competing concerns for your development time and interest.  Spolsky&#8217;s comments constitute a self-professed rant that there is a thread of zealotry in the OO community around TDD.  It reminded me a lot of what <a href="http://beust.com/weblog/archives/000477.html">Cedric Beust has argued</a> in reference to what <a href="http://www.infoq.com/interviews/coplien-martin-tdd">Jim Coplien has debated with Martin himself</a>.  While Spolksy could be playing devil&#8217;s advocate, or could have been looking to start a &#8220;blog fight&#8221; (already popping up in comment threads) I think he could have gone about it in a more pragmatic way.  While Beust does paint Martin as a zealot as well, at least his main point didn&#8217;t portray unit testing as just short of completely useless; rather, he is one of the creators of the popular <a href="http://testng.org/doc/">TestNG </a>framework:</p>
<blockquote><p>&#8220;Tests first&#8221; or &#8220;tests last&#8221; is unimportant as long as there are tests.</p></blockquote>
<p>I might be wrong, but I even remember reading a section of <em>Clean Code</em> in Borders last week and essentially reading Beust&#8217;s point in Martin&#8217;s book.  It stuck out in my mind after watching his debate with Coplian.  But I digress.</p>
<p>Before going further, I wanted to point out how much this debate reminds me of <a href="http://www.plasticbag.org/archives/2004/03/from_pirate_dwarves_to_ninja_elves/">From pirate dwarves to ninja elves&#8230;</a>, which I believe is a great way to classify personality types &#8212; especially those of people writing code.  We know for sure that UncleBob falls into the Ninja-Elf quadrant.  He thinks practicing TDD is a professional responsibilty and lays out his own definition for TDD in <em>Clean Code</em>.  I think this is the very definition of a Ninja-Elf.  My personal leanings are toward that quadrant as well. When you are innundated with Dijsktra, the ulitmate Ninja-Elf, in school, the following quote really sticks with you:</p>
<blockquote><p>I mean, if 10 years from now, when you are doing something quick and dirty, you suddenly visualize that I am looking over your shoulders and say to yourself &#8220;Dijkstra would not have liked this&#8221;, well, that would be enough immortality for me.</p></blockquote>
<p>But there are people whose opinions I respect with Dwarf-Pirate leanings, too.  Obviously Atwood and Spolsky lean in this direction (though they may not fall directly into that quadrant).  I’ve heard some others that I respect espouse the same opinion as Spolsky; Gavin King, for example, I’ve heard him say, “The types of bugs that I introduce usually aren’t caught by a <strong>unit</strong> test.”  He wasn’t as over the top in his argument, he simply explained that he prefers integration tests.  And I don&#8217;t think you&#8217;d hear any of the people mentioned in this post say that they never write any tests.  For a great argument from the ultimate Pirate-Dwarf see Cal Henderson&#8217;s <a href="http://www.ludicorp.com/flickr/flickr_php_final.zip">normalized data is for sissies</a> (slide #27); it is pretty entertaining and compelling when scalability is of utmost concern.</p>
<p>I think Atwood’s argument ultimately came down to championing the idea of <a href="http://www.infoq.com/news/2008/02/continuous-production">continuous production</a>; that being able to respond to change or bugs found and having a quick no-brainer deployment process is the Zen-like state you&#8217;d like to get to.  But the idea of getting there is that it comes out of some notion of continuous integration, which is predicated on the idea of testing.  Henderson himself makes this very argument (I believe in this <a href="http://cdn4.libsyn.com/carsonsystems/Cal_Henderson.mp3?nvb=20090201003132&amp;nva=20090202004132&amp;t=0cab6219613db05c73c82">talk</a>, but perhaps in another). You need to trust your team enough to get changes and fixes out to address problems quickly, and be smart about what you spend time on. Testing is great and if you can find people that can test their code well and be productive, that’s awesome. But Henderson’s point is those people are extremely hard to find and retain.</p>
<p>All this goes back to the old question, is producing code an artistic or engineering practice?  (Interesting that Atwood supported his comment with a Frank Zappa quote about art.)  Obviously you need a talented and cohesive team to be able to make it work either way. I think the answer is it <strong>has to be</strong> a little bit of both.  You&#8217;ll need some measure of creativity, some degree of engineering aptitude, also strong analytical skills, and to succeed in a business environment, some acumen in decision making and managing (at the very least your own time).</p>
<p>The fact is, though, that we’ve come leaps and bounds in terms of being able to efficiently produce these tests, and balance their production and maintenance out with constraints, business expectations, budgets and deadlines.  And <a href="http://rubyconf.org/talks/24">it can fuel your creative side</a>, too.</p>
<p>As for professional responsibilities, I definitely wouldn’t recommend trying to write code without at least <em>some</em> tests if you expect anyone else to have to maintain your code. If you&#8217;ve got a close knit team and an overwhelmingly urgent need to deliver untested code (and are of the Pirate-Dwarf persuasion) then go for it.  But that being said, I’d say I agree with Martin and Jared Richardson that argue it’s a professional responsibility to <strong>not take on the technical debt of untested code</strong>. Of course, if tests mean you can get maintainability (and other -ilities) along the way then I think that you&#8217;re well on your way to a quality product.</p>
<p>One final way to look at this: would you say it&#8217;s better for your team to take the view that code is innocent until proven guilty, or guilty until proven innocent?  In the interest of skepticism, considering the teams that most developers &#8220;in the trenches&#8221; have to work on, and how far we&#8217;ve come in making testing easier and more efficient, I&#8217;d need a very strong team to make the assumption that all they code they write is innocent.  We all make mistakes.  I believe this is also brought up in <em>Clean Code</em>.</p>
<p>Ultimately the message Atwood and Spolsky send in their Stackoverflow podcast is that unit testing and efforts to support it are not a silver bullet.  Personal slights aside (&#8220;I don&#8217;t think these people write very much code.&#8221;) they have a point &#8212; and Martin agrees in his blog post.  But I think it took them a long time to make that point which is certainly no great revelation.  In the end, I did not feel they explained a whole lot about what the <em>right approach to quality</em> is, but communicated their distaste for an attempt (especially if accepted dogmatically) that aims to do so.  I can relate to this, and agree you must treat what you read, hear and are taught with a healthy dose of skepticism.  Martin&#8217;s ideas may seem dogmatic on the surface but I don&#8217;t think it&#8217;s fair to paint him in that light.  If you really read what he writes, I think he realizes that he is a voice many people are listening to, and works hard to say what he thinks is the right.  Martin defends a style of development that favors more rigor and discipline than many others feel is necessary, but in an industry that can be categorized by its lack of discipline, I can&#8217;t do much but respect him for that.</div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=In+response+to+Stackoverflow+%2338%2F%22Quality+Doesn%27t+Matter+That+Much%22+--+Jeff+and+Joel+&amp;link=http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/&amp;notes=Weighing%20in%20on%20the%20recent%20ideological%20classes%20between%20Stackoverflow%27s%20recent%20podcast%20with%20Jeff%20Atwood%20and%20Joel%20Spolsky%20in%20which%20they%20call%20out%20Robert%20%22UncleBob%22%20Martin%20on%20his%20views%20of%20Unit%20Testing%20and%20his%20SOLID%20principles.&amp;short_link=http://bit.ly/a3OkUe&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>November 28, 2008 -- <a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/" title="Must Haves/References For Modern Java EE Developers">Must Haves/References For Modern Java EE Developers</a> (1)</li><li>February 17, 2009 -- <a href="http://cwash.org/2009/02/17/dont-unit-test-anymore-no-really/" title="Don&#8217;t Unit Test Anymore&#8230; No, Really!">Don&#8217;t Unit Test Anymore&#8230; No, Really!</a> (6)</li><li>January 13, 2009 -- <a href="http://cwash.org/2009/01/13/on-software-quality/" title="On Software Quality">On Software Quality</a> (8)</li><li>March 13, 2008 -- <a href="http://cwash.org/2008/03/13/continuous-integration-dissected/" title="Continuous Integration Dissected">Continuous Integration Dissected</a> (0)</li><li>March 11, 2008 -- <a href="http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/" title="Bugs, Detectives, and Test Automation">Bugs, Detectives, and Test Automation</a> (2)</li><li>June 9, 2009 -- <a href="http://cwash.org/2009/06/09/mocking-with-jmockit/" title="Mocking with JMockit">Mocking with JMockit</a> (5)</li><li>August 2, 2008 -- <a href="http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/" title="How I Escape the &#8220;Reuse Trap&#8221;">How I Escape the &#8220;Reuse Trap&#8221;</a> (0)</li><li>July 8, 2010 -- <a href="http://cwash.org/2010/07/08/transactions-part-1/" title="Transactions, Part 1">Transactions, Part 1</a> (0)</li><li>January 7, 2010 -- <a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/" title="Eliminate Branching (IF Statements) to Produce Better Code">Eliminate Branching (IF Statements) to Produce Better Code</a> (0)</li><li>July 24, 2009 -- <a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/" title="The Elements of Reusable Code">The Elements of Reusable Code</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://cdn4.libsyn.com/carsonsystems/Cal_Henderson.mp3?nvb=20090201003132&amp;amp" length="46243558" type="audio/mpeg" />
		</item>
		<item>
		<title>On Software Quality</title>
		<link>http://cwash.org/2009/01/13/on-software-quality/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=on-software-quality</link>
		<comments>http://cwash.org/2009/01/13/on-software-quality/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 02:27:04 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[leadership]]></category>
		<category><![CDATA[planning]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://cwash.org/?p=71</guid>
		<description><![CDATA[A brief discussion of how "the devil is in the details," especially when we're talking about Software Quality.]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2009/01/13/on-software-quality/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><p>Dwight D. Eisenhower said &#8220;In preparing for battle I have always found that plans are useless, but planning is indispensable.&#8221;  After reading Jason Yip&#8217;s <a href="http://jchyip.blogspot.com/2009/01/no-matter-how-many-times-you-say-it-we.html">No matter how many times you say it, we still don&#8217;t need a QA on the team</a>, I started thinking about how similar this is to the correlation between (software) quality and exploring what software quality is.  In the spirit of Jason&#8217;s article, thinking about how you &#8220;get quality right&#8221; will have more positive results for the sake of quality than searching out defects.  So the question stands, how do you get quality right?  I&#8217;m not sure there&#8217;s a cut and dry answer, but I have a feeling it&#8217;s in the details.  I know it sounds anecdotal, but quality isn&#8217;t easy.  It requires a lot of effort applied constantly.  It requires reward and incentive, not punishment and fear.  It&#8217;s caring about small things, and shifting how your team thinks, communicates and works together.<span id="more-71"></span></p>
<p>Jason wisely points out, &#8220;Everyone has a responsibility for quality.&#8221;  But how are you ever to translate this to your team that plays the blame game, avoids at all real issues of quality, or blindly assumes that the &#8220;QA&#8221; (sic) will find all the product defects?  How do you start this discussion, much less keep it going constantly?</p>
<p>Do you simply say, &#8220;Quality is your responsibility&#8221;?  Or hang a sign on the wall to the same effect?  I wouldn&#8217;t.  The very idea of it undermines the ideal you&#8217;re trying to espouse: taking personal responsibility.  It does nothing to encourage people to care about quality, outside of fear of losing your respect, <em>maybe</em>.</p>
<p>It&#8217;s leading by example.  If someone finds a defect in my work, or takes issue with something I&#8217;m responsible for, I congratulate them with a &#8220;Good catch &#8211; thanks!&#8221;  It may sound silly.  It may even sound sissy.  That&#8217;s natural.  After all, we&#8217;re brought up, educated, cultivated with instincts to defend our own work.  I wouldn&#8217;t be the least bit surprised to learn the average adult brain is predisposed to think this way due to the way its been &#8220;wired&#8221; through learning, and even, more philosophically, through our own sense of ego and intellectual self-worth.  But think about psychologically what &#8220;good catch&#8221; does instead:  </p>
<ol>
<li>It acknowledges your teammate&#8217;s effort, and encourages that person to continue to put forth the same effort.  Or more.  </li>
<li>It encourages me to be more diligent in the future, even if I don&#8217;t agree 100%.  </li>
<li>Most importantly, it tells my teammate that I care about quality, too.</li>
</ol>
<p>Yet, all of this assumes people on your team desire to produce quality software.  Somehow I had to tie this into <a href="http://www.codinghorror.com/blog/archives/001202.html">Programming: Love It or Leave It</a>, right?  More rambling to come on this topic later.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2009/01/13/on-software-quality/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=On+Software+Quality&amp;link=http://cwash.org/2009/01/13/on-software-quality/&amp;notes=A%20brief%20discussion%20of%20how%20%22the%20devil%20is%20in%20the%20details%2C%22%20especially%20when%20we%27re%20talking%20about%20Software%20Quality.&amp;short_link=http://bit.ly/clR2hH&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>January 31, 2009 -- <a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/" title="In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel ">In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel </a> (3)</li><li>November 28, 2008 -- <a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/" title="Must Haves/References For Modern Java EE Developers">Must Haves/References For Modern Java EE Developers</a> (1)</li><li>August 2, 2008 -- <a href="http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/" title="How I Escape the &#8220;Reuse Trap&#8221;">How I Escape the &#8220;Reuse Trap&#8221;</a> (0)</li><li>July 8, 2010 -- <a href="http://cwash.org/2010/07/08/transactions-part-1/" title="Transactions, Part 1">Transactions, Part 1</a> (0)</li><li>January 7, 2010 -- <a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/" title="Eliminate Branching (IF Statements) to Produce Better Code">Eliminate Branching (IF Statements) to Produce Better Code</a> (0)</li><li>July 24, 2009 -- <a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/" title="The Elements of Reusable Code">The Elements of Reusable Code</a> (0)</li><li>April 15, 2009 -- <a href="http://cwash.org/2009/04/15/osgi-ggity-giggity/" title="OSGi-ggity-Giggity">OSGi-ggity-Giggity</a> (4)</li><li>January 21, 2009 -- <a href="http://cwash.org/2009/01/21/16-apps-that-lessen-teh-suck-of-web-development-in-xp/" title="16 Apps That Lessen TEH SUCK of Web Development in XP">16 Apps That Lessen TEH SUCK of Web Development in XP</a> (8)</li><li>December 1, 2008 -- <a href="http://cwash.org/2008/12/01/24ways/" title="24ways">24ways</a> (1)</li><li>March 19, 2008 -- <a href="http://cwash.org/2008/03/19/new-wave-logging/" title="New Wave Logging">New Wave Logging</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2009/01/13/on-software-quality/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Must Haves/References For Modern Java EE Developers</title>
		<link>http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=must-havesreferences-for-modern-java-ee-developers</link>
		<comments>http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 01:10:54 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[JBoss Seam]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[guice]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javaee]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[references]]></category>
		<category><![CDATA[seam]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[testng]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://cwash.org/?p=46</guid>
		<description><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/";</script>I&#8217;ve been doing a lot of reading lately and have been meaning to plug some of my favorite reads, and one of the things that I&#8217;ve been trying to read with an eye toward is for converting those that have been stuck on &#8220;behind-the-curve&#8221; projects to the new way of thinking and doing things. As [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><p>I&#8217;ve been doing a lot of reading lately and have been meaning to plug some of my favorite reads, and one of the things that I&#8217;ve been trying to read with an eye toward is for converting those that have been stuck on &#8220;behind-the-curve&#8221; projects to the new way of thinking and doing things.  As such, and just in time for the weekend, I&#8217;ve compiled a list of my favorites with an eye to the &#8220;movers and shakers&#8221; that have driven innovation in the Enterprise Java world recently.  Note that even though some of these links are specific to certain frameworks/technologies, there is a common thread throughout most of these that have a bigger focus on the best way to solve problems using Java 5/EE 5 constructs and concepts.</p>
<p>A book that should be on any Java developer&#8217;s shelf is <a href="http://www.amazon.com/gp/product/0321356683?ie=UTF8&#038;tag=cwasintosoft-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0321356683">Effective Java (2nd Edition)</a><img src="http://www.assoc-amazon.com/e/ir?t=cwasintosoft-20&#038;l=as2&#038;o=1&#038;a=0321356683" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.  <em>Make sure you get the second edition</em>, for all of the Java 5 changes.  <a href="http://www.youtube.com/watch?v=pi_I7oD_uGI">This talk by Joshua</a> should whet your appetite.  (His <a href="http://www.youtube.com/watch?v=aAb7hSCtvGw">talk on good API design</a> is also very good.)  You should also take a look at Bob Lee&#8217;s <a href="http://www.youtube.com/watch?v=FFXhXZnmEQM">talk on Guice</a>.  Guice&#8217;s philosophy and focus on typesafety has spilled over into Web Beans (and newer versions of Seam) and its annotation based approach has heavily influenced newer Spring features.  I especially like his points on type safety around the 11-minute mark.  The walkthrough at the end of the talk from &#8220;old way&#8221; to &#8220;new way&#8221; is great for people who haven&#8217;t really gotten away from Factories, Delegates, and Service Locators yet.</p>
<p>The Guice video mentions that a common thread in modern Java frameworks is a focus on testability. Testing is a very important concept that nearly all new frameworks have embraced, but you still need know-how to be successful with testing.  I&#8217;ve come across some great books recently in the automated (developer) testing arena.  I&#8217;ve found the most thorough book on the topic out there is Lasse Koskela&#8217;s <a href="http://www.amazon.com/gp/product/1932394850?ie=UTF8&#038;tag=cwasintosoft-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1932394850">Test Driven</a><img src="http://www.assoc-amazon.com/e/ir?t=cwasintosoft-20&#038;l=as2&#038;o=1&#038;a=1932394850" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.  The ideas and topics discussed in the book are really language independent, and work equally well with other languages.  To cut your teeth on TestNG, which the Seam documentation turned me onto, I recommend the TestNG developers&#8217; book <a href="http://www.amazon.com/gp/product/0321503104?ie=UTF8&#038;tag=cwasintosoft-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0321503104">Next Generation Java Testing: TestNG and Advanced Concepts</a><img src="http://www.assoc-amazon.com/e/ir?t=cwasintosoft-20&#038;l=as2&#038;o=1&#038;a=0321503104" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.  Cedric Beust, also the author of EJBGen, and Hani Suleiman, author of the Bile Blog, produced a book that was a suprisingly good read.  It&#8217;s packed with a lot of knowledge and some interesting takes on EE concepts.  Newer versions of JUnit also include many of these features and concepts, so you&#8217;ll get the underpinnings of these concepts in this book.  <a href="http://www.youtube.com/watch?v=TtcEpryRy44">This video</a> gives you a basis to TestNG&#8217;s approach.</p>
<p>As one of the growing number of developers who have an application in the <a href="http://seamframework.org/Documentation/SeamInProductionListing" target="_new">Seam In Production</a> page, there are a few Seam resources I have to share.  Even if you don&#8217;t get into Seam, it should be on your radar because a lot of the core concepts around conversations have evolved into Web Beans, and are found other frameworks like Apache Orchestra and Spring WebFlow.  Pete Muir did a <a href="https://jboss.webex.com/ec0600l/eventcenter/recording/recordAction.do;jsessionid=JwTdnQw2TZrh1Zq715zmXWwHBD2ZW2fDynhW2dh7NxYnK1pKkLly!-1137412519?theAction=poprecord&#038;actname=%2Feventcenter%2Fframe%2Fg.do&#038;apiname=lsr.php&#038;renewticket=0&#038;renewticket=0&#038;actappname=ec0600l&#038;entappname=url0106l&#038;needFilter=false&#038;&#038;isurlact=true&#038;entactname=%2FnbrRecordingURL.do&#038;rID=34057132&#038;rKey=F88E0DE2EA1FAC2D&#038;recordID=34057132&#038;rnd=9027886079&#038;siteurl=jboss&#038;SP=EC&#038;AT=pb&#038;format=short">Webcast</a> that&#8217;s a great introduction to Seam 2.  </p>
<p>Author of <a href="http://solutionsfit.com/blog/" target="_new">one of my favorite Seam blogs</a>, Jacob Orshalick, has created a <a href="http://refcardz.dzone.com/refcardz/core-seam?oid=hom6084">DZone RefCard for Seam 2.1 Core</a>.  It&#8217;s right off the presses, being published this week, but is a great quick-capsule review of what Seam can do for you, and nice to have on your desk if you&#8217;re writing Seam.  If you need more in-depth descriptions of what&#8217;s on the RefCard, Jacob also coauthored the latest edition of the great Seam reference <a href="http://www.amazon.com/gp/product/0137129394?ie=UTF8&#038;tag=cwasintosoft-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0137129394">Seam Framework: Experience the Evolution of Java EE</a><img src="http://www.assoc-amazon.com/e/ir?t=cwasintosoft-20&#038;l=as2&#038;o=1&#038;a=0137129394" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.<br />
Dan Allen&#8217;s <a href="http://www.amazon.com/gp/product/1933988401?ie=UTF8&#038;tag=cwasintosoft-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1933988401">Seam in Action</a><img src="http://www.assoc-amazon.com/e/ir?t=cwasintosoft-20&#038;l=as2&#038;o=1&#038;a=1933988401" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> is another excellent resource.  Of course, the awesome <a href="http://seamframework.org/Documentation">Seam Docs</a> and <a href="http://www.seamframework.org/Community/Forums">Forums</a> always come in handy.  You should also RSS <a href="http://in.relation.to/">in.relation.to</a> – the Hibernate/Seam developers&#8217; group blog.</p>
<p>I know I&#8217;m leaving some great things out.  What resources do you think someone who is used to J2EE should take a look at to get them &#8220;up to speed&#8221; with the state of the art?</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Must+Haves%2FReferences+For+Modern+Java+EE+Developers&amp;link=http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/&amp;notes=I%27ve%20been%20doing%20a%20lot%20of%20reading%20lately%20and%20have%20been%20meaning%20to%20plug%20some%20of%20my%20favorite%20reads%2C%20and%20one%20of%20the%20things%20that%20I%27ve%20been%20trying%20to%20read%20with%20an%20eye%20toward%20is%20for%20converting%20those%20that%20have%20been%20stuck%20on%20%22behind-the-curve%22%20projects%20to%20the%20new%20way%20of%20thinking%20and%20doing%20things.%20%20As%20such%2C%20a&amp;short_link=http://bit.ly/bpUdbq&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>January 31, 2009 -- <a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/" title="In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel ">In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel </a> (3)</li><li>March 19, 2008 -- <a href="http://cwash.org/2008/03/19/new-wave-logging/" title="New Wave Logging">New Wave Logging</a> (0)</li><li>June 9, 2009 -- <a href="http://cwash.org/2009/06/09/mocking-with-jmockit/" title="Mocking with JMockit">Mocking with JMockit</a> (5)</li><li>April 15, 2009 -- <a href="http://cwash.org/2009/04/15/osgi-ggity-giggity/" title="OSGi-ggity-Giggity">OSGi-ggity-Giggity</a> (4)</li><li>February 17, 2009 -- <a href="http://cwash.org/2009/02/17/dont-unit-test-anymore-no-really/" title="Don&#8217;t Unit Test Anymore&#8230; No, Really!">Don&#8217;t Unit Test Anymore&#8230; No, Really!</a> (6)</li><li>January 13, 2009 -- <a href="http://cwash.org/2009/01/13/on-software-quality/" title="On Software Quality">On Software Quality</a> (8)</li><li>August 21, 2008 -- <a href="http://cwash.org/2008/08/21/weblogic-92-seam-victory-is-mine/" title="Weblogic 9.2 + Seam : Victory is Mine!">Weblogic 9.2 + Seam : Victory is Mine!</a> (1)</li><li>August 2, 2008 -- <a href="http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/" title="How I Escape the &#8220;Reuse Trap&#8221;">How I Escape the &#8220;Reuse Trap&#8221;</a> (0)</li><li>July 21, 2008 -- <a href="http://cwash.org/2008/07/21/pimp-my-build/" title="Pimp My Build">Pimp My Build</a> (0)</li><li>March 13, 2008 -- <a href="http://cwash.org/2008/03/13/continuous-integration-dissected/" title="Continuous Integration Dissected">Continuous Integration Dissected</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How I Escape the &#8220;Reuse Trap&#8221;</title>
		<link>http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-i-escape-the-reuse-trap</link>
		<comments>http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 16:25:57 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[reuse]]></category>
		<category><![CDATA[reuse trap]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://cwash.org/?p=22</guid>
		<description><![CDATA[While I was reading "The Reuse Trap In Software Design" I found myself thinking,"Me too! Me too!" like a giddy kid on the playground that's found a new pal with a mutual interest in "pet snakes and/or tarantulas."  As with many of the problems Basil writes about in his blog, I experienced the same problem, investigated it and found the same root causes, and came to many of the same conclusions as those outlined.  My preferred technique for getting out of this quagmire is a little bit different than Basil's and I describe it in this article.]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><p>If you&#8217;ve checked out my blogroll, you&#8217;ll notice I have a link to <a title="Professional Software Development" href="http://www.basilv.com/psd/" target="_blank">Basil Vandegriend&#8217;s &#8220;Professional Software Development&#8221;</a> blog.  I like a lot of the articles he has written and to a large extent the subject matter I envision for this blog frequently crisscrosses with Basil&#8217;s.</p>
<p>While I was reading &#8220;<a title="The Reuse Trap In Software Design" href="http://www.basilv.com/psd/blog/2006/the-reuse-trap-in-software-design#comment-58049" target="_blank">The Reuse Trap In Software Design</a>&#8221; I found myself thinking,&#8221;Me too! Me too!&#8221; like a giddy kid on the playground that&#8217;s found a new pal with a mutual interest in &#8220;pet snakes and/or tarantulas.&#8221;  As with many of the problems Basil writes about in his blog, I experienced the same problem, investigated it and found the same root causes, and came to many of the same conclusions as those outlined.  He describes the &#8220;reuse trap&#8221; as:</p>
<blockquote><p>&#8230;[A] term I coined to describe the situation when one becomes stuck trying to design new functionality while simultaneously attempting to reuse existing code that needs some modifications.</p></blockquote>
<p>He then goes on to describe why it&#8217;s a tough problem for n00bs and outlines a strategy he uses to get out of the trap–one that&#8217;s best described as a two-step process: <em>copy-paste to reuse/refactoring to remove duplication</em>.  I encourage you to read his article if you&#8217;re not familiar with the terms, or how this strategy can solve the problem described above.</p>
<p>My preferred technique for mitigating the problems involved isn&#8217;t <em>copy-paste reuse/refactoring</em>; it&#8217;s stubbing the calls to the code-to-be-reused (C2BR) that needs modification.  If I can fake out the behavior I need, it lets me focus on the nature of the dependency that exists between the two objects/components.  When I go to modify the C2BR, my inputs and outputs (or other consequences that occur as a result of a call to the C2BR) translate directly into a test that I can use to drive the changes I make to that code.  It also ensures that the coupling that exists between the objects is loose and legit.</p>
<p>The only thing to watch out for is that care must be taken to then remove the (small) duplication of the stubbed out inputs/outputs and actually wire the two pieces together when finished with the reused code.  I usually do that by throwing a TODO:WIRE marker in when I stub something.</p>
<p>I&#8217;ve found this is the approach I take more often, though I do take the <em>copy-paste reuse/refactoring</em> route from time to time.  This <strong><em>stub/rewire</em></strong> approach is a bit more advanced, but it&#8217;s how I envisioned solving the &#8220;reuse trap&#8221; when, as Basil puts it, &#8220;I became aware of it&#8221; and all that it entailed.</p>
<p>Do you ever come across this problem?  How do you get out of this &#8220;trap&#8221; or avoid being caught up in it in the first place?</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=How+I+Escape+the+%22Reuse+Trap%22&amp;link=http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/&amp;notes=While%20I%20was%20reading%20%22The%20Reuse%20Trap%20In%20Software%20Design%22%20I%20found%20myself%20thinking%2C%22Me%20too%21%20Me%20too%21%22%20like%20a%20giddy%20kid%20on%20the%20playground%20that%27s%20found%20a%20new%20pal%20with%20a%20mutual%20interest%20in%20%22pet%20snakes%20and%2For%20tarantulas.%22%20%20As%20with%20many%20of%20the%20problems%20Basil%20writes%20about%20in%20his%20blog%2C%20I%20experienced%20the%20same%20problem%2C%20investigated%20it%20and%20found%20the%20same%20root%20causes%2C%20and%20came%20to%20many%20of%20the%20same%20conclusions%20as%20those%20outlined.%20%20My%20preferred%20technique%20for%20getting%20out%20of%20this%20quagmire%20is%20a%20little%20bit%20different%20than%20Basil%27s%20and%20I%20describe%20it%20in%20this%20article.&amp;short_link=http://bit.ly/brMnK3&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>July 24, 2009 -- <a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/" title="The Elements of Reusable Code">The Elements of Reusable Code</a> (0)</li><li>January 31, 2009 -- <a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/" title="In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel ">In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel </a> (3)</li><li>January 13, 2009 -- <a href="http://cwash.org/2009/01/13/on-software-quality/" title="On Software Quality">On Software Quality</a> (8)</li><li>December 1, 2008 -- <a href="http://cwash.org/2008/12/01/24ways/" title="24ways">24ways</a> (1)</li><li>November 28, 2008 -- <a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/" title="Must Haves/References For Modern Java EE Developers">Must Haves/References For Modern Java EE Developers</a> (1)</li><li>July 8, 2010 -- <a href="http://cwash.org/2010/07/08/transactions-part-1/" title="Transactions, Part 1">Transactions, Part 1</a> (0)</li><li>January 7, 2010 -- <a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/" title="Eliminate Branching (IF Statements) to Produce Better Code">Eliminate Branching (IF Statements) to Produce Better Code</a> (0)</li><li>July 29, 2009 -- <a href="http://cwash.org/2009/07/29/what-id-tell-myself-about-design-if-i-were-just-beginning/" title="What I&#8217;d Tell Myself About Design If I Were Just Beginning">What I&#8217;d Tell Myself About Design If I Were Just Beginning</a> (5)</li><li>April 15, 2009 -- <a href="http://cwash.org/2009/04/15/osgi-ggity-giggity/" title="OSGi-ggity-Giggity">OSGi-ggity-Giggity</a> (4)</li><li>January 21, 2009 -- <a href="http://cwash.org/2009/01/21/16-apps-that-lessen-teh-suck-of-web-development-in-xp/" title="16 Apps That Lessen TEH SUCK of Web Development in XP">16 Apps That Lessen TEH SUCK of Web Development in XP</a> (8)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Integration Dissected</title>
		<link>http://cwash.org/2008/03/13/continuous-integration-dissected/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=continuous-integration-dissected</link>
		<comments>http://cwash.org/2008/03/13/continuous-integration-dissected/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 16:29:06 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[build process]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[development practices]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://cwash.org/2008/03/13/continuous-integration-dissected/</guid>
		<description><![CDATA[A lot gets written about Continuous Integration, particularly on which is the best visual cue to let you know your build is broken or that a test is failing – lava lamps, Beta Brights, <a href="http://www.thinkgeek.com/gadgets/electronic/5da2/" title="This is probably not the last link to ThinkGeek from me">Ambient Orbs</a>, and some even suggest traffic lights. But aside from this extraneous (at least to business) nerd-banter, a lot of what I find written about the actual topic of CI is fluffy, ivory tower, or pie-in-the-sky jibber-jabber that leaves out important parts of the big picture or confuses people more than it helps.  In hopes of clearing up confusion on what exactly CI is and how it's <em>supposed</em> to work, I'm ripping out a description that I wrote for a client proposal recently (so my apologizes for the dry-tone).  I hope sheds some light on the true nature of CI, why it's important and how to implement it from a birds-eye point of view.
<p style="text-align: center"><img src="http://techepics.com/files/mythbusters_exploading_lava.jpg" alt="Lava Lamps" height="175" hspace="10" width="195" /></p>]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2008/03/13/continuous-integration-dissected/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><h3>Setting the Record Straight</h3>
<p>A lot gets written about Continuous Integration, particularly on which is the best visual cue to let you know your build is broken or that a test is failing – lava lamps, Beta Brights, <a href="http://www.thinkgeek.com/gadgets/electronic/5da2/" title="This is probably not the last link to ThinkGeek from me">Ambient Orbs</a>, and some even suggest traffic lights. But aside from this extraneous (at least to business) nerd-banter, a lot of what I find written about the actual topic of CI is fluffy, ivory tower, or pie-in-the-sky jibber-jabber that leaves out important parts of the big picture or confuses people more than it helps.  In hopes of clearing up confusion on what exactly CI is and how it&#8217;s <em>supposed</em> to work, I&#8217;m ripping out a description that I wrote for a client proposal recently (so my apologizes for the dry-tone).  I hope sheds some light on the true nature of CI, why it&#8217;s important and how to implement it from a birds-eye point of view.</p>
<p style="text-align: center"><img src="http://techepics.com/files/mythbusters_exploading_lava.jpg" alt="Lava Lamps" height="350" hspace="10" width="390" /></p>
<h3>Continuous Integration Dissected</h3>
<p>Any large scale development project needs an automated, repeatable build process.  Following best practices while developing a build process properly separates environment-specific configuration concerns from the codebase.  This allows new environments to be created quickly and easily by simply overriding any environment-specific configuration values when first executing the build process.  Whatever build tool is being used, builds should share a common, consistent process and interface.  A consistent, repeatable build will know all of its dependencies and the goal is to be able to build any given module anywhere, independently, at any time.</p>
<p>Automated, repeatable build processes typically begin by obtaining dependencies (which can be specified using a dependency management tool) and a specific working-copy of the codebase (&#8220;checking out&#8221;) from a SCM system like CVS or Subversion.  It is important to note that this codebase includes any code that is responsible for performing automated testing in addition to source code and configuration (and possibly other source-like artifacts).</p>
<p>Once the checkout has completed, the process will compile code and run automated unit test suites for each module in the system.  At this point, all automated unit tests should pass, and custom development can begin.  Any changes to code must be adequately covered by unit tests (either by changing existing tests or creating new ones), must fully compile without any errors and pass all automated unit test suites before being committed to the repository.  The practice of always keeping the code committed to the SCM repository in this state (no compilation or unit test errors) is known as Continuous Integration and ensures that new development is safe to proceed at any point without fear of integration errors.</p>
<p>Subversion (and CVS) support concurrent development by following a Copy-Edit-Merge paradigm; any contention over files is usually caught when a developer tries to commit their changes and notices the underlying files have changed since they obtained their copy.  In many cases, Subversion is capable of performing a merge automatically, if there was no contention over the same piece of a file.  Sometimes, however, a manual merge will be required.  Merging becomes more painful as the number of differences in the conflicting files increase.  A good rule of thumb is that every developer should commit their changes at least daily.</p>
<p>Designating a single machine as a Continuous Integration (CI) environment provides many added benefits to a large scale development project.  There are many operations which are good candidates to have run &#8220;continuously&#8221; but quite often are too expensive for developers to perform before every commit.  Examples include executing automated in-browser system tests (which, if maintained over multiple releases, can serve as a &#8220;mini&#8221; regression test suite), performance tests/profiling, producing test metrics, generating documentation, etc.  CI servers are an ideal place to schedule these processes to occur in an automated fashion.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2008/03/13/continuous-integration-dissected/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Continuous+Integration+Dissected&amp;link=http://cwash.org/2008/03/13/continuous-integration-dissected/&amp;notes=A%20lot%20gets%20written%20about%20Continuous%20Integration%2C%20particularly%20on%20which%20is%20the%20best%20visual%20cue%20to%20let%20you%20know%20your%20build%20is%20broken%20or%20that%20a%20test%20is%20failing%20%E2%80%93%20lava%20lamps%2C%20Beta%20Brights%2C%20Ambient%20Orbs%2C%20and%20some%20even%20suggest%20traffic%20lights.%20But%20aside%20from%20this%20extraneous%20%28at%20least%20to%20business%29%20nerd-banter%2C%20a%20lot%20of%20what%20I%20find%20written%20about%20the%20actual%20topic%20of%20CI%20is%20fluffy%2C%20ivory%20tower%2C%20or%20pie-in-the-sky%20jibber-jabber%20that%20leaves%20out%20important%20parts%20of%20the%20big%20picture%20or%20confuses%20people%20more%20than%20it%20helps.%20%20In%20hopes%20of%20clearing%20up%20confusion%20on%20what%20exactly%20CI%20is%20and%20how%20it%27s%20supposed%20to%20work%2C%20I%27m%20ripping%20out%20a%20description%20that%20I%20wrote%20for%20a%20client%20proposal%20recently%20%28so%20my%20apologizes%20for%20the%20dry-tone%29.%20%20I%20hope%20sheds%20some%20light%20on%20the%20true%20nature%20of%20CI%2C%20why%20it%27s%20important%20and%20how%20to%20implement%20it%20from%20a%20birds-eye%20point%20of%20view.%0D%0A&amp;short_link=http://bit.ly/9tMLie&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>March 11, 2008 -- <a href="http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/" title="Bugs, Detectives, and Test Automation">Bugs, Detectives, and Test Automation</a> (2)</li><li>January 31, 2009 -- <a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/" title="In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel ">In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel </a> (3)</li><li>November 28, 2008 -- <a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/" title="Must Haves/References For Modern Java EE Developers">Must Haves/References For Modern Java EE Developers</a> (1)</li><li>July 8, 2010 -- <a href="http://cwash.org/2010/07/08/transactions-part-1/" title="Transactions, Part 1">Transactions, Part 1</a> (0)</li><li>January 7, 2010 -- <a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/" title="Eliminate Branching (IF Statements) to Produce Better Code">Eliminate Branching (IF Statements) to Produce Better Code</a> (0)</li><li>July 24, 2009 -- <a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/" title="The Elements of Reusable Code">The Elements of Reusable Code</a> (0)</li><li>June 9, 2009 -- <a href="http://cwash.org/2009/06/09/mocking-with-jmockit/" title="Mocking with JMockit">Mocking with JMockit</a> (5)</li><li>February 17, 2009 -- <a href="http://cwash.org/2009/02/17/dont-unit-test-anymore-no-really/" title="Don&#8217;t Unit Test Anymore&#8230; No, Really!">Don&#8217;t Unit Test Anymore&#8230; No, Really!</a> (6)</li><li>January 13, 2009 -- <a href="http://cwash.org/2009/01/13/on-software-quality/" title="On Software Quality">On Software Quality</a> (8)</li><li>August 2, 2008 -- <a href="http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/" title="How I Escape the &#8220;Reuse Trap&#8221;">How I Escape the &#8220;Reuse Trap&#8221;</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2008/03/13/continuous-integration-dissected/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bugs, Detectives, and Test Automation</title>
		<link>http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=bugs-detectives-and-test-automation</link>
		<comments>http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 21:08:33 +0000</pubDate>
		<dc:creator>Chris Wash</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[bug tracking]]></category>
		<category><![CDATA[development practices]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/</guid>
		<description><![CDATA[[Y]ou might suppose going to the trouble of creating automated tests, simply for your own devices, might be a bit overkill. As it turns out, it is worth it, and it's going to save you a lot of time in the long run.]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">dzone_url = "http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script><p>You&#8217;ve done a thorough code review with your team and your code has come out with a few nice improvements.  Good.  You know that many a trustworthy source have speculated code reviews find as many as two times the number of defects that testing does. So you might suppose going to the trouble of creating automated tests, simply for your own devices, might be a bit overkill. As it turns out, it <em>is </em>worth it, and it&#8217;s going to save you a lot of time in the long run.  Why is it so valuable?</p>
<p><span id="more-7"></span></p>
<p>Indulge me in a brief aside&#8230;  I saw Full Metal Jacket recently on cable for the up-teenth time; the first act of the film, the part that is set on Paris Island, is hard for me to flip away from. I usually end up catching at least the first quarter of the movie.  If you&#8217;ve seen it, you&#8217;ll probably remember the part where the main characters recite, as new recruits, the Marine Corps prayer – it ends with &#8220;Without me, my rifle is useless; without my rifle, I am useless.&#8221;  I think the prayer metaphorically makes sense if developers were reciting it and replaced the rifles with their automated tests.</p>
<p>To figure out why, let&#8217;s answer the burning questions that first come to mind:</p>
<h3>Why should a developer care about doing their <em>own </em>testing?</h3>
<ol>
<li>It alerts you of problems (duh).</li>
<li>You&#8217;ll have a check in place in case a bug ever <a href="http://www.youtube.com/watch?v=MCjskH74mVU" title="Fly REZ PLZ">comes back to life</a>.</li>
<li>It gives you the opportunity to fix things before anyone else finds out about them.</li>
<li>It&#8217;s the best way to demonstrate that your code meets its requirements!</li>
</ol>
<h3>Why don&#8217;t you want testers (or worse, end users) to find your bugs?</h3>
<p>First of all, let&#8217;s be honest, this is an ideal to strive toward, even though actually achieving 100% test coverage and catching every possible bug is a definite pipe-dream.  But we have to keep in mind that bugs discovered by people other than a developer cause a lot of speculation, confusion, and in general, overhead work for everyone – time that could be better spent doing more productive things.  We&#8217;d like nothing better than to hand testers (and ultimately users) squeaky-clean code.  What happens if we don&#8217;t? (and you won&#8217;t!)</p>
<p>Imagine taking a class of third graders outside to find an insect in the &#8220;wild&#8221; and learn about (not burn) it with a magnifying glass. You&#8217;re even able to get everyone to concentrate long enough to take a peek at a would-be critter. The first candidate you find turns out to be a piece of bark that looks like a beetle. As you&#8217;re searching for another, two of your students get in a fight over claim to a partially decomposed boot they find. Another gets a nose bleed. When you finally manage to find another potential insect, you pass it over, mistaking the critter for a leaf. Little do you know it is actually a very well camouflaged member of the family <a href="http://en.wikipedia.org/wiki/Phylliidae" title="Phylliidae">Phyllidae</a>. <img src="http://upload.wikimedia.org/wikipedia/commons/1/12/LeafInsect.jpg" alt="A Leafy-looking bug" align="right" height="284" hspace="10" width="213" />By this time a child has fallen face first into a mud puddle and another has peed in his pants (which, one would think, should start to attract some insects).</p>
<p>Imagine that you do manage to find an insect in the wild; how would you get the whole class to observe it properly? There&#8217;s just one magnifying glass. The moment you get it under the glass, it darts away. It&#8217;s a struggle to keep track of. Not everyone is going to have a good viewing angle. If it disappears, then it might just as well be dead to you (did you hear that tree fall in the woods?).</p>
<p>Enough already with the horrible analogy? Okay, okay. The comparison of users to third graders in our thought experiment was purely coincidental – but you get the point. Having a group of people focus on a moving bug in &#8220;the wild&#8221; is tough! It&#8217;d be much easier to bring a captured critter into a controlled class environment to observe &#8211; our analog of a bug that we have caught with nifty our automated test net.</p>
<h3>Bug Detective?</h3>
<p>Given the fact that a tester&#8217;s job is to find defects, odds are sometimes you&#8217;ll get a defect report filed that looks like it&#8217;s written in cuneiform and requires a wizard&#8217;s hat, cauldron and lizard eyeballs to reproduce it. Sometimes<em> </em> a tester might not be giving you a legit bug – <em>sometimes</em>. There are a few scenarios that come to mind:</p>
<ol>
<li>A requirement is incomplete, misunderstood, miscommunicated or changed.</li>
<li>An external system was down.</li>
<li>An admin fat fingered something.</li>
</ol>
<p>This comes with the territory and you&#8217;re just going to have to suck it up. You&#8217;re ultimately the gumshoe on the case.  A good way to think of it is that testers and users are like the police of our system – they&#8217;re responsible for being the first on the scene, drawing chalk outlines, &#8220;booking&#8221; the suspects we arrest, etc.   What the tester is explaining is probably going to confuse you at least a few times before it makes sense. If you have good testing support, this might not be that painful.  But you could have the Super Troopers on the case, <img src="http://upload.wikimedia.org/wikipedia/en/thumb/5/5a/2002_super_troopers_0001.jpg/800px-2002_super_troopers_0001.jpg" alt="The Super Troopers" align="left" height="200" hspace="10" width="300" />and each clue that comes in is going to waste more and more of your time. And heaven forbid an end user finds this problem, and then tries to communicate this to a support rep – your job then becomes ten times harder because you have to decode 2-3 levels of miscommunication that&#8217;s occurred. Sometimes no good comes of all this, sometimes you find and squash a bug.  In cases where you don&#8217;t know what to do, write some tests – ask what the outcome should be, let the answers create more questions and more tests.  And be sure to hold onto them!</p>
<p>Whatever the outcome, because good developers are lazy, we want more than anything else to prevent this from ever happening again. Worse case, you&#8217;ve spent a lot of time addressing something and should have at least a documented set of work you&#8217;ve done and decisions made. Make sure others know about this. Best case, you are able to add an automated test so you don&#8217;t have to think about this ever again (or tell anyone about it &#8211; you&#8217;ll know the moment when something goes wrong).</p>
<h3>Conclusion</h3>
<p>So let&#8217;s recap –</p>
<ol>
<li>Bugs that slip to production are costly!</li>
<li>Automated tests help us exercise code before and after it goes into production.</li>
<li>If we work on a defect, our automated test net can help us catch a bug, or examine something that looks like a bug more closely.</li>
<li>Whenever we work on a bug (even if it&#8217;s something that isn&#8217;t truly a bug, but is being tracked as one) we should do our best to produce an automated test so we don&#8217;t have to reinvestigate in the future.  A test beats an email- or source control commit-trail any day!</li>
</ol>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=2&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=3&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=24&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=102&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
		<li class="shr-gmail">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=52&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Email this via Gmail">Email this via Gmail</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=74&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=257&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-googlereader">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=207&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Google Reader">Add this to Google Reader</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=88&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=6&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=4&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=40&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=38&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=&amp;service=10&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://www.shareaholic.com/api/share/?title=Bugs%2C+Detectives%2C+and+Test+Automation&amp;link=http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/&amp;notes=%5BY%5Dou%20might%20suppose%20going%20to%20the%20trouble%20of%20creating%20automated%20tests%2C%20simply%20for%20your%20own%20devices%2C%20might%20be%20a%20bit%20overkill.%20As%20it%20turns%20out%2C%20it%20is%20worth%20it%2C%20and%20it%27s%20going%20to%20save%20you%20a%20lot%20of%20time%20in%20the%20long%20run.&amp;short_link=http://bit.ly/dhH36M&amp;v=1&amp;apitype=1&amp;apikey=&amp;source=Shareaholic&amp;template=%24%7Btitle%7D+-+%24%7Bshort_link%7D&amp;service=7&amp;tags=&amp;ctype=" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul><div style="clear: both;"></div></div>

<h3  class="related_post_title">More Related Content</h3><ul class="related_post"><li>March 13, 2008 -- <a href="http://cwash.org/2008/03/13/continuous-integration-dissected/" title="Continuous Integration Dissected">Continuous Integration Dissected</a> (0)</li><li>January 31, 2009 -- <a href="http://cwash.org/2009/01/31/in-response-to-stackoverflow-38quality-doesnt-matter-that-much-jeff-and-joel/" title="In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel ">In response to Stackoverflow #38/&#8221;Quality Doesn&#8217;t Matter That Much&#8221; &#8212; Jeff and Joel </a> (3)</li><li>November 28, 2008 -- <a href="http://cwash.org/2008/11/28/must-havesreferences-for-modern-java-ee-developers/" title="Must Haves/References For Modern Java EE Developers">Must Haves/References For Modern Java EE Developers</a> (1)</li><li>July 8, 2010 -- <a href="http://cwash.org/2010/07/08/transactions-part-1/" title="Transactions, Part 1">Transactions, Part 1</a> (0)</li><li>January 7, 2010 -- <a href="http://cwash.org/2010/01/07/eliminate-branching-if-statements-to-produce-better-code/" title="Eliminate Branching (IF Statements) to Produce Better Code">Eliminate Branching (IF Statements) to Produce Better Code</a> (0)</li><li>July 24, 2009 -- <a href="http://cwash.org/2009/07/24/the-elements-of-reusable-code/" title="The Elements of Reusable Code">The Elements of Reusable Code</a> (0)</li><li>June 9, 2009 -- <a href="http://cwash.org/2009/06/09/mocking-with-jmockit/" title="Mocking with JMockit">Mocking with JMockit</a> (5)</li><li>February 17, 2009 -- <a href="http://cwash.org/2009/02/17/dont-unit-test-anymore-no-really/" title="Don&#8217;t Unit Test Anymore&#8230; No, Really!">Don&#8217;t Unit Test Anymore&#8230; No, Really!</a> (6)</li><li>January 13, 2009 -- <a href="http://cwash.org/2009/01/13/on-software-quality/" title="On Software Quality">On Software Quality</a> (8)</li><li>August 2, 2008 -- <a href="http://cwash.org/2008/08/02/how-i-escape-the-reuse-trap/" title="How I Escape the &#8220;Reuse Trap&#8221;">How I Escape the &#8220;Reuse Trap&#8221;</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://cwash.org/2008/03/11/bugs-detectives-and-test-automation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

