<?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>Gojko Adzic &#187; specification by example</title>
	<atom:link href="http://gojko.net/tag/specification-by-example/feed/" rel="self" type="application/rss+xml" />
	<link>http://gojko.net</link>
	<description>Building software that matters</description>
	<lastBuildDate>Wed, 04 Aug 2010 11:38:56 +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>Stop automating manual test scripts!</title>
		<link>http://gojko.net/2010/07/19/stop-automating-manual-test-scripts/</link>
		<comments>http://gojko.net/2010/07/19/stop-automating-manual-test-scripts/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 10:54:41 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[acceptance testing]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[agile testing]]></category>
		<category><![CDATA[specification by example]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=1917</guid>
		<description><![CDATA[Creating an Executable Specification from existing manual test scripts might seem as a logical thing to do when starting out with Specification by Example and Agile Acceptance Testing. Such scripts already describe what the system does, and the testers are running them anyway, so automation will surely help. Not really &#8212; this is in fact [...]]]></description>
			<content:encoded><![CDATA[<p>Creating an <a href="http://www.acceptancetesting.info/key-ideas/executable-specifications/">Executable Specification</a> from existing manual test scripts might seem as a logical thing to do when starting out with Specification by Example and Agile Acceptance Testing. Such scripts already describe what the system does, and the testers are running them anyway, so automation will surely help. Not really &mdash; this is in fact one of the most common failure patterns.<span id="more-1917"></span></p>
<p>The problem is that manual and automated checks are affected by a completely different set of constraints. With manual testing, the time spent preparing the context is often a key bottleneck. With automated testing, people spend most time on understanding what is wrong when a test fails.</p>
<p>For example, to prepare for a manual test that checks user account management rules, you might have to log on to an administrative application, create a user, log on as that new user to the client application, and change the password after first use. To avoid doing this several times during the test, manual scripts often reuse the context. So you would create the user once, block that account and verify that the user cannot log on, reset the password to verify that it is re-enabled, then set some user preferences and verify they change the home page correctly. This approach helps a tester run through the script quicker.</p>
<p>With automated testing, time spent on setting up the user is no longer a problem. Automated tests generally go through many more cases than manual tests, and when they run correctly nobody is really looking at them. Once a test fails, someone has to go in and understand what went wrong. If a test is described as a sequence of interdependent steps, it will be very hard to understand what exactly caused the problem, because the context changes throughout the script. The fact that a single script is checking ten different things also makes it more probable that the test will fail because it is affected by lots of different areas of code. In the previous example with user account management, if the password reset function stops working, we won&#8217;t be able to set the user preferences correctly.  If we had ten different, smaller, focused and independent tests instead of one big script, a bug in the password reset function won&#8217;t affect the test results for user preferences. That makes tests more resilient to change and reduces the cost of maintenance. It also helps us pin-point the problems quicker.  </p>
<p>Instead of plainly automating manual test scripts, think about what the script is testing and describe that with a group of independent, focused tests. This will significantly reduce the automation overhead and maintenance costs.</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2010/07/19/stop-automating-manual-test-scripts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anatomy of a good acceptance test</title>
		<link>http://gojko.net/2010/06/16/anatomy-of-a-good-acceptance-test/</link>
		<comments>http://gojko.net/2010/06/16/anatomy-of-a-good-acceptance-test/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 02:50:00 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[acceptance testing]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[agile testing]]></category>
		<category><![CDATA[live documentation]]></category>
		<category><![CDATA[specification by example]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=1891</guid>
		<description><![CDATA[The long term benefits of agile acceptance testing come from live documentation – a description of the system functionality which is reliable, easily accessible and much easier to read and understand than the code. In order to be effective as live specification, acceptance tests have to be written in a way that enables others to [...]]]></description>
			<content:encoded><![CDATA[<p>The long term benefits of agile acceptance testing come from <a href="http://www.acceptancetesting.info/key-ideas/live-documentation/">live documentation</a> – a description of the system functionality which is reliable, easily accessible and much easier to read and understand than the code. In order to be effective as live specification, acceptance tests have to be written in a way that enables others to pick them up months or even years later and easily understand what they do, why they are there and what they describe. Here are some simple heuristics that will help you measure and improve your tests to make them better as a live specification.<span id="more-1891"></span></p>
<p>The five most important things to think about are:</p>
<ul>
<li>It needs to be self explanatory</li>
<li>It needs to be focused</li>
<li>It needs to be a specification, not a script</li>
<li>It needs to be in domain language</li>
<li>It needs to be about business functionality, not about software design</li>
</ul>
<p>Here is a really good example:</p>
<p><img src="http://gojko.s3.amazonaws.com/offer2.png" width="500" /></p>
<p>It has all the elements listed above. Whenever I&#8217;ve shown it to people in the workshops, I did not have to use a single word to explain it. The title and the introductory paragraph explain the structure of the test data enough that readers don&#8217;t need to work back from the data to understand the rule. But the examples are there to make it actually testable and explain the behaviour in edge cases. It is focused on a very particular rule of free delivery availability, does not explain how the books are purchased but just what the available delivery mechanism is, and does not try to talk about any implementation specifics.</p>
<p>Here is a really bad example (taken from <a href="http://fitnesse.org/FitNesse.UserGuide.PayrollTests.AddAndPayTest">http://fitnesse.org/FitNesse.UserGuide.PayrollTests.AddAndPayTest</a>)</p>
<p><img src="http://gojko.s3.amazonaws.com/bad_example_acceptance_test.png" /></p>
<p>This test has so many bad things in it that it is actually a good example to demonstrate what happens when people don&#8217;t take care about writing good tests. </p>
<p>First of all, although it has a title and some text around the tables to seemingly explain what&#8217;s going on, the effect of that is marginal. Why is this test &#8220;simple&#8221;, and what exactly in payroll is it checking? It fails straight away on the self-explanatory litmus-test.</p>
<p>Second, it&#8217;s not really clear what this test is checking. We need to work backwards. It seems to verify that the cheques are printed with unique numbers, starting from the next available number that&#8217;s configurable in the system. It also seems to validate the data printed on each cheque. And that there is one cheque printed per employee (I&#8217;ll come back to this later).</p>
<p>There is a lot of seemingly incidental complexity there &#8211; names and addresses aren&#8217;t really used anywhere in the test apart from setting up the employees. There are some database IDs there which are completely irrelevant for the business rules, but they are used to match up employees and the paycheck inspector. </p>
<p>Paycheck inspector is obviously an invented thing just for testing. No company is going to have Peter Sellers in a Clouseau outfit inspecting cheques as they go out. If you have enough employees to have to print cheques, you don&#8217;t want to inspect them manually. That&#8217;s what this test is about, anyway.</p>
<p>There is also a very interesting issue of those blank cells in the assertion part of the test, and the two Paycheck inspector tables which seem unrelated. Blank cells in Fitnesse are used to print test results for debugging and troubleshooting, they don&#8217;t check anything. So this is an automated test that a human has to look over &mdash; pretty much defeating the purpose of automation. Blank cells are typically a sign of instability in tests (more on this a bit later) and they are often a signal that you&#8217;re missing something &#8211; either testing in the wrong place or missing a rule that would help make the system process repeatable and testable.</p>
<p>The language is inconsistent, which makes it hard to make a connection between inputs and outputs at first. What is the 1001 value in the table below? The column header tells us that it is a number &#8211; well thanks for that, I though it was a sausage. There is a &#8220;cheque number&#8221; above, but what kind of a cheque number is that? What is the relationship between these two things?</p>
<p>So this test is very very bad. </p>
<p>Presuming that the addresses are there because cheques are printed as part of a statement with an address ready for automated envelope packaging, this test fails to check at least one very important thing (and I&#8217;ll come back to this later as well): that the right people got paid the right amounts. If the first person got both cheques, this test would happily pass. If they both got each-others salaries, this test would pass. If a date far in the future was printed on the cheque, our employees might not be able to cash it in but the test would still pass. The reason these cells are blank is because there is another hidden rule there: ordering of cheques coming out. There is nothing specifying that. So a technical workaround for a functional gap is to create a test that gives us loads of false positives.</p>
<p>Is this test checking one thing or many things? Without the context information it&#8217;s hard to tell. If the cheque printing system is used for anything else, I&#8217;d pull out the fact that cheque numbers are unique and start from a configured number into a separate page. If we only ever print salary cheques, it&#8217;s probably part of a single thing (salary cheque printing).</p>
<p>Now, let&#8217;s clean it up. Let&#8217;s try to work back and drop all the incidental stuff. Let&#8217;s use a nice descriptive title, such as &#8220;Payroll Cheque Printing&#8221;. And let&#8217;s add a paragraph that explains the structure of the test.</p>
<p>A cheque has the payee name, amount, payment date. A cheque does not have a name and a salary. If the cheque is printed on a statement, it also has an address that will be used for automatic envelope packaging. A combination of a name and address should be enough for us to match the employee with his cheque &mdash; we don&#8217;t really need the database IDs. We can make the system more testable by agreeing on an ordering rule, whatever it is. For example, alphabetic by name.</p>
<p>Let&#8217;s also pull the context to the start of the test. Our context is the payroll date and the next available cheque number, along with employee salary data. Let&#8217;s make it explicit what the number is for, so that the readers don&#8217;t have to figure this out for themselves in the future. We can also make this block stick out visually to show that it is about the context.</p>
<p>The action that gets kicked off doesn&#8217;t necessarily need to be listed in the test. A payroll run can be executed implicitly by the table that checks payroll results. This is an example of focusing on what&#8217;s being tested instead of how it is being checked. There is no need to have a separate step that says &#8220;Next we pay them&#8221;.</p>
<p>Let&#8217;s also rename that paycheck inspector to something that makes more sense. Because we want whoever automates this to ensure that we check for all cheques printed, let&#8217;s put that in the header. Otherwise, someone might use subset matching and the system might print every cheque twice and we won&#8217;t notice.</p>
<p>And here is the cleaned version. </p>
<p><img src="http://gojko.s3.amazonaws.com/fixed_acceptance_test.png" width="500" /></p>
<p>Much easier to understand, without all that incidental stuff.  And now comes the punchline. When we look at the test like this, without database IDs, without all the unnecessary clutter, we can have a nice shot at answering the question &#8220;Are we missing something?&#8221;. What are the edge cases that might break this? We don&#8217;t really need to ensure validity of employee data, hopefully that&#8217;s done in another part of the system. But is there any kind of valid employee data that would be an edge case for this test &#8211; can we play with the numbers to make this illogical in some way?</p>
<p>An obvious answer to that is &#8211; what happens if an employee has a salary of 0? Do we still print the cheque? The rule as we described it says &#8220;One cheque per employee&#8221; &#8211; so any employees that have been fired years ago and no longer receive salaries would still get cheques printed, with zeroes on them. We could then have a discussion with the business on making this rule stronger and ensuring that cheques don&#8217;t go out when they don&#8217;t need to do.</p>
<p>FitNesse gets a lot of bad reputation because of this kind of broken tests. Concordion was built as an answer. Some people at my recent workshop on this example pointed out that Given-When-Then structure of Cucumber would be better at preventing some of these problems.  I don&#8217;t think so. It&#8217;s not about the tools &#8211; people can do this kind of bad test design with any tool, and likewise they could do nice and clean tests with FitNesse. I guess the fact that the basic examples coming with FitNesse are so bad doesn&#8217;t help, but the problem is not in the tool. It&#8217;s about the process and effort put into making the tests easy to understand. The funny thing is it doesn&#8217;t take a lot more effort to make the test nice and clean, but it brings a lot more value that way.   </p>
<p><i>If you found this article helpful, you&#8217;ll love my <a href="http://neuri.co.uk/training/hands-on-agile-acceptance-testing/">three day workshop on effective specification by example and agile acceptance testing</a></i></p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2010/06/16/anatomy-of-a-good-acceptance-test/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Agile Acceptance Testing &#8211; HSBC Talk Slides and Links</title>
		<link>http://gojko.net/2009/09/21/agile-acceptance-testing-hsbc-talk-slides-and-links/</link>
		<comments>http://gojko.net/2009/09/21/agile-acceptance-testing-hsbc-talk-slides-and-links/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 21:05:08 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[presentations]]></category>
		<category><![CDATA[acceptance testing]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[specification by example]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=1166</guid>
		<description><![CDATA[Thanks very much for inviting me to speak about agile acceptance testing and specification by example at HSBC today. It was great to chat to you and I must say that your video-conferencing system is really impressive. As promised, here are the slides and links from the presentation. Online articles and resources US Army experiment [...]]]></description>
			<content:encoded><![CDATA[<p><object align="right" style="margin:5px 5px 5px 5px;" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=hsbc-090921153738-phpapp01&#038;stripped_title=specification-by-example-and-agile-acceptance-testing" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=hsbc-090921153738-phpapp01&#038;stripped_title=specification-by-example-and-agile-acceptance-testing" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object> Thanks very much for inviting me to speak about agile acceptance testing and specification by example at HSBC today. It was great to chat to you and I must say that your video-conferencing system is really impressive. As promised, here are the slides and links from the presentation. </p>
<h3>Online articles and resources</h3>
<ul>
<li><a href="http://www.au.af.mil/au/awc/awcgate/milreview/shattuck.pdf">US Army experiment</a></li>
<li><a href="http://www.foxnews.com/wires/2008Jun05/0,4670,B2Crash,00.html">B2 bomber crash report</a></li>
<li><a href="http://97-things.near-time.net/wiki/Seek%20the%20value%20in%20requested%20capabilities">F-16 design project</a></li>
<li><a href="http://www.gmelnik.com/papers/IEEE_Software_Moebius_GMelnik_RMartin.pdf">Tests and Requirements, Requirements and Tests: A Möbius Strip</a></li>
<li><a href="http://www.jamesshore.com/Blog/How-I-Use-Fit.html">Describe-demonstrate-develop</a></li>
<li><a href="http://video.google.co.uk/videoplay?docid=-7227306990557696708">Rick Mugridge: Doubling the value of automated tests from Google Tech Talks in London in 2006.</a>
</li>
<li><a href="http://www.concordion.org">Concordion</a></li>
<li><a href="http://www.fitnesse.org">FitNesse</a></li>
<li><a href="http://agiletesting.org.uk">Agile Testing UK</a></li>
<li><a href="http://acceptancetesting.info">Agile acceptance testing info portal</a></li>
</ul>
<h3>Books</h3>
<ul>
<li><a href="http://www.amazon.co.uk/gp/product/0955683610?ie=UTF8&#038;tag=swingwiki-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0955683610">Bridging the Communication Gap: Specification by Example and Agile Acceptance Testing</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=swingwiki-21&#038;l=as2&#038;o=2&#038;a=0955683610" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, my book (also see <a href="http://acceptancetesting.info/the-book/buy-pdf">the PDF edition</a>)</li>
<li><a href="http://www.amazon.co.uk/gp/product/0262611465?ie=UTF8&#038;tag=swingwiki-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0262611465">Sources of Power: How People Make Decisions</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=swingwiki-21&#038;l=as2&#038;o=2&#038;a=0262611465" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> by Gary Klein</li>
<li><a href="http://www.amazon.co.uk/gp/product/0321437381?ie=UTF8&#038;tag=swingwiki-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0321437381">Implementing Lean Software Development: From Concept to Cash (Addison-Wesley Signature)</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=swingwiki-21&#038;l=as2&#038;o=2&#038;a=0321437381" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> by Mary and Tom Poppendieck</li>
<li><a href="http://www.amazon.co.uk/gp/product/0932633137?ie=UTF8&#038;tag=swingwiki-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=0932633137">Exploring Requirements: Quality Before Design</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=swingwiki-21&#038;l=as2&#038;o=2&#038;a=0932633137" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> by Gerald Weinberg and Donald C. Gause</li>
</ul>
<h3>Events</h3>
<ul>
<li><a href="http://skillsmatter.com/event/agile-testing/agile-specifications-bdd-and-testing-exchange">Agile Specifications, Testing and BDD exchange</a>, November 27th, London</li>
<li><a href="http://skillsmatter.com/course/open-source-dot-net/gojko-adzics-intro-to-specification-by-example-and-agile-acceptance-testing-with-fitnesse">Intro to Specification by Example and Agile Acceptance Testing with Fitnesse </a>, November 30th, London</li>
<li><a href="http://skillsmatter.com/course/agile-testing/writing-software-that-matters-bdd-and-specification-by-example/wd248">Writing software that matters</a>, December 4th, London</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2009/09/21/agile-acceptance-testing-hsbc-talk-slides-and-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learn BDD and specification by example straight from the horse&#8217;s mouth</title>
		<link>http://gojko.net/2009/08/27/learn-bdd-and-specification-by-example-straight-from-the-horses-mouth/</link>
		<comments>http://gojko.net/2009/08/27/learn-bdd-and-specification-by-example-straight-from-the-horses-mouth/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 17:17:36 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[specification by example]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=1090</guid>
		<description><![CDATA[Dan North and I met up today and decided to do a joint workshop on behaviour-driven development and specification by example. The workshop will be very practical, focused around the following topics: How to communicate effectively with project stakeholders Value of specification by example How to write good scenarios How to spot problems with scenarios [...]]]></description>
			<content:encoded><![CDATA[<p>Dan North and I met up today and decided to do a joint workshop on behaviour-driven development and specification by example. The workshop will be very practical, focused around the following topics:</p>
<ul>
<li>How to communicate effectively with project stakeholders</li>
<li>Value of specification by example</li>
<li>How to write good scenarios</li>
<li>How to spot problems with scenarios and examples and how to fix them</li>
<li>How to integrate BDD and specification by example into your development process and organisation</li>
<li>Focusing on writing software that really matters</li>
<li>Managing code after it is released, using examples and scenarios as live documentation</li>
</ul>
<p>This will be a unique opportunity to learn BDD and specification by example straight from the horse&#8217;s mouth. We&#8217;re ironing out the final details and I&#8217;ll publish them early next week. For now, I can only say that the workshop will take place in central London mid December this year and that the number of places will be very limited (definitely not more than 30), so if this sounds interesting <a href="/contact">send me an e-mail or ping me on twitter</a> and I&#8217;ll keep you posted.  </p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2009/08/27/learn-bdd-and-specification-by-example-straight-from-the-horses-mouth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Examples make it easy to spot inconsistencies</title>
		<link>http://gojko.net/2009/05/12/examples-make-it-easy-to-spot-inconsistencies/</link>
		<comments>http://gojko.net/2009/05/12/examples-make-it-easy-to-spot-inconsistencies/#comments</comments>
		<pubDate>Tue, 12 May 2009 11:12:34 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[acceptance testing]]></category>
		<category><![CDATA[prognet]]></category>
		<category><![CDATA[specification by example]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=896</guid>
		<description><![CDATA[I organised a workshop on Specification by Example yesterday at the Progressive .NET mini-conference in London, demonstrating how realistic examples are a very effective tool to flush out incorrect assumed rules and point to real business rules in software requirements. This was the first time I did something similar at a public event. The workshop [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/prognet-workshop.jpg" style="border:1px solid black; margin:5px 5px 5px 5px;" align="left" />I organised a workshop on Specification by Example yesterday at the <a href="http://progressive-dotnet.com">Progressive .NET</a> mini-conference in London, demonstrating how realistic examples are a very effective tool to flush out incorrect assumed rules and point to real business rules in software requirements. <span id="more-896"></span></p>
<p>This was the first time I did something similar at a public event. The workshop is one of the central parts of my <a href="http://neuri.co.uk/training/agile-acceptance-testing/">one-day agile acceptance testing course</a> but I always presented that on-site in companies, where we work on the domain of that particular company and all the participants know quite a bit about it. With a public event, that is a challenge as participants work for different companies and on different domains. I chose the Blackjack game for the domain as it is one of the most popular casino games, but not a lot of people go to casinos, so I supposed that there will be 5 or 6 people in the room that know how to play and they will be able to act as domain experts or customer representatives. Blackjack rules are fairly simple so one hour of demonstrating with playing cards will be enough to introduce the rules to people who had no previous exposure to the game. It was a bit of a challenge to buy ten packs of playing cards on a Sunday evening where I live, but I think that it was worth it.</p>
<h2>The experiment</h2>
<p>To simulate a situation where a customer points the development team to a competitor site and asks them to copy some functionality, I went to a popular blackjack online games site and copied the game rules. The interesting thing about these rules is that, although they fit on a single A4 paper, there were quite a few inconsistencies and functional gaps there. For example, one rule stated that the house always wins if the dealer has a Blackjack and another rule stated that the player gets his money back if both the player and the dealer have the same cards, so a case where both the player and the dealer have a Blackjack was ambiguous. There were some edge cases that were not properly explained which left a lot of space for ambiguity and misunderstanding. One particular rule dealing with the value of the Ace card was very uncommon, as if it was intended to give more advantage to house over players. I&#8217;m pretty sure that it was not implemented like that even on the original site, but I was interested in finding out whether the workshop participants will complain about it. </p>
<h2>The workshop</h2>
<p>There were seven people in the room who were blackjack players, so I asked them to be domain experts and other people to form teams around them. Teams were then given the task to demonstrate chosen blackjack rules for financial payout using a pack of playing cards and realistic examples. During the first hour I mostly let the people in the teams explain the rules to each-other. During the second hour I asked them to focus more on specifying financial outcome rules with realistic examples and demonstrating individual rules from the requirements document. If they found any inconsistencies or missing functionality, the domain expert on the team was supposed to resolve the issue and in particular write that down as an example. On the end, one representative from each team – not the domain expert – presented the examples and answered the following three questions:</p>
<ul>
<li>was there any functionality missing from the requirements that you discovered?</li>
<li>were there any conflicting rules that you discovered?</li>
<li>was there something that you scrapped and decided not to do?</li>
</ul>
<h2>The results</h2>
<p>Although none of these people had any previous experience with <a href="http://www.acceptancetesting.info/key-ideas/specification-workshop/">example-driven specification workshops</a>, the examples that all teams produced were pretty good which shows that it is fairly easy to get started with specification workshops. Most of the examples ended up being in the form of “with this hand of the player and this hand of the dealer, the outcome is this”. One team used examples to define domain terms such as “bust” and “blackjack” and then used them in the examples demonstrating game outcome. Other teams only used examples of game outcome and defined the domain terms implicitly using that. With specification workshops on real projects, we often end up cleaning up examples to produce the specification (I call this <a href="http://www.acceptancetesting.info/key-ideas/distilling-the-specification/">distilling the specification</a> in my book <a href="http://acceptancetesting.info/the-book">Bridging the communication gap</a>), so this would give people a chance to refine examples and focus them. </p>
<p>One of the teams used the rules on the paper just as a guideline, they worked on Blackjack rules that the domain expert demonstrated during the workshop and ignored the details on the paper, which is an interesting example of the team ignoring written requirements and going with their understanding of the matter. A domain expert in another team pulled out a card with Blackjack rules and card counting strategies from somewhere and they used that to clear up any questions. Two teams decided to ignore the offending rule about Ace values and just specify the Ace value as it was in a normal Blackjack game, which is an example of a domain expert overruling a requirement that makes no sense. One team had not reached that rule during the workshop at all so they haven&#8217;t noticed it. All the teams discovered almost all the inconsistencies and functional gaps, and one team even noticed something that I missed while preparing the workshop. It turned out that one of the designated domain experts wasn&#8217;t really a Blackjack player so they spent lots of time discussing cases which are irrelevant for the game, such as the dealer splitting cards. That might seem logical from a perspective of someone who values symmetry (and developers typically do) so this demonstrated what can happen when developers try to implement acceptance testing on their own without customers or domain experts.</p>
<h2>Measuring the effectiveness</h2>
<p>I asked for a quick show of hands to count who considered that discussing realistic examples helped flush out inconsistencies and functional gaps. All the workshop participants except one raised their hands, and the one that did not raise his hand said that he had not heard the question, then said that he agrees with that as well. </p>
<p>I also ran a quick feedback exercise. Feedback exercises are a very effective way of measuring shared understanding of the domain, working on the same principle as Planning poker. Team members write down answers to a question that requires understanding of the domain, typically a difficult edge case, and then compare the results. Differences in answers point to differences in understanding. Before the workshop, I selected three particularly difficult edge cases that were not explained precisely on the requirements sheet. After the workshop, I asked all the participants to write down the outcome in those three cases and then compare it with other members of their team. Different teams will probably have different answers because their domain experts made different decisions, but people in the same team should have the same answers to these questions if they share the understanding of the domain. After they compared the results, I asked people to raise their hands if they had different answers within the team – only one team raised their hands. The explanation was that they still have not had time to discuss a particular rule that was demonstrated by the edge case.</p>
<p>As six out of seven teams had a shared understanding good enough to come up with the same answers to really difficult edge cases after a quick workshop, even though most people on the team had no previous exposure to the target domain, for me the experiment was a very effective demonstration of how <a href="http://www.acceptancetesting.info/key-ideas/specification-workshop/">specification workshops</a> and <a href="http://www.acceptancetesting.info/key-ideas/specification-by-example/">specification by example</a> help improve clarity in software projects and give us a much better foundation for implementation and testing than traditional requirements. </p>
<h2>Feedback</h2>
<p>If you participated in this workshop – I&#8217;d really love to hear your feedback. Please post a comment below or contact me. To find out more about specification workshops and agile acceptance testing, have a look at the <a href="http://acceptancetesting.info">agile acceptance testing</a> portal and the <a href="/resources">resources</a> page on my site.</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2009/05/12/examples-make-it-easy-to-spot-inconsistencies/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
