<?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>Claudio Perrone&#039;s Monologues &#187; bdd</title>
	<atom:link href="http://www.agilesensei.com/articles/tag/bdd/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.agilesensei.com</link>
	<description>Personal and professional transformations in today&#039;s agile world</description>
	<lastBuildDate>Wed, 11 Jan 2012 16:24:15 +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>MisBehave 0.1: Oslo&#8217;s MGrammar for BDD Executable Specifications</title>
		<link>http://www.agilesensei.com/blog/articles/2008/11/09/misbehave-01-oslos-mgrammar-for-bdd-executable-specifications/</link>
		<comments>http://www.agilesensei.com/blog/articles/2008/11/09/misbehave-01-oslos-mgrammar-for-bdd-executable-specifications/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 21:45:55 +0000</pubDate>
		<dc:creator>Claudio Perrone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[MisBehave]]></category>
		<category><![CDATA[Oslo]]></category>

		<guid isPermaLink="false">http://www.claudioperrone.com/blog/articles/2008/11/09/misbehave-01-oslos-mgrammar-for-bdd-executable-specifications/</guid>
		<description><![CDATA[While people are still debating about the reasons behind Oslo, the forthcoming modeling platform officially disclosed at PDC a couple of weeks ago, I thought it would be useful to share with you how, this weekend, I used MGrammar to parse plain text stories and scenarios using the Behavior-Driven Development (BDD) language originally devised by [...]]]></description>
			<content:encoded><![CDATA[<p>While people are still debating about the reasons behind <a href="http://msdn.microsoft.com/en-gb/oslo/default.aspx">Oslo</a>, the forthcoming modeling platform officially disclosed at PDC a couple of weeks ago, I thought it would be useful to share with you how, this weekend, I used MGrammar to parse plain text stories and scenarios using the <a href="http://dannorth.net/introducing-bdd">Behavior-Driven Development</a> (BDD) language originally devised by my good friend <a href="http://dannorth.net/">Dan North</a>.<br />
One of the main ideas around BDD is that we can adopt a simple language for expressing business requirements that is ubiquitous among &#8220;customers&#8221; (business analysts), testers and developers.<br />
At the simplest level, a story may be expressed using this template (emphasis on bold is mine):</p>
<p><strong>Story:</strong> <em>&lt;title&gt;</em><br />
<strong>As</strong> <em>&lt;role&gt;</em><br />
<strong>I want</strong> <em>&lt;feature&gt;</em><br />
<strong>So that</strong> <em>&lt;business reason&gt;</em></p>
<p>In other words, a customer may write something along these lines:</p>
<p><strong>Story:</strong> View music chart<br />
<strong>As </strong>a music fan<br />
<strong>I want</strong> to browse a list of popular songs<br />
<strong>So that</strong> I can be motivated to buy something from the catalog</p>
<p>One of the immediate benefits of using this convention is that high-level requirements can be described and manipulated consistently and succinctly.<br />
I&#8217;m particularly fond of the <strong>So that</strong> step: if well written, it often highlights the actual customer needs.<br />
Once a need is identified, it becomes much easier for the development team to find further (and often cheaper) alternatives to the requested feature!</p>
<p>In the example above, &#8220;browse a list of popular songs&#8221; is the request, but being &#8220;motivated to buy something from the catalog&#8221; is the actual need. Can you imagine other features that would motivate customers to buy more? I certainly do.<br />
The lesson here is that, almost invariably, customers request a <em>longer antenna</em> when they actually need a <em>better reception</em>. Trust me, this kind of deliberate creative thinking on finding alternatives can save you days, weeks, or even months of work.</p>
<p>Identifying the need is so important, in fact, that others proposed the following alternative convention, so that you can force users to put the reason of the requirement at the beginning:</p>
<p><strong>In order to</strong> be motivated to buy something<br />
<strong>As </strong>a music fan<br />
<strong>I want</strong> to browse a list of popular songs</p>
<p>Are you still with me? Good. Let&#8217;s move on and discuss scenarios.<br />
Differently from conventional, &#8220;fully dressed&#8221; use cases that I used years ago, a user story is usually written on a small card which acts as a placeholder for a subsequent conversation with the development team.<br />
When the conversation takes place, the team would ask the customer questions such as: &#8220;what do you mean by that exactly?&#8221;  To express and clarify the details of each story we write down a few scenarios:<br />
Here, BDD can help us again with another template:</p>
<p><strong>Scenario:</strong>  <em>&lt;title&gt;</em><br />
<strong>Given</strong> <em>&lt;some initial context&gt;</em><br />
<strong>And</strong>  <em>&lt;some more context&gt;</em><br />
&#8230;<br />
<strong>When</strong> <em>&lt;some event occurs&gt;</em><br />
<strong>Then</strong> <em>&lt;ensure outcome&gt;</em><br />
<strong>And</strong> <em>&lt;some more outcome&gt;</em><br />
&#8230;</p>
<p>For example, customers, testers and/or developers could write and discuss the following:</p>
<p><strong>Scenario:</strong>  Browse chart<br />
<strong>Given</strong> visitor is logged in<br />
<strong>And</strong> visitor is on home page<br />
<strong>When</strong> visitor clicks on chart page link<br />
<strong>Then</strong> page should display title &#8220;Top charts&#8221;<br />
<strong>And</strong> page should display list of top songs</p>
<p>These scenarios can be used as both documentation and as acceptance criteria.<br />
If you are new to BDD, there is a little twist. Each single step in the scenario is sufficiently small to be &#8220;automated&#8221;.</p>
<p>Indeed, there are already several frameworks (some more mature than others) that have story runners able to relate the intention (expressed by customers) to some code (written by developers), often using a simple naming conventions (e.g. a <strong>Given</strong> step can run an equivalent <strong>Given</strong> method). The list is growing fast: <a href="http://jbehave.org/">JBehave</a>, <a href="http://dannorth.net/2007/06/introducing-rbehave">RBehave</a>, <a href="http://www.codeplex.com/NBehave">NBehave</a>, <a href="http://rspec.info/">RSPec</a>, <a href="http://github.com/aslakhellesoy/cucumber/wikis">Cucumber,</a> and so on.<br />
At InnerWorkings, we experimented for a long time with various frameworks (including our own) but we now use a Ruby-based framework called <a href="http://github.com/aslakhellesoy/cucumber/wikis">Cucumber</a> (a brilliant rewrite of the RSpec story runner, now deprecated).<br />
Great stuff, you will say, but I don&#8217;t want to use Ruby. Your loss, I would reply <img src='http://www.agilesensei.com/weblog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . We love .NET too, but we use Ruby as well.</p>
<p>Although I&#8217;m sure many plain-text story runners based on .NET will emerge soon (if they are not there already), this weekend I started my own pet projet. Since it uses the new language ‘M&#8217; (MGrammar, specifically) I decided to call it MisBehave.<br />
I haven&#8217;t bothered building a story runner yet, but you may find this picture quite interesting:</p>
<p><a href="http://www.claudioperrone.com/blog/files/intellipad.gif" title="intellipad"></a></p>
<p style="text-align: center"><a href="http://www.claudioperrone.com/blog/files/intellipad.gif" title="intellipad.gif"><img src="http://www.claudioperrone.com/blog/files/intellipad.thumbnail.gif" alt="intellipad.gif" /></a></p>
<p>It shows Intellipad, one of the tools provided with the Oslo CTP.</p>
<p>On the left column, I have an instance of the language. On the central column, I have the grammar I wrote, and the third column, shows the projected tree structure. So far, I have plain text converted into a structure that will be further processed by a program. Hopefully you can see where this is going.</p>
<p>I haven&#8217;t tested the grammar extensively. I will clean it up, add support for scenario reuse (GivenScenario), add FIT-style tables, improve the error notifications, and refine the projections.</p>
<p>A few people said that writing languages is difficult. Well, it is difficult indeed if you write general purpose languages.<br />
For simple domain-specific languages though, the task is much simpler. I wish I could say it is really trivial, but I won&#8217;t <img src='http://www.agilesensei.com/weblog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>For educational purposes, you can download my grammar <a href="http://www.claudioperrone.com/blog/files/misbehavemg.txt">here</a>  (useful if you have the Oslo SDK).<br />
Any feedback is more than welcome.<br />
Now I&#8217;ll better stop toying around and start preparing for my presentation at <a href="http://www.oredev.org/"><span class="mainheader">Ø</span>redev</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agilesensei.com/blog/articles/2008/11/09/misbehave-01-oslos-mgrammar-for-bdd-executable-specifications/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Introducing Behaviour-Driven Development</title>
		<link>http://www.agilesensei.com/blog/articles/2006/11/06/introducing-behaviour-driven-development/</link>
		<comments>http://www.agilesensei.com/blog/articles/2006/11/06/introducing-behaviour-driven-development/#comments</comments>
		<pubDate>Mon, 06 Nov 2006 04:18:52 +0000</pubDate>
		<dc:creator>Claudio Perrone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bdd]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>I came across <a href="http://behaviour-driven.org/">behaviour-driven development (BDD)</a> early this year at the software architecture workshop in Cortina.<br/>
When <a href="http://dannorth.net/">Dan North</a> started illustrating the concept and his findings, I almost immediately felt that he was on to something with incredible potential; so much in fact, that I definitely consider that session the highlight of the entire workshop. </p>

<p>On the surface, BDD can be described as a simple refinement of <a href="http://en.wikipedia.org/wiki/Test-driven_development">test-driven development (TDD)</a>. </p>

<p>After practicing TDD for a while, it is easy to realize that test-driven development is more about code design (specification) than testing (validation).<br/>
In fact, it is about expressing the behavioural intent of the systems we are developing.</p>

<p>As a consequence, BDD is a practice that, at its core, advocates modifying the nomenclature of our tests to better support this mindset. </p>

<p>There is a lot more to it of course, but since I still have to prepare my luggage and I risk to be late for my flight to Barcelona (yep, I&#8217;m going to Tech-Ed Developers!) I won&#8217;t go into any detail today.<br/>
I will write about it very soon, however, as I&#8217;ve been trying it for a while and I think it is only fair to share my experience.  </p>

<p>In the meantime, I strongly suggest reading the excellent <a href="http://dannorth.net/introducing-bdd">article</a> that Dan published for <a href="http://www.stickyminds.com/BetterSoftware/magazine.asp">Better Software magazine</a> last March and that now is finally available online. </p>]]></description>
			<content:encoded><![CDATA[<p>I came across <a href="http://behaviour-driven.org/">behaviour-driven development (BDD)</a> early this year at the software architecture workshop in Cortina.</p>
<p>When <a href="http://dannorth.net/">Dan North</a> started illustrating the concept and his findings, I almost immediately felt that he was on to something with incredible potential; so much in fact, that I definitely consider that session the highlight of the entire workshop. </p>
<p>On the surface, BDD can be described as a simple refinement of <a href="http://en.wikipedia.org/wiki/Test-driven_development">test-driven development (TDD)</a>. </p>
<p>After practicing TDD for a while, it is easy to realize that test-driven development is more about code design (specification) than testing (validation).<br />
In fact, it is about expressing the behavioural intent of the systems we are developing.</p>
<p>As a consequence, BDD is a practice that, at its core, advocates modifying the nomenclature of our tests to better support this mindset. </p>
<p>There is a lot more to it of course, but since I still have to prepare my luggage and I risk to be late for my flight to Barcelona (yep, I’m going to Tech-Ed Developers!) I won’t go into any detail today.<br />
I will write about it very soon, however, as I’ve been trying it for a while and I think it is only fair to share my experience.  </p>
<p>In the meantime, I strongly suggest reading the excellent <a href="http://dannorth.net/introducing-bdd">article</a> that Dan published for <a href="http://www.stickyminds.com/BetterSoftware/magazine.asp">Better Software magazine</a> last March and that now is finally available online. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.agilesensei.com/blog/articles/2006/11/06/introducing-behaviour-driven-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

