<?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>One Man's Walk in work &#187; nfit</title>
	<atom:link href="http://onemanswalk.com/work/tag/nfit/feed/" rel="self" type="application/rss+xml" />
	<link>http://onemanswalk.com/work</link>
	<description>jeremy lightsmith on agile, ruby, and consulting</description>
	<lastBuildDate>Wed, 04 May 2011 04:29:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using NFit</title>
		<link>http://onemanswalk.com/work/2003/08/25/using-nfit/</link>
		<comments>http://onemanswalk.com/work/2003/08/25/using-nfit/#comments</comments>
		<pubDate>Mon, 25 Aug 2003 00:00:00 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[nfit]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[	So I&#8217;ve started committing some of the tweaks I&#8217;ve made to the .net version of FIT into
the sourceforge project Steve Freeman and I started at http://sourceforge.net/projects/nfit/.
I&#8217;d like to talk about how my team structures its code around FIT.

	For context, this is a c# project, and we&#8217;re using VS.Net, NAnt, and !SLiNgshot to build, along w/ [...]]]></description>
			<content:encoded><![CDATA[	<p>So I&#8217;ve started committing some of the tweaks I&#8217;ve made to the .net version of <span class="caps">FIT</span> into<br />
the sourceforge project Steve Freeman and I started at http://sourceforge.net/projects/nfit/.<br />
I&#8217;d like to talk about how my team structures its code around <span class="caps">FIT</span>.</p>

	<p>For context, this is a c# project, and we&#8217;re using VS.Net, NAnt, and !SLiNgshot to build, along w/ the usual suspects:<br />
NUnit, !CruiseControl.Net, etc.</p>

	<p>Directory Structure&#8212;&#8212;<br />
We have a directory structure that looks like :</p>
	<ul>
		<li>doc/</li>
		<li>Iteration1/</li>
		<li><story name>.html  &#8211;  all tests associated w/ a story</li>
		<li><story name>.html</li>
		<li>Iteration2/</li>
		<li><story name>.html</li>
		<li>Iteration3/</li>
		<li>stories.html  &#8211;  list of all stories in an !AllFiles like fixture</li>
		<li>lib/</li>
		<li>src/</li>
		<li>project 1/</li>
		<li>project 2/</li>
		<li>fit/</li>
		<li>run.aspx  &#8211;  copied from nfit</li>
		<li>custom fixture 1.cs  &#8211;  fixture used in a fit test</li>
		<li>custom fixture 2.cs</li>
		<li>project 3/</li>
		<li>foo.sln  &#8211;  solution file</li>
	</ul>

	<p>We&#8217;ve argued a lot over what the structure of the source should look like on a .net project, and our current solution is a src dir, inside of which is one dir for each project and a solution file.  It&#8217;s flat and easy to see where everything is.</p>

	<p>All the <span class="caps">FIT</span> tests go into the <strong>doc</strong> dir.  <strong>fit</strong> is a VS web project that references all the other projects, along w/ the <span class="caps">FIT</span> dll&#8217;s.  It includes all the fixtures our tests will need and the run.aspx file from NFit.</p>


	<p>Running <span class="caps">FIT </span>Dynamically&#8212;&#8212;<br />
We&#8217;ve found it totally necessary to be able to run fit tests dynamically in addition to<br />
running them from command line.  Ward has his <strong>run.cgi</strong> on http://fit.c2.com/ to let you click &#8216;run&#8217; on a fit test.  I&#8217;ve just checked in <strong>Run.aspx</strong> into NFit which will let you do the same thing.</p>

	<p>This is how we use it:</p>

	<p>We have 2 webshares.  */doc* points to our &#8216;doc&#8217; directory and holds all the tests.  */fit* points to our &#8216;src/fit&#8217; directory and holds our copy of <strong>Run.aspx</strong> along w/ all the code our tests run against.  We put a run link at the top of each test that points to &#8216;/fit/run.aspx&#8217;, and when we browse our tests we do it through our local <span class="caps">IIS</span> using something like &#8216;http://localhost/doc/stories.html&#8217;.</p>

	<p>Because fit is just another project along w/ all our other projects in VS, we get linking,<br />
debugging, and building for free inside and outside visual studio.</p>


	<p>Structuring <span class="caps">FIT </span>Tests&#8212;&#8212;<br />
When you&#8217;re writing so-called &#8216;acceptance tests&#8217;, it&#8217;s important to remember that there are several different missions of testing and types of tests to achieve them.  The way you structure your tests should reflect this, see default.WhatAboutAcceptanceTesting</p>

	<p>In the doc directory, we group our tests in files by the story they test against, and the stories by the iterations they are completed (or scheduled to be completed) in. This of course makes the assumption that all tests &#8220;belong&#8221; to one and only one story.  Up until now that&#8217;s been okay, we&#8217;ll probably add another place to put tests when and if that becomes a problem.  It has been good to teach our team to think about testing functionality in terms the customer can see.</p>

	<p>Now we <em>could</em> just run all our tests automatically, but we wanted one page that everyone could<br />
go to to see our teams status.  So we take the spreadsheet of stories that our client keeps complete with<br />
their points, their iteration, and their status (done or not).  And we point to it with an aspx page to<br />
provide an html view that fit can run against.  So when you go to http://localhost/doc/, you see a table for<br />
every iteration, each of which contains all the tests in that iteration.  Only ones that have been marked<br />
done in the spreadsheet get run.</p>

	<p>So we have one page that tells you the status of all stories we&#8217;ve ever done.  And it tells you how we&#8217;re doing<br />
on the current iteration as well &#8211; along w/ our velocity of course <img src='http://onemanswalk.com/work/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />&#8212;&#8212;How about if my return value is an <span class="caps">XML</span> document, how does <span class="caps">FIT</span> deal with that. How do I pass two parameters to a method.</p>

	<p><span class="caps">TIA</span></p>
 &#8211; Yazid Arezki
 ]]></content:encoded>
			<wfw:commentRss>http://onemanswalk.com/work/2003/08/25/using-nfit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

