<?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>Kai Ramuenke &#187; User stories</title>
	<atom:link href="http://www.ramuenke.de/archives/tag/user-stories/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ramuenke.de</link>
	<description>Just another agile software development blog</description>
	<lastBuildDate>Wed, 20 May 2009 13:28:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>It&#8217;s done when it&#8217;s done!</title>
		<link>http://www.ramuenke.de/archives/3</link>
		<comments>http://www.ramuenke.de/archives/3#comments</comments>
		<pubDate>Sun, 15 Jun 2008 04:23:26 +0000</pubDate>
		<dc:creator>Kai</dc:creator>
				<category><![CDATA[Agile Software Development]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[User stories]]></category>

		<guid isPermaLink="false">http://www.ramuenke.de/?p=3</guid>
		<description><![CDATA[To define a user story as done can be a tricky task. It&#8217;s about negotiating with the customer and setting the right expectations. A common tool we use in our projects is defining Acceptance Criteria for user stories. Using Acceptance Criteria is great because we set expectations on the application&#8217;s behavior right from the start [...]]]></description>
			<content:encoded><![CDATA[<p>To define a user story as done can be a tricky task. It&#8217;s about negotiating with the customer and setting the right expectations. A common tool we use in our projects is defining Acceptance Criteria for user stories. Using Acceptance Criteria is great because we set expectations on the application&#8217;s behavior right from the start before implementing the story. We can drive the expectations of the customer on what will be delivered at the end of an iteration. Furthermore we can translate those Acceptance Criteria into executable and automated tests (more on that later). Thus we make sure that we do not break any existing functionality as we move on in the project. If a story passes all Acceptance Criteria it can be considered as done.</p>
<p>So how does an Acceptance Criteria look like? Let&#8217;s say we have a simple user story called &#8220;Login&#8221;:</p>
<p><em>As a registered user i want to log in so that i can view my personalized report</em></p>
<p>Acceptance Criteria are then described as scenarios. As an expample let&#8217;s look at a typical main success scenario for the user story above:</p>
<p><em>Given a registered user u<br />
When entering username FooFoo and password BarBar<br />
And logging in<br />
Then the personalized report for user u is shown.<br />
</em></p>
<p>A story can have as many Acceptance Criteria as necessary to consider it as done. Don&#8217;t be fooled to believe you can define every Acceptance Criteria upfront. As the team gains more and more knowledge while proceeding in an iteration more Acceptance Criteria may be discovered. Your initial set of Acceptance Criteria should be enough to make everyone comfortable to deliver that story.</p>
<p>So why this format of &#8220;Given&#8221; &#8220;When&#8221; &#8220;Then&#8221;? On my current project we use RSpec, a Behavior Driven Development framework for Ruby. You start by writing your stories with the scenarios in plain text files:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Story: Login
  As a registered user
  I want to log in
  So that i can view my personalized report
&nbsp;
  Scenario: login successful
    Given a registered user u
    When entering username FooFoo and password BarBar
    And logging in
    Then the personalized report for user u is shown.</pre></div></div>

<p>Each Given, When, Then is a step and i can define these steps in Ruby:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">steps_for<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:login</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  Given<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;a registered user $user&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span> user <span style="color:#006600; font-weight:bold;">|</span>
    user.<span style="color:#9900CC;">should</span> exsist
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">When</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;entering username $username and password $password&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span> username, password <span style="color:#006600; font-weight:bold;">|</span>
    page.<span style="color:#9900CC;">type</span><span style="color:#006600; font-weight:bold;">&#40;</span>username, account<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">When</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;logging in&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    page.<span style="color:#9900CC;">login</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">Then</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;the personalized report for user $user is shown&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span> user <span style="color:#006600; font-weight:bold;">|</span>
    page.<span style="color:#9900CC;">should</span> be_personalized_for<span style="color:#006600; font-weight:bold;">&#40;</span>user<span style="color:#006600; font-weight:bold;">&#41;</span> 
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The great thing about this is that you can reuse the steps for other scenarios and hook up the RSpec framework with functional testing tools like Selenium or Frankenstein to have real end-to-end testing. In addition you can integrate the tests into the Continuous Integration server to have automated regression testing. The effort the team puts into fledging out Acceptance Criteria is directly translated into automated test code producing minimal waste.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ramuenke.de/archives/3/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
