<?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>Casual Miracles - Blog</title>
	<atom:link href="http://www.casualmiracles.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.casualmiracles.com/blog</link>
	<description>Casual Miracles WordPress weblog</description>
	<lastBuildDate>Mon, 06 Sep 2010 21:12:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rank, Authority and Power</title>
		<link>http://www.casualmiracles.com/blog/2010/09/06/rank-authority-and-power/</link>
		<comments>http://www.casualmiracles.com/blog/2010/09/06/rank-authority-and-power/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 21:12:46 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=354</guid>
		<description><![CDATA[One of the characteristics of many teams that Casual Miracles has helped over the past few years is that team members have felt a lack of authority to make changes that are necessary to achieve success. Frequently this occurs despite senior management telling them that they can make the changes they want to.

Sometimes this is [...]]]></description>
			<content:encoded><![CDATA[<p>One of the characteristics of many teams that Casual Miracles has helped over the past few years is that team members have felt a lack of authority to make changes that are necessary to achieve success. Frequently this occurs despite senior management telling them that they can make the changes they want to.</p>
<p><span id="more-354"></span></p>
<p>Sometimes this is due to organisational constraints. In some very hierarchical, command-and-control organisations, by the time the message reaches those who have the ideas, it has been corrupted beyond recognition, and appears to be an admonishment to maintain the status quo or instruction to move in a different direction completely. Even without these confusions, and within a relatively shallow local hierarchy (one or two layers of management), team members can inhibit themselves because of a sense of impotence, with each team member thinking that others have greater authority because of a whole host of factors.</p>
<p>In most organisations hierarchical rank is a major component of a person&#8217;s authority and power. But the concept of rank is a complex, multi-dimensional notion that frequently speaks to our primate brains. Furthermore, rank is dependent on context and is relational; a person only has rank with respect to others and in a particular  situation &#8211; there is no absolute rank.</p>
<h1>The Problem</h1>
<p>One such organisation we worked with recently suffered from just this issue. Various well-intentioned management attempts to help the team had actually reinforced this sense of lack of authority. </p>
<p>We ran retrospectives to try to get the team to cohere around certain issues and solutions. Almost every retrospectives followed a pattern of identifying issues, coming up with solutions and then declaring the solutions impossible because the team lacked the authority to apply the solutions.</p>
<h1>An Exercise</h1>
<p>Several years ago, I attended a course run by Ben Fuchs and Joseph Pelrine of <a href="http://www.cateams.com">CATeams</a> entitled &#8216;The Deep Dynamics of Agile Teams&#8217;. A large part of this course was about rank, and this is where the ideas and material came from for this exercise.</p>
<p>After a (too) brief introduction to the concept of rank, we gave everybody a questionnaire which asked them to assess their own rank on 25 distinct dimensions (e.g. position in the formal hierarchy, education, gender, intelligence, self-confidence, etc.) placed into 3 categories (Situational, Social and Personal).</p>
<p>Having done that, we then asked everybody to pair up. We gave each team member another copy of the questionnaire, asking them to assess their partner&#8217;s rank in the same way. Having done that, we asked the pair to discuss the differences in the two assessments of each member of the pair.</p>
<p>What is striking about this process is that usually, individuals will assess their own rank lower than their partner&#8217;s assessment on many dimensions. In this instance, almost everybody afforded their partners greater rank than their partner had afforded themselves.</p>
<p>This is quite common and was actually the point of the exercise when Fuchs and Pelrine asked us to do it on the course.</p>
<h1>Taking it a Bit Further</h1>
<p>Somewhat on a whim, we asked each person to provide us with two post-it notes.</p>
<p>On the first, we asked them to write &#8216;&lt;&#8217;, &#8216;=&#8217; or &#8216;&gt;&#8217; if they felt that, in general, their partner had assessed their rank lower, equal to or higher respectively, than their own assessment of their rank.</p>
<p>On the second, we asked them to write &#8216;&lt;&#8217;, &#8216;=&#8217; or &#8216;&gt;&#8217; if they felt that, in general, they assessed their partner&#8217;s rank lower, equal to or higher than their partner had assessed his or her own rank.</p>
<p>Of course, given that software development teams (including testers, BAs and project managers) frequently believe that they have impeccable logic, this request was regarded with incredulity; &#8217;surely the results will be symmetrical?&#8217; they asked.</p>
<p>However, once the team had done as we asked, we put the post it notes on display and found that in response to the first question, just over half of the people present felt that their partners had ranked them higher than they had ranked themselves. However, in response to the second, almost all believed that they had ranked their partners higher than than their partners had ranked themselves.</p>
<p>So to some extent the participants&#8217; assessment of their own rank even coloured their assessment of the questionnaire results.</p>
<h1>Conclusion</h1>
<p>The message is that we frequently assess our own rank lower than other people assess it. The gap between our assessment and the assessment others make of us represents rank, authority and power that we can use if only we are prepared to wield it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2010/09/06/rank-authority-and-power/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scaladays 2010</title>
		<link>http://www.casualmiracles.com/blog/2010/05/20/scaladays-2010/</link>
		<comments>http://www.casualmiracles.com/blog/2010/05/20/scaladays-2010/#comments</comments>
		<pubDate>Thu, 20 May 2010 14:45:42 +0000</pubDate>
		<dc:creator>channing</dc:creator>
				<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=343</guid>
		<description><![CDATA[I attended Scaladays 2010 at EPFL in Lausanne, Switzerland in April. at which Nigel Warren and I presented the work we had done on porting Fly’s Java client library to Scala. You can watch all the Scaladays videos on the Scaladays website and so I will not dwell on the talks, which were excellent. Instead, [...]]]></description>
			<content:encoded><![CDATA[<p>I attended <a href="http://days2010.scala-lang.org/">Scaladays 2010</a> at EPFL in Lausanne, Switzerland in April. at which Nigel Warren and I presented the work we had done on porting <a href="http://www.flyobjectspace.com/">Fly’s</a> Java client library to Scala. You can watch all the <a href="http://days2010.scala-lang.org/node/136">Scaladays videos</a> on the Scaladays website and so I will not dwell on the talks, which were excellent. Instead, I want to talk about Scala and its community, led by Martin Ordersky.</p>
<p>It has become clear to me, as it did with Java 15 years ago, that Scala is an incredibly important language and almost certainly Java’s successor. There is no reason for anyone intending to build applications for the JVM to choose Java over Scala. </p>
<p>Any Java developer is capable of writing Scala in a basic sense, that is, write exactly what they would write in Java but in Scala’s syntax. They can even start by mixing Java and Scala if they feel uncomfortable about jumping all the way in. Developers can choose to use Scala on parts of a system or even just in tests. Scala’s tight integration with Java libraries and frameworks enables developers to make use of the Java ecosystem as they normally would which is incredibly valuable.</p>
<p>However, Scala has a great deal of headroom. It enables much more concise, simpler, reusable and elegant software to be written for those that have the will to learn functional programming and a little practical type theory. Importantly, Scala offers Java developers a way to move from idiomatic Java to idiomatic Scala in small steps, there is no need for a wholesale leap into the unknown. In short, Scala offers a migration path to a better way to build robust software.</p>
<p>A reason why Scala is important is that it offers mechanisms for controlling complexity. In The Structure and Interpretation of Computer Programs, Abelson and Sussman said:</p>
<p><em>In our study of program design, we have seen that expert programmers control the complexity of their designs with the same general techniques used by designers of all complex systems. They combine primitive elements to form compound objects, they abstract compound objects to form higher-level building blocks, and they preserve modularity by adopting appropriate large-scale views of system structure.</em></p>
<p>Scala facilitates this abstraction and combination that results in simpler, more robust software in a number of ways: functional programming techniques, object oriented techniques, a rich type system and mechanisms to build components. In Scalable Component Abstractions, Martin Odersky and Matthias Zenger describe abstractions for the construction of reusable components: </p>
<p>	<em>abstract type members, explicit selftypes, and modular mixin composition. Together, these abstractions enable us to transform an arbitrary assembly of static program parts with hard references between them into a system of reusable components.</em></p>
<p>Making <em>full</em> use of Scala does not come for free, there is a lot to learn. Fortunately, the Scala community is very friendly which is in large part due to Martin and his team’s efforts. The community is full of very smart people who are very willing to help novices. It is not unusual for questions asked on mailing lists to be answered by Martin or other leaders in the Scala community. This friendly environment is actively fostered so that beginners feel comfortable asking basic questions without fear of angry replies to RTFM.</p>
<p>There are those that think that Scala is a complex language and they are right to a certain extent, but you can be productive in Scala without using advanced features, just not as productive as you would be if you learnt about those features. </p>
<p>Most objections to new languages like Scala and Clojure can be reduced to, “I don’t understand this after 2 mins of skimming the website so its too academic”. Not very good really and not worthy of further argument.</p>
<p>Learning Scala has real benefits in understanding more about computing in general, and it lets you do it gently whilst being productive. Give it a try!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2010/05/20/scaladays-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing Maintainable Acceptance Tests</title>
		<link>http://www.casualmiracles.com/blog/2010/03/04/writing-maintainable-acceptance-tests/</link>
		<comments>http://www.casualmiracles.com/blog/2010/03/04/writing-maintainable-acceptance-tests/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 01:20:08 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[Quality]]></category>
		<category><![CDATA[Software Process]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=283</guid>
		<description><![CDATA[Over the past six months or so, there has been a fair amount of negative commentary about automated acceptance / integration / system testing. The thrust of this commentary is that testing at this level tends to be brittle, slow and have a high maintenance overhead. None of this needs to be true, but producing [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past six months or so, there has been a fair amount of negative commentary about automated acceptance / integration / system testing. The thrust of this commentary is that testing at this level tends to be brittle, slow and have a high maintenance overhead. None of this needs to be true, but producing a robust suite of tests requires an uncommon adherence to good practice.</p>
<p><span id="more-283"></span></p>
<p>To be sure, this kind of automated test will run slower than unit tests, because almost all of the machinery of the system under test is going to be involved. But I have seen many implementations that are much slower than they need to be because of one or two technical choices.</p>
<p>The advice that I offer here does not guarantee fast and robust tests, but if you don&#8217;t follow this advice and you don&#8217;t somehow deal with the issues raised in this article, I am pretty sure your tests will be slow and time-consuming to maintain as the test suite grows.</p>
<p>By way of example, let us consider an online book seller. The kind of test that can be built with the aid of many libraries might well look like this:</p>
<pre>public void testSearchAndOrder() {
    type("username", "JRHartley");
    type("password", "verysecret");
    click("Submit");

    type("searchField", "Fly Fishing Hartley");
    click("Search");

    assertEquals("Fly Fishing"), innerHtml("searchresults/tr[1]/td[1]");
    assertEquals("J.R.Hartley"), innerHtml("searchresults/tr[1]/td[2]");

    click("searchresults/tr[1]/td[1]");
    click("Order");

    assertPageTitle("Your order has been placed");
}</pre>
<p>This will certainly test the functionality. However, there are two things wrong with it:</p>
<ul>
<li>Who is &#8216;JRHartley&#8217;? Why is he buying &#8216;Fly Fishing&#8217;? <em>i.e.</em> Is there something significant about that author or that book in the &#8217;standard test dataset&#8217;? No? Then this test is overspecified. Yes? Then the test is dependent on something that is not stated clearly. In either case, it is dependent on a &#8217;standard dataset&#8217;.</li>
<li>Is JRHartley really interested in clicking buttons, typing into text fields, <em>etc.</em>? <em>i.e.</em> is the logic we are testing really about button clicks and typing? This test is specifying mechanisms rather than outcome.</li>
</ul>
<p>These issues contribute to brittleness and difficulties with maintenance. In addition, the dependency on standard data frequently leads to slow tests because there is more data than required.</p>
<p>My general approach to these problems is to focus on <strong>abstraction</strong> and <strong>composability</strong>. The solutions shown below achieve these fundamental aspects of software development partially by using a domain specific language in fluent interface style (although the fluency is limited and I usually go considerably further). By good fortune, Debasish Ghosh describes an approach to building DSLs <a href="http://debasishg.blogspot.com/2010/02/dsl-grow-your-syntax-on-top-of-clean.html">here</a> that is precisely what I am advocating.</p>
<p>However, this choice is largely irrelevant. You could achieve the results with, for example,  FIT, Fitness, Concordion or some other tool instead. I have never used those tools and suspect that I don&#8217;t really want to, but if you like them, go for it.</p>
<h3>Dependency on a &#8216;Standard Dataset&#8217;</h3>
<p><strong>Note:</strong> Although this section refers to databases, the same argument applies if, for example, your system accepts feed files from other systems and processes them.</p>
<p>My preference is for each test to start with an empty database schema and to populate it with exactly what is needed. This tends to:</p>
<ul>
<li>prevent one test from destroying the data that another test depends on</li>
<li>prevent tests from becoming dependent on an incidental aspect of the data</li>
<li>prevent more and more data being added to the database in order to accomodate new tests without breaking previous tests</li>
<li>make tests run quickly because there is very little data in the database</li>
</ul>
<p>However, I do not want each test to have a bunch of database inserts, because doing so will make the test fragile with respect to database changes and in any case, doing this specifies the test at the wrong level. Therefore the <strong>database setup must be abstracted</strong>.</p>
<p>In order to truly achieve this, the abstraction must be above the level of database tables; for example, if tests need to know that in order to add a <em>book</em> to the database, a <em>publisher</em> must be created first, each test:</p>
<ul>
<li>has structural knowledge of the database leading to duplication of information</li>
<li>contains information that is not relevant to the test leading to overspecified tests</li>
</ul>
<p>In the example above, as far as the test is concerned, the book needs two attributes: a name and an author. Undoubtedly, the book will have many more attributes and relationships in the database, but none of these are relevant to this test and so should not be part of the setup. My DSL will therefore start to look like this:</p>
<pre>public void testOrderBook() {
    given()
        .aBook()
            .title("Fly Fishing")
            .author("Hartley");

    ...
}</pre>
<p>The <em>given()</em> method is an entry point into the fluent interface and this expression should be read &#8216;Given a book with title &#8220;Fly Fishing&#8221; and author &#8220;Hartley&#8221;&#8216;. The important aspect of this is that the <em>book()</em> method initialises all of the book&#8217;s fields and knows how to build a book with integrity in the database. I usually initialise fields to random values.</p>
<p>This deals with the dependency on the standard data issue. However, it does not eliminate the over-specificity of the test. To put it simply, while the test is interested in the title and author, it should be non-specific about what title and author is actually used.</p>
<h3>Overspecificity</h3>
<p>In order to solve this problem, we need to allow the title and author to be given to us, rather than prescribed. As said earlier, my convention is to randomise any unspecified fields. So not specifying an author and title will result in what we want.</p>
<pre>public void testOrderBook() {
    Book book = given().aBook();

    ...
}</pre>
<p>We can now express the rest of the test using the book&#8217;s properties. We will see how to do that later.</p>
<p>Some might feel uncomfortable that something important has been lost from this fixture; the fact that the test does depend on an author and title and yet we are not setting up the book with a particular author and title. If that really bothers you, it is easily remedied (I&#8217;ll use the more terse form above for the rest of the article though):</p>
<pre>public void testOrderBook() {
    String author = given().anAuthor();
    String title = given().aBookTitle();

    Book book = given()
        .aBook()
            .author(author)
            .title(title);

    ...
}</pre>
<p>The important point is that the test is now free of pre-existing fixture data and is minimally specific.</p>
<h3>Specify Tests In Business Terms</h3>
<p>The other concern in the original test was that it was expressed in terms of what to type into form fields and what buttons to click. We should hide this away:</p>
<pre>public void testOrderBook() {
    Book book = given().aBook()

    ...

    then()
        .searchingFor(book.getTitle() + " " + book.getAuthor());

    resultsIn()
        .searchResults(book);

    ...
}</pre>
<p>The logic of how to do the search is hidden behind the <em>searchingFor(&#8230;)</em> method. The only relevant thing passed is the search term. Subsequently, we make sure that the results returned from the search contain the book. We could be more specific and assert that the search results contain only one book. Of course, for that to have any real relevance, more than one book would have to be created in the database.</p>
<p>This test now does not directly depend on button clicks and, apart from a few artifacts of the Java language, is pretty easy to understand at the level of business interactions.</p>
<p>Finally, we want to place the order:</p>
<pre>public void testOrderBook() {
    Book book = given().aBook();
    User user = given().aUser();

    loginAs(user);

    then()
        .searchingFor(book.getTitle() + " " + book.getAuthor())

    resultsIn()
        .searchResults(book);

    then()
        .select(book)
        .order()

    resultsIn()
        .anOrder(book, user);
}</pre>
<p>And once again, details about how the order is placed and how we verify that the order has been placed are abstracted away. Of course, if the user was able to check their orders on a web-page, we could use that page to determine that the order has been placed. Otherwise, we might go to the database to make sure that an entry has been added to an appropriate table. We might also expect an email to be sent, so the <em>anOrder(Book, User)</em> method might verify that too. The point is that all of that can be hidden in <em>anOrder(Book, User)</em> and can be changed over time if necessary.</p>
<h3>Emergent Goodness</h3>
<p>The approach described above brings enough benefits as it is; fixture data independence and tests specified at the level of the business process. However, there are now two things that also emerge:</p>
<ul>
<li>Because the DSL is written in fluent interface style in Java, as more tests are written, the fluent interface helps to guide the writing of tests. New tests can be composed very quickly.</li>
<li>The test is not tied to an implementation. The fact that this started life as a test for a web-app does not mean that it will always be so. An entire test suite can be reused to test, for example, a REST api, or a B2B messaging system for book supplies. All that is needed is to reimplement the model behind the DSL appropriately. This may not be a small task, but the fact remains that the tests themselves can be used in many ways.</li>
</ul>
<p>This latter point has been exercised on one of our recent projects in which there were multiple ways of using the system (web-app, REST API and message queues each offering the same functionality to clients).</p>
<h3>Conclusion</h3>
<p>In order to keep automated acceptance tests maintainable, fast and flexible, focus on those staples of solid development: abstraction and composability. Avoid &#8217;standard data sets&#8217; and express tests in terms of business processes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2010/03/04/writing-maintainable-acceptance-tests/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Large Systems</title>
		<link>http://www.casualmiracles.com/blog/2010/02/21/large-systems/</link>
		<comments>http://www.casualmiracles.com/blog/2010/02/21/large-systems/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 13:57:54 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[Quality]]></category>
		<category><![CDATA[Software Process]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=251</guid>
		<description><![CDATA[Many times over the years we have encountered an attitude towards code cleanliness that is summed up in the assertion that as systems grow in size, code quality will necessarily degrade. Often the argument is backed by references to &#8216;programming in the large&#8217; as opposed to &#8216;programming in the small&#8217;. We have consistently found these [...]]]></description>
			<content:encoded><![CDATA[<p>Many times over the years we have encountered an attitude towards code cleanliness that is summed up in the assertion that as systems grow in size, code quality will necessarily degrade. Often the argument is backed by references to &#8216;programming in the large&#8217; as opposed to &#8216;programming in the small&#8217;. We have consistently found these assertions to be unfounded and this article is an attempt to explain why.</p>
<p><span id="more-251"></span></p>
<p>To do so, we will break a recent client&#8217;s confidence and show you the whole system we built. This system was an &#8216;enterprise&#8217; system in that it was bought to life within an ecosystem that contained the usual array of multiple messaging technologies, databases (legacy and new) and bizarre mandated in-house technologies that performed functions we didn&#8217;t have a need for.</p>
<p>The system in question is an order management system, the back end of which is written in Java and a front end is written in C#. The back end takes orders in the form of messages from multiple sources. Each source has its own message format and sometimes its own messaging technology. Examples of the different message formats and messaging technology are: the C# GUI which uses REST over HTTP to exchange XML messages, an electronic sales system that sends messages over JMS using a proprietary message format, and another electronic system that sends messages over a proprietary messaging system in FIXML.</p>
<p>In addition, we had to back onto a legacy database for reference data, but used our own new database for storing our specific data.</p>
<p>I think it&#8217;s reasonable to say that this is not a toy problem. It is exactly the kind of problem that might set an expectation of low code quality, high defect rates, etc.</p>
<p>Now, without further ado, I will show you the whole system. Brace yourselves:</p>
<pre>public class MessageConsumer {
    private MessageTranslator translator;
    private OrderCommandProcessor processor;
    private Responder responder;

    public MessageConsumer(MessageTranslator translator,
                           OrderCommandProcessor processor,
                           Responder responder) {
        this.translator = translator;
        this.processor = processor;
        this.responder = responder;
    }

    public void consume(T message) {
        try {
            processor.process(translator.translate(message));
            responder.success(message);
        } catch (Exception ex) {
            responder.error(message, ex);
        }
    }
}</pre>
<p>There it is. Nine months of work!</p>
<p>This class represents the entire function of the system. It accepts messages, translates them into a canonical form, processes them and informs the sender of the result.</p>
<p>So where is the complexity? This code is pretty clean; there&#8217;s no duplication, no excessive cyclomatic complexities, no global variables, no spooky action at a distance, etc.</p>
<p>What&#8217;s that? You&#8217;re saying I&#8217;m cheating. That all of the complexity must be in the MessageTranslator, OrderCommandProcessor and Responder. Yes, OK, there&#8217;s some more code there. As an irrelevant side note, there are actually multiple instances of the MessageConsumer, each configured with different MessageTranslators and Responders but the same OrderCommandProcessor. This is because, as stated earlier, there were multiple messaging technologies and message protocols in play and the abstractions represented by MessageTranslators and Responders adapt each of those to the one internal form that we want to handle.</p>
<p>But since you insisted, let&#8217;s look at the OrderCommandProcessor to see if we can find some of these &#8216;large system&#8217; problems:</p>
<pre>public class OrderCommandProcessor {
    private OrderCommandLogger logger;
    private OrderBook orderBook;
    private ProductCatalog productCatalog;
    private OrderValidator validator;

    public OrderCommandProcessor(OrderBook orderBook,
                                 ProductCatalog productCatalog,
                                 OrderValidator validator,
                                 OrderCommandLogger logger) {
        this.orderBook = orderBook;
        this.productCatalog = productCatalog;
        this.validator = validator;
        this.logger = logger;
    }

    public void process(OrderCommand orderCommand)
                throws ValidationException {
        orderCommand.validate(validator, productCatalog);
        orderCommand.execute(orderBook);
        logger.success(orderCommand);
    }
}</pre>
<p>Hmmm&#8230;. That doesn&#8217;t look too bad either. One question the astute reader might ask is why we have the OrderCommandProcessor at all. Why don&#8217;t we just have those three lines of code and the necessary dependencies in MessageConsumer? The Single Responsibility Principle notwithstanding, it looks like the introduction of an unnecessary class. Right?</p>
<p>Well, the MessageConsumer is one of many entry points into the system. All but one entry point is a message queue of one kind of another. The C# GUI is the other one and that sends XML over HTTP. Our corresponding servlet turns the XML into OrderCommands and then dispatches to the OrderCommandProcessor for the rest. But, messages received from the GUI also required some additional processing so we couldn&#8217;t simply have a MessageTranslator and Responder suitable for HTTP messages (actually, we could have done that and then decorated the OrderCommandProcessor with the extra stuff &#8211; this would have required an extra class anyway). In any case, separating out this functionality lets us process the OrderCommands uniformly, regardless of where they come from.</p>
<p>But still, it&#8217;s not complicated; we have a bunch of instances of MessageConsumer and our servlet, all appropriately configured to translate messages and hand them over to the OrderCommandProcessor to do the rest. That&#8217;s all fairly straightforward, so far.</p>
<p>However, validation always makes things more complicated. Maybe we can find some complexity in there. OrderCommand is an interface, because there are different kinds of command (create, update, cancel, execute, book, etc). So to see the validation we&#8217;ll have to look at a particular implementation:</p>
<pre>public class CreateOrderCommand implements OrderCommand {
    private Integer salesPersonId;
    private Integer clientId;
    private SourceSystem sourceSystem;
    private Integer productId;
    private Quantity quantity;
    private Price price;
    private Side clientSide;

    public void validate(OrderValidator validator,
                         ProductCatalog productCatalog,
                         ClientBook clientBook)
                throws ValidationException {
        validateRequiredFields(validator);
        validateClient(validator, clientBook);
        validateSalesPerson(validator);
        validateProduct(validator, productCatalog);
        validateQuantity(validator, productCatalog);
        validatePrice(validator, productCatalog);
    }

    private void validateRequiredFields(OrderValidator validator)
                 throws ValidationException {
        validator.notNull(salesPersonId, "salesPersonId");
        validator.notNull(clientId, "clientId");
        validator.notNull(sourceSystem, "sourceSystem");
        validator.notNull(productId, "productId");
        validator.notNull(quantity, "quantity");
        validator.notNull(side, "side");
    }

    private void validateClient(OrderValidator validator,
                                ClientBook clientBook)
                 throws ValidationException {
        validator.validate(clientBook.hasClient(clientId), "client does not exist");
    }

    ...
}</pre>
<p>Oh well, not too much complexity there either.</p>
<p>OK. I have shown enough of this system. What is my point? Well, it all looks the same! Yes&#8230; code at each level of this system looks the same. It is very hard to tell by looking at the code that one class is &#8216;enterprisey&#8217;, whereas another is &#8216;domainy&#8217;, other than by looking at their names. Where is the &#8216;large-system&#8217; code? This code all looks &#8217;small-system&#8217; to me. The complexity of code in each location is no more or less complex than in any other location, and it&#8217;s all pretty simple stuff.</p>
<p>All code, no matter what size of system it appears in, consists of the same language constructs to which is added some library usage plus whatever application specific abstractions are required. There is no difference between the code in &#8216;high-level&#8217; classes and that in &#8216;low-level&#8217; classes. A class doesn&#8217;t need to know that it is in a large system or a small system. The level of complexity at any point can be about the same, if you choose to distribute it appropriately.</p>
<p>What is true is that systems usually (but not always) become large over a longer period of time than small systems, giving them more time to accumulate bad decisions. There are however some practices that make it more likely that a system will suffer in this way. For example, ubiquitous use of language primitives to represent rich concepts invites complexity, subsequent attempts to work around the complexity, and introduction of &#8216;clever hacks&#8217; to avoid disturbing too much code. These &#8216;clever hacks&#8217; are often themselves the source of need for future workarounds.</p>
<p>The &#8216;large-system&#8217; problems start as choices about the small stuff. As an example consider the Side type in the CreateOrderCommand above. This represents the notion that an order can be a &#8216;buy&#8217; or a &#8217;sell&#8217; order. When we introduced this type, we had a choice. We could represent the concept of <em>side</em> with a language primitive (a char with value &#8216;B&#8217; or &#8216;S&#8217; maybe, a String with value &#8216;buy&#8217; or &#8217;sell&#8217;, a boolean named &#8216;buy&#8217; implying a sell if its value was false, etc.) or we could introduce something whose meaning was unequivocal. We chose the latter and in so doing we aid future development because we leave little room for misunderstanding, and we also allow safe extension of the notion of <em>side</em>. In this system, this concept did end up being extended with two more cases and dealing with those cases at all the decision points in the code (some polymorphic, some explicit) simply became an issue of looking at the compiler errors and understanding what the business wanted in each case, rather than having to track down each case, often in response to a defect found in production.</p>
<p>Another example of a &#8216;big system problem&#8217; is that in order to add a new feature, a new piece of data needs to be passed through a large number of interfaces before it is finally used. Sometimes, developers decide to circumvent the need to touch a large number of classes by using some shared mutable state. This is &#8216;chewing-gum and string&#8217; programming. While it preserves the appearance of the interfaces, it profoundly changes its semantics, introduces non-locality, hides something essential to understanding and will most likely result in defects (even without concurrency). It certainly results in something that has to be remembered or documented. Often this problem is due to a reluctance to add new abstractions &#8211; &#8216;primitive obsession&#8217; and concern about &#8216;proliferation of classes&#8217;; it is frequently the case that if various domain specific abstractions are being passed as parameters, then the data required for new features will fit into existing abstractions. If the new data does not fit, then something significant has happened and a team that thinks in terms of abstractions will not hesitate to make use of that new information to make their code more accepting of changes in the future.</p>
<p>When we maintain &#8216;big&#8217; systems, we are often involved with third party components. For example, the order management system above uses messaging systems, has an embedded HTTP server, persistence layers, etc. The degree to which these components pollute the application specific code is entirely a matter of choice. These components could have been allowed to run amok through the codebase above but instead are tightly contained and as a result, the code that deals with them amounts to a few dozen lines at the most, expressed in one or two classes in each case.</p>
<p>Collectively, the amount of code represented by these components completely dwarfs the order management system codebase. So the vast majority of the system is code that wasn&#8217;t even written by us. But all of those components do not require us to deal with &#8216;big system&#8217; problems. Why? Because most developers would rightly shy away from using a third party component if it invaded the rest of their codebase &#8211; consider the reaction of developers to using an &#8216;ORM&#8217; framework that requires all persistent classes to implement a framework interface &#8211; so the implementers of those components have taken great care to make sure that their stuff can be used in simple, non-invasive ways.</p>
<p>Given that at any one time, a developer sees a very small fraction of most codebases and it hardly matters if that fraction is 0.01% or 0.0001%, the difference between small systems and large systems is simply that we deem a system to be large when we can no longer keep track of the idiosyncrasies. And that can happen in very small codebases indeed. These &#8216;large system&#8217; problems are actually nothing to do with the size of the system, but instead entirely to do with their quality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2010/02/21/large-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Producing Systems that Do Not Rot</title>
		<link>http://www.casualmiracles.com/blog/2009/12/30/producing-systems-that-do-not-rot/</link>
		<comments>http://www.casualmiracles.com/blog/2009/12/30/producing-systems-that-do-not-rot/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 21:00:54 +0000</pubDate>
		<dc:creator>channing</dc:creator>
				<category><![CDATA[Quality]]></category>
		<category><![CDATA[Software Process]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=220</guid>
		<description><![CDATA[I was driven to write this article after reading Kirk Knoernschild&#8217;s blog about Rotting Design and felt I needed to say something.

In Kirk&#8217;s article he states two things, amongst others, which caught my attention:

Over time, at least a portion of every enterprise software system experiences the problem of rotting design.
Fred Brooks: &#8220;All repairs tend to [...]]]></description>
			<content:encoded><![CDATA[<p>I was driven to write this article after reading Kirk Knoernschild&#8217;s blog about <a title="Rotting Design" href="http://techdistrict.kirkk.com/2009/12/21/that-rotting-design/">Rotting Design</a> and felt I needed to say something.</p>
<p><span id="more-220"></span></p>
<p>In Kirk&#8217;s article he states two things, amongst others, which caught my attention:</p>
<ol>
<li>Over time, at least a portion of every enterprise software system experiences the problem of rotting design.</li>
<li>Fred Brooks: &#8220;All repairs tend to destroy the structure, to increase the entropy and disorder of the system. Less and less effort is spent on fixing the original design flaws; more and more is spent on fixing flaws introduced by earlier fixes. As time passes, the system becomes less and less well-ordered. Sooner or later the fixing ceases to gain any ground. Each forward step is matched by a backward one. Although in principle usable forever, the system has worn out as a base for progress.&#8221;</li>
</ol>
<p>My initial reaction to both of these was to be both irritated and depressed, particularly with Fred&#8217;s statement. However, my irritation is not with Kirk or Fred but rather the sad fact that they are right and that most people involved in software development use it as an excuse not to do better. Its a self-perpetuating phenomenon.</p>
<p>I find it doubly irritating because over the last 20 years I have seen a number of systems that do not rot in the manner described. Indeed, not only do they not rot they actually become easier to work with over time and have incredibly low bug counts.</p>
<p>So how did those teams do it?</p>
<h2>Trust and Respect</h2>
<p>Mutual trust between management, developers, users and analysts is of fundamental importance. When a developer says &#8220;no we can&#8217;t just add a column to the table&#8221; then people back off and respect the expert&#8217;s opinion. That&#8217;s not to say that questions shouldn&#8217;t be asked &#8211; quite the opposite. Because we trust each other we can ask questions in a non-confrontational, exploratory environment, but ultimately the expert&#8217;s opinion must be respected.</p>
<p>Trust also enables people to explore and develop in new and interesting ways without fear of failure, more of which below.</p>
<h2>People</h2>
<p>You cannot build high quality software with poor quality people.</p>
<p>Writing code is easy. Writing code that is easy to maintain, extend, doesn&#8217;t rot, doesn&#8217;t crash, doesn&#8217;t require a production support team, demands highly skilled, experienced people. I am not just talking about developers here; I include management, analysts, developers and anyone else involved in the system you are building.</p>
<h2>Process</h2>
<p>You cannot build high quality software with a poor quality process.</p>
<p>I&#8217;ve never seen a waterfall project succeed. Ever. Don&#8217;t do it. Royce never intended the wholesale adoption of the waterfall process which he described as &#8216;high risk and invites failure&#8217;. If you don&#8217;t know who I&#8217;m talking about then you have another problem. Go and learn something about process and where it comes from and where it&#8217;s going. Find out who Deming was while you&#8217;re at it. Read about iterative and incremental methods, Agile methods, Kanban and Lean, etc.</p>
<h2>Accepting Acceptable Failure</h2>
<p>By <em>acceptable failure</em> I do not mean that the system was deployed and it didn&#8217;t do what the users asked for or it fell over in a sorry heap. That is unacceptable failure.</p>
<p>Acceptable failure is to explore a solution to a problem and find that the solution does not work or is not good enough. This kind of acceptable failure must be going on as part of the discovery and learning process of the team. If it isn&#8217;t then I would be concerned that the system as a whole is not as good as it could be.</p>
<p>Accepting this kind of failure requires a deep respect and humility between all members of the team.</p>
<h2>Technical Practices</h2>
<p>Test everything. Everything!!! That means production code, scripts, batches, anything that makes your system run. Test everything without fail and without compromise.</p>
<p>Refactor everything. Everything!!! That means production code, unit tests, acceptance tests, scripts, batches, anything that makes your system run. Refactor everything without fail and without compromise.</p>
<p>If you code is difficult to refactor then you have a big problem. Stop everything and fix it. Today. Now. No, now!</p>
<p>Define <strong>DONE</strong>. I hear &#8220;its <em>development complete,</em> we just need to test it and fix it&#8221; far too often and its always in a failing system. To me, DONE means ready to go to production. Nothing less. Not ready for testing, or staging, or whatever else.</p>
<p>The deployment process should be fully automated. By that I mean you are able to go to a command line or equivalent, type a single command or press a button and sit back whilst the system is deployed. Don&#8217;t argue with me, I&#8217;ve done it often enough to know its possible. I&#8217;ll accept that retrofitting this to a legacy system is very, very difficult, but not impossible.</p>
<h2>The Real World</h2>
<p>I am sure a lot of readers are now thinking, &#8220;Yeah but in the real world blah blah blah&#8221;. First, YOU created your world!!! Second, this IS my real world. I am describing my experience and the experience of many successful developers I&#8217;ve worked with in a range of industries. Don&#8217;t bother arguing with me about whether this is feasible.</p>
<h2>No Time</h2>
<p>I am sure some readers are thinking, &#8220;We don&#8217;t have the time for all this testing and refactoring nonsense&#8221;. Time. What is meant by &#8216;time&#8217; here?</p>
<p>The <em>lack of time</em> argument usually surfaces when the development process values arbitrary targets, deadlines, measurements and, worst of all, maximum work in progress. This leads people to minimise the time taken for individual tasks today, rather than maximising the delivery of value overall. They never spend time investing in the system as a whole and, therefore, never reach the point where the costs of writing tests and refactoring is low.</p>
<p>In my experience, systems developed as I have described actually <em>facilitate</em> changes and additions rather than impede them. The code is malleable, understandable and a pleasure to work with.</p>
<h2>The Culture</h2>
<p>I have revisited a number of teams that have adopted good practices and have found something very remarkable. Even when the original team members have left and been replaced by new people, the culture of the original team survives and the quality of software produced is sustained.</p>
<p>The investment in good people, processes, and technical practices pays dividends for the life of the project with n<span style="font-family: Helvetica; line-height: normal;">o sign of rot at all.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2009/12/30/producing-systems-that-do-not-rot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>There Is Only One Codebase</title>
		<link>http://www.casualmiracles.com/blog/2009/12/23/there-is-only-one-codebase/</link>
		<comments>http://www.casualmiracles.com/blog/2009/12/23/there-is-only-one-codebase/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 14:13:52 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[Software Process]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=173</guid>
		<description><![CDATA[Some Casual Miracles consultants have recently been helping teams in which the central, unrecognised problem was that there were multiple streams of development that operated on different timescales (i.e. release dates were uncoordinated) but which shared a common codebase.

Each of the teams was putting a great deal of effort into resolving the issues that arise [...]]]></description>
			<content:encoded><![CDATA[<div><span style="font-family: Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="line-height: normal; font-size: small;">Some Casual Miracles consultants have recently been helping teams in which the central, unrecognised problem was that there were multiple streams of development that operated on different timescales (i.e. release dates were uncoordinated) but which shared a common codebase.</p>
<p><span id="more-173"></span></p>
<p>Each of the teams was putting a great deal of effort into resolving the issues that arise from this: difficulties pulling together a release because of conflicting changes, various strategies for avoiding the conflicting changes, tightly controlled ownership of modules producing a concentration of knowledge in one or a few people and bottlenecks in the process, building incredibly complex traceability matrices, etc.</p>
<p>Each of these streams was managed by different project managers (sometimes one project manager had two or more streams), but if there was management above that level (not always the case), it was advocating multiple streams so that ‘progress can be seen&#8217; in each area.</p>
<p>In addition, the business and project management teams tended to view the issues that arose from this approach as technical problems or as failures of the developers. This is a classic example of the kind of problem that W. Edwards Deming reasoned against throughout most of the last century; management prescribes working practices that cripple those who do the work, and then berate those same people for failing to achieve the results predicted by the project management theory.</p>
<p>It seems that the principle reason that the business and management continued to expect results that were repeatedly not forthcoming was that they simply did not understand how the streams necessarily interact in the one essential product of development &#8211; the codebase. In one case, development process &#8216;experts&#8217; were advocating an estimation method which depended not on the experience of the developers, but at least partially on developers’ estimates of the complexity of the class that must be developed in order to solve the problem. Any developer with the smallest experience will tell you that most development in object oriented systems is achieved by modifying existing classes, not by creating new ones. The same is true for every programming paradigm, if  &#8216;class&#8217; is replaced with its equivalent module concept in that paradigm.</p>
<p>This blog is an attempt to provide an example to business and management of why this approach will not work, why there is no general technical solution that does not dramatically increase complexity, and therefore, why the problem should be solved by a process change that starts with the business and management.</p>
<p>To achieve this, I will provide a series of example of the inevitable problems that arise. As most of my target audience will not understand any programming language, the examples will be in the form of a paragraph of text from a detective novel that has been ‘in production&#8217; for some time, and which is still in active development. Each paragraph represents a unit that a developer would manipulate (a &#8216;class&#8217; in object-oriented programming, for example). So imagine that the business provides requirements for how the novel should proceed, and the developers work on the necessary paragraphs to produce the desired result. Also imagine that this book, like software, will be released frequently and that, for example, bugs sometimes need emergency releases to correct.<br />
</span></span></div>
<h1>Example</h1>
<div><span style="font-family: Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="line-height: normal; font-size: small;">Here is the first paragraph for our consideration. Our detective is in some trouble:</span></span></div>
<p><span style="font-size: small;"></p>
<table class="wptable rowstyle-alt" id="wptable-2"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:1000px" align="left">Version 1</th>
	</tr>
	</thead>
	<tr>
		<td style="width:1000px" align="left">Bob woke up as icy water was thrown over him. His hands and feet were bound to his chair and he was blindfolded.</td>
	</tr>
</table><p>
</span></p>
<div><span style="font-family: Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="line-height: normal; font-size: small;"><br />
As an example of a single stream of development, a new requirement has come in. The business wants to enhance the descriptions in this paragraph, and there have been some complaints that the language seems a little &#8217;stilted&#8217;. The developers get to work straight away and produce the following, revised version.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;">
<p></p>
<table class="wptable rowstyle-alt" id="wptable-4"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:1000px" align="left">Version 2</th>
	</tr>
	</thead>
	<tr>
		<td style="width:1000px" align="left">Ice cold water hit Bob in the face and he wakes up with a start. He struggled but found that his hands and feet were tied tightly to his chair. He was blindfolded too.</td>
	</tr>
</table><p>
</p>
<div><span style="font-family: Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: small;"><span style="line-height: normal;"><br />
Although it&#8217;s still a little stilted, we’re up against the deadline and needs must; the business agrees to put this into production. Everybody is very pleased, some money is made available by senior management and a party is thrown.</p>
<p>Now, the business has decided that they don&#8217;t want Bob to be blindfolded, but instead want the room to be almost dark so that sinister shadows can be seen. Work has started on this, and the paragraph &#8211; now a work in progress &#8211; looks like this:<br />
</p>
<table class="wptable rowstyle-alt" id="wptable-5"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:1000px" align="left">Version 3 : Incomplete</th>
	</tr>
	</thead>
	<tr>
		<td style="width:1000px" align="left">Ice cold water hit Bob in the face and he wakes up with a start. He struggled but found that his hands and feet were tied tightly to his chair. As his vision cleared he realised the room was almost dark.</td>
	</tr>
</table><p>
</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="font-size: x-large;"><span><strong><span style="font-size: small;"><span style="font-weight: normal;"><br />
</span></span></strong></span></span></p>
<p>Now, a production bug has been found in V2; the tense is inconsistent in the first sentence. This is considered critical by the business, so they want an emergency bug fix. Clearly, the developers can&#8217;t simply fix the bug in V3 because it contains incomplete work for the next release. So the fix has to be based on version 2. Fortunately, developers have tools called &#8216;version control systems&#8217; or sometimes, erroneously, &#8216;configuration management systems&#8217;, that allow us to deal with this very problem. Every time a developer &#8216;commits&#8217; or &#8216;checks in&#8217; the changes from their ‘working copy’ (the one on their hard drive) to the version control system, the old version is superseded, but still retained by the version control system. When other developers &#8216;update&#8217; their local working copy from the version control system, they will see the changes that other developers have made. The version control system is therefore a way of retaining history and also allows developers to share their changes with each other in a controlled way.</p>
<p>Critically, for this emergency bug fix, it is possible to go back to earlier versions. So, the unfortunate developer chosen to fix the bug (the one who will be asked &#8216;is it done yet?&#8217; every 5 minutes by the worried project manager), can retrieve version 2 of the paragraph and &#8216;branch&#8217; it to create a version 2 bug fix branch. Now, side by side in the version control system we have these relevant versions of the paragraph (the bug fix is emboldened):</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-6"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:30px" align="left">Version 2 Bug Fix Branch</th>
		<th class="sortable" style="width:30px" >Version 3 : Incomplete</th>
	</tr>
	</thead>
	<tr>
		<td style="width:30px" align="left">Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. He was blindfolded too.</td>
		<td style="width:30px" >Ice cold water hit Bob in the face and he wakes up with a start. He struggled but found that his hands and feet were tied tightly to his chair. As his vision cleared he realised the room was almost dark.</td>
	</tr>
</table><p>
</p>
<p>This is great! The bug fix can be, and is, released from the bug fix branch as version 2.1. Everybody is a bit ashamed that such an obvious bug made it into production, so no party is thrown this time.</p>
<p>However, if we look at the version 3 branch (this is sometimes called the ‘trunk’ or the ‘head’ but I will refer to it here as just another branch), we can still see the bug. If nothing is done to correct it, we will have a regression when version 3 is released. As our developer is competent he will know that he has to <em>merge</em> his bug fix into the version 3 branch, or if version 3 has changed too much from version 2, figure out again how to fix the bug in version 3.</p>
<p>Because the version 3 branch is still very similar to the version 2 bug fix branch, it is easy to merge the fix in, and this is duly done:</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-7"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:500px" align="left">Version 2 Bug Fix Branch</th>
		<th class="sortable" style="width:500px" >Version 3 : Incomplete</th>
	</tr>
	</thead>
	<tr>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. He was blindfolded too.</td>
		<td style="width:500px" >Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. As his vision cleared he realised the room was almost dark.</td>
	</tr>
</table><p>
</p>
<p>If any more bug fixes are required in the released 2.x version, they can be made in the Version 2 bug fix branch and released without inadvertently releasing incomplete version 3 work.</p>
<p>Although simplified somewhat, the situation described above is a schematic of the common working practice of millions of developers worldwide. It works very well. The mechanisms used to achieve it are described in more detail by Mike Hogan <a href="http://www.youtube.com/watch?v=wVxkT24id60">here</a>. </p>
<p>However, this approach starts to break down if we introduce another significant stream of development that works on a different timescale. Suppose that a new senior manager has arrived with the firm conviction that detective novels work best when they are written in the first person. This is viewed as quite a significant change that will take quite a while to achieve, so a new ‘project’ is launched to effect this change. A new team is formed to do this work, because the business demands ongoing enhancements to the book, and these will occupy the current team. Also, there are bug fixes. So now, we have three streams with three different release cycles.</p>
<p>Now the developers have a choice. They can create a new branch for the ‘first person’ work or they can try to do both sets of work in the main development branch (the Version 3 branch). Now some developers may relish this challenge. ‘Maybe,’ they will say, ‘we can achieve this though configuration, so that the new stuff remains hidden until we turn it on’.</p>
<p>If we try that approach, those developers need to either have conditional logic everywhere to switch between the first person and third person forms, or they need to find some abstraction of the first person / third person parts of the sentence.</p>
<p>Lots of conditional logic is a recipe for bugs, so they choose to abstract the ‘personness’ away. In this case they will need to understand the parts of speech represented by the third person ‘Bob’ and the equivalent first person ‘me’ in the first sentence and ‘call a function’ or ‘define some constants’ that will provide the right value, depending on what is configured. I am not an expert grammarian, but the version 3 branch below represents an attempt at this:</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-8"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:500px" align="left">Version 2 Bug Fix Branch</th>
		<th class="sortable" style="width:500px" >Version 3 : Incomplete</th>
	</tr>
	</thead>
	<tr>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. He was blindfolded too.</td>
		<td style="width:500px" >Ice cold water hit [singular pronoun object or name] in the face and [singular pronoun subject] <b>woke</b> up with a start. [singular pronoun subject] struggled but found that [singular pronoun possesive adjective] hands and feet were tied tightly to his chair. As [singular pronoun possesive adjective] vision cleared [singular pronoun subject] realised the room was almost dark.</td>
	</tr>
</table><p>
</p>
<p>Clearly, now there is a lot more &#8216;code&#8217; required to support this decision. This is all stuff that developers working on version 3 or on the third person project have to think about whenever they do something. This is also stuff that obscures the ‘business logic’ of the paragraph. It is, as Fred Brooks termed it, ‘accidental complexity’.</p>
<p>In addition, if we look at the text as it would appear in the first person, it doesn’t actually work very well; surely, I would ‘wake up with a start because ice cold water hit me in the face’, rather than ‘Ice cold water hit me in the face and I woke up with a start’.</p>
<p>We could also say ‘Bob woke up with a start as ice cold water hit him in the face’ but now, <em>the first person project is imposing changes on the version 3 work &#8211; </em>i.e. the longer timescale project is affecting the work of the shorter timescale project. In the end, those changes imposed by the first person (longer timescale) project will become too many and too heavy for the version 3, 4, 5, etc stream to manage. In addition, the version 3, etc stream will continuously be introducing changes that the first person team will have to deal with, slowing down their efforts. So, clearly, we have not actually managed to separate the projects; they are both causing work for, and influencing, each other.</p>
<p>Now think about what would happen to this approach if the business decides that detective novels are far more exciting if they are phrased in the present tense. Because this is another big effort, another project is kicked off that is going to work with the same material as the original Version 3 project. We will end up with something like this:</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-9"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:500px" align="left">Version 2 Bug Fix Branch</th>
		<th class="sortable" style="width:500px" >Version 3 : Incomplete</th>
	</tr>
	</thead>
	<tr>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. He was blindfolded too.</td>
		<td style="width:500px" >Ice cold water [tense(‘to hit’)] [singular pronoun object or name] in the face and [singular pronoun subject] [tense(‘to wake up’] with a start. [singular pronoun subject] [tense(‘to struggle’)] but [tense(‘to find’)] that [singular pronoun possesive adjective] hands and feet [tense(‘to be’)] tied tightly to his chair. As [singular pronoun possesive adjective] vision [tense(‘to clear’)], [singular pronoun subject] [tense(‘to realise’)] the room [tense(‘to be’)] almost dark.</td>
	</tr>
</table><p>
</p>
<p>Actually, there isn’t enough in the above abstractions to correctly deal with verb agreement, and that would further complicate the paragraph &#8211; maybe a good grammarian could do better, but it is unquestionable that we can no longer understand the paragraph easily. The central point is that complexity is being introduced not because of complexity in a business domain, but because of complexity in the process.</p>
<p>By the way, did you notice at least two bugs in the Version 3 stream above? One of them was actually introduced in the previous example and one was introduced in this example. No? Exactly! This approach is not going to work.</p>
<p>What if we tried the same approach as we used for the bug fix branch earlier? Although it may seem logical, given what I have said above, to separate the two major streams of development by branching again, there are significant problems associated with branching over long time scales. The main one is that as more changes are made to each branch, it becomes increasingly difficult to see the similarities between the branches, and this makes merging of changes more and more difficult until it simply ceases to be possible. All work must be done twice, and the inevitable bugs that arise from this will need to be fixed.</p>
<p>To see this, consider what would happen if the ‘first person’ project was launched before the 2.1 bug had been spotted and fixed:</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-10"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:500px" align="left">Version 3: Incomplete</th>
		<th class="sortable" style="width:500px" >First Person Branch</th>
	</tr>
	</thead>
	<tr>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he wakes up with a start. He struggled but found that his hands and feet were tied tightly to his chair. As his vision cleared he realised the room was almost dark.</td>
		<td style="width:500px" >Ice cold water hit <b>me</b> in the face and <b>I</b> wake up with a start. <b>I</b> struggled but found that <b>my</b> hands and feet were tied tightly to <b>my</b> chair. As <b>my</b> vision cleared <b>I</b> realised the room was almost dark.</td>
	</tr>
</table><p>
</p>
<p>Now, upon reading the First Person Branch version, the events appear to be in the wrong order and the business requests some revisions (in <em>italics</em>):</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-11"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:500px" align="left">Version 3: Incomplete</th>
		<th class="sortable" style="width:500px" >First Person Branch</th>
	</tr>
	</thead>
	<tr>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he wakes up with a start. He struggled but found that his hands and feet were tied tightly to his chair. As his vision cleared he realised the room was almost dark.</td>
		<td style="width:500px" ><i><b>I</b> wake up with a start as ice cold water hit <b>me</b> in the face</i>. <b>I</b> struggled but found that <b>my</b> hands and feet were tied tightly to <b>my</b> chair. As <b>my</b> vision cleared <b>I</b> realised the room was almost dark.</td>
	</tr>
</table><p>
</p>
<p>Now, the production bug fix is required, and applied to the bug fix branch and merged into the version 3 branch as before:</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-12"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:500px" align="left">Version 2 Bugfix Branch</th>
		<th class="sortable" style="width:500px" align="left">Version 3: Incomplete</th>
		<th class="sortable" style="width:500px" align="left">First Person Branch</th>
	</tr>
	</thead>
	<tr>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. He was blindfolded too.</td>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. As his vision cleared he realised the room was almost dark.</td>
		<td style="width:500px" align="left"><i><b>I</b> wake up with a start as ice cold water hit <b>me</b> in the face</i>. <b>I</b> struggled but found that <b>my</b> hands and feet were tied tightly to <b>my</b> chair. As <b>my</b> vision cleared <b>I</b> realised the room was almost dark.</td>
	</tr>
</table><p>
</p>
<p>But, because of the revision to the first sentence in the first person branch, it is far harder to see how to merge the bug fix. We must now understand the restructuring of the sentence and identify where to place the <em>equivalent</em>, not identical change. If we do not do this, then we will have a regression when the first person branch finally goes into production for a bug that was eliminated several version earlier.</p>
<p>But of course, we <em>can</em> actually, correct the First Person Branch too, it just takes more effort (or, if you prefer, more time, money and risk).</p>
<p></p>
<table class="wptable rowstyle-alt" id="wptable-13"  cellspacing="1" cellpadding="3">
	<thead>
	<tr>
		<th class="sortable" style="width:500px" align="left">Version 2 Bugfix Branch</th>
		<th class="sortable" style="width:500px" align="left">Version 3: Incomplete</th>
		<th class="sortable" style="width:500px" align="left">First Person Branch</th>
	</tr>
	</thead>
	<tr>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. He was blindfolded too.</td>
		<td style="width:500px" align="left">Ice cold water hit Bob in the face and he <b>woke</b> up with a start. He struggled but found that his hands and feet were tied tightly to his chair. As his vision cleared he realised the room was almost dark.</td>
		<td style="width:500px" align="left"><i><b>I</b> <b>woke</b> up with a start as ice cold water hit <b>me</b> in the face</i>. <b>I</b> struggled but found that <b>my</b> hands and feet were tied tightly to <b>my</b> chair. As <b>my</b> vision cleared <b>I</b> realised the room was almost dark.</td>
	</tr>
</table><p>
</p>
<p>Furthermore, once version 3 has been released, version 4 will be required, and then version 5. The first person branch must include all of those enhancements too, suitably modified to suit the restructured sentences. Now add the complexity of the ‘present tense’ work on top of this. I don’t think another example is required to show how intricate (i.e. risky and defect-ridden) this is going to become.</p>
<p>So, getting the teams to work with exactly the same material doesn’t really work, and neither does branching the material and getting the teams to keep them synchronised.</p>
<p>In addition, consider the fact that we have looked at a single paragraph in these examples, but in a moderately sized project, it is not unusual to find thousands to hundreds of thousands of ‘paragraphs’ that must be kept consistent, not only internally, but with each other too. If this does not happen, defects will abound, regressions will occur and their will be (and is) a wailing and a gnashing of teeth. This is an indication that the word ‘risk’ that I have used several times is too weak; it is almost a certainty that this risk will materialise and the problems encountered will overwhelm the developers, and the result will be massive schedule slips for all streams.</p>
<h1><span style="letter-spacing: 0.0px;">Summary of the Problem</span></h1>
<p>The essential point is that running projects in this way is an utter project management and business fantasy. It <em>cannot</em> be done efficiently and <em>will</em> lead to problems that cost time, money and increase the risks associated with the project.</p>
<p>These are not technical problems because there is no sensible technical solution. Even though developers can work in these unproductive ways and, after a lot of pain for everybody involved, produce a viable result, choosing to do so is a project management or business decision. So even when the problem is ‘handled’ by the development team, the problem and its ‘solution’ is one <em>chosen</em> by project management or business; spend much more money, much more time and deal with the fallout, which will be significant. Developers cannot be held accountable for these consequences; they are entirely of the making of the project management and the business. The time, costs and risks associated with this approach must therefore be accepted by project management and the business.</p>
<p>If this is not considered acceptable then a simple fact must be understood: whenever you see a problem at one stage of a process that has no known solution at that stage, you must either be prepared to invest a lot of time (money) trying to find a solution in that or subsequent stages and accept the risk of failure, or you must look at a previous stage to prevent the problem from occurring.</p>
<p>Given that most business and project management teams are averse to spending the project budget by asking technical teams to research such problems (and in this case, there is very little hope of finding a technical solution), the only remaining option is to look at the approach chosen by project management and the business.</p>
<h1><span style="letter-spacing: 0.0px;">Avoiding the Problem</span></h1>
<p>One important step to take is to stop slicing the ‘resource pool’ and to start slicing the work in the right way. Obviously, arbitrary slicing of the work will not yield benefit; it has to be sliced in ways that result in deliverable pieces of functionality.</p>
<p>As an example of the kind of dysfunctional ‘allocation of resources’ we have seen, a recent project involved one ‘team’ of 7 developers. One of the developers was assigned to a piece of work that was estimated to take 9 elapsed months to complete, another 3 were assigned to another piece of work that was estimated at 7 months elapsed time, and the final three to another piece that was estimated at 3 months elapsed time.</p>
<p>Any piece of work that is estimated at 9 months of developer time can easily and efficiently, be worked on by 7 developers at once, and the result <em>will</em> be that, assuming the original estimate is good, the time to completion will reduce to just over a month. There will not be massive ‘communication overhead’ and developers will not be tripping over each other as a result of this. Our experience has been that the focus generated by this kind of approach actually keeps the whole effort on track, and can help to reduce the amount of work required. Once this piece of work has been completed, it can be released (and can start to produce some return on investment) and the team &#8211; now a genuine team &#8211; can move onto the next piece of work together.</p>
<p>In addition, it almost always the case that when a development team is handed a set of ‘requirements’, no matter how pared down the business thinks it is, more can be done to trim off work: by slimming each requirement down, by selecting a core subset that can be released and which can be rapidly followed by the remainder, by challenging the business on their understanding of the system as it stands, and many other approaches.</p>
<p>All of this amounts to a simple notion. In order to avoid the problems described above, the amount of work in progress needs to be reduced and the team organised around that work to get it <em>done</em>. It is poor project management and a poor process that requires several plates to be kept spinning at once.</p>
<p>The measure that we should value is the amount of work <em>done</em>, not the amount of work <em>in progress</em>. But what do we mean by ‘done’? If it is in production and providing business value, it is ‘done’. Otherwise, it is decidedly <em>not</em> done. Work that is <em>not done</em> is better not <em>started</em>, until it is possible to get it <em>done</em> quickly and efficiently.</p>
<p></span></span></div>
<p></span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2009/12/23/there-is-only-one-codebase/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Software Quality &#8211; Pragmatics</title>
		<link>http://www.casualmiracles.com/blog/2009/10/20/software-quality-pragmatics/</link>
		<comments>http://www.casualmiracles.com/blog/2009/10/20/software-quality-pragmatics/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 20:10:25 +0000</pubDate>
		<dc:creator>channing</dc:creator>
				<category><![CDATA[Quality]]></category>
		<category><![CDATA[Software Process]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=150</guid>
		<description><![CDATA[This article continues my series on Software Quality. My thesis is that we judge quality using the same inbuilt sense of aesthetics as we would a work of art or an everyday object, albeit at quite a high level of abstraction. 
The design industry has a lot to say about this kind of thing and [...]]]></description>
			<content:encoded><![CDATA[<p>This article continues my series on <a href="http://www.casualmiracles.com/blog/2009/03/13/16/">Software Quality</a>. My thesis is that we judge quality using the same inbuilt sense of aesthetics as we would a work of art or an everyday object, albeit at quite a high level of abstraction. </p>
<p>The design industry has a lot to say about this kind of thing and no one more so than Massimo Vignelli, who summarised his core ideas in <a href="http://www.vignelli.com/home/bookmagazine/canon.html">The Vignelli Canon</a>. I am following each part of the Canon, this part being Pragmatics.</p>
<p><b>Whatever we do, if not understood, fails to communicate and is wasted effort. &#8211; Vignelli</b></p>
<p>No matter how cleverly we design something, if it is not understood then that design has failed. Software is complex and some decisions will need explanation, but if the design is still not understood then the effort in producing it is wasted.</p>
<p>Complicated, confused designs are very common in our industry. They are often the result of confusion in the minds of their developers, analysts and users. A confused mind will produce a confused product. These projects usually limp along before collapsing, mercifully, under their own weight, but not after many years of very expensive and wasted effort.</p>
<p>We should be careful not to confuse a complex solution with an accidentally complicated one. Some systems are unavoidably complex and what we expect to find there, as in all systems, is a set of core principles that underpin the whole edifice. Without clear, strong and forceful decisions that provide structure to systems, there will be no clarity and plenty of confusion. This is not to say that those decisions are carved in stone. Constantly changing environments and requirements are a fact of life in software and so those decisions will need to be revisited and reworked. However, it is much easier to move from one set of clear and strong design decisions to another, than it is to rework a confused system.  </p>
<p>Having clear, strong and forceful decisions is the only pragmatic choice we can make. Allowing ambiguity and confusion is not pragmatic, it is simply sloppy and is the easy way out in the short term.</p>
<p>Vignelli sums it beautifully:</p>
<p>	•	We like Design to be forceful<br />
	•	We do not like limpy Design<br />
	•	We like Design to be intellectually elegant &#8211; that means elegance of the mind, not one of manners, elegance that is the opposite of vulgarity<br />
	•	We like Design to be beyond fashionable modes and temporary fads<br />
	•	We like Design to be as timeless as possible<br />
	•	We despise the culture of obsolescence<br />
	•	We feel the moral imperative of designing things that will last for a long time</p>
<p>This is pragmatism in any field, and no more so than in software.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2009/10/20/software-quality-pragmatics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TDD from a Control Theory Point of View</title>
		<link>http://www.casualmiracles.com/blog/2009/10/02/tdd-from-a-control-theory-point-of-view/</link>
		<comments>http://www.casualmiracles.com/blog/2009/10/02/tdd-from-a-control-theory-point-of-view/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 20:50:42 +0000</pubDate>
		<dc:creator>channing</dc:creator>
				<category><![CDATA[Quality]]></category>
		<category><![CDATA[Software Process]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=126</guid>
		<description><![CDATA[This article provides another argument for Test Driven Development from the point of view of a control system, and how it improves the stability of the development process.]]></description>
			<content:encoded><![CDATA[<p>Before becoming a developer, I was an academic at University College London. We built the world&#8217;s first homodyne and <a href="http://www.ee.ucl.ac.uk/UP/publications/Recent%20Publications_files/pdf/fibre_radio/highperf98_walton.pdf">heterodyne</a> <a href="http://en.wikipedia.org/wiki/Phase-locked_loop">phase locked loop</a> with semiconductor lasers for oscillators instead of electronic oscillators. Sounds easy, right? But the problem is that because lasers oscillate at high frequencies (it&#8217;s light after all), a delay of a few hundred picoseconds around the feedback loop is significant and results in the system becoming unstable.</p>
<p>Indeed, <em>any</em> system with feedback can become unstable if the delay around the loop is significant. There are things that one can do to prevent instability but the best thing to do is remove the delay if possible.</p>
<p>In software, there are many feedback loops. When you write code, often the first feedback you get is whether it compiles or not. Can you imagine the pain if that wasn&#8217;t the case? Waiting a few weeks to find out whether the code actually compiled would be ridiculous. Right?</p>
<p>Fortunately, most software developers have a go at making sure their software actually compiles. Some don&#8217;t, but thats a different article.</p>
<p>Testing is another feedback mechanism. So how is it sane to wait months before finding out that your code actually works? It isn&#8217;t, thats crazy talk. TDD helps in a number of ways: it helps you to think about <em>what</em> your code will do before you think about <em>how</em> it will do it; it provides a safety-net for all those refactorings you <em>will</em> need to do; and it tells you that the code you thought you wrote is what you actually wrote.</p>
<p>The instant feedback obtained by TDD is a stabilising mechanism to ensure that what is written is correct and that you haven&#8217;t broken anything else inadvertently because all that other code in the system is also tested.</p>
<p>But what is meant by stability in this context? </p>
<p>The main instability is the <em>code &#8211; wait &#8211; test &#8211; fix &#8211; repeat</em> cycle. During the wait and test phases, new code is being built on top of the broken code, and the fixes themselves often introduce new defects. This results in increasingly painful fix phases. What is worse is that there may be many overlapping loops like this which is utterly chaotic!</p>
<p>This chaotic process results in developers working in a panicked, crisis mode which leaves no time for refactoring, reflection about improving the codebase, or writing tests. It&#8217;s very demoralising as the deterioration in the codebase cannot be stopped.</p>
<p>The end result is a brittle, sprawling mess of a system that is now not in any state to be tested or repaired without heroic effort from the developers, and buy in from business stakeholders. And we know how that story ends&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2009/10/02/tdd-from-a-control-theory-point-of-view/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Different Interpretations</title>
		<link>http://www.casualmiracles.com/blog/2009/09/24/different-interpretations/</link>
		<comments>http://www.casualmiracles.com/blog/2009/09/24/different-interpretations/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 21:12:13 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[Software Process]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=121</guid>
		<description><![CDATA[As a retrospective facilitator I frequently see different parts of a team presenting different perceptions of the same event. In fact, this underlies a great many of the problems seen in teams.

This problem occurs no less frequently when there are conversations, often by phone, intended to clarify or analyse an issue but the participants leave [...]]]></description>
			<content:encoded><![CDATA[<p>As a retrospective facilitator I frequently see different parts of a team presenting different perceptions of the same event. In fact, this underlies a great many of the problems seen in teams.</p>
<p><span id="more-121"></span></p>
<p>This problem occurs no less frequently when there are conversations, often by phone, intended to clarify or analyse an issue but the participants leave with varying views of what has been decided or agreed. It is more frequent between team members with different roles (developers, business analysts, users, project managers, testers, etc).</p>
<p>The main reason this happens is that there is a lack of large scale feedback in the conversation. </p>
<p>The solution is usually to summarise the conversation at the end. The key is that the person who summarises it should be the person who initiated the conversation, <em>i.e.</em> the person who has been trying to find out the information. This now puts the questioner in the position of knowledgeable authority and gives the other party a chance to correct any misunderstandings or supply further information that they feel has been missed.</p>
<p>When I am the initiator of a discussion and I believe I have acquired all the information I need, I prefer to start the summary formally by making a statement such as &#8216;OK. Now let me summarise of all this and you can correct anything that I&#8217;ve got wrong&#8217;. This indicates to the other participants that you believe that the interrogative part of the conversation is finished, that the roles are changing, and that I am inviting corrections and won&#8217;t be offended if they are given. It also gives the other person a chance to indicate that they do not think they&#8217;ve finished giving you all the information you need.</p>
<p>The key part of this, as with any good summary, is that the information is presented much more concisely than it has in the preceding conversation and without any extraneous side paths. Remember to include decisions about what must be done, what is not going to be done and what still needs some decisions and who is going to do these things. If necessary, follow up with written notes about what has been discussed.</p>
<p>By following this simple protocol, I have seen extraordinary improvements in the effectiveness of several teams and their working relationships.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2009/09/24/different-interpretations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demand Quality: You Get What You Ask For</title>
		<link>http://www.casualmiracles.com/blog/2009/06/22/demand-quality-you-get-what-you-ask-for/</link>
		<comments>http://www.casualmiracles.com/blog/2009/06/22/demand-quality-you-get-what-you-ask-for/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 20:11:38 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[Quality]]></category>
		<category><![CDATA[Software Process]]></category>

		<guid isPermaLink="false">http://www.casualmiracles.com/blog/?p=105</guid>
		<description><![CDATA[&#8220;In the long run, men hit only what they aim at. Therefore, though they should fail immediately, they had better aim at something high.&#8221;  &#8211; Henry David Thoreau


I recently had occassion to phone Sky because my &#8217;set-top box&#8217; was misbehaving. While I was waiting in the queue for an operator, I was entertained by the requisite [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;In the long run, men hit only what they aim at. Therefore, though they should fail immediately, they had better aim at something high.&#8221;  &#8211; <em><strong>Henry David Thoreau</strong></em></p></blockquote>
</blockquote>
<p><span id="more-105"></span></p>
<p>I recently had occassion to phone Sky because my &#8217;set-top box&#8217; was misbehaving. While I was waiting in the queue for an operator, I was entertained by the requisite generic music, which was interrupted every 15 seconds or so in order that I may be given some useful piece of information about Sky or their services. One such interruption provided the following illumination: &#8220;Your set-top box is like a computer and so will need to be rebooted from time to time.&#8221;</p>
<p>I believe that this message crystalises the expectation that most people have of software; it is unreliable, mystical, needs manual support and is generally unsatisfactory.</p>
<p>On the other hand, Casual Miracles has recently completed an eleven month piece of work in a large investment bank. One of the reasons that we were asked to take part in this project was to &#8216;get it started&#8217; since the incumbent team had been unable to do so for four months. Another reason was that the organisation has trouble producing high quality software. Business users are frequently dissatisfied with work done for them and a significant support team is usually required. Nine months after we started, the software was put into production. In the four months since that release the users have expressed pleasure with the software, <em>no</em> bugs have been reported and the support team have not had a single event to deal with. The only reason it has not been available continuously is that it has been taken down for new releases.</p>
<p>While the first story is an indication of expectations held by the general population about software, the second is a story of possibility. Keep in mind that this is not a theoretical possibility; Casual Miracles achieves these kinds of results as a matter of course. They are actually not very hard to achieve. A small fraction of developers and teams actually seem to find it easier to achieve these results than the alternative low quality stuff that normally limps over the finishing line of a software development project.</p>
<p>In this article I am not going to talk about the mechanics of this achievement. Instead I want to talk about one  essential precondition. That is, the expectation of quality.</p>
<p>As evinced by the first story above, expectation is astonishingly low with respect to the quality of software. Although projects often start with grand ambitions (the grandness of which is frequently to do with size rather than quality), this usually rapidly subordinates to getting *something* done under a mass of bad approaches to management, implementation, analysis, politics, resourcing, etc.</p>
<p>In order to correct this problem a line needs to be drawn in the sand. Expectations need to be raised and a clear goal set. A system that performs the functions required by the business is necessary, but usually not sufficient. There are infrequent cases for which a piece of software can be said to have attained an appropriate level of quality merely because it doesn&#8217;t crash too frequently and its bugs are suitably hidden from the user but such circumstances are few and far between and should not be the aspiration of most development efforts.</p>
<p>At the very least we need a sort of Hypocratic Oath of software development &#8211; &#8216;Above all, do no harm&#8217;. But a better expectation is that the software will do its work in ways that bring joy rather than pain to the users and other stakeholders (including those who developed it). It must do this without need for significant support staff (if the developers are nervous about supporting it, pay attention!).  Planning to rely on support staff to handle the inevitable crashes, data integrity issues and other failures is woefully inadequate. The notion of bug triage is to be deplored.</p>
<p>However, along with the expectation of high quality comes a responsibility. It behooves ill of stakeholders, whatever their function, to expect one thing and then behave as if other things are more important. No man can serve two masters. </p>
<p>When Casual Miracles was asked to take part in the project described above, senior management specified a few things that should be achieved. First and most obvious, deliver the software in some reasonable time. Second, the project was a replacement for another system that had been in operation for almost two decades and the software that we were providing should be capable of being maintained for an equally long time. Third, help the incumbent team to adapt to our &#8216;new&#8217; way of doing things if we could, but do not let this requirement cause the first two to be threatened; if it could not be achieved, let senior management know so that they could take necessary action.</p>
<p>These were clear, non-conflicting goals. When the third goal did prove too difficult, senior management did what they had promised, thus affirming their commitment to the first two goals. These actions helped us to deliver the result that we did.</p>
<p>One of the most significant distractions from a high quality software product is the notion that time is excessively constrained and that quality should be sacrificed. This apprehension is often caused and maintained by business analysts, project managers and developers, rather than users or other, more senior stakeholders. But poor quality work is future waste. The appropriate thing to do, as Deming showed so many years ago, is to find and eliminate the cause of inadequate quality. This may be achieved simply by having the stakeholders confirm that quality is the goal and making adjustments elsewhere as necessary. If change does not follow, retraining may be necessary. If there is still no change, then more radical approaches are needed.</p>
<p>In short, if the expectation is low, so too will be the result. If you want a better result, expect it and admonish all stakeholders to expect it also. Then act consistently with those expectations.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casualmiracles.com/blog/2009/06/22/demand-quality-you-get-what-you-ask-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
