<?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>Tea-Driven Development &#187; testing</title>
	<atom:link href="http://blog.mattwynne.net/tag/testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mattwynne.net</link>
	<description>Matt Wynne taking it one tea at a time</description>
	<lastBuildDate>Tue, 10 Jan 2012 20:07:10 +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>Fixing my testing workflow</title>
		<link>http://blog.mattwynne.net/2011/05/27/fixing-my-testing-workflow/</link>
		<comments>http://blog.mattwynne.net/2011/05/27/fixing-my-testing-workflow/#comments</comments>
		<pubDate>Fri, 27 May 2011 17:21:25 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Agile / Lean Software Development]]></category>
		<category><![CDATA[Ruby Programming]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2011/05/27/fixing-my-testing-workflow/</guid>
		<description><![CDATA[Okay I&#8217;m bored of this. I need to talk about it. I love to use Ruby, RSpec, Cucumber and Rails to do test-driven development, but my tools for running tests are just infuriatingly dumb. Here&#8217;s what I want: When a test fails, it should be kept on a list until it has been seen to [...]]]></description>
			<content:encoded><![CDATA[<p>Okay I&#8217;m bored of this. I need to talk about it.</p>

<p>I love to use Ruby, RSpec, Cucumber and Rails to do test-driven development, but my tools for running tests are just infuriatingly <em>dumb</em>. Here&#8217;s what I want:</p>

<ul>
<li>When a test fails, it should be kept on a list until it has been seen to pass</li>
<li>When more than one test fails:

<ul>
<li>Show me the list, let me choose one</li>
<li>Focus on that one until it passes, or I ask to go &#8216;back up&#8217; to the list</li>
<li>When it passes, go back up to the list and let me choose again</li>
<li>When the list is empty, I get a free biscuit</li>
</ul></li>
<li>When a test case is run, a mapping should be stored to the source files that were covered as it ran so that:

<ul>
<li>When a file changes, I can use that mapping to guess which test cases to run. Fuck all this naming convention stuff, it&#8217;s full of holes.</li>
<li>At any time, I can pipe the git diff though the tool to figure out which test cases to run to cover the entire commit I&#8217;m about to make.</li>
</ul></li>
</ul>

<p>When I say test case, I personally mean:</p>

<ul>
<li>An RSpec example</li>
<li>A Cucumber scenario</li>
</ul>

<p>&#8230;but it should work for any other testing framework too.</p>

<p>I feel like having a tool like this that I trusted would make a huge difference to me. There are all these various scrappy little pieces of the puzzle around: guard plugins, autotest, cucover, cucumber&#8217;s rerun formatter. None of them seem to quite do it, for me. Am I missing something?</p>

<p>Or shall we make one?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2011/05/27/fixing-my-testing-workflow/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Cucumber: Why Bother?</title>
		<link>http://blog.mattwynne.net/2011/03/30/cucumber-why-bother/</link>
		<comments>http://blog.mattwynne.net/2011/03/30/cucumber-why-bother/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 21:03:33 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Agile / Lean Software Development]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2011/03/30/cucumber-why-bother/</guid>
		<description><![CDATA[It’s perfectly possible to write automated acceptance tests without using Cucumber. You can just write them in pure Ruby. Take this test for withdrawing cash from an ATM: Scenario: Attempt withdrawal using stolen card Given I have $100 in my account But my card is invalid When I request $50 Then my card should not [...]]]></description>
			<content:encoded><![CDATA[<p>It’s perfectly possible to write automated acceptance tests without using Cucumber. You can just write them in pure Ruby. Take this test for withdrawing cash from an ATM:</p>

<p><div>
<pre class="txt" style="font-family:monospace;">Scenario: Attempt withdrawal using stolen card 
  Given I have $100 in my account 
  But my card is invalid
  When I request $50
  Then my card should not be returned 
  And I should be told to contact the bank</pre>
</div></p>

<p>We could automate that test using good old Test::Unit, perhaps something like this:</p>

<p><div>
<pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'test/unit'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> WithdrawlTests <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#CC00FF; font-weight:bold;"><span style="color:#6666ff; font-weight:bold;">Test::Unit::TestCase</span></span>
  <span style="color:#9966CC; font-weight:bold;">def</span> test_attempt_widthrawl_using_stolen_card
    bank = Bank.<span style="color:#9900CC;">new</span>
    account = Account.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>bank<span style="color:#006600; font-weight:bold;">&#41;</span>
    account.<span style="color:#9900CC;">deposit</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    card = DebitCard.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>account<span style="color:#006600; font-weight:bold;">&#41;</span>
    bank.<span style="color:#9900CC;">lock_out</span><span style="color:#006600; font-weight:bold;">&#40;</span>card<span style="color:#006600; font-weight:bold;">&#41;</span>
    atm = Atm.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>bank<span style="color:#006600; font-weight:bold;">&#41;</span>
    atm.<span style="color:#9900CC;">insert_card</span><span style="color:#006600; font-weight:bold;">&#40;</span>card<span style="color:#006600; font-weight:bold;">&#41;</span>
    atm.<span style="color:#9900CC;">enter_pin</span><span style="color:#006600; font-weight:bold;">&#40;</span>card.<span style="color:#9900CC;">pin</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    atm.<span style="color:#9900CC;">withdraw</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">50</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    assert atm.<span style="color:#9900CC;">card_withheld</span>?, <span style="color:#996600;">&quot;Expected the card to be withheld by the ATM&quot;</span>
    assert_equal <span style="color:#996600;">&quot;Please contact the bank.&quot;</span>, atm.<span style="color:#9900CC;">message_on_screen</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre>
</div></p>

<p>The big disadvantage of writing acceptance tests in pure Ruby like this is that it’s unlikely you’ll be able to show this test to your team&#8217;s analyst without their eyes glazing over.</p>

<p><img src="http://blog.mattwynne.net/wp-content/uploads/2011/03/bored.jpg" alt="bored" /></p>

<p>Unless your analyst is, or has recently been, a programmer themselves, they won’t be able to see past the noise of Ruby’s syntax, clean as it may be, to understand the actual behaviour that’s being specified. The specification of behaviour and the implementation of the test are all mixed up together, and that’s a problem if we want to get feedback from our stakeholders about whether we’ve specified the right thing <em>before</em> we go ahead and build it.</p>

<p>If we want the benefits of using plain language to write our behaviour specification, then we need a way to translate that into automation code that actually pulls and pokes at our application. Step definitions give you a translation layer between the plain-language specification of behviour and the test automation code, mapping the Gherkin steps of each scenario to Ruby code that Cucumber can execute.</p>

<p>The cost of this extra layer is complexity: Yes, you have more test code to maintain than you would if you stuck to writing your tests in pure Ruby. The benefit is clarity: by separating the <em>what</em> (the features) from the <em>how</em> (the ruby automation code), you keep each part simpler and easier for its target audience to understand.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2011/03/30/cucumber-why-bother/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Seven Truths Exercise</title>
		<link>http://blog.mattwynne.net/2010/10/14/seven-truths-exercise/</link>
		<comments>http://blog.mattwynne.net/2010/10/14/seven-truths-exercise/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 11:40:51 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Agile / Lean Software Development]]></category>
		<category><![CDATA[Coaching]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[Workshop]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2010/10/14/seven-truths-exercise/</guid>
		<description><![CDATA[Recently, I played a game with a team I was training which I called &#8220;Seven Truths of Test Automation&#8221;. I got each &#8220;truth&#8221; and wrote it on an index card and put it in a (blank) envelope. I got to the training room early and hid them around the room, not very well, so that [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I played a game with a team I was training which I called &#8220;Seven Truths of Test Automation&#8221;.</p>

<p>I got each &#8220;truth&#8221; and wrote it on an index card and put it in a (blank) envelope. I got to the training room early and hid them around the room, not very well, so that they were quite easy to find.</p>

<p>We did some other stuff first, and people were looking at all these little envelopes sticking out from behind whiteboards and under cushions, wondering what was going to happen.</p>

<p>Then I told them that we were going to play a game. I told them that there are seven truths of test automation, and they were about to discover them. I split them into 6 small groups. I then told them they would each go out and discover a truth. When they found it, they had to ask themselves the following questions:</p>

<ul>
<li>Do we agree with this?</li>
<li>What are the implications of acting on this truth?</li>
<li>What are we going to do now?</li>
</ul>

<p>I wrote those questions on a flip-chart. We then played the game out as a group on a single truth to make sure everyone got it. I made sure that we had a full and frank discussion about whether we agreed with the truth or not. We thought through the implications (good and bad) and listed them out. We then talked about some concrete steps we could take. When they offered vague intents &#8220;We&#8217;ll start getting better at reducing duplication&#8221; I urged them to say exactly what they were going to do <em>next week</em> to get better at reducing duplication.</p>

<p>Then they split off and each did their own. They wrote up a poster and we did a gallery at the end of the session where they had a chance to share their learning with the group.</p>

<p>It worked really well, generated great energy and used up a good couple of hours.</p>

<p>For the record, I think the truths I used with this group were:</p>

<ul>
<li>test automation is software development (this is the one I picked to do with the whole group)*</li>
<li>duplication destroys maintainability*</li>
<li>incidental details destroy maintainability*</li>
<li>know when it&#8217;s OK to cheat</li>
<li>some things just aren&#8217;t worth testing</li>
<li>work with developers to make their systems testable</li>
<li>don&#8217;t test other people&#8217;s code</li>
</ul>

<p>It felt a bit egotistical handing them down My Seven Truths, so I made the point that they were just my truths, and they would discover their own as they learned to become better testers. You could obviously vary the truths depending on what you think the that group needs to hear / discuss, and those truths could be about anything, not just test automation.</p>

<ul>
<li>Thanks to Dale Emery for these: <a href="http://dhemery.com/pdf/writing_maintainable_automated_acceptance_tests.pdf">http://dhemery.com/pdf/writing<em>maintainable</em>automated<em>acceptance</em>tests.pdf</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2010/10/14/seven-truths-exercise/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Belly Wants to Eat Your Tests</title>
		<link>http://blog.mattwynne.net/2010/08/23/belly-wants-to-eat-your-tests/</link>
		<comments>http://blog.mattwynne.net/2010/08/23/belly-wants-to-eat-your-tests/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 15:03:37 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Agile / Lean Software Development]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2010/08/23/belly-wants-to-eat-your-tests/</guid>
		<description><![CDATA[Ever since I lead the team at Songkick through an Acceptance-Test-Driven re-write of their gorgeous web-ui, I&#8217;ve been thinking about problem of scaling a large suite of acceptance tests. By the time I left Songkick for the wilds of Scotland, it would take over 3 hours to run all the Cucumber tests on a single [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I lead the team at Songkick through an Acceptance-Test-Driven re-write of their <a href="http://songkick.com">gorgeous web-ui</a>, I&#8217;ve been <a href="http://blog.mattwynne.net/2009/04/06/the-future-of-automated-acceptance-testing/">thinking about problem</a> of scaling a large suite of acceptance tests. By the time I left Songkick for the wilds of Scotland, it would take over 3 hours to run all the Cucumber tests on a single machine.</p>

<p>When things take that long, TDD stops being fun.</p>

<h2>Intelligent Selection</h2>

<p>In order to make an intelligent selection of which tests to run, you need some knowledge of the past history of each of your tests. Most testing tools are like goldfish: they run the tests and show you what failed, then on the next run they wipe the slate clean and start over. Dumb.</p>

<p><a href="http://www.threeriversinstitute.org/">Sir Kent Beck</a>, always ahead of the game, has been building an <a href="http://www.threeriversinstitute.org/junitmax/subscribe.html">exciting new product</a> to enable precisely this kind of <em>selective testing</em> for Java projects.</p>

<p>But I don&#8217;t work on Java projects.</p>

<h2>Enter the Belly</h2>

<p>I decided to build a web service that would record the history of each scenario in my Cucumber test suite, so that I could start to make decisions about which ones to run. I see no reason why this service can&#8217;t be generic enough to work for any kind of test case, but Cucumber scenarios seem like a good place to get started, since that&#8217;s where I do a lot of my testing, and they&#8217;re often slow.</p>

<p>Belly works by installing a little hook into your Cucumber test suite. When the tests run, Belly sends a message to the central &#8216;hub&#8217; web service (currently hosted at <a href="http://belly.heroku.com">http://belly.heroku.com</a>) reporting the result of the test. Gradually, Belly builds up a picture of your test suite, which you can browse from the website.</p>

<h2>Features</h2>

<p>The current version of Belly is alpha-ware, proof-of-concept. It works, but I&#8217;m sure it won&#8217;t scale well to thousands of users with thousands of tests. I&#8217;m sure you&#8217;ll find bugs. It also looks pretty rough, but don&#8217;t let that put you off; there&#8217;s huge potential here.</p>

<p><img src="http://blog.mattwynne.net/wp-content/uploads/2010/08/works_on_my_machine.png" alt="works-on-my-machine" /></p>

<p>Right now, probably the most useful feature is the <code>belly rerun</code> command, which helps you focus on running just the cukes that you&#8217;ve broken. Rather than having to keep track of them in a rerun.txt file, Belly will remember everything you&#8217;ve broken and give you the output you need to run it again with Cucumber:</p>

<p><div>
<pre class="txt" style="font-family:monospace;">cucumber `belly rerun`</pre>
</div></p>

<p>You can see a demonstration of how to get started using Belly in <a href="http://www.youtube.com/watch?v=1WIfKn-0CeI">this slick and polished screencast</a>.</p>

<h2>How To</h2>

<p>If you can&#8217;t make out the details on the horribly blurry screencast, here&#8217;s the summary:</p>

<p><div>
<pre class="txt" style="font-family:monospace;"># install the gem:
gem install belly
&nbsp;
# write belly's hook and config files into your project:
belly init
&nbsp;
# run your features
cucumber features
&nbsp;
# see your test results live on the internets. tada!
open http://belly.heroku.com
&nbsp;
# see what's left to do
belly rerun
&nbsp;
# tell cucumber to run what's left to do
cucumber `belly rerun`</pre>
</div></p>

<h2>Disclaimer</h2>

<p>I can&#8217;t stress how rough-and-ready this is, but I think it&#8217;s still useful enough to provoke you into giving me some feedback. Use it at your own risk, and <a href="mailto:belly-users@googlegroups.com">let me know</a> your thoughts.</p>

<h2>Coincidences</h2>

<p>Incredibly, it turns out that Joe Wilk, my old team-mate at Songkick and fellow Cucumber-core hacker, has been working on <a href="http://blog.josephwilk.net/ruby/limiting-red-smarter-test-builds-through-metrics.html">another solution</a> to exactly the same problem. Living with a 3-hour build can be quite a motivator! I&#8217;m hoping Joe and I can figure out a way to combine our efforts into something really beautiful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2010/08/23/belly-wants-to-eat-your-tests/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Acceptance Tests Trump Unit Tests</title>
		<link>http://blog.mattwynne.net/2009/01/17/acceptance-tests-trump-unit-tests/</link>
		<comments>http://blog.mattwynne.net/2009/01/17/acceptance-tests-trump-unit-tests/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 21:57:55 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Agile / Lean Software Development]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2009/01/17/acceptance-tests-trump-unit-tests/</guid>
		<description><![CDATA[At work, we have been practising something approximating Acceptance Test Driven Development now for several months. This means that pretty much every feature of the system that a user would expect to be there, has an automated test to ensure that it really is. It has given me a whole new perspective on the value [...]]]></description>
			<content:encoded><![CDATA[<p>At work, we have been practising something approximating Acceptance Test Driven Development now for several months. This means that pretty much every feature of the system that a user would expect to be there, has an automated test to ensure that it really is.</p>

<p>It has given me a whole new perspective on the value of tests as artefacts produced by a project.</p>

<p>I made a pledge to myself when I started this new job in August that I would not (knowingly) check in a single line of code that wasn&#8217;t driven out by a failing test. At the time, I thought this would always mean a failing <em>unit</em> test, but I&#8217;m starting to see that this isn&#8217;t always necessary, or in fact even wise.</p>

<p>Don&#8217;t get me wrong. Unit testing is extremely important, and there&#8217;s no doubt that practising TDD helps you to write well-structured, low-defect code in an really satisfying manner. But I do feel like the extent to which TDD, at the level of unit testing alone, allows for subsequent changes to the behaviour of the code, has been oversold.</p>

<p>If you think you&#8217;re doing TDD, and you&#8217;re only writing unit tests, I think you&#8217;re doing it wrong.</p>

<p>As new requirements come in, the tensions influencing the design of the code shift. Refactoring eases these tensions, but by definition means that the design has to change. This almost certainly means that some, often significant, portion of the unit tests around that area of the code will have to change too.</p>

<p>I struggled with this for a long time. I had worked hard on those tests, for one thing, and was intuitively resistant to letting go of them. More than that, I knew that somewhere in there, they were testing behaviour that I wanted to preserve: if I threw them out, how would I know it still worked?</p>

<p>Yet those old unit tests were so coupled to the old design that I wanted to change&#8230;</p>

<p><img src="http://blog.mattwynne.net/wp-content/uploads/2009/01/gulliver.jpg" alt="Gulliver" /></p>

<p>In my mind, I have started to picture the tests we write to drive out a system like little strings, each one pulling at the code in a slightly different direction. The sum total of these tensions is, hopefully, the system we want right now.</p>

<p>While these strings are useful to make sure the code doesn&#8217;t fall loose and do something unexpected, they can sometimes mean that the code, like Gulliver in the picture above, is to restrained and inflexible to change.</p>

<p>The promise of writing automated tests up front is regression confidence: if every change to the system is covered by a test, then it&#8217;s impossible to accidentally reverse that change without being alerted by a failing test. Yet how often do unit tests really give us regression alerts, compared to the number of times they whinge an whine when we simply refactor the design without altering the behaviour at all? Worse still, how often do they fail to let us know when the mocks or stubs for one unit fail to accurately simulate the actual behaviour of that unit?</p>

<p>Enter acceptance tests.</p>

<p>By working at a higher level, acceptance tests give you a number of advantages over unit tests:</p>

<ul>
<li>You get a much larger level of coverage per test</li>
<li>You get more space within which to refactor</li>
<li>You will test through layers to ensure they integrate correctly</li>
<li>They remain valuable even as underlying implementation technology changes</li>
</ul>

<p>Admittedly, the larger level of coverage per test has a downside: When you get a regression failure, the signpost to the point of failure isn&#8217;t as clear. This is where unit tests come in: if you haven&#8217;t written any at all yet, you can use something like the <a href="http://www.threeriversinstitute.org/HitEmHighHitEmLow.html">saff squeeze</a> to isolate the fault and cover it with a new test.</p>

<p>They&#8217;re also much slower to run, which can be important when you&#8217;re iterating quickly over changes to a specific part of the system.</p>

<p>To be clear, I&#8217;m not advocating that you stop unit testing altogether. I do feel there&#8217;s a better balance to strike, though, than forcing yourself to get 100% coverage from unit tests alone. They&#8217;re not always the most appropriate tool for the job.</p>

<p>To go back to the metaphor of the pulling strings, I think of acceptance tests as sturdy ropes, anchoring the system to the real world. While sometimes the little strings will need to be cut in order to facilitate a refactoring, the acceptance tests live on.</p>

<p>The main thing is to have the assurance that if you accidentally regress the behaviour of the system, something will let you know. As long as every change you make is driven out by some kind of automated test, be it at the system level or the unit level, I think you&#8217;re on the right track.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2009/01/17/acceptance-tests-trump-unit-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is the Value Fetish Killing Agile Teams?</title>
		<link>http://blog.mattwynne.net/2008/10/08/is-the-value-fetish-killing-agile-teams/</link>
		<comments>http://blog.mattwynne.net/2008/10/08/is-the-value-fetish-killing-agile-teams/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 11:59:40 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Agile / Lean Software Development]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[citcon]]></category>
		<category><![CDATA[lean]]></category>
		<category><![CDATA[post-agile]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[value]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/10/08/is-the-value-fetish-killing-agile-teams/</guid>
		<description><![CDATA[Last weekend I was at CITCON Europe, a great opportunity to meet some of the leading minds in the agile software movement. One intriguing new term I heard a few times was &#8220;value fetish&#8221;. Let me try to explain what I think it means, and discuss the implications for agile teams. Back in the pre-agile [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend I was at <a href="http://www.citconf.com/amsterdam2008/">CITCON Europe</a>, a great opportunity to meet some of the leading minds in the agile software movement. One intriguing new term I heard a few times was &#8220;value fetish&#8221;. Let me try to explain what I think it means, and discuss the implications for agile teams.</p>

<p><span id="more-81"></span></p>

<p>Back in the pre-agile days when our projects were planned around component pieces of the architecture, &#8220;value&#8221; was a meaningless concept. The whole project had a value, but day-to-day that didn&#8217;t help us prioritise our work &#8211; from inside the plan it was impossible to judge whether my database stored procedure was contributing more value than your pricing component &#8211; without one, the other would simply not function.</p>

<p>As we started to plan around small deliverables like user stories, the concept of value came to the fore. Suddenly it was obvious that the &#8220;file saving&#8221; feature was much more valuable than the &#8220;conditional formatting&#8221; feature. This helped us immensely &#8211; we could prioritise our work around this value, and as a result actually felt the glow from knowing that the work we were doing was worthwhile, valuable even.</p>

<p>Now that value has become a first-class concept to software development teams, what happens when it becomes an obsession? When managers who can now measure value and velocity start to compare teams, or offer them incentives to deliver more, faster? When we as developers get so driven and focussed on the delivery of value that we forget to design, refactor, consolidate, reflect, and sharpen our tools? When we forget to go home on time?</p>

<p>We get burned out.</p>

<p>As ever, it&#8217;s the responsibility of the developers (and their leaders) to stand firm and hold on to the space and time that they need to do their work at a <a href="http://industrialxp.org/sustainablePace.html">sustainable pace</a>. Not all the hours you spend in a day &#8211; tidying up the build scripts, writing a code generator, cleaning up a library so you can release it as open source &#8211; can or should be directly attributed to the value they will immediately offer to the business. That&#8217;s not to say we should spend our days idling, but that we should maintain a level of self-respect in everything that we do.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/10/08/is-the-value-fetish-killing-agile-teams/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WatiN Goes Cross-Browser</title>
		<link>http://blog.mattwynne.net/2008/04/22/watin-goes-cross-browser/</link>
		<comments>http://blog.mattwynne.net/2008/04/22/watin-goes-cross-browser/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 15:03:15 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Agile / Lean Software Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[watin]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/04/22/watin-goes-cross-browser/</guid>
		<description><![CDATA[The WatiN (Web Application Testing In .Net) framework, a port of the popular watir framework in ruby, has recently announced support for Firefox. This should make it a compelling alternative to selenium, especially as it looks to be a good deal quicker. Sweet. Now if only I had a way to serve up an ASP.NET [...]]]></description>
			<content:encoded><![CDATA[<p>The WatiN (Web Application Testing In .Net) framework, a port of the popular <a href="http://wtr.rubyforge.org/">watir</a> framework in ruby, has <a href="http://watin.sourceforge.net/firefox.html">recently announced support for Firefox</a>. This should make it a compelling alternative to <a href="http://selenium.openqa.org/">selenium</a>, especially as it <a href="http://adamesterline.com/2007/04/23/watin-watir-and-selenium-reviewed/">looks to be a good deal quicker</a>.</p>

<p>Sweet. Now if only I had a way to serve up an ASP.NET web application from code. Could <a href="http://blogs.msdn.com/dmitryr/archive/2006/03/09/548131.aspx">this</a> be what I need?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/04/22/watin-goes-cross-browser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Awesome Acceptance Testing</title>
		<link>http://blog.mattwynne.net/2008/03/18/awesome-acceptance-testing/</link>
		<comments>http://blog.mattwynne.net/2008/03/18/awesome-acceptance-testing/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 21:52:42 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Agile / Lean Software Development]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://blog.mattwynne.net/2008/03/18/awesome-acceptance-testing/</guid>
		<description><![CDATA[My notes on DanNorth and JoeWalnes&#8216; session at Spa 2008. Five artefacts: Automation &#8211; the glue that binds the tests to the code Vocabulary &#8211; the language that the tests are expressed in Syntax &#8211; the technology that the tests are expressed in (C#, Java) Intent &#8211; the actual scenario being tested Harness &#8211; the [...]]]></description>
			<content:encoded><![CDATA[<p>My notes on <a href="http://dannorth.net/">DanNorth</a> and <a href="http://www.xpdeveloper.net/xpdwiki/Wiki.jsp?page=JoeWalnes">JoeWalnes</a>&#8216; session at Spa 2008.</p>

<p>Five artefacts:</p>

<ul>
<li>Automation &#8211; the glue that binds the tests to the code</li>
<li>Vocabulary &#8211; the language that the tests are expressed in</li>
<li>Syntax &#8211; the technology that the tests are expressed in (C#, Java)</li>
<li>Intent &#8211; the actual scenario being tested</li>
<li>Harness &#8211; the thing that runs the tests and tells you if they passed</li>
</ul>

<p>Four roles. People might fill more than one, or more than one person might be in a role:</p>

<ul>
<li>Stakeholder</li>
<li>Analyst</li>
<li>Tester</li>
<li>Developer</li>
</ul>

<p>Taking a requirement, the Stakeholder and the Analyst have a conversation:</p>

<ul>
<li>what does that requirement <em>mean</em>?</li>
<li>how can we create a shared understanding?</li>
</ul>

<p>Then the Analyst and the Tester have a conversation:</p>

<ul>
<li>what is the scope of (&#8216;bigness&#8217;) of this requirement?</li>
<li>how will we know when we&#8217;re done?</li>
<li>=&gt; Scenarios (examples)</li>
</ul>

<p>Tester then &#8216;monkeyfies&#8217; the scenarios, using the following template:</p>

<p><strong>Given</strong> &#8230;
- assumptions, context in which the scenario occurs.</p>

<p><strong>When</strong> &#8230;
- user action, interaction with the system</p>

<p><strong>Then</strong> &#8230;
- expected outcome</p>

<p>e.g.
<strong>Given</strong> we have an account holder Joe
and their current account contains $100
and the interest rate is 10%
<strong>When</strong> Joe withdraws $120
<strong>Then</strong> Joe&#8217;s balance should be $-22</p>

<p>The tester and the developer sit down and write an automated test to implement each scenario.</p>

<p>You might chain these up, but you can always categorise test code into these three partitions. This really helps how you look at test code.</p>

<h4>Consistency Validation Between &#8216;Units&#8217;</h4>

<p>See the <a href="http://martinfowler.com/articles/consumerDrivenContracts.html">Consumer Driven Contracts</a> paper on <a href="http://martinfowler.com">Martin Fowler</a>&#8216;s website.</p>

<h4>Tooling for Automation</h4>

<p>Consider extending / creating the domain model to cover the application itself &#8211; the UI, the back end.</p>

<p>Loads of tools are availlable. Use whatever works and build on it.</p>

<h4>Building a Vocabulary</h4>

<p>Ubiquitous Language &#8211; Start with a shared language. It becomes ubiquitous when it appears <em>everywhere</em> &#8211; documents, code, databases, conversations.</p>

<p>You will use different vocabularies in different <em>bounded contexts</em>. A context might be your problem domain, testing domain, software domain, or the user interface domain.</p>

<p>Beware which roles understand you when you&#8217;re talking in a particular domain. Often terms will span domains.</p>

<p>e.g. NHibernateCustomerRepository
&lt;&#8211;  1 &#8211;&gt;&lt;&#8211; 2&#8211;&gt;&lt;&#8211; 3  &#8211;&gt;</p>

<p>1 = 3rd Party Provider Domain
2 = Problem Domain
3 &#8211; Software Domain</p>

<p>Make your tests tell a story &#8211; make it flow. Don&#8217;t hide away things in Setup methods that will make the test hard to read. If that means a little bit of duplication, so be it. &#8216;Damp not DRY&#8217;.</p>

<h4>Syntax &#8211; Implementing Your Tests</h4>

<ul>
<li>write your own</li>
<li>keep it simple. don&#8217;t fart around writing too fancy a DSL. you&#8217;ll be surprised what testers / analysts / stakeholders will be prepared to read.</li>
<li>great way to learn</li>
<li>Jbehave2</li>
<li>training wheels?</li>
<li><a href="http://rspec.info/">rspec</a></li>
<li>very nice.</li>
<li>create templates for each given / when / then which you can plug together with parameter values into scenarios</li>
<li><a href="http://fit.c2.com/">fit</a></li>
<li><a href="http://www.concordion.org/">concordion</a></li>
<li><a href="http://nbehave.org/">nbehave</a> &#8211; <a href="http://www.lostechies.com/blogs/joe%5Focampo/">joe ocampo</a></li>
</ul>

<p>Basically what you need is a way to assemble different permutations and combinations of Given / When / Then with different parameters to make different scenarios.</p>

<h4>Expressing Intent</h4>

<p>Think in terms of narrative, flow. Think in terms of bounded contexts, and who the audience (role) is for that context. Who will understand that vocabulary?</p>

<p>Make sure the intent is clear &#8211; that&#8217;s the main thing.</p>

<h4>Harness</h4>

<p>Do you want to hook into continuous integration build?</p>

<p>Which version of the code is it going to run against?</p>

<p>Keep the tests in two buckets:
* in progress
* done</p>

<p>Those which are in the &#8216;done&#8217; bucket, <strong>should always work</strong>, those which are in progress are allowed to be failing, until you make them pass.</p>

<h4>Getting Started</h4>

<p>Things you can do today.</p>

<ul>
<li>Try it for your next requirement</li>
<li>Given When Then helps guide the tests</li>
<li>It&#8217;s a collaborative process &#8211; get people involved</li>
<li>Works for bug fixes</li>
<li>a bug is a scenario that you missed in the first place
use the tools you&#8217;re most comfortable with</li>
<li>doesn&#8217;t have to be perfect</li>
</ul>

<h4>Down The Line</h4>

<p>What to aim for.</p>

<ul>
<li><strong>ALL</strong> requirements have acceptance criteria specified up front</li>
<li><a href="http://www.springerlink.com/content/vcq847l8ker3jc1d/">helps with estimation</a></li>
<li>acceptance tests are automated <em>where appropriate</em></li>
<li>just having thought about it helps &#8211; you may come back to automating it later.</li>
<li>Push button, availlable to all.</li>
<li>helps build trust with stakeholders</li>
</ul>

<h4>Advice</h4>

<ul>
<li>Automate pragmatically</li>
<li>Don&#8217;t try to automate what you can&#8217;t do manually</li>
<li>Testing is validating an <em>outcome</em> against <em>intention</em></li>
<li>Non functional requirements</li>
<li>Plan for false positives</li>
<li>Quality is a variable</li>
<li>doesn&#8217;t mean you don&#8217;t go test first</li>
<li>doesn&#8217;t mean low quality code</li>
<li>does mean <em>how complete is the solution</em>? &#8211; how many scenarios / edge cases are you going to try and meet?</li>
</ul>

<h4>Summary</h4>

<ul>
<li>Have a shared understanding of <strong>done</strong></li>
<li>There is no Golden Hammer</li>
<li>Be aware of the five aspects of test automation</li>
<li>Automation, Vocabulary, Syntax, Intent, Harness</li>
<li>Start simple, then you can benefit now</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mattwynne.net/2008/03/18/awesome-acceptance-testing/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

