<?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>Platformability &#187; Software Engineering</title>
	<atom:link href="http://blog.caplin.com/tag/software-engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.caplin.com</link>
	<description>SWIMMING WITH TECHNOLOGY</description>
	<lastBuildDate>Thu, 09 Sep 2010 09:20:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>If you can&#8217;t think of a good name, use a bad one</title>
		<link>http://blog.caplin.com/2010/09/09/if-you-cant-think-of-a-good-name-use-a-bad-one/</link>
		<comments>http://blog.caplin.com/2010/09/09/if-you-cant-think-of-a-good-name-use-a-bad-one/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 09:09:02 +0000</pubDate>
		<dc:creator>Ian Alderson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Dev Tips]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=3660</guid>
		<description><![CDATA[I&#8217;ve just read a great tweet from @KentBeck that provides an interesting solution for something that I have always struggled with. if you don&#8217;t have a good name for it, give it a bad name. a really, really bad name so you&#8217;ll fix it later. Good naming is hard Sometimes when writing a class, or [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just read a <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL0tlbnRCZWNrL3N0YXR1c2VzLzIzOTU3ODgwMDY4">great tweet</a> from <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R3aXR0ZXIuY29tL0tlbnRCZWNr">@KentBeck</a> that provides an interesting solution for something that I have always struggled with.</p>
<blockquote><p>if you don&#8217;t have a good name for it, give it a bad name. a really, really bad name so you&#8217;ll fix it later.</p></blockquote>
<p><b>Good naming is hard</b></p>
<p>Sometimes when writing a class, or occasionally even a method, I struggle to find a good name for it. After a while I give up trying to find a good name for it and chose something that is just about &#8220;OK&#8221;, a working title if you like. Unfortunately this tends to create poor generic names, such as &#8220;ConnectionManager&#8221;, that vaguely make sense, but can obfuscate the true purpose of the class. I&#8217;ve lost count of the number of times that I&#8217;ve heard developers say something like, &#8220;Oh, so that&#8217;s what that class does!&#8221;</p>
<p>The problem with these &#8220;OK&#8221; names is that they tend to have a strong inertia to change. Typically I have the intention of going back and renaming it, however the longer I leave it the less likely this is. If the name is adequate, but not great, then why go through the effort of renaming it? Sure, some IDEs, such as Eclipse, do a superb job at refactoring, however a lot of the code we write here at Caplin is in JavaScript and the tool support for this isn&#8217;t as good. Regardless of this, even where there is good tool support, there are time pressures, backward compatibility and other considerations that lead to &#8220;OK&#8221; names sticking.</p>
<p><span id="more-3660"></span></p>
<p><b>Overcoming renaming inertia</b></p>
<p>This brings me back to <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9LZW50X0JlY2s=">Kent Beck</a>&#8216;s excellent suggestion. If you provide something with a really bad name the inertia to change it will be non-existent. You will have to change it before it becomes part of your public API or other developers have to use it.</p>
<p>The great thing with this is that it allows you to write your class and see what it responsibilities are before you provide its proper name. This should lead to meaningful names that define exactly what a class does, ensuring no one is surprised when they try to use it.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=3660" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/09/09/if-you-cant-think-of-a-good-name-use-a-bad-one/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What&#8217;s in a Persona?</title>
		<link>http://blog.caplin.com/2010/08/11/whats-in-a-persona/</link>
		<comments>http://blog.caplin.com/2010/08/11/whats-in-a-persona/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 09:10:48 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[sdlc]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[User Experience]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1626</guid>
		<description><![CDATA[Personas are a tool we use at Caplin to help us REALLY understand who our users are and engage everyone in the company in building something compelling that will delight our users. No I am not talking about a sexy, gimmicky UI which when first stumbled upon people go &#8220;Wow&#8221;. I am referring to a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS8yMDEwLzA4LzExL3doYXRzLWluLWEtcGVyc29uYS8="><img class="size-full wp-image-3342 aligncenter" src="http://blog.caplin.com/wp-content/uploads/personas.jpg" alt="" width="620" height="254" /></a></p>
<p>Personas are a tool we use at Caplin to help us REALLY understand who our users are and engage everyone in the company in building something compelling that will delight our users. No I am not talking about a sexy, gimmicky UI which when first stumbled upon people go &#8220;Wow&#8221;. I am referring to a product that seamlessly fits into the user&#8217;s life, compliments their day-to-day tasks and basically engages them to a level that they no longer can live without it.</p>
<p><strong>So what is a persona?</strong></p>
<p><strong><span id="more-1626"></span></strong>A persona represents a group of users that hold the same goals &#8211; an archetype. These goals are not &#8220;I like to use this feature&#8221; BUT &#8220;what&#8217;s the end goal in an individual&#8217;s or company&#8217;s day/week. It&#8217;s only when we look outside the boundaries forged over time that we begin to really understand their needs. If you are passionate about doing this you will deliver products that delight.</p>
<p>The persona also includes people that are driven by the same motives, driving like-minded behavior with common frustrations.  Just think how powerful this is when developing a product. There will be no self-referential in a meeting room arguing, &#8221; No, I think it should do this because that&#8217;s what I would like to do&#8221;, or &#8220;how cool would it be if we added this feature&#8221;.</p>
<p>EVERYTHING is referred back to the persona &#8211; does it help them achieve their goal? No? Then out. Yes, then how?  Design meetings become focused on making the persona&#8217;s life easier,  aligned to removing the pain points in their process. No swirling gimmicky feature just because the technology can do it, it has to add value to the persona.</p>
<p>At Caplin, we have found it has removed the ambiguity around the term &#8220;user&#8221; and has also been a great educational tool on who our users are. We are now seeing many developers refer to the persona by name in discussions and has really helped us &#8220;walk in the shoes&#8221; of our users and show real empathy during the development process.</p>
<p>The real power also comes when you use Personas with <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS8yMDEwLzAzLzA0L25hcnJhdGl2ZS1qb3VybmV5LW1hcHMv" 0="target="_self"">Narrative Journey Maps</a>.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1626" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/08/11/whats-in-a-persona/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The beauty of small tests</title>
		<link>http://blog.caplin.com/2010/04/15/the-beauty-of-small-tests/</link>
		<comments>http://blog.caplin.com/2010/04/15/the-beauty-of-small-tests/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 11:53:35 +0000</pubDate>
		<dc:creator>Andrew Darnell</dc:creator>
				<category><![CDATA[Quality Assurance]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Ajax Testing]]></category>
		<category><![CDATA[Dev Tips]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1342</guid>
		<description><![CDATA[When tests are small, a test failure means just one thing – somewhere in these ten lines of code which are being tested, there is an error.  Ok, sometimes this can mean that there is an error in the test script, or a there is a failure, or change of expectation, but fundamentally, it pin-points [...]]]></description>
			<content:encoded><![CDATA[<p>When tests are small, a test failure means just one thing – somewhere in these ten lines of code which are being tested, there is an error.  Ok, sometimes this can mean that there is an error in the test script, or a there is a failure, or change of expectation, but fundamentally, it pin-points the cause of the failure to a <strong>small</strong> target, which usually means that debugging becomes <strong>trivial</strong>.</p>
<p>When an end to end acceptance test fails, the failure could be due to any one of a large number of source lines or expectations changes across a large body of code.  Debugging may be quick, but often isn&#8217;t.</p>
<p><span id="more-1342"></span></p>
<p>Small tests run faster too! While a typical small test may take 10 milliseconds to run, a large acceptance test may take twenty minutes.</p>
<p>Just a small back of the envelope calculation tells us that if a developer checks in twice a day and saves an hour each time because potential issues had been found before check-in with fast small tests, and the faster feedback, or has reduced their time spent debugging &#8211; that is two hours a day per developer that could be put to better use.</p>
<blockquote><p>2 hours a day * thirty developers * two working weeks = <strong>600 additional hours</strong> per two week iteration available.</p></blockquote>
<p>This is equivalent to adding seven and a half developers to the team!</p>
<p><strong>What value do you get from tests of different sizes?</strong></p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1342" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/04/15/the-beauty-of-small-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agile – Tests = Fragile</title>
		<link>http://blog.caplin.com/2010/04/09/agile-%e2%80%93-tests-fragile/</link>
		<comments>http://blog.caplin.com/2010/04/09/agile-%e2%80%93-tests-fragile/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 14:55:46 +0000</pubDate>
		<dc:creator>Andrew Darnell</dc:creator>
				<category><![CDATA[Quality Assurance]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Dev Tips]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1341</guid>
		<description><![CDATA[The nature of agile projects, with lots of small releases mean that there are a lot of test runs to execute if you want to have any confidence in the code and the product. Ignoring this testing just generates projects which will fail – not may fail &#8211; will fail, categorically will fail! There are [...]]]></description>
			<content:encoded><![CDATA[<p>The nature of agile projects, with lots of small releases mean that there are a lot of test runs to execute if you want to have any confidence in the code and the product.</p>
<p>Ignoring this testing just generates projects which will fail – not may fail &#8211; will fail, <strong>categorically will fail!</strong></p>
<p>There are two sets of tests that are critical here&#8230;</p>
<p><strong>Good unit test coverage and a TDD approach to development</strong> ensure that the rest of the organisation is supplied with product that works as developers expect it to.</p>
<p><strong>Component tests and functional acceptance test</strong>s ensure that the product does what the product owner expects it to.</p>
<ul>
<li>Practically, the only way to do solid testing on new features is to have a stable product.</li>
<li>Practically, the only way to assure a stable product is to either have solid regression testing on each release or to not make any changes.</li>
<li>Practically, the only way to make sure that adequate regression testing is done is to automate the regression tests (unit, component, functional).</li>
</ul>
<p>Without these tests in place, iterating quickly places an impossible to meet burden of verification demand on the testers and product owners, which just gives you a <strong>fragile</strong> process not an <strong>agile</strong> one.</p>
<p><strong> Is your process Agile or Fragile?</strong></p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1341" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/04/09/agile-%e2%80%93-tests-fragile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tech Talk &#8211; Behaviour Driven Development</title>
		<link>http://blog.caplin.com/2010/03/18/tech-talk-behaviour-driven-development/</link>
		<comments>http://blog.caplin.com/2010/03/18/tech-talk-behaviour-driven-development/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 11:37:32 +0000</pubDate>
		<dc:creator>Ian Alderson</dc:creator>
				<category><![CDATA[Tech Talks]]></category>
		<category><![CDATA[Behaviour Driven Development]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[Test Driven Development]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1634</guid>
		<description><![CDATA[Last week several of my colleagues and I watched a Google Tech Talk on Beyond Test Driven Development: Behaviour Driven Development, presented by Dave Astels way back in March 2006. Although four years can seem like an eternity within software development, I found this video extremely pertinent to what I find myself doing today. I [...]]]></description>
			<content:encoded><![CDATA[<p>Last week several of my colleagues and I watched a <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS91c2VyL0dvb2dsZVRlY2hUYWxrcw==">Google Tech Talk</a> on <b>Beyond Test Driven Development: Behaviour Driven Development</b>, presented by <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9EYXZlX0FzdGVscw==">Dave Astels</a> way back in March 2006.</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/XOkHh8zF33o&#038;hl=en_GB&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/XOkHh8zF33o&#038;hl=en_GB&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>Although four years can seem like an eternity within software development, I found this video extremely pertinent to what I find myself doing today. I have been following the principles of <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9UZXN0LWRyaXZlbl9kZXZlbG9wbWVudA==">Test Driven Development</a> (TDD) for many years now, however this is the first time I have really delved into <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9CZWhhdmlvcl9kcml2ZW5fZGV2ZWxvcG1lbnQ=">Behaviour Driven Development</a> (BDD). I would thoroughly recommend watching <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZGVvLmdvb2dsZS5jby51ay92aWRlb3BsYXk/ZG9jaWQ9ODEzNTY5MDk5MDA4MTA3NTMyNCYjMDM4O2VpPXNzV1lTN3o2RXRubS1BYlJqNGptQWcmIzAzODtxPUJleW9uZCtUZXN0K0RyaXZlbitEZXZlbG9wbWVudDorQmVoYXZpb3VyK0RyaXZlbitEZXZlbG9wbWVudCM=">the video</a> if you have 45 minutes to spare, however, if not, I have summarised the notes I took whilst watching it below.</p>
<p><span id="more-1634"></span></p>
<h2>My Notes</h2>
<ul>
<li>BDD is an evolution of TDD. Dave Astels described it as what TDD looks like if it is done well.</li>
<li>When talking about unit tests, what is a unit? Is it a method? Is it a class? The definition of unit is ambiguous.</li>
<li>BDD is attempting to move away from several of the words that Dave Astels believes have negative connotations after their use within TDD:
<ul>
<li>Instead of calling something a test it&#8217;s called a specification or <b>spec</b> for short.</li>
<li>Instead of using assertions we should use <b>expectations</b> instead. Anyone using mock objects will already be familiar with this concept.</li>
</ul>
</li>
<li>One of the key things to avoid is state based testing. Depending on the internal state of an object to verify a particular method works correctly breaks encapsulation, even if the test is intentionally meant to be friendly with the class it&#8217;s testing. This leads to fragile tests and creates a barrier to refactoring.</li>
<li>The focus with RSpec was to make it readable. The writer and reader should not have to remember things like whether the first argument to the assertion is the actual or expected value.</li>
<li>Although Dave Astels jokes that he has until version 1.0 to rename the <code>should</code> method with <code>must</code> it looks like he either lost the argument or changed his mind about it; RSpec is now version 1.3 and <code>should</code> is still being used.</li>
<li>In TDD there is a tendency to create a one-to-one relationship between a class and its test. BDD says that we should be creating specs that verify a particular behaviour, rather than writing tests for each class and its methods. A coverage tool can be used to ensure that all possible code paths have been exercised.
<ul>
<li>The example that was given for this were the specs for <code>EmptyCollection</code> which might be &#8220;should return empty iterator&#8221;, &#8220;should have zero size&#8221; and &#8220;should return is empty true&#8221;.</li>
</ul>
</li>
</ul>
<h2>Some BDD Frameworks</h2>
<ul>
<li><a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JzcGVjLmluZm8v">RSpec</a> &#8211; The BDD framework for Ruby that Dave Astels is talking about in the video.</li>
<li><a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2piZWhhdmUub3JnLw==">JBehave</a> &#8211; A BDD framework for Java.</li>
<li><a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3Zpc2lvbm1lZGlhLmdpdGh1Yi5jb20vanNwZWM=">JSpec</a> &#8211; A BDD framework for JavaScript.</li>
<li><a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2N1a2VzLmluZm8v">Cucumber</a> &#8211; A BDD framework with implementations in various languages, including Ruby, Java, .NET, Flex and web applications.</li>
</ul>
<p>Please <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9CZWhhdmlvcl9kcml2ZW5fZGV2ZWxvcG1lbnQjVG9vbHM=">look here</a> for a more comprehensive list.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1634" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/03/18/tech-talk-behaviour-driven-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Caplin Tech Talk Series, by the self-elected programme chair ;-)</title>
		<link>http://blog.caplin.com/2010/03/16/caplin-tech-talk-series-by-the-self-elected-programme-chair/</link>
		<comments>http://blog.caplin.com/2010/03/16/caplin-tech-talk-series-by-the-self-elected-programme-chair/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 16:12:37 +0000</pubDate>
		<dc:creator>Andrew Darnell</dc:creator>
				<category><![CDATA[Tech Talks]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[techtalk]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1719</guid>
		<description><![CDATA[As QA manager at Caplin, I manage a very busy team of test engineers. Previous to starting at Caplin, I was the European Test Engineering Manager at Google. While there I gained a few helpful tips to encourage ongoing learning, brainstorming, discussion and a bit of entertainment despite the typical time constraints of a busy testing environment. [...]]]></description>
			<content:encoded><![CDATA[<p>As QA manager at Caplin, I manage a very busy team of test engineers.</p>
<p>Previous to starting at Caplin, I was the European Test Engineering Manager at Google. While there I gained a few helpful tips to encourage ongoing learning, brainstorming, discussion and a bit of entertainment despite the typical time constraints of a busy testing environment.</p>
<p>One of these ideas is regular tech talks. I find a short mental break from my usual week looking into something completely different can spur a number of interesting ideas and some excellent discussion amongst participants.</p>
<p><strong>The Caplin Tech Talk Series</strong></p>
<p><span id="more-1719"></span></p>
<p>We introduced Caplin’s Tech Talk series in October. These weekly(ish) talks have proved to be a great success, with attendance from across the company, not just from the test team.</p>
<p>The Tech Talks usually begin with either a live speaker, or a video from the internet, with questions and discussion during and after. While the the videos are valuable, it is often the resulting discussion that makes them worthwhile. We&#8217;ve generated a lot of great ideas and the discussion is often animated and thought-provoking. Thankfully, not quite as animated as when the Blues Brothers play <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZGVvLmdvb2dsZS5jb20vdmlkZW9wbGF5P2RvY2lkPS0zMDI2NjY2NjYzMTEzNTkyNzAx">&#8220;Rawhide&#8221;</a> <img src='http://blog.caplin.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>At Google, tech talks are done with a live speaker, and often recorded for posterity. Many of these are available on YouTube and Google Video. Other sources of good videos are the <a  0="id="kqov"" 1="title="Yahoo" 2="developer" 3="channel"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RldmVsb3Blci55YWhvby5uZXQvYmxvZ3MvdGhlYXRlci8=">Yahoo developer channel</a>, various conference videos (e.g. <a  0="id="mr6y"" 1="title="The" 2="Irrational" 3="Tester"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zdGlja3ltaW5kcy5jb20vTWVkaWEvVmlkZW8vRGV0YWlsLmFzcHg/V2ViUGFnZT0xNjY=">James Lyndsay</a>, <a  0="id="v3r2"" 1="title="Seven" 2="Years" 3="on:" 4="What" 5="the" 6="agile" 7="maifesto" 8="left" 9="out."" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zdGlja3ltaW5kcy5jb20vTWVkaWEvVmlkZW8vRGV0YWlsLmFzcHg/V2ViUGFnZT05OQ==">Brian Marick</a>, <a  0="id="ky0y"" 1="title="James" 2="Gosling's" 3="Toy" 4="Show" 5="2009" 6="Java" 7="One"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2phdmEuc3VuLmNvbS9qYXZhb25lLzIwMDkvZ2VuZXJhbF9zZXNzaW9ucy5qc3A=">James Gosling</a>), <a  0="id="hr.2"" 1="title="TED" 2="-" 3="Ideas" 4="worth" 5="spreading"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy50ZWQuY29tLw==">TED</a>, etc.</p>
<p>Most of the talks are technical in nature to suit the general audience though we do throw in a couple of more general productivity, business focussed or more general interest talks.</p>
<p>We originally launched the Caplin Tech Talk series with the following few topics, trying to get a mix of things to interest a broad range of people.</p>
<ul>
<li><a  0="id="ryhq"" 1="title="Misco" 2="Hervery" 3="-" 4="The" 5="Clean" 6="Code" 7="Talks" 8="-" 9="Mr" 10="Untestable!"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PXdFaHU1N3BpaDV3">Misco Hervery &#8211; The Clean Code Talks &#8211; Mr Untestable!</a></li>
<li><a  0="id="nqyp"" 1="title="iPhone" 2="Game" 3="Development" 4="Channel"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS91c2VyLzcxc3F1YXJlZA==">iPhone Game Development Channel</a> - <a  0="id="pnn7"" 1="title="71Squared"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy43MXNxdWFyZWQuY29tLw==">71Squared</a></li>
<li><a  0="id="b5eq"" 1="title="GTAC" 2="2007:" 3="Simon" 4="Stewart" 5="-" 6="Web" 7="Driver"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PXRHdTF1ZDdoazVJ">GTAC 2007: Simon Stewart &#8211; Web Driver</a> followed by the <a  0="id="rai6"" 1="title="Steel" 2="Cage" 3="Knife" 4="Fight"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PVZsei1XbWNyQkw4">Steel Cage Knife Fight</a>.</li>
<li><a  0="id="p1_4"" 1="title="JavaScript:" 2="The" 3="Good" 4="Parts" 5="-" 6="Doug" 7="Crockford"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWhRVlRJSkJab29r">JavaScript: The Good Parts &#8211; Doug Crockford</a></li>
<li><a  0="id="xq87"" 1="title="Brad" 2="Neuberg" 3="—" 4="Introduction" 5="to" 6="HTML5"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RldmVsb3Blci55YWhvby5jb20veXVpL3RoZWF0ZXIvdmlkZW8ucGhwP3Y9bmV1YmVyZy1odG1sNQ==">Brad Neuberg — Introduction to HTML5</a></li>
<li><a  0="id="ir:s"" 1="title="Linus" 2="Torvalds" 3="on" 4="git"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PTRYcG5LSEpBb2s4">Linus Torvalds on git</a></li>
<li><a  0="id="ikn7"" 1="title="David" 2="Allen:" 3="Getting" 4="Things" 5="Done" 6="(Knowledge" 7="Work" 8="Athletics)"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PVFvN3ZVZEtUbGhr">David Allen: Getting Things Done (Knowledge Work Athletics)</a></li>
</ul>
<p>We encourage ideas from the across the company, and have often discovered really interesting talks based on these contributions.</p>
<p>Recently we had a “Productivity Theme” where we watched <a  0="id="r7at"" 1="title="Allen" 2="Hutchison"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FsbGVuLmh1dGNoaXNvbi5vcmcv">Allen Hutchison&#8217;s</a> <a  0="id="onjv"" 1="title="Fireside" 2="Chat" 3="with" 4="Tim" 5="Ferriss"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWk4ZnlJaHN2amhjJmFtcDtmZWF0dXJlPXJlbGF0ZWQ=">&#8216;fireside chat&#8217;</a> with <a  0="id="poz-"" 1="title="Tim" 2="Ferriss" 3="Wikipedia" 4="Entry"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9UaW1vdGh5X0ZlcnJpc3M=">Tim Ferriss</a>, author of the <a  0="id="lek_"" 1="title="“The" 2="4" 3="Hour" 4="Work" 5="Week”"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hbWF6b24uY29tL2dwL3Byb2R1Y3QvMDMwNzM1MzEzMz9pZT1VVEY4JmFtcDt0YWc9YW5kcjBjLTIwJmFtcDtsaW5rQ29kZT1hczImYW1wO2NhbXA9MTc4OSZhbXA7Y3JlYXRpdmU9MzkwOTU3JmFtcDtjcmVhdGl2ZUFTSU49MDMwNzM1MzEzMw==">“The 4 Hour Work Week”</a> and discussed some of his concepts including Manufactured Emergencies, Personal Outsourcing and Testable Experiments. Because the topics lend themselves to a wider audience we got a really good turnout and some useful discussion.</p>
<p>Occasionally, after a talk, we will watch something light-hearted for a couple of minutes&#8230; e.g. <a  0="id="b.bv"" 1="title="Bobby" 2="McFerrin" 3="at" 4="TED"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy50ZWQuY29tL3RhbGtzL2JvYmJ5X21jZmVycmluX2hhY2tzX3lvdXJfYnJhaW5fd2l0aF9tdXNpYy5odG1s">Bobby McFerrin at TED</a>, or <a  0="id="v0sq"" 1="title="Humorous" 2="subtitles" 3="over" 4="a" 5="clip" 6="of" 7="the" 8="film" 9="'The" 10="Downfall'" 11="[Der" 12="Untergang]﻿"" href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PUF6bDRucUxuNC1Z">&#8220;Hitler&#8217;s Nightly build fails&#8221;</a></p>
</p>
<p><strong>What talks have you seen that were great?</strong></p></p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1719" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/03/16/caplin-tech-talk-series-by-the-self-elected-programme-chair/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imprecise Accuracy is better than Precise Inaccuracy</title>
		<link>http://blog.caplin.com/2010/03/05/imprecise-accuracy-is-better-than-precise-inaccuracy/</link>
		<comments>http://blog.caplin.com/2010/03/05/imprecise-accuracy-is-better-than-precise-inaccuracy/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 14:53:41 +0000</pubDate>
		<dc:creator>Ian Alderson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1428</guid>
		<description><![CDATA[Last week I blogged about how an estimate is not a guarantee. A small, but important, omission from that post was the distinction between an accurate estimate and a precise estimate. Frequently accuracy and precision seem to be considered the same thing. The critical difference was highlighted when I went on an agile course run [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I blogged about how <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2Jsb2cuY2FwbGluLmNvbS8yMDEwLzAyLzI2L2FuLWVzdGltYXRlLWlzLW5vdC1hLWd1YXJhbnRlZS8=">an estimate is not a guarantee</a>. A small, but important, omission from that post was the distinction between an accurate estimate and a precise estimate.</p>
<p>Frequently accuracy and precision seem to be considered the same thing. The critical difference was highlighted when I went on an agile course run by <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9NaWtlX0NvaG4=">Mike Cohn</a>. He demonstrated the difference by asking the question of when your birthday was?</p>
<p><span id="more-1428"></span> </p>
<p>I could answer this question by saying it’s in November. This is accurate and in some cases might be a good enough answer, however it is not precise and certainly wouldn’t help if you were planning on organising a surprise party. However if I had said the 2nd December I would have given a precise answer, although completely inaccurate.</p>
<p>What I have learnt from this is that in software development it&#8217;s more important to focus on making an estimate accurate, rather than trying to be precise. I like the approach taken in <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9QbGFubmluZ19wb2tlcg==">planning poker</a> where there are quantized buckets that your estimates can fit into. The difference between a story being sized at 1 story point and 2 is huge; the second is twice the size of the first.</p>
<p>However the difference between a story sized at 20 story points and 21 is insignificant. In fact, how can we possibly tell that one is marginally larger than the other? There is also a danger that the extra precision suggests a high level of confidence in our estimates, which, in my experience, just doesn&#8217;t happen in software development. In this case it makes more sense to estimate both at 20 story points and allow <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5leHRyZW1lcHJvZ3JhbW1pbmcub3JnL3J1bGVzL3ZlbG9jaXR5Lmh0bWw=">velocity</a> to work its magic of how much work to take on during a sprint.</p>
<p>At the end of the day it is better to be imprecisely accurate than it is to be precisely inaccurate.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1428" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/03/05/imprecise-accuracy-is-better-than-precise-inaccuracy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Estimate is not a Guarantee</title>
		<link>http://blog.caplin.com/2010/02/26/an-estimate-is-not-a-guarantee/</link>
		<comments>http://blog.caplin.com/2010/02/26/an-estimate-is-not-a-guarantee/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 12:57:27 +0000</pubDate>
		<dc:creator>Ian Alderson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[kanban]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1212</guid>
		<description><![CDATA[The statement that an estimate is not a guarantee might sound obvious but it often feels anything but. Over the years I have frequently heard managers complain that something has taken longer than was anticipated and have been told to improve the estimates. Of course at times the estimates have been inaccurate, with features taking [...]]]></description>
			<content:encoded><![CDATA[<p>The statement that an estimate is not a guarantee might sound obvious but it often feels anything but. Over the years I have frequently heard managers complain that something has taken longer than was anticipated and have been told to improve the estimates.</p>
<p>Of course at times the estimates have been inaccurate, with features taking far more time to implement than was initially predicted. The question is how to learn from these experiences to help improve your estimates. This is especially pertinent for software engineers within financial services because this same conundrum is at the heart of pricing financial instruments.</p>
<p>This article looks at how the <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5pbnZlc3RvcGVkaWEuY29tL3Rlcm1zL3IvcmF0aW9uYWx0aGVvcnlvZmV4cGVjdGF0aW9ucy5hc3A=">Rational Expectations Theory</a> can help you improve your estimates in software development. It starts by looking at estimating something much easier than a software enhancement, your journey time into work, and demonstrates when that estimate should be considered good or bad. It then looks how this can be applied to software development.</p>
<p><span id="more-1212"></span></p>
<h2>Rational Expectations Theory</h2>
<p>A few years ago, I was introduced to the <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5pbnZlc3RvcGVkaWEuY29tL3Rlcm1zL2UvZWZmaWNpZW50bWFya2V0aHlwb3RoZXNpcy5hc3A=">Efficient Market Hypothesis</a> whilst reading about how stocks are priced. This hypothesis is built upon the Rational Expectations Theory. Paraphrasing this theory, it states that an individual bases their estimate on:</p>
<ol>
<li>Their rational outlook</li>
<li>All the available information</li>
<li>Their previous experiences</li>
</ol>
<p>Although both the hypothesis and the theory are out of favour with many economists, the principles of rational expectations struck a chord with me.</p>
<p><b>Rational Expectations applied to Journey Times</b></p>
<p>To demonstrate rational expectations in practice, consider the question of how long it will take you the next time you travel into work? Assuming that you don&#8217;t work at home, aren&#8217;t starting a brand new job and haven&#8217;t just moved homes, then this is something that you should be pretty good at. After all you have an abundance of experience making that journey.</p>
<p>My estimate for my door to door journey time would be an hour. However there is a pretty big deviation between my fastest and slowest ever times. Every now and again my interconnections align perfectly and I can make the journey in 45 minutes. On the other hand, it has taken me 3 hours when my train broke down and, to compound matters, the tube line I needed to complete my journey was closed.</p>
<p>Rational Expectation Theory says that estimate of 1 hour is good because it is the equilibrium of my times. An estimate of 45 minutes would be bad because it&#8217;s overly optimistic and I&#8217;d rarely expect to meet it. An estimate of 3 hours is also bad because it is too pessimistic since it has only occurred once, and the circumstances were exceptional.</p>
<p>The theory also states that the estimate is based on all available information. My estimate of 1 hour would no longer be reasonable if there was a weather forecast for tomorrow predicting snow. In Britain <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9UaGVfd3JvbmdfdHlwZV9vZl9zbm93">snow is renowned</a> for crippling the travel network. It doesn&#8217;t matter whether I have heard the weather forecast or not, it is my responsibility to find out all relevant information to aid my estimate. Ignorance is no excuse.</p>
<p><b>Rational Expectations applied to Development</b></p>
<p>I like the Rational Expectation Theory because I think its three rules capture the essence of what estimating in software development is about. Prior to reading about the theory I didn&#8217;t think too much about how I came up with an estimate, it was pretty much a gut feel. Now I realise that subconsciously these rules were actually what were going through my mind. The theory helps me to break the estimate into its constituent parts.</p>
<p>Applying the theory to development leads to these conclusions:</p>
<ul>
<li>Two features on the backlog, in the same area of the code base, with a comparable depth and level of complexity should have similar estimates.</li>
<li>Knowledge about how easily a new feature might be implemented within the current code base is important. If you know the code will need some refactoring in order to implement the new functionality cleanly, then this should be allowed for. Of course the <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9EaW1pbmlzaGluZ19yZXR1cm5z">law of diminishing returns</a> applies here; familiarity with, rather than intimate knowledge of, how the feature might be implemented will be good enough in most cases.</li>
<li>Allow for your past experiences with your code base. Take the case where the two similar features have been sized at 1 day (or story point, or other unit of measurement). Whilst working on the first you uncover some unexpected issues, and it ends up taking 4 days to complete. Does it still make sense for the second item to still be sized at 1 day? The answer to this depends on which of these two scenarios the overrun fell into:
<ol>
<li>If the reason it took much longer to complete is systematic and likely to affect the estimates for all the other features, then <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5leHRyZW1lcHJvZ3JhbW1pbmcub3JnL3J1bGVzL3ZlbG9jaXR5Lmh0bWw=">project velocity</a> will be able to compensate for it. The relative sizes of the estimates are still the same.</li>
<li>If the reason was localised to the code surrounding that feature then it is only rational to keep the estimate at 1 day if I believe that the problems were an anomaly and won&#8217;t impact the other feature.</li>
</li>
</ol>
</ul>
<p><b>Well, that&#8217;s nice in Theory&#8230;</b></p>
<p>I find that the Rational Expectation Theory is a useful reminder of what to do when estimating, however in software development we are never building the same thing twice (we are <a href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Eb24="t_repeat_yourself\">DRY</a> here aren&#8217;t we?). As a result the idea of an equilibrium point is non-existent; we are dealing with a unique piece of development with a sample set of one. However a lot of the time we are doing similar things that we&#8217;ve done before, so we do have a reasonable point of reference for comparison.</p>
<h2>When is an Estimate bad?</h2>
<p>In my example of a journey to work I estimated that it would take an hour. I should be pretty good at knowing how long this takes since I have made the journey over 2,000 times. If the journey takes me an hour and a half tomorrow does that make it a bad estimate? That depends. If there was planned engineering work causing a reduced service that I could have found out about in advance, then it was a bad estimate. I should have allowed for the impact of the engineering work. If the delay was caused by my train breaking down then the estimate was rational and therefore wasn&#8217;t bad. After all, it is just a estimate, not a guarantee.</p>
<p>The same logic applies to estimates given for development. We never have the luxury of having written exactly the same functionality many times previously, but there are often significant overlaps. Provided that your estimates are rational, then you can be confident that things should average out. Some features will take longer to write than estimated whilst others will take less time. Also don&#8217;t be afraid to re-estimate specific features if fresh evidence comes to light that shows that the estimate for a particular feature is irrational.</p>
<h2>Afterthought: A World Free of Estimates</h2>
<p>At Caplin we have spent the last few months trialling <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FnaWxlcHJvZHVjdGRlc2lnbi5jb20vYmxvZy8yMDA5L2thbmJhbl9vdmVyX3NpbXBsaWZpZWQuaHRtbA==">Kanban</a> with several of our internal development teams, which offers a idyllic world where estimates aren&#8217;t needed.</p>
<p>I am still trying to grapple with the implications of this, and am looking forward to understanding it better. My gut feeling is even with Kanban estimates will still be necessary at a high level due to the inexorable fact that the priority of some features will always be based on the cost to build them, which is a multiple of number of people working on it by the time taken by them to build it.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1212" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/02/26/an-estimate-is-not-a-guarantee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing APIs for Backwards Compatibility</title>
		<link>http://blog.caplin.com/2010/02/19/testing-apis-for-backwards-compatibility/</link>
		<comments>http://blog.caplin.com/2010/02/19/testing-apis-for-backwards-compatibility/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 17:07:22 +0000</pubDate>
		<dc:creator>Ian Alderson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Quality Assurance]]></category>
		<category><![CDATA[Caplin Trader]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1137</guid>
		<description><![CDATA[A couple of weeks ago, I wrote about Agile Framework Development and the various techniques that we have used here at Caplin to build our APIs in a way that is sympathetic to agile methodologies. One of the key problems with the iterative development of an API is how to ensure that it remains backwardly [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago, I wrote about <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=LzIwMTAvMDIvMDIvYWdpbGUtZnJhbWV3b3JrLWRldmVsb3BtZW50Lw==">Agile Framework Development</a> and the various techniques that we have used here at Caplin to build our APIs in a way that is sympathetic to agile methodologies. One of the key problems with the iterative development of an API is how to ensure that it remains backwardly compatible. Although each new release of an API is focussed on providing more functionality, easier use, or increased robustness for its users, those same users want their existing code to continue working when they upgrade.</p>
<p>This article addresses the issue of how to identify, with confidence, whether an API is backwardly compatible or not. As I mentioned previously  there are times when an API is just too incorrect to be kept, however the decision for a breaking change must be a deliberate one &#8211; not an accidental one that is typically only discovered when the users of the API find that their existing code no longer works.</p>
<p><span id="more-1137"></span></p>
<h2>Preventing Breaking Changes</h2>
<p>It is easy to tell developers that they should keep an API backwardly compatible, however even with the best of intentions it is possible to introduce subtle changes to the behaviour, particularly if you are refactoring collaborating classes that may not directly be part of the public interface. Every developer should be aware of the importance of keeping the API backwardly compatible, however this cannot be relied upon. After all, every developer should be striving to keep their code bug free, but we still write tests to verify this.</p>
<p>The solution is to detect any API changes before it is released, preferably in an automated fashion, so that it can be fixed. The problem is how to know whether an API has actually changed.</p>
<p><b>Compilation</b></p>
<p>A starting point for a compiled language, such as Java, is whether some code that was written against the old API still compiles against the new one. Any interfaces that have changed, including those with changes to method signatures and so on, will be flagged up immediately by the compiler. However this is no guarantee that the behaviour of the API hasn&#8217;t changed, and this simple verification isn&#8217;t available for non-compiled languages like JavaScript.</p>
<p><b>Unit Tests</b></p>
<p>The next obvious tool to detect a change are unit tests. The problem with this is that the unit tests will also be updated when the underlying code is modified. The fact that a unit test for a public API is having to be changed should start alarm bells ringing for the developer making the change; are the changes that they are making backwardly compatible or not? Again, however, the problem with this is that sometimes the changes can be subtle and the breaking change may be missed, particularly if the changes are made to a collaborating class rather that the one that is directly part of the public API.</p>
<p><b>Acceptance Tests</b></p>
<p>Acceptance tests can be used to detect breaking changes in a similar way to the unit tests. My problem with this approach is that they tend to be less granular and therefore susceptible to missing subtle breaking changes. Ideally I want my tests for API changes to have excellent coverage and to test all possible code paths, which is usually something that isn&#8217;t done by acceptance tests.</p>
<p><b>API Tests</b></p>
<p>Taking a step back, it does look like unit tests seem a good match for solving this particular problem. The only issue is that the unit tests will be modified when the code is changed, which may mask any breaking changes that have unwittingly been introduced. However we do have a set of unit tests perfectly suited to this which haven&#8217;t been modified, those from our previous release. We know that they proved the API for that release worked, so if the same tests pass against the new code it stands to reason that we should be backwardly compatible.</p>
<h2>Creating API Tests</h2>
<p>At Caplin we have a set of API tests that are a specialised group of unit tests aimed at verifying that all aspects and behaviours of the public API have not changed. They are usually a subset of the unit tests written for a particular library.</p>
<p><b>Only Running the API Tests</b></p>
<p>The first problem is specifying which tests are those for the API and which are standard unit tests. This is important since the implementation of collaborating classes can be changed without impacting the public API. As a result the old unit tests for refactored collaborating classes may now fail, however these are unimportant if they have no impact on the API.</p>
<p>Within our JavaScript unit tests we have added the ability to flag a particular test as an API test. We can specify whether we want to run only the API tests or all the tests, including the API tests.</p>
<p>Alternate approaches would be to create different test suites for the API and standard tests, or perhaps to use a custom annotation like <code>@ApiTest</code> rather than <code>@Test</code> in <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5qdW5pdC5vcmcv">JUnit 4</a>.</p>
<p><b>Dangers With Mocking</b></p>
<p>One danger with testing APIs is the use of <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5tb2Nrb2JqZWN0cy5jb20v">mock objects</a>. Mock objects combined with <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9EZXBlbmRlbmN5X2luamVjdGlvbg==">dependency injection</a> provide a powerful way to test the logic of a particular piece of code as a single unit, without having to rely on the real logic in the collaborating objects. Instead the mock object acts as a replacement for the real collaborating object, verifying that it is invoked in the correct way and returns the appropriate values.</p>
<p>The danger is that changes to the collaborating object, such as the addition of a statement that throws a runtime exception if an argument is null, will not be emulated by the mock object. These problems are not insurmountable, however you need to be aware of the potential risks. In the case above there is a reasonable argument that there should have been an API test written for the collaborating class that demonstrated that the arguments could have been null previously which would now fail.</p>
<p><b>Getting the API Tests</b></p>
<p>At Caplin we upload the API tests to our <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21hdmVuLmFwYWNoZS5vcmcv">Maven</a> repository along with the other build artifacts for our libraries. For example when we release version 1.0 of a library, the API tests for 1.0 are uploaded to Maven. When we are building version 1.1 of the library we download the API tests for 1.0 to verify that the API has not changed.</p>
<p>Alternatives to getting the tests from Maven are to use another dependency management system, to pull the tests from a branch or label from source control, or even copying them from a network share.</p>
<p><b>Updating API Tests</b></p>
<p>It is possible that a public API hasn&#8217;t changed, however the API test for it fails. The reason for this could be that the interaction between the API method and its collaborating objects, particularly if they have been mocked out, have changed, and the test expectations are no longer valid. As a result the code for the API tests will need to be updated.</p>
<p>This change needs to be managed via source control, with a new version of the API tests pushed into Maven, or wherever they are being stored.</p>
<p><b>Backward Compatibility With Older Versions</b></p>
<p>At the moment we are only checking backward compatibility against the previous version of the API. I believe that if an API is compatible with the previous one, and that previous one was compatible with the one before, and so on, then it stands to reason that the current API should be compatible with the oldest one.</p>
<h2>Conclusions</h2>
<p>We are still in the early days of trying out this approach, however the early signs have been encouraging.</p>
<p>Ultimately a large amount of the responsibility still lies with developers to ensure that their code changes to a public API maintain backwards compatibility. The API tests are a safety net that gives confidence that it really is backwardly compatible and provide an early warning of any breaking changes, allowing them to be fixed before a release is made.</p>
<p>Any breaking changes within an API must be a conscious decision, not an inadvertent one.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1137" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/02/19/testing-apis-for-backwards-compatibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Variable Naming Convention</title>
		<link>http://blog.caplin.com/2010/02/10/javascript-variable-naming-convention/</link>
		<comments>http://blog.caplin.com/2010/02/10/javascript-variable-naming-convention/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 16:05:50 +0000</pubDate>
		<dc:creator>Ian Alderson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://blog.caplin.com/?p=1098</guid>
		<description><![CDATA[When I joined Caplin 10 years ago I came from a company that used Hungarian notation to name its C++ and Visual Basic variables. For me, it seemed a natural progression to continue to use these naming conventions and adapt them to be suitable for the JavaScript code that I now writing. The evolution of [...]]]></description>
			<content:encoded><![CDATA[<p>When I joined Caplin 10 years ago I came from a company that used <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9IdW5nYXJpYW5fbm90YXRpb24=">Hungarian notation</a> to name its C++ and Visual Basic variables. For me, it seemed a natural progression to continue to use these naming conventions and adapt them to be suitable for the JavaScript code that I now writing.</p>
<p>The evolution of software practices ebbs and flows over time, and it seems that Hungarian notation is currently out of favour. This is especially apparent with some of the new developers that have joined the team here at Caplin. One of the first questions they ask is often about the naming convention that we use.</p>
<p><span id="more-1098"></span></p>
<p><strong>Hungarian Notation is useful in JavaScript</strong></p>
<p>I believe that an untyped language like JavaScript benefits greatly from Hungarian notation, allowing the intended type of a variable to be determined from its name. If I am debugging some code that is going wrong I can quickly check that the data associated with that variable is of the expected type. Also if I am writing new code I know which methods I can invoke on the variable.</p>
<p>The scoping within JavaScript is strange too. If a developer forgets to add a <code>var</code> declaration for a particular local variable within a function then the variable is added to the global scope, with the potential of nasty unforeseen side effects.</p>
<p><strong>Caplin&#8217;s JavaScript Naming Convention</strong></p>
<p>At Caplin, we have two components that are added to the start of the names of our JavaScript variables: one represents the type, and the other represents the scope.</p>
<p><strong>Type Prefix</strong></p>
<ul>
<li><code>b</code> &#8211; a Boolean variable. We only expect it to have a value <code>true</code> or <code>false</code>. For example <code>bIsVisible</code>.</li>
<li><code>e</code> &#8211; a DOM element. Provided its not <code>null</code> we expect to be able to access <code>childNodes</code> and so on. For example <code>eGridBody</code>.</li>
<li><code>f</code> &#8211; a function pointer. Typically this will be invoked at some stage in the future. For example <code>fCallback</code>.</li>
<li><code>m</code> &#8211; a map. For example <code>mPropertyNamesToValues</code>.</li>
<li><code>n</code> &#8211; number, either a integer or a float. For example <code>nColumnIndex</code>.</li>
<li><code>o</code> &#8211; an object. We don&#8217;t try to differentiate between all the different object types we have defined within our code with dozens of different prefixes, this would get too complicated to remember. Typically we use <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2pzZG9jLnNvdXJjZWZvcmdlLm5ldC8=">JsDoc</a> to identify the types, if the scope of a variable is not small enough to see its type. For example <code>oObservable</code>.</li>
<li><code>p</code> &#8211; an array. This should really use an <code>a</code> prefix, however this is a throw back to the original Hungarian notation from my C++ days where an array was just a pointer. For example <code>pQueue</code>.</li>
<li><code>s</code> &#8211; a string. Provided its not <code>null</code> we expect to be able to invoke methods like <code>match()</code>. For example <code>sUsername</code>.</li>
<li><code>v</code> &#8211; a variant, where various different types might be allowed. A typical example of where this might be used is a generic debugging method that is happy to take any type of argument and output it to a log. For example <code>vValueToLog</code>.</li>
</ul>
<p><strong>Scope Prefix</strong></p>
<ul>
<li><code>m_</code> &#8211; private member variable. Although there are techniques to hide member variables there are performance costs associated with them. The <code>m_</code> prefix is a gentle reminder that only the class the member variable is defined in should be accessing it. In fact, when the code is obfuscated these private members may also be obfuscated since they aren&#8217;t part of of the public interface of the class. For example <code>this.m_sSubject</code>.</li>
<li><code>g_</code> &#8211; global variable. These are <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2MyLmNvbS9jZ2kvd2lraT9HbG9iYWxWYXJpYWJsZXNBcmVCYWQ=">used sparingly</a>. If a variable has a value to assigned to it within a method but does not have a g_ prefix then beware, this is probably a mistake and we now have an unexpected side effect. For example <code>g_bIsDevelopment</code>.</li>
<li>All other variables, such as local variables or function arguments, have no scope prefix.</li>
</ul>
<p><strong>Horses for Courses</strong></p>
<p>To be honest, although I use Hungarian notation throughout all of my JavaScript code, I avoid it altogether when coding in other languages such as Java. The reason for this is simply that Java is a typed language, and I don&#8217;t feel that this adds any benefit, however <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Kb2VsX1Nwb2xza3k=">Joel Spolsky</a> makes a great case for using it, even in the case of a typed language, in his blog <a  href="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5qb2Vsb25zb2Z0d2FyZS5jb20vYXJ0aWNsZXMvV3JvbmcuaHRtbA==">Making Wrong Code Look Wrong</a>.</p>
 <img src="http://blog.caplin.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1098" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.caplin.com/2010/02/10/javascript-variable-naming-convention/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
