<?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>pedant.dk &#187; testing</title>
	<atom:link href="http://www.pedant.dk/category/it/testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pedant.dk</link>
	<description>I hack on things that lets you find stuff.</description>
	<lastBuildDate>Sun, 13 Nov 2011 11:22:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>adventures with mingw , ruby,java, rhino and jspec</title>
		<link>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/</link>
		<comments>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 23:09:06 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=689</guid>
		<description><![CDATA[update 2010-10-05: jspec has been deprecated in favour of jasmine update 2009-10-21: This post is a writeup of my early experiences with gemcutter and rubygems. The strange runtime error I did not understand was probably related to that I needed to update rubygems to 1.3.5. I now know how to use gemcutter from ruby1.8.6 using [...]]]></description>
			<content:encoded><![CDATA[<p><strong>update 2010-10-05: jspec has been deprecated in favour of <a title="jasmine" href="http://pivotal.github.com/jasmine/">jasmine</a></strong></p>
<p><strong>update 2009-10-21: This post is a writeup of my early experiences with gemcutter and rubygems. The strange runtime error I did not understand was probably related to that I needed to update rubygems to 1.3.5.  <a href="http://www.pedant.dk/2009/10/21/gemcutter-the-missing-manual/">I now know how to use gemcutter from ruby1.8.6 using the oneclick installer</a> .</strong></p>
<p>I have been using <a href="http://github.com/visionmedia/jspec/tree/3.x">jspec</a> on macosx for a while  and decided to give it a try on windows vista today. Installing jspec on macosx and linux can be done using the instructions <a href="http://github.com/visionmedia/jspec/blob/3.x/README.md">here</a> .</p>
<p>I want to run the automated jspec tests available via rhino at a client site. Sadly , I am forced to use windows there, so I have given some thought on how to make jspec run on windows.</p>
<p>First of all you need to install ruby.  I used the automated 1.8.6 One-Click Installer available <a href="http://www.ruby-lang.org/en/downloads/">here</a> . After installing i ran</p>
<p><code lang="bash"><br />
gem update<br />
</code></p>
<p>the instructions in the README file for jspec currently states that I should install gemcutter and install jspec via that . I was not able to do that on windows  ( my system decided to report an obscure runtime error that I did not understand). So i decided to do this instead:</p>
<p><code lang="bash"><br />
gem sources -a http://gems.github.com<br />
gem install visionmedia-jspec<br />
</code></p>
<p>I let gem install the required dependencies visionmedia-commander and visionmedia-bind. After this I had the jspec script available. Sadly this gave me version 2.7.2 (I noticed \ruby\lib\ruby\gems\1.8\gems\visionmedia-jspec-2.7.2 ) <a href="http://gemcutter.org/gems/jspec">The listing on gemcutter</a> told me that a version 2.11.10 is a avaiable , so I decided to dig deeper. Maybe I could make gemcutter work anyway?</p>
<p>After a little browsing on github.com I found the <a href="http://github.com/oneclick/rubyinstaller/">oneclick installer</a></p>
<p>I cloned this repo using git</p>
<p>using the following command:<br />
<code lang="bash"><br />
git clone git://github.com/oneclick/rubyinstaller.git<br />
</code></p>
<p>and pressed</p>
<p><code lang="bash"><br />
rake ruby19<br />
</code></p>
<p>This project creates a sandbox that compiles a working ruby environment using <a href="http://mingw.org/">mingw</a>.</p>
<p>After contemplating the insanity of what I was doing for a couple of minutes (remember : installing a working ruby on linux is a single shell command) I grabbed some coca cola and started browsing through the source code for ruby distro while the rubyinstall was compiling. I looked a bit at ruby.c and  vm_exec.c  and had grim flashbacks to my c days. Luckily the compile finished and I copied ruby19_mingw to my c:\ drive and set it up on my PATH variable. Then I could check which version I was using:</p>
<p><code lang="bash"><br />
C:\&gt;ruby -v<br />
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]<br />
</code></p>
<p>Now I was able to do:<br />
<code lang="bash"><br />
gem install gemcutter<br />
gem tumble<br />
gem install jspec<br />
</code></p>
<p>(Note that there is  information sent to the terminal during these steps)</p>
<p>Now for the interesting part(!) jspec was working , so I could do this:</p>
<p><code lang="bash"><br />
jspec init SolitaireCipher --freeze<br />
</code></p>
<p>This created a directory where I can train doing the <a href="http://www.rubyquiz.com/quiz1.html">SolitaireCipher</a> using javascript. I renamed lib/yourlib.core.js to lib/SolitaireCipher.js  and spec/spec.core.js to spec/spec.SolitaireCipher.js and spec/spec.dom.html accordingly.</p>
<p>After 20 mins of fiddling I managed to get some running tests in a browser by opening spec.dom.html. Then I decided I want to automate the tests using <a href="http://www.mozilla.org/rhino/download.html">mozilla rhino</a>. After installing rhino , I could run automated tests like this</p>
<p><code lang="bash"><br />
cd c:\projects\SolitaireCipher<br />
jspec --rhino<br />
</code></p>
<p>This opens up a proces that listens to file changes in the lib and spec folders. All very well &#8211; untill I discovered that jspec currently uses ANSI codes to render colors to the terminal screens. ANSI codes are not supported on windows vista (something with ANSI.SYS being obsoleted), so if I want the nice colors then I need an alternative terminal than my command prompt in vista.</p>
<p>I found rxvt available from <a href="http://code.google.com/p/msysgit/downloads/list">PortableGit</a> on google code. This renders the colors just nicely &#8211; but has some other drawbacks. If I just use rxvt for rendering feedback from the jspec tests, then it seems to work though.</p>
<p>One thing to note is that rhino needs the java sdk to be installed and js.jar needs to be on your CLASSPATH. when starting jspec from rxvt on the msys from PortableGit, then CLASSPATH could be set like this (assuming rhino is installed in c:\tools ):</p>
<p><code lang="bash"><br />
export CLASSPATH=/c/tools/rhino1_7R2/js.jar<br />
</code></p>
<p>I probably want to avoid using rxvt on PortableGit too much . There are some major flaws listed <a href="http://code.google.com/p/msysgit/wiki/WhyIsRxvtNotTheDefault">here</a> .</p>
<p>Maybe I should look into doing a adobe air frontend for jspec?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/10/21/adventures-with-mingw-rubyjava-rhino-and-jspec/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>BDD is not about testing</title>
		<link>http://www.pedant.dk/2009/10/03/bdd-is-not-about-testing/</link>
		<comments>http://www.pedant.dk/2009/10/03/bdd-is-not-about-testing/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 20:17:11 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[testing]]></category>
		<category><![CDATA[bdd]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=671</guid>
		<description><![CDATA[When talking to people about BDD and my lame example using Paris Hilton, then I got the question &#8220;it was really interesting reading about Paris Hiliton .. but what is BDD really about?. The central insight of BDD is that TDD is really computer aided specifications of the executable behaviour of your system. BDD tries [...]]]></description>
			<content:encoded><![CDATA[<p>When talking to people about BDD and my lame example using Paris Hilton, then I got the question &#8220;it was really interesting reading about Paris Hiliton .. but what is BDD really about?.</p>
<p>The central insight of BDD is that TDD is really computer aided specifications of the executable behaviour of your system. BDD tries to express this using a Domain Specific language.</p>
<p>Back in 2006 , Dave Astels described how to ascend from the focus on 1-1 testing of production code to use the test proces as a way to describe the way you want your system to behave.</p>
<p><embed id="VideoPlayback" style="width: 400px; height: 326px;" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=8135690990081075324&amp;hl=da&amp;fs=true" allowscriptaccess="always" allowfullscreen="true"></embed></p>
<p>In the video Dave makes the valid point that &#8220;The words you use shape how you think&#8221;.  So we should go away from thinking about &#8220;testing&#8221; constantly to think about describing how you want your system to work.</p>
<p>So to me &#8211; BDD sounds like a kickstart to be productive in TDD &#8211; and do it well from the start. So if you are starting out on TDD , you should really start out doing BDD.</p>
<p>Dave walks through some examples using rspec in ruby. I am  currently using <a href="http://github.com/visionmedia/jspec">jspec</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/10/03/bdd-is-not-about-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Paris Hilton and Behaviour Driven Development</title>
		<link>http://www.pedant.dk/2009/09/27/paris-hilton-and-behaviour-driven-development/</link>
		<comments>http://www.pedant.dk/2009/09/27/paris-hilton-and-behaviour-driven-development/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 18:36:20 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[bdd]]></category>

		<guid isPermaLink="false">http://www.pedant.dk/?p=644</guid>
		<description><![CDATA[Recently, I have been giving Behaviour Driven Development some thought. Let&#8217;s take a an example of how to develop and test a music video search and storage system. A traditional way of developing this would require formulating a object oriented system architecture, thinking about streaming and metadata enabled search. The system architecture could consist of [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been giving  <a href="http://behaviour-driven.org/Introduction">Behaviour Driven Development</a> some thought.</p>
<p>Let&#8217;s take a an example of how to develop and test a  music video search and storage  system. A traditional way of developing this would require formulating a object oriented system architecture, thinking about streaming and metadata enabled search. The system architecture could consist  of a well chosen database server, a streaming server and a metadata enabled search engine &#8211; combining these technologies with a modern UI  and encapsulating theme in carefully designed object oriented structures. During all these important choices , and all during development we would make sure to write tests before we write a single line of code.</p>
<p>All these things put together would lead to a well thought out system architecture , but all the effort put into the system architecture can be in vain &#8211; if we don&#8217;t have a solid business understanding of what a video storage system should do. What will the users expect?</p>
<p>While browsing on <a href="http://www.facebook.com">facebook</a> this other day I found the <a href="http://www.facebook.com/group.php?gid=5299495387">&#8220;The Paris Hilton &amp; Jacques Derrida Appreciation Society&#8221; </a> &#8211; this group explores the connections between the works of Paris Hilton and Jacques Derrida. When we deconstruct the &#8220;pretty blonde&#8221; facade of Paris Hilton, then you can actually find some deep insights. Take &#8220;Nothing in this world&#8221; for instance:</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/32DwYTRmmto&amp;hl=en&amp;fs=1&amp;" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/32DwYTRmmto&amp;hl=en&amp;fs=1&amp;" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<p>Take the phrase &#8220;when you are with somebody else, that&#8217;s me in your eye&#8221;.  There is the obvious interpretation of the sentence .  But thinking about that sentence also let&#8217;s you reflect on the <em>real meaning</em> . When you look at Paris Hilton in this video, what do you see? Do you see the pretty blonde or the millionaire , hard working young girl . In this video I am seeing the image of the pretty blonde &#8211; but I am also thinking about the millions of dollars she is earning portraying herself in this way.  So in a sense &#8211; I am reading the original message out of context. I am admiring what Paris Hilton in some other way than she intended &#8211; the original meaning of the words seem to have disappeared &#8211; but my understanding of the sentence is more useful to me.  I wish I could do what Paris Hilton does &#8211; but in a way that would make sense in my world .</p>
<p>The producers of the &#8220;Nothing in this world&#8221; video are not likely to convey information about the business empire of Paris Hilton in the metadata supplied for the video. So a system formulated as a &#8220;video storage system&#8221; would not let me exploit the information I found in the facebook group.</p>
<p>BDD introduces the use of a Domain Specific language to express the users expectations in a manner more directly focused on the behavioural aspects of the system. This lifts the clouds from the system aspects and focuses on <em>intent</em>.</p>
<p>A better way to formulate my expectations for the system would be:</p>
<pre>Describe the music video storage system:
  I should be able to search for videos using metadata
  it should play videos  in my browser
  I should be able to query facebook for information about it</pre>
<p>If I had those expectations formulated to me , then I would choose to implement this system as a mashup between youtube and facebook as a facebook application. This would be a radically different system architecture than the one describe above.</p>
<p>Furthermore , by leveraging one of the <a href="http://behaviour-driven.org/Implementations">several BDD test frameworks available</a>, then the expectations could be formulated in way that can be used as tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pedant.dk/2009/09/27/paris-hilton-and-behaviour-driven-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

