<?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; emergent design</title>
	<atom:link href="http://www.crazymcphee.net/x/tag/emergent-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>Systems versus Individuals and technical debt</title>
		<link>http://www.crazymcphee.net/x/2009/09/05/systems-versus-individuals-and-technical-debt/</link>
		<comments>http://www.crazymcphee.net/x/2009/09/05/systems-versus-individuals-and-technical-debt/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 23:38:48 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[refactor]]></category>
		<category><![CDATA[technical debt]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=468</guid>
		<description><![CDATA[I kind of disagree with this picture by Josh Susser regarding the &#8220;circle of death&#8221; in terms of code quality and late night effort. It is right enough as far as it goes but it doesn&#8217;t go far enough. First up, the easy way out &#8211; take a day off, go for a walk in [...]]]></description>
			<content:encoded><![CDATA[<p>I kind of disagree with <a href="http://blog.hasmanythrough.com/2009/9/3/circle-of-death">this picture</a> by Josh Susser regarding the &#8220;circle of death&#8221; in terms of code quality and late night effort. It is right enough as far as it goes but it doesn&#8217;t go far enough.</p>
<p>First up, the easy way out &#8211; take a day off, go for a walk in the park, have a nice dinner, get a good nights sleep. You should always work to &#8220;sustainable progress&#8221; and yes this means every hour you work over 40 hours a week means your quality is steadily decreasing until some point where every extra hour you put will take two to fix it later (in other words, negative impact). Even just pair programming will help prevent this in the first place as long at least one of you isn&#8217;t operating on half the sleep they need. But ultimately, all of this just blames the individual, when really poor code quality and technical debt are much more a function of the management system, methodology, total sum of the choices by every on the team, etc. (For a start, why are you up late in the first place? Was that your choice, or an outside imposed deadline?).</p>
<p>As James Adam and &#8220;iSteve&#8221; point out in the comments &#8211; technical debt is different from just &#8220;buggy software&#8221; and in my experience it&#8217;s usually function of management or other types of systemic choices (and &#8220;systemic&#8221; includes you, the programmer as well everyone else). What it really does is trade <em>easy change now</em> for <em>even harder change later</em>. It wants that sweet sweet sugar hit straight away but forgets about the &#8220;sugar coma&#8221; that comes a few minutes afterwards. It defers &#8220;paying the piper&#8221; until tomorrow for that lovely tune today. James Adam rightly says in his comment this <em>can be a valid choice</em>, but all of the team have to be fully aware of the <em>consequences</em> of that choice. One of which is typically that the longer  you defer the payment, the more debt you&#8217;ll accumulate, until all you are doing is paying off the interest and not getting to the principal.</p>
<p>As &#8220;iSteve&#8221; says, management (and maybe &#8220;management&#8221; might mean just you telling yourself this in your head) always promises to &#8220;fix it later&#8221; and never does allow that. &#8220;Just make the hack&#8221; and gloss over the problem is a mantra that we&#8217;ve all heard before. Where it gets painful is where every change is now taking twice as long as it should because of the accumulation of hacks. Every single one one of us has been there before, and are probably in various levels of it right now.</p>
<p>In my view this is the much more insidious circumstance because it is <em>systemic</em>.  After all the solution to a bad day&#8217;s work because I was too tired to think properly is to simply get a good night&#8217;s sleep, roll back yesterday&#8217;s coding, and do it again today. All I&#8217;ve done is lost a day&#8217;s work.  However, an organisation is likely to have accumulated months if not years of organisational cruft that makes changing their context that much harder than just rolling back yesterday&#8217;s poor code and trying again &#8211; it requires commitment to change from everyone who counts in the first instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/09/05/systems-versus-individuals-and-technical-debt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Just Say No (to broken processes)</title>
		<link>http://www.crazymcphee.net/x/2009/06/05/just-say-no-to-broken-processes/</link>
		<comments>http://www.crazymcphee.net/x/2009/06/05/just-say-no-to-broken-processes/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 23:23:27 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[refactor]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=384</guid>
		<description><![CDATA[Broken development processes lead to broken code. When you find badly formed code, and especially if you didn&#8217;t  write it just then in order to make the test pass just a minute ago, and super-especially is the code is already in production, you not only need to rectify the code, you need to rectify the [...]]]></description>
			<content:encoded><![CDATA[<p>Broken development processes lead to broken code. When you find badly formed code, and <em>especially</em> if you didn&#8217;t  write it just then in order to make the test pass just a minute ago, and <em>super-especially</em> is the code is already in production, you not only need to rectify the <em>code</em>, you need to rectify the <em>process</em> that lead to the broken code. Well, to be accurate, you need to start engaging in some root-cause-analysis on how this badly formed code came to be included in the production system.</p>
<p>On a technical mailing list I&#8217;m on, a developer asked for help in regard to a class he had to modify. There&#8217;s no need for the full gory detail here; suffice to say it&#8217;s main feature was that it had a very long if-then-else method that had nearly 20 steps testing multiple boolean statuses strung out after each other. The question was very simply; &#8220;how to refactor this?&#8221;. The suggestions were all good; ranging from using polymorphism to implementing a rules engine.</p>
<p>It&#8217;s not the solutions, or even the code that I want to discuss. Near the end of the thread, the original poster came back and said he&#8217;d discovered that (to paraphrase) &#8216;the feature change needs to go to the QA process today&#8217; and that the refactoring couldn&#8217;t be done: the two-line hack would have to suffice.</p>
<p>I feel for the poor bugger, I really do, I&#8217;ve been in that situation myself. Maybe it&#8217;s just my bombastic, iconoclastic nature that makes me push back at these situations and tell people what fools they are for not valuing the <em>craftsmanship</em> of the very craftsmen they&#8217;ve hired specifically to build their software solutions. We need to start to insist that craftsmanship is valued and not just dismissed with an airy wave of the hand by management anymore. I&#8217;m fully aware this frequently makes me unpopular amongst those who don&#8217;t like to told the hard, brutal, truth. But I&#8217;ve given up caring. The truth it is.</p>
<p>In this spirit, I&#8217;m going to put on my &#8220;I&#8217;m as mad as hell and I&#8217;m not gonna take this anymore&#8221; hat and say the following. The reason that class in that state is because &#8220;changes to this feature are going to need to be in a build for QA today&#8221;. What needs to be done about these situations?</p>
<p>Just Say No.</p>
<p>Developers &#8211; those aspiring to be craftsmen anyway, need to be able to say it just is not possible for this feature to be changed today. Tell the management they have maxed out the credit card and the bailiffs are banging at the door and taking the silverware away as payment.</p>
<p>For a start, who decided this feature had to be in the QA build at some arbitrary cut-off date anyway? Someone who had never seen that class, that&#8217;s who. That &#8220;chicken&#8221; committed developer &#8211; the &#8220;pig&#8221; &#8211; to deliver the feature by some arbitrary cut off date and didn&#8217;t know the details. This is estimation by <em>fiat</em>. In any half-way decent process that respects it&#8217;s workers as people and not jut bit-flippers, no-one has the right to do this; it&#8217;s massively broken process. Chickens are not allowed to decide on estimates: only pigs are. The only way these things change if someone stands up and says &#8220;NO&#8221; to such broken process.</p>
<p>I don&#8217;t mean to say the developers can just go off with the fairies and gold-plate every piece of code they touch. But it has to be at least <em>well-made</em>. Obviously this particular process isn&#8217;t an agile environment &#8211; as it includes a &#8220;QA&#8221; stage with arbitrary cut off date at which point hte code &#8220;gets thrown over the wall&#8221;. And the company has management (I assume it&#8217;s management) running around and setting arbitrary delivery dates for unknown work.</p>
<p>Seriously, process improvement has to start somewhere. Be the change you seek. Stop tolerating poor code. If the process you work in demands you to tolerate it, change the process as best you can.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/06/05/just-say-no-to-broken-processes/feed/</wfw:commentRss>
		<slash:comments>3</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>Code re-writes and U.S. health care reform</title>
		<link>http://www.crazymcphee.net/x/2009/01/20/code-re-writes-and-us-health-care-reform/</link>
		<comments>http://www.crazymcphee.net/x/2009/01/20/code-re-writes-and-us-health-care-reform/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 08:16:53 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[professional practice]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[refactor]]></category>
		<category><![CDATA[rewrite]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=70</guid>
		<description><![CDATA[This post is not about health-care, per se. This is about &#8220;re-writes&#8221; or &#8220;total reforms&#8221; of systems. An argument Atul Gawande makes in New Yorker magazine about health-care reform: [Certain reformists say] The country has this one chance, the idealist maintains, to sweep away our inhumane, wasteful patchwork system and replace it with something new [...]]]></description>
			<content:encoded><![CDATA[<p>This post is not about health-care, per se. This is about &#8220;re-writes&#8221; or &#8220;total reforms&#8221; of systems. <a href="http://www.newyorker.com/reporting/2009/01/26/090126fa_fact_gawande?currentPage=all">An argument Atul Gawande makes in New Yorker magazine about health-care reform</a>:</p>
<blockquote><p>[Certain reformists say] The country has this one chance, the idealist maintains, to sweep away our inhumane, wasteful patchwork system and replace it with something new and more rational. So we should prepare for a bold overhaul, just as every other Western democracy has. True reform requires transformation at a stroke. But is this really the way it has occurred in other countries? The answer is no. And the reality of how health reform has come about elsewhere is both surprising and instructive.</p></blockquote>
<p>He goes at lengths to explain how the health care that the rest of the developed world (e.g. Australia) has found itself with, are the results of ad-hoc changes to existing systems, not large-scale rewrites. As a result, every country has a &#8220;path-dependent&#8221; health care system. For example, Britain&#8217;s NHS evolved in 1945 from wartime requirements and infrastructure. After the way, France&#8217;s infrastructure was largely destroyed, so they used (that is, modified and extended) an existing system of union organised health care insurance paid for through payroll taxes. And so on. Everyone&#8217;s system is different because their initial conditions where different, and solutions have to respect what&#8217;s there, and not just blithely sweep it all aside.</p>
<p>This possibly could give us a <em>general</em> principle with regards to all types of reform -<em> you have to work with what you&#8217;ve got</em>. That includes software.</p>
<p>We&#8217;ve <a href="http://www.oreillynet.com/onlamp/blog/2007/08/informal_survey_do_rewrites_re.html" target="_blank">known</a> for <a title="Joel On Software - Things Not To Do" href="http://www.joelonsoftware.com/articles/fog0000000069.html" target="_blank">some time</a> that the <a title="The Big Rewrite" href="http://chadfowler.com/2006/12/27/the-big-rewrite" target="_blank">big rewrite</a><a href="http://www.ronkes.nl/blog/?2005-04-15-neverrewritecode" target="_blank"> nearly always</a> <a href="http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html" target="_blank">ends</a> in <a href="http://www.jwz.org/gruntle/nomo.html" target="_blank">failure</a> (although <a href="http://codehappy.wordpress.com/tag/rewrites-development-code-smells/" target="_blank">not everyone</a> <a href="http://my.opera.com/Vorlath/blog/2007/09/25/code-rewrite-yes" target="_blank">agrees</a>). Especially when the specification for the new system is &#8220;make it do what the old system does&#8221;. Why are you re-writing it then?! (<a title="Software as the The Spec" href="http://chadfowler.com/index.cgi/Computing/Programming/TheBigRewrite/TheSpec.rdoc,v" target="_blank">Chad Fowler has an excellent article about this</a>).</p>
<p>It&#8217;s an excellent general principle that software systems should to evolve  incrementally over time. Has anyone else worked in an environment where they&#8217;ve spent 12, 18, 24 months squirrelled away somewhere vigorously rewriting an entire system while the existing system is still being maintained and improved? Not so long ago I worked on a system where we spent 4 months re-writing just a small section of a piece of software &#8211; delivered in two steps &#8211; and it was bad enough as it was. But a <em>year</em>? It just has to be disastrous.</p>
<p>What&#8217;s important is your initial set of conditions, which shape the scope of what is actually possible to do &#8211; and importantly, how you&#8217;d go about doing it. Your future system is &#8220;path dependent&#8221; on the existing one, and that was dependant on what was there before.  Software developers frequently chafe at these limits, and instead form a desire to just chuck it out and start over. But you are dooming yourself to failure if you do that.</p>
<p>Part of our professional practices  should be the delivery of <a title="Emergent Design" href="http://www.crazymcphee.net/x/2009/01/13/emergent-design/" target="_self">incremental design to systems</a>. Instead of that 4 month re-write of a small section of functionality could we have delivered it in even smaller chunks? My feeling is <em>quite probably, yes</em> &#8211; and it would have been a lot less stressful at the time too. Always work with what you&#8217;ve got, and change -and <em>improve</em> &#8211; it one small piece at a time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/01/20/code-re-writes-and-us-health-care-reform/feed/</wfw:commentRss>
		<slash:comments>0</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>
		<item>
		<title>Emergent Design &amp; Professional Software Development</title>
		<link>http://www.crazymcphee.net/x/2009/01/13/emergent-design/</link>
		<comments>http://www.crazymcphee.net/x/2009/01/13/emergent-design/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 12:19:37 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[professional practice]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[profession]]></category>
		<category><![CDATA[test driven design]]></category>
		<category><![CDATA[test first]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=11</guid>
		<description><![CDATA[Recently I read Emergent Design: The Evolutionary Nature of Professional Software Development by Scott L. Bain (on Amazon). It&#8217;s a very interesting read. [E]mergent design works by refactoring and enhancing code, due to the changes, bugs, and extensions that have to accommodate, while paying close attention to these principles of coding. (152) In order to deal with the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I read <span class="nobr"><a rel="nofollow" href="http://www.netobjectives.com/resources/books/emergent-design">Emergent Design: The Evolutionary Nature of Professional Software Development by Scott L. Bain<sup><img class="rendericon" src="http://modular.autonomous.org/confluence/images/icons/linkext7.gif" border="0" alt="" width="7" height="7" align="absmiddle" /></sup></a></span> (on <span class="nobr"><a rel="nofollow" href="http://www.amazon.com/Emergent-Design-Evolutionary-Professional-Development/dp/0321509366">Amazon<sup><img class="rendericon" src="http://modular.autonomous.org/confluence/images/icons/linkext7.gif" border="0" alt="" width="7" height="7" align="absmiddle" /></sup></a></span>). It&#8217;s a very interesting read.</p>
<blockquote><p>[E]mergent design works by refactoring and enhancing code, due to the changes, bugs, and extensions that have to accommodate, while paying close attention to these principles of coding. (152)</p></blockquote>
<p>In order to deal with the idea idea of evolutionary software development with a lean or agile methodology you have to first grasp what software development is and isn&#8217;t. As a consequence of this, the first part of the book deals with the idea of &#8220;Software as a profession&#8221;. A lot of this is very thought-provoking; I&#8217;ve never really thought about what a &#8216;profession&#8217; actually is before.</p>
<blockquote><p>Software development has not been around for very long, in the grand scheme of things. Other, similar complex endeavors (medicine, the law, architecture and so on) have been around for hundreds, even thousands, of years, and in that time a whole set of standards, practices, and general wisdom has been captured and handed down from generation to generation. This has helped to increase the rate of predictable success for each new batch of doctors, lawyers, and builders, and in each case has led to the formation of an organism we call <em>the profession</em>.</p></blockquote>
<p>Although he admits that the choice of development as <em>profession</em> is somewhat arbitrary, it does serve to highlight that <em>what we do as developers is like no other activity</em>. In other words, software development is a unique activity, and there&#8217;s no point in organising it using the methods of electrical or mechanical engineering, research science, medicine, or house building. Each of these professions is different from software development and different <em>from each other</em>. Software developers need our own ways of organising our field of knowledge, some of these are currently absent.</p>
<p>Features that need to be covered in software development as a profession:</p>
<ul>
<li><strong>Specialised language</strong>. This would be at a high level, not a low abstraction level like at the code itself. Bain maintains that the design patterns &#8216;movement&#8217; is a move towards the development of a high-level specialised language that matures our field towards professionalism.</li>
</ul>
<ul>
<li><strong>A clear entry path</strong>. Something that&#8217;s currently clearly missing, although I&#8217;d contend that perhaps a computer science or information technology degree and employment as a graduate programmer, at least in this country (Australia), is something that somewhat fills that role.</li>
</ul>
<ul>
<li><strong>Peer-review</strong>. Peer review is fairly ad-hoc and chaotic, despite attempts at things like user groups and websites.</li>
</ul>
<ul>
<li><strong>Standards and practices</strong>. Unfortunately there is little agreement amongst the broad software development community about &#8216;what is right&#8217;. However, I would argue that the Agile movement is at least a move in the right direction.</li>
</ul>
<p>The sorts of things that need to be discussed and understood by a profession of evolutionary software development might number:</p>
<ul>
<li><strong>Qualities</strong>. How do we know when something is good? How do we choose the best thing? What is meant by <em>best</em>?</li>
</ul>
<ul>
<li><strong>Principles</strong>. The fundamentals of good software. &#8220;Principles promise better results in terms of the qualities we will emphasize&#8221;.</li>
</ul>
<ul>
<li><strong>Practices</strong>. The things you do in your daily coding activities. Practices must be easily taught because they &#8220;are truly valuable when they are shared and promoted to all the developers on a team&#8221;.</li>
</ul>
<ul>
<li><strong>Disciplines</strong>. These are similar to practices, but on a larger scale. Things you <em>should</em> do that have a basic and profound value to what you do as a developer. For example, unit testing, refactoring, test-driven development.</li>
</ul>
<ul>
<li><strong>Patterns</strong>. What worked before; &#8220;the set of interrelated points of wisdom that reflect what [the profession knows] about certain situations &#8230; that we find ourselves in again and again&#8221;. I would add, and the common, standarised jargon that we use to describe and discuss these patterns.</li>
</ul>
<ul>
<li><strong>Processes</strong>. How does development work? How do we know what to build? How do we know when we&#8217;ve built it? How do we correct the situation when we discover something&#8217;s wrong? How we we discover that something is wrong? Et cetera.</li>
</ul>
<p>In this day and age I can <em>still</em> find developers, usually working in crippled environments, who won&#8217;t even agree on the simple principles of maintaining &#8216;good&#8217; code practices, for <em>any</em> version of good. Whatever&#8217;s there, they&#8217;ll accept. Even when faced with seriously broken design, and a mandate to effect change, a cascading series of ever-fragile hacks will be accepted, even if it takes more time to produce, or modify, the hack. Code will never be deleted, even long after obsolescence. It is left remaining, &#8220;just in case&#8221;, and as if there was no version control system.</p>
<p>As a consultant, I have no real choice but to work with these programmers. I can only try to encourage them to follow a right path. I was recently told I was a <em>perfectionist</em>, simply for demanding any level of unit testing greater than 0.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2009/01/13/emergent-design/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
