<?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; bdd</title>
	<atom:link href="http://gojko.net/tag/bdd/feed/" rel="self" type="application/rss+xml" />
	<link>http://gojko.net</link>
	<description>Building software that matters</description>
	<lastBuildDate>Tue, 31 Jan 2012 09:07:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Designing good Cucumber feature files</title>
		<link>http://gojko.net/2011/05/18/designing-good-cucumber-feature-files/</link>
		<comments>http://gojko.net/2011/05/18/designing-good-cucumber-feature-files/#comments</comments>
		<pubDate>Wed, 18 May 2011 23:43:14 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[atdd]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[specification by example]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=2430</guid>
		<description><![CDATA[Alister Scott wrote a really nice paper on designing good specifications with examples/bdd scenarios/acceptance tests &#8211; focused on Cucumber, but applicable to other tools as well. He captured how to evolve horrible scripts into something quite useful. I strongly recommend reading it, especially if you&#8217;re working with UI tests. Now...]]></description>
			<content:encoded><![CDATA[<p>Alister Scott wrote a really nice paper on designing good specifications with examples/bdd scenarios/acceptance tests &#8211; focused on Cucumber, but applicable to other tools as well.  He captured how to evolve horrible scripts into something quite useful. I strongly recommend reading it, especially if you&#8217;re working with UI tests.</p>
<p>Now go to <a href="http://watirmelon.com/2011/05/18/specification-by-example-a-love-story/">http://watirmelon.com/2011/05/18/specification-by-example-a-love-story/</a> and enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2011/05/18/designing-good-cucumber-feature-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Duplication between BDD and Unit tests</title>
		<link>http://gojko.net/2011/01/28/duplication-between-bdd-and-unit-tests/</link>
		<comments>http://gojko.net/2011/01/28/duplication-between-bdd-and-unit-tests/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 07:33:48 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=2228</guid>
		<description><![CDATA[I got this e-mail recently from a blog reader, and decided to share the answer as it might be interesting to others as well: I listened to your podcast with Scott Hanselman and the discussion touched on the mix of unit tests and BDD acceptance tests, but didn’t really go...]]></description>
			<content:encoded><![CDATA[<p>I got this e-mail recently from a blog reader, and decided to share the answer as it might be interesting to others as well:</p>
<blockquote><p>
I listened to your podcast with Scott Hanselman and the discussion touched on the mix of unit tests and BDD acceptance tests, but didn’t really go as far as to offer guidance on where each is really best suited.</p>
<p>Since the BDD tests are integration tests it would seem that for ultimate confidence in the BDD tests as a regression suite they should cover all of the corner cases that the unit tests cover where possible (strange input cases that lead to null references, divide by zero, zero, one, edge case testing, etc) and be exposed to the BA’s to ensure that the code is handling these as expected.   This seems to require essentially a near duplication of the cases handled in unit tests to achieve this level.  The tests in the unit tests are still useful as they give guidance to developers on which layer the expectation is failing at, especially if the tests are layered with mocks stuffed with the correct behaviors at higher levels.</p>
<p>All of the examples of BDD I’ve seen follow mostly the happy path with only an occasional nod to the unhappy path and don’t seem to go into as many corner cases and essentially code coverage as unit tests too, but this feels incomplete.</p>
<p>I saw <a href="http://msdn.microsoft.com/en-us/magazine/gg490346.aspx">this article referenced</a> in the show note comments, but it also felt incomplete </p>
<p>I’m curious if you have any advice or good examples of projects covered by both BDD and unit tests that achieve a good mix.
</p></blockquote>
<p><span id="more-2228"></span></p>
<p>Regarding the division of responsibilities, I like <a href="http://blog.jonasbandi.net/2010/02/agile-testing-quadrants.html">Brian Marick&#8217;s quandrants as a model</a>, they explain that nicely.</p>
<p>I disagree with the statement that BDD tests are integration tests. BDD tests are a functional specification of a system (in the quadrant model, they are business facing and supporting the team), unit tests guide technical design (in the quadrant model, team facing and supporting). They address two different issues. Unit tests tell you that the system works as the programmers wanted it to in the technical aspects, BDD scenarios tell you that the right functionality is there from a business perspective. They interact with the system on completely different levels and have different key examples. Null pointers don&#8217;t exist in most businesses. Integration tests check that the system components are connected correctly and that they talk to each other (including third parties), not that the business functionality is there.</p>
<p>I wrote about <a href="http://gojko.net/2011/01/12/the-false-dichotomy-of-tests/">this problem</a> of mixing up BDD and integration tests recently.</p>
<p>If the BDD scenarios you&#8217;ve seen cover only happy paths, you haven&#8217;t seen good examples then. They should contain key examples &#8211; positive and negative. See <a href="http://cuke4ninja.com/sec_collaborative_feature_files.html">what Cuke4Ninja has to say on the key examples</a>. (in the cucumber language, a feature file is a bdd test).</p>
<p>For examples of projects that got BDD right, see <a href="http://specificationbyexample.com">specificationbyexample.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2011/01/28/duplication-between-bdd-and-unit-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Specification by example: Executive Summary</title>
		<link>http://gojko.net/2011/01/05/specification-by-example-executive-summary/</link>
		<comments>http://gojko.net/2011/01/05/specification-by-example-executive-summary/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:20:28 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[specification by example]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=2154</guid>
		<description><![CDATA[I&#8217;m running a half-day seminar on Specification by Example in London on 2nd of February. The seminar covers an introduction to Specification by Example and the most important results of the research I&#8217;ve conducted for my new book on how 50+ teams, from small web startups to teams working for...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running a half-day seminar on Specification by Example in London on 2nd of February. The seminar covers an introduction to Specification by Example and the most important results of the research I&#8217;ve conducted for my new book on how 50+ teams, from small web startups to teams working for large investment banks, got big pay-offs from BDD, agile acceptance testing, specification by example and related techniques. </p>
<p>The seminar should specifically fit people who are too busy to attend training otherwise, such as team leaders, managers and senior technical people.  <a href="http://specificationbyexample-gojko.eventbrite.com/">Click here for more information and to register</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2011/01/05/specification-by-example-executive-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The principle of symmetric change</title>
		<link>http://gojko.net/2010/12/02/the-principle-of-symmetric-change/</link>
		<comments>http://gojko.net/2010/12/02/the-principle-of-symmetric-change/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 12:29:39 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[agile testing]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[specification by example]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=2143</guid>
		<description><![CDATA[One of the most important lessons that I&#8217;ve learned as the result of the research conducted for my upcoming book Specification by Example is that many of the most common problems people have with implementing BDD or agile acceptance testing come from a misalignment of conceptual models. By changing our...]]></description>
			<content:encoded><![CDATA[<p>One of the most important lessons that I&#8217;ve learned as the result of the research conducted for my upcoming book <a href="http://specificationbyexample.com">Specification by Example</a> is that many of the most common problems people have with implementing BDD or agile acceptance testing come from a misalignment of conceptual models. By changing our view at the specifications/tests we can make most of those issues go away instantly.<span id="more-2143"></span></p>
<p>The most useful software models are the ones where the technical view of the world is aligned with the relevant business domain model. This ensures that one small change in the business domain (new requirements or changes to existing features) results in one small change in software. This is one of the key ideas of Domain Driven Design. The alignment of the technical and the business models ensures that software evolves nicely with the business and that we never get into a position where a small report change requires a rewrite of the entire system or six months to implement.</p>
<p>The same is true for the other artefacts produced for software &mdash; especially tests and documentation. When the conceptual model used in the tests is aligned with the business domain model, one small change in business will result in one small change in tests, making the tests easy to maintain. This applies to the language used in the tests, the abstractions used to describe features and the way that the tests are organised. So I propose the following principle to get good executable specifications/acceptance tests/bdd scenarios/feature files/fitnesse pages or whatever you call them:</p>
<blockquote><p><b>The principle of symmetric change</b><br />
One small change in a business model should require one small change to executable specifications.
</p></blockquote>
<p>To achieve this, ensure that:</p>
<ul>
<li>each specification should be focused on a single concept of the business domain model (which might be a business rule, step in a flow, or something higher such as the overall definition of a business process)</li>
<li>the concepts used in key examples in a specification are closely aligned with the business domain model and reflected in underlying software domain model. this includes naming (concepts are described in the business domain language) but also the relationships between them.</li>
<li>the (automated) validation procedure is clearly separated from the specification of key examples</li>
<li>the specifications are organised into a living documentation system according to the conceptual relationships that exist in the business domain model</li>
</ul>
<p>Thinking about aligning key examples and specifications with the business domain model instantly solves many of <a href="http://gojko.net/2009/09/24/top-10-reasons-why-teams-fail-with-acceptance-testing/">classic acceptance testing/bdd problems we identified during a CITCON workshop in Paris last year</a>.  For example, &#8220;Focusing on How, not What&#8221; is a sure way to write tests that are very hard to maintain but lots of teams still do it. By thinking about aligning the language and abstraction concepts in the specifications with the business domain model, we force ourselves to describe what the software should do, not how it does it. This separates the specification (what) from the validation procedure (how can we check it in software). The validation procedure can then be automated using a tool. This is a classic problem that Ward Cunningham and Rick Mugridge have identified in Fit For Developing Software nand advised readers not to automate flows. But that is an overly generalised statement &#8211; it confuses people who deal with genuine workflows,  for example in payment systems where business workflows are everything. David Peterson advised people to focus on specification over scripting, which is less generalised but still not directly to the point. Flows or scripts aren&#8217;t the real problem &#8211; it is mixing the business definition of a function with the validation procedure. </p>
<p>Thinking about specifications and tests in this way also prevents people from falling into the trap of <a href="http://gojko.net/2010/07/29/the-sine-of-death-by-ui-test-automation/">The Sine of Death by UI Test Automation</a>. Tests described with low level technical detail, in the language of technical UI interactions, are everything but aligned with a business model. If anything, they are aligned with the current design and layout of user interfaces. A small change in business requirements can have a huge impact on such tests, requiring hours of updates to tests after just a few minutes of changes to the code, which then fails the symmetric change principle. </p>
<p>Ensuring that the specifications are aligned with the business model and in the business language, organised according to the relationships the underlying concepts have in the business model solves all the reasons behind the &#8220;Tests unusable as live documentation&#8221; family of problems, and ensuring that the previous documents are still aligned with the new model resolves most of the issues we described as &#8220;Test code not maintained with love&#8221;.    </p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2010/12/02/the-principle-of-symmetric-change/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Secret Ninja Cucumber Scrolls</title>
		<link>http://gojko.net/2010/09/20/the-secret-ninja-cucumber-scrolls/</link>
		<comments>http://gojko.net/2010/09/20/the-secret-ninja-cucumber-scrolls/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 14:04:15 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[agile testing]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[cuke4ninja]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=1996</guid>
		<description><![CDATA[It is my great pleasure to announce the immediate availability of The Secret Ninja Cucumber Scrolls, a free e-book and online step-by-step guide for Cucumber, a tool that is quickly becoming the weapon of choice for many agile teams when it comes to functional test automation, creating executable specifications and...]]></description>
			<content:encoded><![CDATA[<p>It is my great pleasure to announce the immediate availability of <a href="http://cuke4ninja.com">The Secret Ninja Cucumber Scrolls</a>, a free e-book and online step-by-step guide for Cucumber, a tool that is quickly becoming the weapon of choice for many agile teams when it comes to functional test automation, creating executable specifications and building a living documentation. </p>
<p>The main author of this e-book is my colleague <a href="http://deflorinier.blogspot.com/">David de Florinier</a>, and I&#8217;ve also contributed a bit. </p>
<p>The first version covers the basics of Cucumber, setting up for Ruby, Java and .NET projects, implementing basic features in all three languages, effective test design and managing complex features efficiently. We plan to develop this guide incrementally, and the  next version will include web browser automation topics.    </p>
<p>To download the PDF or read the e-Book online, point your browser to <a href="http://cuke4ninja.com">cuke4ninja.com</a>. For news and updates, follow <a href="http://twitter.com/cuke4ninja">cuke4ninja</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2010/09/20/the-secret-ninja-cucumber-scrolls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

