<?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>let x=x &#187; test driven design</title>
	<atom:link href="http://www.crazymcphee.net/x/tag/test-driven-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.crazymcphee.net/x</link>
	<description>programming idiom and methodology</description>
	<lastBuildDate>Tue, 13 Jul 2010 21:56:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Throw it away and write another one</title>
		<link>http://www.crazymcphee.net/x/2010/05/30/throw-it-away-and-write-another-one/</link>
		<comments>http://www.crazymcphee.net/x/2010/05/30/throw-it-away-and-write-another-one/#comments</comments>
		<pubDate>Sun, 30 May 2010 08:47:10 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[professional practice]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[ANTLR]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[craftsmanship]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[refactor]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[test driven design]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=557</guid>
		<description><![CDATA[Most developers familiar with agile methods are familiar with the idea of the spike. A spike is a time-boxed task that concentrates on clarifying the unknowns in your project. Usually these are technological (&#8220;can this be done with this technology?&#8221;) but they are also sometimes in the area of the business domain (&#8220;is this a [...]]]></description>
			<content:encoded><![CDATA[<p>Most developers familiar with agile methods are familiar with the idea of the <em>spike</em>. A spike is a time-boxed task that concentrates on clarifying the unknowns in your project. Usually these are technological (&#8220;can this be done with this technology?&#8221;) but they are also sometimes in the area of the business domain (&#8220;is this a good idea?&#8221;) too. One key idea is that the at the end of the spike, it is thrown away. It&#8217;s not supposed to be used as production code, it&#8217;s just supposed to answer some questions about the project, to validate or invalidate particular approaches to a problem, to provide further clarity around unknowns, to explore risk, to help with estimation, etc. I think this can be a useful general idea when dealing with technology, even in a &#8220;production&#8221; context.</p>
<p>Recently I was learning <a href="http://www.antlr.org">ANTLR</a>, trying to decide whether this was a right technology to pursue a particular project which involved parsing a preexisting message format. After a week of a spike, we decided that it was worth pursuing and started on earnest on the grammar for our project. However a week into this process, I had an epiphany &#8230; I was doing some things wrong with the ANTLR grammar which were now slowing progress in adding the new characteristics it needed to be complete. Many developers know this feeling; the features of my grammar that I had built over the first week were naive and now hampering it from expanding into the new requirements. I took it on myself to kill the entire grammar and start again. It took less than a day and half to replicate that week&#8217;s worth of work (i.e. pass the test suite which had built up around it).  I&#8217;ve done this before; scrap the first attempt at building a domain and try again. Here my domain was the same (it was after all defined in both a standards specification and in the many hundreds of thousands of sample messages we captured from an existing system), but its implementation needed refinement.</p>
<p>So I think that the rule about throwing away spikes can in fact be made a general axiom of programming:</p>
<blockquote><p>When you are learning a new technology, make sure you  throw away the first thing you build that works &#8211; to avoid accumulating  your mistakes.</p></blockquote>
<p>Thanks to <a href="http://www.twasink.net/">Robert</a> for the important qualifier &#8220;that works&#8221;. <img src='http://www.crazymcphee.net/x/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>N.B. my views about <a title="The rewrite will be ready shortly" href="http://www.crazymcphee.net/x/2009/02/01/the-rewrite-will-be-ready-shortly/">system  rewrites</a> have not changed regardless.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2010/05/30/throw-it-away-and-write-another-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mistakes you can make with SOA</title>
		<link>http://www.crazymcphee.net/x/2009/11/03/mistakes-you-can-make-with-soa/</link>
		<comments>http://www.crazymcphee.net/x/2009/11/03/mistakes-you-can-make-with-soa/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 07:49:45 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[test driven design]]></category>
		<category><![CDATA[wizards considered harmful]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=494</guid>
		<description><![CDATA[Bob Lewis has a great column this month, &#8220;What if SOA is a mistake&#8220;? His penultimate paragraph asks: Lost in the shuffle is something basic: Programmer productivity. Friends who are hands-on with such matters tell me the available SOA development environments are less than half as productive as products like PowerBuilder and Delphi were, back [...]]]></description>
			<content:encoded><![CDATA[<p>Bob Lewis has a great column this month, &#8220;<a href="http://www.weblog.keepthejointrunning.com/wordpress/?p=3174" target="_blank">What if SOA is a mistake</a>&#8220;? His penultimate paragraph asks:</p>
<blockquote><p>Lost in the shuffle is something basic: Programmer productivity. Friends who are hands-on with such matters tell me the available SOA development environments are less than half as productive as products like PowerBuilder and Delphi were, back when they were viable.</p></blockquote>
<p>Putting aside the Powerbuilder and Delphi love for just one minute, this is something I&#8217;ve been banging on about now for the past year &#8230; the programming tooling that is foisted onto programmers by the choice of the deployment architecture. It&#8217;s just all <em>wrong</em>.</p>
<p>In my view, what makes a programming language really productive is <em>notepad</em>. Or <em>vi</em>, or <em>emacs, </em>or<em> gvim, </em>or<em> textmate</em>, take your pick. What I mean is &#8230; <em>the programming language has to be able to be programmed with a simple editor</em>. Yes, an advanced IDE will make things more productive, but the basics must also apply. Now a lot of SOA environments are simply <em>not programmable</em> without the specific IDE tied to it. Even worse, the IDEs are often completely custom jobs that require a developer to be re-trained &#8230; losing <em>years and years</em> of productive speed with muscle-memory style automatic ability to navigate the programmer&#8217;s usual editing tool. Seriously. This stuff is whack. A program language or an environment needs to be IDE-neutral. If you got a plumber around, would you insist that he only use the tools you supply from your home handyman kit? Or would you expect the plumber to have mastered a set of his own tools already? And making matters worse, it&#8217;s rarely <em>programmers</em> that choose these tools which are foisted on them. The server/deployment environment and the language used to implement need to be decoupled from the tools used to build it.</p>
<p>But an even <em>worse</em> failing of many of these SOA tool suites, is that they all strongly and irrevocably coupled to the deployment/runtime environment. Generally they totally lack the ability to keep up with modern programming practice. Like for instance, automated testing. Or even <em>unit tests</em>, let alone advanced and productive techniques such as Test-First approaches or Test Driven Design. The tools often lack refactoring support. All of these things are in my opinion, and in the opinion of many leading developers, absolutely essential to quality engineering practice and agile development outcomes like &#8220;delivery of working software&#8221;. Both the &#8220;delivering&#8221; and the &#8220;working&#8221; part means the whole process needs to be <em>repeatable</em>. That&#8217;s why automated integration testing, to name just one thing, is <em>essential</em> in modern development. But often the fancy custom development tooling is a complete barrier to achieving this.</p>
<p>But you won&#8217;t hear any of this from the big vendors. One big vendor recently announced their new version of their middleware product suite had a &#8216;focus on testability&#8217;, but you ask any of their presales guys to demonstrate this in an actual development environment. Ask them about continuous integration support, for example. Witness their blank looks. Their development product is completely orientated to &#8220;one button push from the IDE to production&#8221; modes of thinking the idea of continuous integration builds is almost totally antithetical to the very concepts of operation the product is organised around. They think that finally adding support for Subversion version control system, at least five years too late, is a wondrous achievement.</p>
<p>They are aiming for &#8216;programmerless programming&#8217;: of course in process just creating a new type of programmer. Every new generation of programmers simply have to learn the same hard-fought lessons of software engineering over and over again because each generation of tooling apparently scraps the paradigm over and over again in a vain attempt to create push-button, wizard-driven programming models. They nearly all suffer from &#8216;hello world&#8217; programming &#8211; the simple examples that sell them to IT management are trivial to conquer using the wizards, but more complex problems (i.e. real world ones) are flat-out impossible. Thus these tools are always mirages which look great at a huge distance on the horizon but are flat lifeless salt pans of bleached skulls and bones on closer examination (or, maybe they are more like tar pits that look like a nice waterhole but one step into it and you are sucked down   to your doom).</p>
<p>As you might be able to tell, I am utterly contemptuous of many of these SOA tool paradigms. I have nothing against SOA itself, <em>per se</em>. But there is nothing more productive than a programmer who understands the importance of simple and repeatable build and deployment automation using command line tools and who knows his programming <em>editor</em> inside out after ten years of use. Give that programmer a better language by all means, add incremental features to that IDE, allow the programmers to continuously improve their techniques, promote professional craftsmanship, yes, yes and a thousand times yes. But no amount of drag and drop wizards, push-button deployments, and &#8220;object inspector&#8221; property editors will ever usurp that deep knowledge a good programmer brings to both his language and his personal tooling choices.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/11/03/mistakes-you-can-make-with-soa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I&#8217;m not making this mess anymore!</title>
		<link>http://www.crazymcphee.net/x/2009/03/17/im-not-making-this-mess-anymore/</link>
		<comments>http://www.crazymcphee.net/x/2009/03/17/im-not-making-this-mess-anymore/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 12:14:48 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[craftsmanship]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[refactor]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[test driven design]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=236</guid>
		<description><![CDATA[XP: After 10 years why are we still talking about it? By Robert C. Martin. Uncle Bob argues passionately, and correctly, for the principles of software craftsmanship. Link: http://www.viddler.com/explore/sergiopereira/videos/7/.]]></description>
			<content:encoded><![CDATA[<p>XP: After 10 years why are we still talking about it? By Robert C. Martin. Uncle Bob argues passionately, and correctly, for the principles of software craftsmanship.</p>
<p><object width="437" height="370" data="http://www.viddler.com/player/ef4eb06a/" type="application/x-shockwave-flash"><param name="id" value="viddler_ef4eb06a" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.viddler.com/player/ef4eb06a/" /><param name="name" value="viddler_ef4eb06a" /><param name="allowfullscreen" value="true" /></object></p>
<p>Link: <a href="http://www.viddler.com/explore/sergiopereira/videos/7/"> http://www.viddler.com/explore/sergiopereira/videos/7/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/03/17/im-not-making-this-mess-anymore/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Achieving high velocity</title>
		<link>http://www.crazymcphee.net/x/2009/03/08/achieving-high-velocity/</link>
		<comments>http://www.crazymcphee.net/x/2009/03/08/achieving-high-velocity/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 06:40:31 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[professional practice]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[process improvement]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[test driven design]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=215</guid>
		<description><![CDATA[Sprint to the lead in your industry &#8211; and stay there! So says the back of the dust cover on Chasing The Rabbit: How market leaders outdistance the competition and how great companies can catch up and win by Steven J Spear (McGraw Hill, New York, 2009). I referenced this book last week in my [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Sprint to the lead in your industry &#8211; and stay there!</p></blockquote>
<p>So says the back of the dust cover on <em>Chasing The Rabbit: How market leaders outdistance the competition and how great companies can catch up and win</em> by Steven J Spear (McGraw Hill, New York, 2009). I referenced this book last week in my post <a href="http://www.crazymcphee.net/x/2009/03/01/let-it-fail-then-learn-to-succeed/" target="_self">&#8216;Let it fail then learn to succeed&#8217;</a> which is about using failure as a signal for process improvement.</p>
<p>It&#8217;s a great book. Obviously it is not addressed directly to software development, and as I said, Spear covers its application in a range of different settings, including engineering and health-care as well as manufacturing. There&#8217;s a distinct lack of focus on the buzzwords <em>kanban</em>, <em>kaizen</em>, and <em>just-in-time</em>, all of which Spear says are merely artifacts of a deeper underlying approach that he proceeds to illustrate extremely well in the course of the book.</p>
<p>The approach might be illustrated by the asking of some fairly simple questions: &#8216;What did you do?&#8217;, &#8216;What happened then?&#8217;, &#8216;What did you expect to see?&#8217;, &#8216;Was it successful?&#8217;, &#8216;What did you do to correct it?&#8217;, &#8216;What did you learn?&#8217; (my list is not exhaustive). Spears characterises it as:</p>
<blockquote><p>&#8230; a systematic approach to designing and operating systems, a simple set of rules for problem solving and improvement, a clear way to share learning, and a well-defined role as a manager. (p 358)</p></blockquote>
<p>More formally, the organisation exhibiting these qualities shows two characteristics and four capabilities.</p>
<p>Two characteristics:</p>
<ol>
<li><em>Managing the functions as parts of the process.</em> A high-velocity organisation orientates its processes away from functional &#8216;silos&#8217; (without ignoring the necessary competency of individual functions), and towards &#8220;the way the work of individuals, teams and technologies will contribute to (or impede) the process of which they are part&#8221; (p 20). For example, Spear describes his own experience while at Toyota: he is asked what a particular factory he is being trained at makes. At first he interviews the management of the factory, and returns with a list, only to be told he doesn&#8217;t really know. Then he looks at invoices of the shipped items, which is still said to be wrong. In response to this, he examines what the receiving factory actually paid for, but he is still told he doesn&#8217;t know what the factory makes. Finally, he stands at the shipping dock, as as each shipment was sent out, ignoring the shipping label, took a note of the part number stamped onto the part. Then he checked that the factory actually possessed the die for stamping the part number. In response, he was told; &#8220;Well, that&#8217;s probably not wrong. But I have another question: How are these parts made?&#8221; (p 280).</li>
<li><em>Continually improve the pieces and the process.</em> High-velocity organisations are always learning about all the work they do. Workarounds, tolerating problems, putting out fires, and heroic efforts are simply not tolerated. Every time you have to put out a fire, or devise a workaround, or engage in a heroic measure to get work done, you&#8217;ve found a process problem that should be eliminated. Your highest priority isn&#8217;t engaging in the workaround, or performing heroic efforts of late-night last-minute production delivery effort. Your highest priority, and that of your management, is swarming the problem to fix the <em>process</em> that led to the situation. Doug South described it to me as &#8220;not tolerating things&#8221;. Instead you should fix their <em>causes</em> rather than developing a workaround to the immediate problem.</li>
</ol>
<p>Four capabilities:</p>
<ol>
<li><em>Specifying design to capture existing knowledge and building in tests to reveal problems.</em> Make explicit the most effective approach currently known to you to successfully achieve the task. Make sure that the approach has the capacity to detect failure as soon as it occurs. You need to be sure what outcomes you expect, not from a &#8220;perverse Taylorism&#8221; (p 23) but as an investment. By specifying expectations, you can more easily capture when something unexpected happens &#8211; that is, what the gaps in your current knowledge are. Go out of your way to build in these tests. Alcoa for example, focused exclusively on improving safety &#8211; with the goal of zero injuries, because this &#8220;meant perfect processes based on perfect knowledge of how to do work&#8221; (p 94). The test therefore, was the occurrence of workplace accidents. When an accident occurred, it highlighted a dangerous ignorance, and had to be rectified.</li>
<li><em>Swarming and solving problems to build new knowledge.</em> When you encounter problems, at the time and place of the encounter, the problem should be swarmed. Contain the problem to prevent it from spreading. Diagnose and treat the cause so the problem cannot reoccur. Problem-solving skills are built by solving actual problems, and those doing the work are responsible for improving the process by which the work is done.  Doing this will allow you to &#8220;build ever-deeper knowledge about how to manage the systems for doing [your] work, converting inevitable up-front ignorance into knowledge&#8221; (p 24). For example, at Alcoa, it was made a rule that business-unit presidents had to not only inform the Alcoa CEO within 24 hours of an injury or injury near-miss, &#8220;but within two days they had to report what the initial investigation had revealed about its causes and what was being done to prevent the problem from recurring&#8221; (p 96). This ensured a discipline, a warp-speed cycle involving real-time problem recognition, diagnosis and treatment.</li>
<li><em>Sharing new knowledge throughout the organisation.</em> It&#8217;s not just that <em>you</em> learn. It&#8217;s that the <em>entire organisation</em> learns. Toyota did this for a joint-venture plant it created with General Motors. Toyota&#8217;s approach was a one-variable-at-a-time tuning. The American plant would make an existing model and not an all-new car. Rather than creating an entirely new plant, or swarming the old GM plant with Toyota managers, it took newly hired American managers and coached them in the Toyota way. They didn&#8217;t just drop them into the plant. They first made similar products (Corollas) at a Toyota plant. Then they went back to the American plant and Toyota gave the new managers continuous support from Japanese experts. The joint-venture plant was far more successful than the old General Motors plant it replaced. In 2003, in order to be abale to accelerate organisational learning, Toyota created the Global Production Center, which was staffed with experienced cadres of trainers in areas identified as critical to production success. They developed standardised practice equipment and had other groups test the new equipment to identify problems with it. And because these practices are orientated around the <em>discovery</em> of solutions via practical experimentation, and rapid cycles of concepts and validaty testing, they can &#8220;smoothly converge on solutions that were agreeable across disciplines&#8221; (p 253). Having done all this, it shared it&#8217;s newfound knowledge with representatives from factories around the world, and trained managers and group-leaders who were setting up a similar centre for Toyota&#8217;s North American operations. Just as important as creating new knowledge and sharing information about particular capabilities, it&#8217;s just as critical to spread <em>problem-solving capability</em> throughout the organisation.</li>
<li><em>Leading by developing the first three capabilities.</em> Managers are not there to measure, berate, and exhort their workers in a command-and-control environment. The role of management is to ensure their organisation becomes &#8220;ever more self-diagnosing and self-improving, skilled at detecting problems, solving them, and multiplying the effect by making the solutions available throughout the organisation&#8221; (p 26). The process of finding out what the plant made which I outlined above was part of learning this fourth capability by observing a system at four levels &#8211; output, pathways, connections and activities.</li>
</ol>
<p>At the end of the book is an illuminating conversation about golf. Now personally I can&#8217;t stand golf but I suppose lots of middle-aged businessmen do, and the conversation was about the simplicity of the game. Despite protestations about bunkers, traps, and hazards, roughs and fast greens, and how difficult it really is, in the end it&#8217;s actually a simple game with very simple rules. <em>Keep hitting the ball with a club until you get it into the hole</em>. Simple rules that require a <em>lot</em> of practice to do it right. And like golf, making your organisation high-velocity might run with a fairly simple set of rules, but they require a great deal of practice at the various skills needed to make it happen.</p>
<p>That gives a general overview of the content of the book. It&#8217;s written in a very accessible style which communicates the essential concepts very well without trivialising them. If you are a software developer who is interested in thinking about development process, and general business process, then I definitely recommend this book. Sometime in the next few weeks I will try to produce a further post relating some of these specific concepts that Spear has identified and apply them to software development process. In the meantime, buy and read this book.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/03/08/achieving-high-velocity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let it fail then learn to succeed</title>
		<link>http://www.crazymcphee.net/x/2009/03/01/let-it-fail-then-learn-to-succeed/</link>
		<comments>http://www.crazymcphee.net/x/2009/03/01/let-it-fail-then-learn-to-succeed/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 07:00:51 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[test driven design]]></category>
		<category><![CDATA[test first]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=208</guid>
		<description><![CDATA[On the scrum development mailing list, Dave Nicollette recommended shortening sprint length until it failed, then backing up one step: &#8220;Oh, my God! You&#8217;re going to let a sprint fail, just so you can determine the optimum length?&#8221; Yes. In other words, failure lets you learn your limits. But more importantly, as suggested here, is [...]]]></description>
			<content:encoded><![CDATA[<p>On the <a href="http://groups.yahoo.com/group/scrumdevelopment/" target="_blank">scrum development mailing list</a>, Dave Nicollette recommended shortening sprint length until it failed, then backing up one step:</p>
<blockquote><p>&#8220;Oh, my God! You&#8217;re going to let a sprint fail, just so you can determine the optimum length?&#8221; Yes.</p></blockquote>
<p>In other words, failure lets you learn your limits. But more importantly, as suggested here, is that failure can be <em>deliberately introduced</em> in order to <em>improve the process</em> &#8211; to decrease your limitations. I would say, for an organisation committed to process optimisation, you should shorten the sprint until it fails, but rather than just <em>accepting</em> that limit, learn <em>why</em> it fails and then experiment with optimising it until it succeeds. Let me explain.</p>
<p>Courtesy of a tip from <a href="http://trontos.com/dsouth/blog/" target="_blank">Doug South</a> at the <a href="http://groups.google.com/group/Brisbane-XP" target="_blank">Brisbane XP user&#8217;s group</a>, I&#8217;m nearly finished reading a book at the moment, <em>Chasing the Rabbit</em> by Steven J. Spear of MIT and formerly of Harvard. The book&#8217;s full title is <em>Chasing The Rabbit: How market leaders outdistance the competition and how great companies can catch up and win</em>. It&#8217;s a business book that describes the essential feature of successful companies such as Toyota and the Toyota Production System.</p>
<p>Before you roll your eyes and think I&#8217;m just another one of these lean software guys who&#8217;s about to rave over <em>kanban</em>, <em>kaizen</em>, and <em>just-in-time</em>, and applying manufacturing production-line process, possibly inappropriately, to the professional practice of software development, let me assure you I&#8217;m not. Neither does Spear. Basing his book on years of hands-on research into these high-velocity organisations (including time spent actually working on real production lines) he characterises <em>kanban</em> and friends as merely an <em>artifact</em> of a deeper philosophy towards building a successful company. In some ways its breathtaking simple, although hard to practice. The theme of the book is <em>discovery</em>.</p>
<blockquote><p>The factory was not only a place to to produce physical products, it was also a place to learn <em>how</em> to produce those products and &#8211; most important of all &#8211; it was a place to <em>keep</em> learning how to produce those products. In fact, this is exactly what so much of the early research about Japanese management had revealed &#8211; that learning and discovery were intrinsic to success. But that idea had gotten lost as people focused on the particular tools and artifacts used in the workplace at the expense of understanding the principles of how those systems where managed. (p 15).</p></blockquote>
<p>These companies don&#8217;t <em>succeed</em> or <em>fail</em>. They <em>succeed</em> or <em>learn to succeed</em>.</p>
<p>Now it is of course slightly more complex that just that. There are two characteristics and four capabilities that high-velocity organisations exhibit. The four capabilities are:</p>
<ol>
<li>Specifying design to capture existing knowledge and building in tests to reveal problems.</li>
<li>Swarming and solving problems to build new knowledge.</li>
<li>Sharing new knowledge throughout the organisation.</li>
<li>Leading by developing the first three capabilities.</li>
</ol>
<p>Now these capabilities can be developed &#8211; in different manifestations &#8211; in any sort of process, not just production-line processes. Spear shows it in action in health-care, in nuclear engineering, in aluminium production, and of course automotive production. I&#8217;ll into further detail perhaps in a later post. Here I&#8217;m going to discuss a simple example illustrating not just capability 1, in which a process not only captures knowledge but has built-in tests, and also capability 2, involving problem solving and process improvement, where the process is tested to failure, in order to reveal what knowledge is missing about the process.</p>
<p>In the book he describes a mattress factory, Aisin, that, after a long capability improvement process ends up with two production lines each capable of making (e.g.) 100 units a day to custom order. On some given day, imagine they have a requirement to make say 180 units. Rather instead of running one line at 100 the other at 80, or both at 90 units, they will instead <em>deliberately</em> overload one of the lines (e.g. ramp it to 110 or 120 units) in order to discover the process failure modes (that is, the process&#8217;s bottlenecks) so as to to improve them. They already know how to make 100 units a day. They can learn more about their process if they try to make 120. The reason they do this on days of lighter loading, is that the can use the unstressed production line as a back up, if the test was too stressful for the line under test.</p>
<p>Experienced software engineers might recognize this <em>stress testing</em> from their performance testing toolkit. Loading a software system to the point of failure is one quick way to learn where a system&#8217;s bottlenecks are, and what to do about eliminating them, and thus making your software architecture more efficient, and discovering new knowledge about how your architecture performs and what needs to change.</p>
<p>The point is of course, I&#8217;m not talking about stress testing <em>software</em>. I&#8217;m talking about stress testing software development <em>methodology</em> so you can discover what you don&#8217;t already know about your process, and therefore improve it. I don&#8217;t mean, just arbitrarily place more demands on your software teams to produce more with less. That&#8217;s just the most retarded type of management-by-objective.</p>
<p>Think about all the moving parts in your development process. What do you know about them? What do you assume? What do you just take for granted? How much do your team members know about the process? Can they identify problems and propose solutions? Do they need to learn that capability? Where are your failure modes? Do you just accept them, and perform a work around, or do you understand them as signals to elicit further discovery about the things you don&#8217;t understand about the process?<em> Embrace failure</em>. In fact, actively seek it out. Use it an opportunity to discover unknown information about your business and to improve your team&#8217;s skills.</p>
<p><em>Chasing The Rabbit</em> is a great book, highly recommended that all software development practioners read it, and special thanks to Doug for bringing it to my attention.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/03/01/let-it-fail-then-learn-to-succeed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Incremental test running with JUnit Max</title>
		<link>http://www.crazymcphee.net/x/2009/02/07/incremental-test-running-with-junit-max/</link>
		<comments>http://www.crazymcphee.net/x/2009/02/07/incremental-test-running-with-junit-max/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 06:38:29 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[test driven design]]></category>
		<category><![CDATA[test first]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=146</guid>
		<description><![CDATA[Well looks like Joel Spolsky&#8217;s ignorant rant about Test Driven Design (TDD) resulted in some good after all. Kent Beck posted a brief response to Joel, which was pointed out in a mailing list discussion about the issue. But that&#8217;s not what I wanted to talk about here. Anyway it turns out that Kent is [...]]]></description>
			<content:encoded><![CDATA[<p>Well looks like Joel Spolsky&#8217;s ignorant rant about Test Driven Design (TDD) resulted in <em>some</em> good after all. Kent Beck posted a <a title="Joel Spolsky is wrong about my work: Kent Beck" href="http://www.threeriversinstitute.org/blog/?p=29" target="_blank">brief response to Joel</a>, which was pointed out in a<a href="http://groups.yahoo.com/group/straight_talking_java/"> mailing list</a> discussion about the issue. But that&#8217;s not what I wanted to talk about here.</p>
<p>Anyway it turns out that Kent is writing a product called <strong><a title="Junit Max" href="http://www.threeriversinstitute.org/junitmax/subscribe.html" target="_blank">JUnit Max</a></strong> which looks <em>super</em> interesting for those using the discipline of TDD to write better code. Look at the Flash presentation on this page: <a title="JUnit Max" href="http://www.threeriversinstitute.org/junitmax/subscribe.html" target="_blank">http://www.threeriversinstitute.org/junitmax/subscribe.html</a> &#8230; Also it brings together another thread we had on the mailing list which was about Eclipse&#8217;s incremental compilation features. This is incremental test running!</p>
<p>A pity it&#8217;s not free but I guess Kent&#8217;s got to eat. I might be tempted to buy it in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/02/07/incremental-test-running-with-junit-max/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8216;Disappeared&#8217; DAO layers</title>
		<link>http://www.crazymcphee.net/x/2009/02/06/disappeared-dao-layers/</link>
		<comments>http://www.crazymcphee.net/x/2009/02/06/disappeared-dao-layers/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 07:01:18 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[test driven design]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=139</guid>
		<description><![CDATA[Adam Bien still wants to believe that a JPA layer can directly replace a formal &#8216;DAO layer&#8217;. And I still disagree. I might agree that for simple enough systems, it could end up being that in fact the service layers end up with PersistenceManager logic directly in their methods. But then I might say a [...]]]></description>
			<content:encoded><![CDATA[<p>Adam Bien still wants to believe that a <a href="http://www.adam-bien.com/roller/abien/entry/daos_aren_t_dead_but" target="_blank">JPA layer can directly replace a formal &#8216;DAO layer&#8217;</a>. And I still disagree.</p>
<p>I might agree that for simple enough systems, it could end up being that in fact the service layers end up with PersistenceManager logic directly in their methods. But then I might say a language and framework like Ruby on Rails could suit your application better in that case. For any sufficiently complex Java-based enterprise system, a POJO-style data persistence layer naturally evolves, in order to reduce as far as possible the responsibilities the service layer must carry out.</p>
<p>As mentioned by commentators on his blog, the discipline of test-driven design is usually  a strong driver of having a separated set of components that deal with persistence and other data concerns. Not just from the issue over mocking the PersistenceManager, which is certainly a strong driver, but also from design principles.</p>
<p>Service layers marshall requests from clients, and decompose them to call various component layers. Data access layers typically form part of these component layers. A TDD discipline means these data access layers usually end up with more than just CRUD operations.</p>
<p>Furthermore, as a matter of discipline, in any sufficiently complex service layer I prefer not to work directly with database abstractions (i.e. entities that are modelled on database tables and their relationships) but on first-class objects designed to fit directly with the modelled domain. I want those objects to have rich behaviour &#8211; the service layer is actually part of their behaviour. I want to start the design of the system by directly modelling those actions, e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">passenger.<span style="color: #006633;">at</span><span style="color: #009900;">&#40;</span>origin<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
passenger.<span style="color: #006633;">orderJourney</span><span style="color: #009900;">&#40;</span>dispatch, destination<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Vehicle vehicle <span style="color: #339933;">=</span> dispatch.<span style="color: #006633;">sendVehicle</span><span style="color: #009900;">&#40;</span>origin<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
vehicle.<span style="color: #006633;">pickUp</span><span style="color: #009900;">&#40;</span>passenger<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
vehicle.<span style="color: #006633;">arrives</span><span style="color: #009900;">&#40;</span>destination<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">dropsOff</span><span style="color: #009900;">&#40;</span>passenger<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
vehicle.<span style="color: #006633;">notify</span><span style="color: #009900;">&#40;</span>dispatch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I do not want these objects to know about database semantics. That is a responsibility of a separated persistence layer, which we may for convienience sake, called the DAO. Even if internally we end up with;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Passenger <span style="color: #009900;">&#123;</span>
  at<span style="color: #009900;">&#40;</span>Location origin<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">origin</span><span style="color: #339933;">=</span>origin<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  call<span style="color: #009900;">&#40;</span>DispatchCentre dispatch, Location destination<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    dispatch.<span style="color: #006633;">passengerOrder</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>, destination<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>DispatchCentre at this level, is a service, but we will model it as part of the domain of passengers, locations, and vehicles. Behind that service, it will have a database layer with the semantics as to how it saves and loads the data concerning passengers, locations, and vehicles. I don&#8217;t necessarily want the client objects (e.g. the web action) to have to deal with JPA annotated objects. They just deal with objects as much as possible. And I don&#8217;t see there&#8217;s anything served with developing possibly complex persistence logic directly in the DispatchCentre. In fact, taking a top-down approach, I know pretty much I won&#8217;t do that.</p>
<p>Only after I&#8217;ve done this initial part of the modelling, will I be concerned as to which of these components can be directly JPA or Hibernate annotated, which are Spring-injected services, which are Session EJBs, and the like. I think starting your modelling from the point of view of having a persistence framework like JPA or Session EJBs or any other &#8216;archtectural artifact&#8217; leads to an unnatural design.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/02/06/disappeared-dao-layers/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Code quality and development teams</title>
		<link>http://www.crazymcphee.net/x/2009/02/04/code-qualit-and-development-team/</link>
		<comments>http://www.crazymcphee.net/x/2009/02/04/code-qualit-and-development-team/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 08:28:33 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[teams]]></category>
		<category><![CDATA[test driven design]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=135</guid>
		<description><![CDATA[Robert C. Martin, aka &#8220;Uncle Bob&#8221;, lays into Joel Spolsky and Jeff Atwood: I was riding my exercise bike, listening to Stack Overflow #38 when I heard Jeff Atwood and Joel Spolsky say “Quality just doesn’t matter that much.” I nearly fell off my bike. (There&#8217;s a transcript of part of the podcast on Joel&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Robert C. Martin, aka &#8220;Uncle Bob&#8221;, <a href="http://blog.objectmentor.com/articles/2009/01/31/quality-doesnt-matter-that-much-jeff-and-joel" target="_blank">lays into Joel Spolsky and Jeff Atwood</a>:</p>
<blockquote><p>I was riding my exercise bike, listening to <a href="http://blog.stackoverflow.com/2009/01/podcast-38/">Stack Overflow #38</a> when I heard Jeff Atwood and Joel Spolsky say <em>“Quality just doesn’t matter that much.”</em> I nearly fell off my bike.</p></blockquote>
<p>(There&#8217;s a <a href="http://joelonsoftware.com/items/2009/01/31.html" target="_blank">transcript of part of the podcast</a> on Joel&#8217;s blog &#8220;Joel On Software&#8221; if you don&#8217;t want to listen to it).</p>
<p>Of course I&#8217;m going to say here that I completely agree with Uncle Bob. The more extraordinary parts of the actual podcast come along when Joel attacks the idea of TDD &#8211; test-driven design (although he refers to test-driven <em>development</em>):</p>
<blockquote><p>But the real problem with unit tests as I&#8217;ve discovered is that the type of changes that you tend to make as code evolves tend to break a constant percentage of your unit tests. Sometimes you will make a change to your code that, somehow, breaks 10% of your unit tests. Intentionally. [ ... ] And you have to be able to go in and recreate those tests to reflect the new reality of the code.</p></blockquote>
<p>This stuff is just a sheer obtuse misunderstanding about the very <em>nature</em> of TDD. Uncle Bob takes him to task for it I&#8217;m not going to repeat them here other to say I utterly agree with everything Mr. Martin has to say. Go and read the link above, it&#8217;s very effective and thorough pulling apart of Joel&#8217;s position on the matter.</p>
<p>I just want to talk about some other things, about the nature of software development, as against <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">some of the things that Joel says</a> is the <a href="http://www.joelonsoftware.com/articles/FieldGuidetoDevelopers.html" target="_blank">best way</a> to <a href="http://www.joelonsoftware.com/articles/Wrong.html" target="_blank">organise</a> development and development teams. Joel just doesn&#8217;t seem to get agile engineering practices, and never has, but even  worse, he <em>willfully misrepresents</em> its disciplines and practices in order to demolish a straw man of his own making. The stuff above about TDD is clearly the prosecution&#8217;s exhibit A. He&#8217;s a respected development guru, and a lot of people trust what he says about code and the business of running a development sales organisation, which I admit, it&#8217;s reasonably sensible most of the time. However when he starts to talk about development practices and team organisation, while he says some things that are highly insightful, some of the others are full of horse manure. Or even worse than that, it&#8217;s 50% good advice, and 25% outright harmful advice.  There&#8217;s plenty of manure spread around by everybody else of course, me included, but due to his position as an exhalted spokesperson, and due to the wrongful nature of the things he says,  I find that his is particularly <em>dangerous</em> horse manure.</p>
<p>For example, all that stuff regarding &#8220;developers get offices of their own&#8221;. The best teams I&#8217;ve worked in are all in the one room, clustered on desks together and as noisy as hell. It&#8217;s usually best to put the <em>whole team</em> in a large office space of their own &#8211; so they don&#8217;t annoy the hell out of other teams. Joel maintains that <em>individual</em> developer offices are the only way &#8211; the illusion of the developer as a single genius toiling away in silence &#8211; rather than a member of a multifunctional, communicating, effective team. I disagree, and vehemently. Sure a big &#8216;TEAMWORK&#8217; banner is just self-deception, but effective teams aren&#8217;t make effective through slogans and exhortations. Effective teams are made through actual action. If you have offices, they should be large team-based spaces where whole teams are co-located. And small temporary, hot-desk&#8217;d offices, if for good reasons, a developer (or better, a <em>pair</em>) need some quiet time to concentrate on solving some particularly hard problem. But mostly, delivering effective software is about <em>team communication</em>, not <em>developer concentration</em>.</p>
<p>Joel&#8217;s totally focused on the notion of the hero-developer.</p>
<p>There&#8217;s a bell curve of developer ability (like all such talent) which guarantees the vast majority of developers are &#8220;average&#8221;. Focusing your effort on finding only the top 5th percentile for your team is <em>futile</em>. Especially when you&#8217;ve already got a team you have to work with. Are you going to fire them all if they don&#8217;t come up to standard? Or just fire maybe the incompetant ones and work to improve the <em>team</em>. Sure, when you find you&#8217;ve <em>got</em> one of these &#8220;rock star developers&#8221; on your team, maybe you <em>do</em> have to treat him (or her) a little different to the others, to keep him (or her) motivated and interested at the tasks you offer. Nonetheless, 70% of your developers are going to fall within the standard deviation, almost by <em>definition</em>. An additional consideration is, you can get an absolute <em>genius</em> developer who is a complete social misfit and can&#8217;t work in a team very effectively. We all know (and maybe some of us <em>are</em>) this guy. At the end of the day sometimes these people are <em>destructive</em> to teams &#8211; reducing the teams productive capacity, if they can&#8217;t play nice with others. I&#8217;m not advocating some sort of we-are-all-mediocre approach and, yes, everyone&#8217;s an individual &#8211; but we do generally have to work in teams in order to achieve productive software development outcomes.</p>
<p>It&#8217;s the agile approach to value &#8216;people and interactions&#8217; over &#8216;processes and tools&#8217; but also notice it&#8217;s <em>people</em>, in the plural, and not individuals, and <em>interactions</em> implies work is multiplied when those people exchange information effectively and work together as a team. Information exchange bandwidth is greatest face-to-face, or better yet across entire teams. Private conversations that can&#8217;t be interrupted are only useful in the context of personal, and therefore truly private, information. <em>Not team interactions</em>. Any team member should be able to &#8216;stick their oar in&#8217; on any matter being handled by the team &#8211; that&#8217;s how you get the best ideas! The idea of hierarchicalised, compartmentalised, information exchanges in the context of a private office sounds to me like an MI6 operation, not a software development practice.</p>
<p>Joel might know heaps about the <em>micro</em>-algorithms of manipulating data structures and carrying out instructions efficiently but ultimately it&#8217;s the <em>macro</em>-algorithms as to how software is effectively developed and how teams can deliver the best and quickest value to the customer that are the <em>really hard </em>problems. These are also the very problems that IT the whole world over have with the greater business world &#8211; how to prove to them we can organise, manage and deliver development effectively. Wearing a pointy hat and talking obtusely about pointer arithmetic and demanding expensive offices for all the prima-donna developers you&#8217;re going to employ to toil away in silence won&#8217;t convince the suits in charge of the <em>actual</em> money of anything other than you&#8217;re a crazy nerd who can&#8217;t be trusted with a budget.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/02/04/code-qualit-and-development-team/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Programmerless programming is just a mirage</title>
		<link>http://www.crazymcphee.net/x/2009/01/17/programmerless-programming-is-just-a-mirage/</link>
		<comments>http://www.crazymcphee.net/x/2009/01/17/programmerless-programming-is-just-a-mirage/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 10:09:24 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[test driven design]]></category>
		<category><![CDATA[test first]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=51</guid>
		<description><![CDATA[&#8220;Programmerless programming&#8221; is a fad that never dies. It&#8217;s a mirage that never fades but always recedes to just out of reach. Every few years a vendor, or a group of vendors comes out with some bright idea to allow some class of end-user, or business analyst, or what have you to build their own [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Programmerless programming&#8221; is a fad that <a title="The End of The Software Developer" href="http://www.craigslinkedlist.com/posts/end-of-the-software-developer" target="_blank">never dies</a>. It&#8217;s a mirage that never fades but always recedes to just out of reach.</p>
<p>Every few years a vendor, or a group of vendors comes out with some bright idea to allow some class of end-user, or business analyst, or what have you to build their own systems, in recent years usually by some type of graphic language (draw your system&#8217;s program flow right on the screen! bypass those pesky, and expensive, <em>programmers</em> who just ask confusing questions and force you to clarify your thinking!  press the magic &#8216;deployment&#8217; button and your half-baked idea is in <em>production in seconds</em>!). In the past, these systems used &#8220;natural&#8221; language or &#8220;plain English&#8221;  languages such as say Director Lingo.  Every few years it moves onto some new paradigm or expression of the old one. <em>And it always just ends up simply with a whole new class of programmers being created.</em></p>
<p>Do not trust any product &#8211; or standard &#8211; that promises to deliver &#8220;programmerless programming&#8221;. Plenty of 4GLs like SQL and the like are originally meant for non-programmers to use  &#8230; imagine giving a business user just a SQLPLUS prompt now! Included in that mix there was CASE &#8230; a recent example from the past few years I can think of might be BPEL and ESB style tools, or for another example a number of attempts to define architectural languages that generate the system components for you off the UML or similar.</p>
<p>A big issue I see with these systems is that they tend to be highly resistant to modern programming <a title="Emergent Design" href="http://www.crazymcphee.net/x/2009/01/13/emergent-design/" target="_self">principles and practices</a>. For example, test-driven design &#8211; or even simple <a title="Unit testing as a discipline" href="http://www.crazymcphee.net/x/2009/01/15/unitestingasadiscipline/" target="_self">unit testing</a>. Sure, if you&#8217;re building a web app with these things, maybe you could use a web-testing framework to build functional tests and build-to-pass. But most of these tools are very resistant to a test-first approach.</p>
<p>Take Oracle&#8217;s BPEL tooling. For a start, you&#8217;re forced to used JDeveloper, which is a crap IDE you&#8217;d never otherwise inflict on yourself (it is so bad, on start up it displays the most meaningless <em>product slogan</em> I&#8217;ve seen seen on such a tool &#8211; &#8220;Productivity through Choice&#8221;). But more than poor tooling, the very paradigm is completely broken. Forget about a test-first approach (although I&#8217;m sure there&#8217;s some seriously weird way to achieve it), just try setting the damn tools to have the traditional <em>development</em>, <em>testing</em> and <em>production</em> environments. When ever you need to call a service end-point, you are bound to the particular host and port you specify &#8211; it&#8217;s embedded in XML document that represents the BPEL design. The workarounds? Well if you are super organised you could arrange for your different environments to contain identical setups and  use DNS hacks (or host files) to ensure that each service looks the same when you move from development to integration testing to production. Or you can write Ant scripts (or sed and awk if you really want) to search-and-replace the offending hostnames and ports and replace them with the correct values for the target environment. Clearly, once you use it, you see that the tool&#8217;s paradigm is, in reality, to just hook up the IDE to the production server, draw your pretty flow chart modelling your business process, then publish it straight back into production. In other words, there&#8217;s a whole new class of programmer out there now &#8211; BPEL programmers &#8211; and life must be a <em>nightmare</em> for them. Its fundamental paradigm is broken. Given me <em>any</em> language with a unit test framework with a half-decent programmer on <em>any</em> day of the week, and you will beat the pants off this system in productivity <em>and</em> choice. It&#8217;s living a lie &#8211; and a big one.</p>
<p>Ultimately, as each new generation of &#8220;programmerless&#8221; program-construction tooling comes along, it allows developers to do more powerful things (and sometimes, <em>less</em> powerful things in a <em>more</em> retarded way). And the scale of the task always increases to the point where development specialists are still needed. In my view, there is a definite on-going role for for the talented programmer/analyst who knows how to take a vaguely-worded, incomplete, and contradictory bunch of requirements expressed in common verbal language and then <em>ask the right questions</em> in order to clarify them and decompose the requirements to a series of simple logical components &#8211; and then develop and deliver those components in the form of usable systems. You need to continuously learn new languages and systems, but the basic skills stay the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/01/17/programmerless-programming-is-just-a-mirage/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Unit testing as a discipline</title>
		<link>http://www.crazymcphee.net/x/2009/01/15/unitestingasadiscipline/</link>
		<comments>http://www.crazymcphee.net/x/2009/01/15/unitestingasadiscipline/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 09:49:57 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[refactor]]></category>
		<category><![CDATA[test driven design]]></category>
		<category><![CDATA[test first]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=25</guid>
		<description><![CDATA[In Emergent Design Scott L. Bain dedicates a chapter to Paying attention to Disciplines: Unit testing. To an experienced agilist this may seem a little basic: of course the discipline of unit testing pays dividends! But I think that we agilists forget sometimes that there are still many programmers &#8211; or their management &#8211; who don&#8217;t value the investment [...]]]></description>
			<content:encoded><![CDATA[<p>In <a title="Emergent Design" href="http://www.crazymcphee.net/x/2009/01/13/emergent-design/" target="_self">Emergent Design</a> Scott L. Bain dedicates a chapter to <em>Paying attention to Disciplines: Unit testing</em>. To an experienced agilist this may seem a little basic: <em>of course</em> the discipline of unit testing pays dividends! But I think that we agilists forget sometimes that there are still many programmers &#8211; or their management &#8211; who don&#8217;t value the investment needed to get the extensive returns of unit testing and test driven development (let alone test driven <em>design</em>).</p>
<p>I have found too many code bases over the years, with bolted-on, after the fact tests, plagued by spaghetti code and strongly coupled components to be <em>that</em> naive about unit tests. Sure people pay lip-service to testing, but I think many programmers haven&#8217;t yet found the value of test driven design in their professional practice. I know enough that I come across this situation frequently. &#8220;Oh I&#8217;ll do the tests later&#8221;, &#8220;I don&#8217;t have time to write tests, I have to write code!&#8221;, etc. Heck, I am sometimes still guilty of it myself. Here&#8217;s some rolled-gold reasons Bain gives to pay particular attention to the discipline of unit testing in a test-first scenario:</p>
<ul>
<li>It reduces bugging time.</li>
<li>It makes the development process more predictable &#8211; finding bugs often exhibits non-linear unpredictability.</li>
<li>It encourages appropriate coupling, ensures cohesiveness, and reduces redundancy.</li>
<li>It makes you think about your code in more depth.</li>
</ul>
<p>I must say, even when confronted with an existing code base that has little to no unit testing, it&#8217;s always advantageous to start writing the tests before you start fooling around too much with the code base. It will help you discover the design weaknesses.</p>
<p>Another point I have to make about unit testing, is that whenever I need to evaluate a new technology,  I now use the ability to utilise test-driven methodologies as an important criteria. <em>Especially</em> if that technology is supposed to be a productivity-booster for programmers. If I can&#8217;t write the tests first, then I just know the tool, or technology, is going to produce less than optimum results &#8211; how can it make any programmer <em>more</em> productive if it removes the ability to write code until the tests pass? And if I can&#8217;t write <em>any</em> tests &#8211; that is it has no test framework either built-in or freely available, then I just know the tool <em><span style="text-decoration: underline;">sucks</span></em>, and is to be actively avoided and recommended against. I&#8217;m especially suspicious of technology such BPEL frameworks and other frameworks designed to provide &#8220;programmer-less programming&#8221; (but that will have to wait for another day).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/01/15/unitestingasadiscipline/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
