<?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>One brike at a time</title>
	<atom:link href="http://digitalbrikes.com/onebrikeatatime/feed/" rel="self" type="application/rss+xml" />
	<link>http://digitalbrikes.com/onebrikeatatime</link>
	<description>Notes on software development</description>
	<lastBuildDate>Thu, 22 Jul 2010 03:48:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Sonar the quality dashboard tool</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/07/21/sonar-the-quality-dashboard-tool/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/07/21/sonar-the-quality-dashboard-tool/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 03:48:04 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Driven]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=184</guid>
		<description><![CDATA[I thought I would share my new preferred tool: sonar. It is a web application that enables to visualize and exploit the results of static analysis tools, tests and dependency analysis tools. It gives a fantastic view of the overall quality of your code, highlights the problem areas and even enable you to visualize the [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Driven' --><!-- no icon for 'Open Source' --><p>I thought I would share my new preferred tool: <a href="http://www.sonarsource.org/">sonar</a>.</p>
<p>It is a web application that enables to visualize and exploit the results of static analysis tools, tests and dependency analysis tools. It gives a fantastic view of the overall quality of your code, highlights the problem areas and even enable you to visualize the highest priority items.</p>
<p>My favorite piece is the technical debt optional plugin. With some effort you can probably make it somewhat accurate for your particular circumstances. Which would be somewhat missing the point. Ideally you would want to use it as a benchmark value across organizations as the appetite for quality is already reflected in the rules you choose to include in the analysis.</p>
<p>And did I mention it is effortlessly populated from maven ?</p>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Sonar+the+quality+dashboard+tool+http://s79fp.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Sonar+the+quality+dashboard+tool+http://s79fp.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/07/21/sonar-the-quality-dashboard-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test Driven Development and Design by Contract, the return</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/07/08/test-driven-development-and-design-by-contract-the-return/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/07/08/test-driven-development-and-design-by-contract-the-return/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 02:54:54 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Driven]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=181</guid>
		<description><![CDATA[I wrote a long time ago about how I would like these two tools to be combined. In the end I gave it a shot and just posted that on github. I have not tried it in real life yet but I will soon. The README explains the intent and the design assumptions. Check the [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Design' --><!-- no icon for 'Driven' --><p>I wrote a long time ago about how I would like these two tools to be combined.</p>
<p>In the end I gave it a shot and just posted that on <a href="http://github.com/dbregeon/contracts">github</a>. I have not tried it in real life yet but I will soon. The README explains the intent and the design assumptions. Check the tests for some examples.</p>
<p>On the other end, nothing is more than valuable than your input so please let me know what you think about it.</p>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Test+Driven+Development+and+Design+by+Contract%2C+the+return+http://x9shr.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Test+Driven+Development+and+Design+by+Contract%2C+the+return+http://x9shr.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/07/08/test-driven-development-and-design-by-contract-the-return/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Normalizing story cost</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/05/19/normalizing-story-cost/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/05/19/normalizing-story-cost/#comments</comments>
		<pubDate>Wed, 19 May 2010 16:16:13 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=179</guid>
		<description><![CDATA[This article is the second in the series started with the use of cost. In agile software development the cost of a story has this interesting property that it is highly correlated to the time it takes to implement it. Consciously or unconsciously cost is used as a proxy variable for time. Actual implementation times [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Agile' --><p>
This article is the second in the series started with <a href="http://digitalbrikes.com/onebrikeatatime/2010/02/22/story-cost-uses-and-limits/">the use of cost</a>.
</p>
<p>
In agile software development the cost of a story has this interesting property that it is highly correlated to the time it takes to implement it. Consciously or unconsciously cost is used as a proxy variable for time. Actual implementation times in turn tend to be hijacked by managers to measure performance by comparing them to cost estimate. Points are often used to remove that parasitising.
</p>
<p>
While using points is good, what we really need, the purpose of estimating cost in the first place, is the ability to layout project  plans in terms of time. In comes velocity that enables the transformation back from points into time. I have witnessed enough attempts to manipulate the velocity either to look good when reporting in or to transform it into a measure of productivity (including at the individual level) to have entirely lost faith in its usefulness. Burn up charts are a lot more useful. They illustrate trends rather than instant pictures, they keep people at the project level rather than the individual contributor and they provide a view of the evolution of scope.
</p>
<p>
Finally let us focus on the estimation process. I firmly believe that this process is very important as it is unveiling the real work that will be needed to complete a story. It is a crucial analysis and design process. It is very unfortunate that the cost, the number, that comes out of the process considerably overshadows the other outcome: the establishment of common knowledge in the team. It is the learning that happened that is in practice the all important outcome. This learning is sometimes expressed in artifacts, from new stories being created, to new examples being attached to the story, to a change in the definition of done. All of which are rich expressions. Cost in contrast is the poorest of them all. Why then try to estimate it or even make the focus of the process?
</p>
<p>
Estimating should not be the focus of the analysis process. The focus of the analysis process should be to ensure the stories are ready to be implemented. In other words make them of a tractable size with an agreed upon definition of done. Tractable size means they all have more or less the same cost. The cost of the story becomes a measurable random variable that provides some indication on the predictability of the process. The distribution probability of that variable can be influenced by changing the process. And in return the effect of process changes can be measured usefully. It provides management with a tool to forecast the future and to influence it. It removes the cat and mouse game that estimate versus actuals tend to become. It helps measure the performance of the project rather than that of individuals. And last but not least it focuses project teams on risk adjusted value rather than cost to prioritise their work.
</p>
<p>
That is what we have been experimenting with for the last 10 months. Although we do not actually measure the monetary cost of a story but rather its lead time. It is the cost in terms of time, an acceptable approximation considering the previous argument that the bulk of cost is personnel. So far (excluding vacation induced outliers) we average 6.23 calendar days per story from analysis start to close with a standard deviation of 3.82. Our targets for those numbers are 8 and 2.5 respectively meaning we would trade a higher average for less fluctuation. The probability distribution derived from this data also enables us to make useful predictions about the possible lateness of a story, when the lead time breaks the 3 sigma barrier, and to react to it earlier. For instance a story that reaches 8 days of lead time has 28% lateness.</p>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Normalizing+story+cost+http://o3n5h.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Normalizing+story+cost+http://o3n5h.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/05/19/normalizing-story-cost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integer flyweight implementation</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/04/23/integer-flyweight-implementation/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/04/23/integer-flyweight-implementation/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 13:00:58 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Something for the week end]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=176</guid>
		<description><![CDATA[Here is a unit test that illustrates the Fly Weight implementation of Integers in Java. import junit.framework.TestCase; public final class TestIntegers extends TestCase { public void testValueOfGivesTheSameIntegerForSmallValues() { assertSame(Integer.valueOf(1), Integer.valueOf(1)); } public void testValueOfGivesADifferentIntegerForSomeValues() { assertNotSame(Integer.valueOf(13333333), Integer.valueOf(13333333)); assertEquals(Integer.valueOf(13333333), Integer.valueOf(13333333)); } public void testNew() { assertNotSame(new Integer(1), new Integer(1)); assertEquals(new Integer(1), new Integer(1)); } public void [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Something for the week end' --><p>Here is a unit test that illustrates the <a href="http://web.cs.wpi.edu/~gpollice/cs509-s04/Patterns/Flyweight.htm">Fly Weight</a> implementation of Integers in Java.</p>
<pre>import junit.framework.TestCase;

public final class TestIntegers extends TestCase {
    public void testValueOfGivesTheSameIntegerForSmallValues() {
        assertSame(Integer.valueOf(1), Integer.valueOf(1));
    }

    public void testValueOfGivesADifferentIntegerForSomeValues() {
        assertNotSame(Integer.valueOf(13333333), Integer.valueOf(13333333));
        assertEquals(Integer.valueOf(13333333), Integer.valueOf(13333333));
    }

    public void testNew() {
        assertNotSame(new Integer(1), new Integer(1));
        assertEquals(new Integer(1), new Integer(1));
    }

    public void testValueOfGivesTheSameIntegerForAutoBoxing() {
        assertSame((Integer) 1, (Integer) 1);
    }

    public void testValueOfGivesADifferentIntegerForAutoBoxing() {
        assertNotSame((Integer) 13333333, (Integer) 13333333);
        assertEquals((Integer) 13333333, (Integer) 13333333);
    }
}</pre>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Integer+flyweight+implementation+http://dmbf4.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Integer+flyweight+implementation+http://dmbf4.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/04/23/integer-flyweight-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java BigDecimal equality</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/03/06/java-bigdecimal-equality/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/03/06/java-bigdecimal-equality/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 01:00:26 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Something for the week end]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=173</guid>
		<description><![CDATA[Here is why you should use compareTo to find out whether two BigDecimals represent the same number or not. import java.math.BigDecimal; import junit.framework.TestCase; public final class TestBigDecimal extends TestCase { public void testBigDecimalZeroEqualsBigDecimalValueOfZero() { assertTrue(BigDecimal.ZERO.equals(BigDecimal.valueOf(0))); } public void testBigDecimalZeroNotEqualsBigDecimalValueOfZeroDot() { assertFalse(BigDecimal.ZERO.equals(BigDecimal.valueOf(0.))); } public void testBigDecimalZeroEqualsBigDecimalValueOfZeroString() { assertTrue(BigDecimal.ZERO.equals(new BigDecimal("0"))); } public void testBigDecimalZeroEqualsBigDecimalValueOfZeroDotString() { assertTrue(BigDecimal.ZERO.equals(new BigDecimal("0."))); [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Something for the week end' --><p>Here is why you should use compareTo to find out whether two BigDecimals represent the same number or not.</p>
<pre>import java.math.BigDecimal;

import junit.framework.TestCase;

public final class TestBigDecimal extends TestCase {
    public void testBigDecimalZeroEqualsBigDecimalValueOfZero() {
        assertTrue(BigDecimal.ZERO.equals(BigDecimal.valueOf(0)));
    }

    public void testBigDecimalZeroNotEqualsBigDecimalValueOfZeroDot() {
        assertFalse(BigDecimal.ZERO.equals(BigDecimal.valueOf(0.)));
    }

    public void testBigDecimalZeroEqualsBigDecimalValueOfZeroString() {
        assertTrue(BigDecimal.ZERO.equals(new BigDecimal("0")));
    }

    public void testBigDecimalZeroEqualsBigDecimalValueOfZeroDotString() {
        assertTrue(BigDecimal.ZERO.equals(new BigDecimal("0.")));
    }

    public void testBigDecimalZeroNotEqualsBigDecimalValueOfZeroDotZeroString() {
        assertFalse(BigDecimal.ZERO.equals(new BigDecimal("0.0")));
    }

    public void testBigDecimalZeroComparesToBigDecimalValueOfZeroDotAsZero() {
        assertEquals(0, BigDecimal.ZERO.compareTo(BigDecimal.valueOf(0.)));
    }

    public void testBigDecimalZeroComparesToBigDecimalValueOfZeroDotZeroStringAsZero() {
        assertEquals(0, BigDecimal.ZERO.compareTo(new BigDecimal("0.0")));
    }
}</pre>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Java+BigDecimal+equality+http://gw97x.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Java+BigDecimal+equality+http://gw97x.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/03/06/java-bigdecimal-equality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something for the week-end</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/02/27/something-for-the-week-end/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/02/27/something-for-the-week-end/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 15:54:01 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=171</guid>
		<description><![CDATA[I used to like overloading methods to provide a default behaviour for any object and a specialised one for some select types. That&#8217;s possible when the language supports multiple dispatch. It is not possible in Java: import junit.framework.TestCase; public class TestOverloading extends TestCase { public static final class OverloadedClass { public String thisIsA(final Object o) [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Design' --><p>I used to like overloading methods to provide a default behaviour for any object and a specialised one for some select types. That&#8217;s possible when the language supports <a href="http://en.wikipedia.org/wiki/Multiple_dispatch">multiple dispatch</a>. It is not possible in Java:</p>
<pre>
import junit.framework.TestCase;

public class TestOverloading extends TestCase {
    public static final class OverloadedClass {
        public String thisIsA(final Object o) {
            return "Object";
        }

        public String thisIsA(final String s) {
            return "String";
        }
    }

    public void testIsCallingObjectFromObject() {
        final OverloadedClass tested = new OverloadedClass();
        final Object value = new Object();

        assertEquals("Object", tested.thisIsA(value));
    }

    public void testIsCallingObjectFromString() {
        final OverloadedClass tested = new OverloadedClass();
        final Object value = new String();

        assertEquals("Object", tested.thisIsA(value));
    }

    public void testIsCallingStringFromString() {
        final OverloadedClass tested = new OverloadedClass();
        final String value = new String();

        assertEquals("String", tested.thisIsA(value));
    }
}
</pre>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Something+for+the+week-end+http://tx3t7.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Something+for+the+week-end+http://tx3t7.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/02/27/something-for-the-week-end/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Story cost, uses and limits.</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/02/22/story-cost-uses-and-limits/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/02/22/story-cost-uses-and-limits/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 04:04:50 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=169</guid>
		<description><![CDATA[Last tuesday&#8217;s meeting at the BayAPLN was a talk by Jim Highsmith entitled &#8216;Beyond Scope&#8217;. The talk itself was very interesting and did trigger some thoughts that I will try to organise in four or five posts. This first one is about cost. How is cost estimated ? There are numerous articles, methods and even [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Agile' --><p>Last tuesday&#8217;s meeting at the BayAPLN was a talk by <a href="http://www.jimhighsmith.com/">Jim Highsmith</a> entitled &#8216;Beyond Scope&#8217;. The talk itself was very interesting and did trigger some thoughts that I will try to organise in four or five posts. This first one is about cost.</p>
<h2>How is cost estimated ?</h2>
<p>There are numerous <a href="http://www.agilemanagement.net/Articles/Weblog/FeatureComplexityPoints.html">articles</a>, <a href="http://www.infoq.com/articles/agile-estimation-techniques">methods</a> and even <a href="http://www.amazon.com/gp/product/0131479415?ie=UTF8&amp;tag=digitalbrikes-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0131479415">books</a><img src="http://www.assoc-amazon.com/e/ir?t=digitalbrikes-20&amp;l=as2&amp;o=1&amp;a=0131479415" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" /> that describe how to do cost estimation for agile stories. In my limited world the consensus seem to be that cost estimation should be relative rather than absolute. It can be expressed with numbers or words. It also seems that one of the preferred methods for cost estimation is <a href="http://en.wikipedia.org/wiki/Planning_poker">the planning poker</a>. In that space more <a href="http://en.wikipedia.org/wiki/Function_point">formal methods</a> have been proved to work although they are rather tedious to practice.</p>
<h2>Cost estimation for planning</h2>
<p>Usually it is used to give an estimate of when the project will finish. As it happens, in software intensive systems, most of the operating expense is the payroll and so setting the length of the project is also essentially fixing its cost. And in many cases people will jump from one notion to the next. Now the trick is that to go from relative cost estimation to cost planning, some time equivalence has to be defined.</p>
<p>While we all know that circumstances (such as technical debt, absence of key team members and the colour of the sky) will make these equivalences vary over time, they are usually used in a normative way. In other words the team&#8217;s performance will be evaluated with regard to its ability to match the equivalent time that was initially chosen. In the worst cases it will be used to perform individual evaluation.</p>
<h2>Cost as a proxy for value.</h2>
<p>This however is a minor managerial effect. Use of cost estimation has a few implications of its own. First, while this is rarely expressed it means the scope is set. Otherwise, the planning is meaningless and what use do we have of the cost estimation ? I hear your answer: to give the business an idea of how to prioritise the stories. I was more than once on the losing side of arguing the business should prioritise before cost is known. In other words, cost is used as a proxy to value.</p>
<p>Is cost a good proxy for value ? Is something expensive a worst value than something cheap ? Or the contrary ? Worse, in a software system actual cost is usually dependent on the sequencing of stories. Or on how many stories a structural cost can be amortised.</p>
<h2>To sum up.</h2>
<p>Cost estimation is easy to come up with. It appears to be an easy control variable to measure the performance of the development process. It also appears to be an easy indicator to determine the priority of stories. In reality, is it good at any of that ?</p>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Story+cost%2C+uses+and+limits.+http://na5hn.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Story+cost%2C+uses+and+limits.+http://na5hn.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/02/22/story-cost-uses-and-limits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding &#8216;given a&#8217; to rspec</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/02/16/adding-given-a-to-rspec/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/02/16/adding-given-a-to-rspec/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 17:41:21 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Driven]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=167</guid>
		<description><![CDATA[Over the past few months I have grown to like the &#8216;given a&#8217; syntax more and more (described here). So when I recently reactivated my Ruby On rails home project (see brikeyard deployed on heroku), I thought I would add that syntax to my rspec examples rather than use before(:each). I have not spent too [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Driven' --><p>Over the past few months I have grown to like the &#8216;given a&#8217; syntax more and more (described <a href="http://digitalbrikes.com/onebrikeatatime/2009/03/01/the-state-of-my-testing-art/">here</a>). So when I recently reactivated my Ruby On rails home project (see <a href="http://brikeyard.heroku.com">brikeyard</a> deployed on heroku), I thought I would add that syntax to my rspec examples rather than use before(:each).</p>
<p>I have  not spent too much time thinking about where to put this code. Nor did I spend much time peeling away the nested modules inside rspec. Ideas to make this better are very welcomed. I would also love to collect some feedback on this before I make a fool of myself by proposing its inclusion in rspec proper. Thanks in advance for your help !</p>
<p>Here is how the setup looks like in one of the specs:</p>
<pre>
describe :something do
    given {
      a StatisticalControl
      a WorkItem, {:lead_time =&gt; 1}
      another WorkItem, {:lead_time =&gt; 3}
      a ProcessStage, {:work_in_process =&gt; [a_work_item, another_work_item]}
      a ControlChart
      @project = Project.new
      @project.stub!(:lead_time_control).and_return(a_statistical_control)
      @project.stub!(:closed_stage).and_return(a_process_stage)
    }

    it "should do something useful" do
		(...)
    end
end
</pre>
<p>And here is what I added to my spec_helper.rb file:</p>
<pre>
def a(type, stubs ={})
  stub = mock_model(type, stubs)
  member_name = type.name.gsub(/[A-Z]/) {|match|
    "_#{match.downcase}"
  }
  instance_eval("
        @a#{member_name} = stub
          def a#{member_name}
            return @a#{member_name}
          end
      ")
end

def another(type, stubs ={})
  stub = mock_model(type, stubs)
  member_name = type.name.gsub(/[A-Z]/) {|match|
    "_#{match.downcase}"
  }
  instance_eval("
        @another#{member_name} = stub
          def another#{member_name}
            return @another#{member_name}
          end
      ")
end

class Spec::Rails::Example::FunctionalExampleGroup
  class &lt;&lt; self
    def given &amp;block
      before(:each, &amp;block)
    end
  end
end

class Spec::Rails::Example::ModelExampleGroup
  class &lt;&lt; self
    def given &amp;block
      before(:each, &amp;block)
    end
  end
end
</pre>
<p>Please let me know what you think. I welcome suggestions to improve.</p>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Adding+%E2%80%98given+a%E2%80%99+to+rspec+http://n7nzn.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Adding+%E2%80%98given+a%E2%80%99+to+rspec+http://n7nzn.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/02/16/adding-given-a-to-rspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Process Metrics</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2010/01/28/process-metrics/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2010/01/28/process-metrics/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 01:24:15 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Driven]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=163</guid>
		<description><![CDATA[In our process we have started using two metrics in addition to the cumulative flow diagram indicator. These metrics are tracked against target values to measure if the process is in statistical control. The first metric is the lead time. It measures the time in days between the moment a work item enters our process [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Agile' --><!-- no icon for 'Driven' --><p>In our process we have started using two metrics in addition to the cumulative flow diagram indicator. These metrics are tracked against target values to measure if the process is in statistical control.</p>
<p>The first metric is the lead time. It measures the time in days between the moment a work item enters our process and the moment it is declared finished and exists the process.</p>
<p>The second metric is the throughput period (the inverse of the throughput rate) which is the time in days between the end dates of successive work items. If we note two cards C1 and C2 with start dates SD1 and SD2 and end dates ED1 and ED2, then the lead time for C1 is (ED1 &#8211; SD1) in days and the cadence for that period is ED2 &#8211; ED1.</p>
<p>Over a period of time these measures can be plotted against a target mean (10 days of lead time and 4 days of throughput period) and a target deviation (5 days for the lead time and 2 days for the throughput period). These targets can be changed independently as our process matures. Improvement to the means benefit the delivery speed. Improvements to the deviation benefits the predictability.</p>
<p>Finally you will find <a href="http://digitalbrikes.com/onebrikeatatime/wp-content/uploads/2010/01/ProjectManagement.nmbtemplate">here</a> the model I use (for Apple&#8217;s Numbers) to visualize these process metrics.</p>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Process+Metrics+http://bz6oc.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Process+Metrics+http://bz6oc.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2010/01/28/process-metrics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lesson learned: do not clog your workstream</title>
		<link>http://digitalbrikes.com/onebrikeatatime/2009/11/24/lesson-learned-do-not-clog-your-workstream/</link>
		<comments>http://digitalbrikes.com/onebrikeatatime/2009/11/24/lesson-learned-do-not-clog-your-workstream/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 18:49:53 +0000</pubDate>
		<dc:creator>Denis</dc:creator>
				<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://digitalbrikes.com/onebrikeatatime/?p=161</guid>
		<description><![CDATA[Learning this lesson cost us two weeks of throughput. Here is what happened. We started work on a feature that was dependent on external resources for completion. In anticipation of a quick completion (based on past experience with other providers), we filled our &#8220;Analysis Compete&#8221; queue with work that depended on the completion of the [...]]]></description>
			<content:encoded><![CDATA[<!-- no icon for 'Agile' --><p>Learning this lesson cost us two weeks of throughput. Here is what happened.</p>
<p>We started work on a feature that was dependent on external resources for completion. In anticipation of a quick completion (based on past experience with other providers), we filled our &#8220;Analysis Compete&#8221; queue with work that depended on the completion of the work in development.</p>
<p>Of course, completion was delayed and it involved a lot of waiting and very little work. So the bottleneck resource, me, was under utilized. As the delays dragged from day to day we tagged the work with an issue and thought of pushing some other work instead. But all the work in our stream was dependent on the resolution of the issue. I did not want to break WIP limits so we could not simply start a new work item. So I kept myself busy with some refactoring.</p>
<p>There are two bad things that stemmed from this. First we lost throughput. Second I did work that will not be verified as a story would have. The good thing to come out is that we reflected on how to improve.</p>
<p>The first improvement is obviously to limit dependencies between work items that are in process. In particular those for which we do not fully control the completion. The second improvement is to try to avoid saturating our queues, in other words avoid a one hundred percent utilization of them. The third improvement is that we are now comfortable dropping work in process when we find out that either it cannot be completed in a reasonable amount of time or it does not have the value we anticipated.</p>
<p>What do you think ? Are there other lessons that we should learn ? Do you have any advice on how to anticipate these issues ?</p>
<p align="right"><a class="tt" href="http://twitter.com/home/?status=Lesson+learned%3A+do+not+clog+your+workstream+http://o93wh.th8.us+#digitalbrikes" title=" "><img class="nothumb" src="http://digitalbrikes.com/onebrikeatatime/wp-content/plugins/tweet-this/icons/tt-twitter-big1.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Lesson+learned%3A+do+not+clog+your+workstream+http://o93wh.th8.us+#digitalbrikes" title=" "> </a></p>]]></content:encoded>
			<wfw:commentRss>http://digitalbrikes.com/onebrikeatatime/2009/11/24/lesson-learned-do-not-clog-your-workstream/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
