<?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>Christopher Bird &#187; ruby</title>
	<atom:link href="http://www.christopherbird.co.uk/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christopherbird.co.uk</link>
	<description>Personal and professional blog</description>
	<lastBuildDate>Mon, 21 Jun 2010 15:32:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Lessons learnt from acceptance testing&#8230; again</title>
		<link>http://www.christopherbird.co.uk/2009/12/lessons-learnt-from-acceptance-testing-again/</link>
		<comments>http://www.christopherbird.co.uk/2009/12/lessons-learnt-from-acceptance-testing-again/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 22:26:48 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[acceptance testing]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://www.christopherbird.co.uk/?p=49</guid>
		<description><![CDATA[After writing my last post i&#8217;ve been thinking more about the question of &#8220;How should i organise my tests?&#8221;. The answer i gave last time seemed to work for fixing existing tests but didn&#8217;t seem to fix the cause of the problem that all the tests were still too much like unit tests. Oh yeah, [...]]]></description>
			<content:encoded><![CDATA[<p>After writing my last post i&#8217;ve been thinking more about the question of &#8220;How should i organise my tests?&#8221;. The answer i gave last time seemed to work for fixing existing tests but didn&#8217;t seem to fix the cause of the problem that all the tests were still too much like unit tests. Oh yeah, at this point i&#8217;d like to point out i reserve the right to contradict myself.</p>
<p>While working on a separate RoR project I&#8217;ve used <a href="http://cukes.info/">Cucumber</a> to drive acceptance tests. If you&#8217;ve not tried it already, it&#8217;s great give it a go! Also on a side note i also discovered the guys who wrote selenium-client put a great deal more thought into the API than the .NET counterpart. Lots of extensions for waits and JQuery/Prototype integration are included by default. Anyway back to the problem at had, Cucumber forces you to write plain text stories (or features) and one or more scenarios for that story. Scenarios are written with each line start with &#8220;Given&#8221;, &#8220;When&#8221; and &#8220;Then&#8221; (and optionally And). Each line of the scenario corresponds to an executable &#8220;Step&#8221; that in my case performed a selenium action (or it could also quite easily perform an action against an API).</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Feature: Manage blog posts<br />
&nbsp; In order to manage my blog posts<br />
&nbsp; As a writer of poor blog posts<br />
&nbsp; I want to be able to create blog posts<br />
<br />
&nbsp; Scenario: Create a blog post <br />
&nbsp; &nbsp; Given i have clicked add blog post<br />
&nbsp; &nbsp; And i have written &quot;My first post&quot; with content &quot;My first post&quot;<br />
&nbsp; &nbsp; When i click publish<br />
&nbsp; &nbsp; Then i should see the post &quot;My first entry&quot; in the list of posts</div></div>
<p>Anyway this method of writing test with the emphasis on the behaviour of the user (not surprising for a BDD tool) meant i ended up with less focus on one bit of functionality on a single page and more on the overall journey of the users actions through the application. Each scenario taking a different path or journey through that story.</p>
<p>Overall cucumber forced me to stay true to testing behaviour, avoiding the pitfalls of the test written in a plain unit testing framework. So, try cucumber, even if you don&#8217;t use it in your project i hope it makes you think differently about how you write the same tests in your native language.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christopherbird.co.uk/2009/12/lessons-learnt-from-acceptance-testing-again/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
