<?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>Josh Arnold&#039;s Blog</title>
	<atom:link href="http://lostechies.com/josharnold/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/josharnold</link>
	<description>Startups, open source, and coffee.</description>
	<lastBuildDate>Thu, 30 May 2013 13:23:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>FubuValidation: Have validation your way</title>
		<link>http://lostechies.com/josharnold/2013/05/30/fubuvalidation-have-validation-your-way/</link>
		<comments>http://lostechies.com/josharnold/2013/05/30/fubuvalidation-have-validation-your-way/#comments</comments>
		<pubDate>Thu, 30 May 2013 13:23:49 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=263</guid>
		<description><![CDATA[I&#8217;m happy to announce that another member of the Fubu family of projects has been documented. The project of the day is: FubuValidation. As usual, the docs go into far greater detail than I will here but I&#8217;ll provide some&#160;&#8230; <a href="http://lostechies.com/josharnold/2013/05/30/fubuvalidation-have-validation-your-way/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m happy to announce that another member of the Fubu family of projects has been documented. The project of the day is: <a href="http://darthfubumvc.github.io/fubuvalidation/topics/">FubuValidation</a>. As usual, the docs go into far greater detail than I will here but I&#8217;ll provide some highlights.</p>
<p><strong>Overview</strong></p>
<p>FubuValidation is a member of the Fubu-family of frameworks &#8212; frameworks that aim to get out of your way by providing rich semantic models with powerful convention-driven operations. It aims to provide a convention-driven approach to validation while supporting more traditional approaches when needed.</p>
<blockquote><p>An important thing to note: FubuValidation is NOT coupled to FubuMVC. In fact, it maintains no references to the project.</p></blockquote>
<p><strong>What&#8217;s different about it?</strong></p>
<p>Inspired by the modularity patterns used in the Fubu ecosystem (and previous work with validation), FubuValidation utilizes the concept of an &#8220;IValidationSource&#8221;. That is, a source of rules for any particular class.</p>
<p>Any number of IValidationSource implementations can be registered and they can pull rules anywhere from attributes to generating them on the fly. You can use the built-in attributes, DSL, or write your own mechanism for creating rules based on NHibernate/EF mappings. The docs have plenty of examples of each.</p>
<p>On top of the extensibility, FubuValidation was designed with diagnostics in mind. While they are currently only surfaced in FubuMVC, the data structures used to query and report on validation rules are defined in FubuValidation. At any point you can query the ValidationGraph and find out not only what rules apply to your class but WHY they apply.</p>
<p><strong>Read the docs</strong></p>
<p>Enough from me. <a href="http://darthfubumvc.github.io/fubuvalidation/topics/">Checkout the new documentation</a> and let us know what you think.
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2013/05/30/fubuvalidation-have-validation-your-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ripple: Fubu-inspired dependency management</title>
		<link>http://lostechies.com/josharnold/2013/05/20/ripple-fubu-inspired-dependency-management/</link>
		<comments>http://lostechies.com/josharnold/2013/05/20/ripple-fubu-inspired-dependency-management/#comments</comments>
		<pubDate>Mon, 20 May 2013 15:47:33 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[fubu]]></category>
		<category><![CDATA[ripple]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=257</guid>
		<description><![CDATA[I&#8217;m happy to announce that our ripple project is now publicly available and it&#8217;s sporting some brand new documentation. The docs go into greater detail than I&#8217;m going to write here but I&#8217;ll provide some highlights: Overview: Ripple is a&#160;&#8230; <a href="http://lostechies.com/josharnold/2013/05/20/ripple-fubu-inspired-dependency-management/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m happy to announce that our ripple project is now publicly available and it&#8217;s sporting some <a href="http://darthfubumvc.github.io/ripple/ripple/">brand new documentation</a>. The docs go into greater detail than I&#8217;m going to write here but I&#8217;ll provide some highlights:</p>
<p><strong>Overview:</strong></p>
<p>Ripple is a new kind of package manager that was created out of heavy usage of the standard NuGet client. The feeds, the protocol, and the packages are the same. Ripple just embodies differing opinions and provides a new way of consuming them that is friendlier for continuous integration.</p>
<p><strong>Features:</strong></p>
<p>1. Staying up to date with the latest build</p>
<p>Ripple introduces the concept of &#8220;Fixed&#8221; vs. &#8220;Float&#8221; dependencies. For internal dependencies, it&#8217;s often beneficial to keep all of your downstream projects built against the very latest of your internal libraries. For the Fubu team, this means that changes to FubuMVC.Core &#8220;ripple&#8221; into downstream projects and help us find bugs FAST.</p>
<p>2. Command line friendly</p>
<p>Ripple is 100% command line and has no ties into Visual Studio. The usages were designed for how the Fubu team works and for integration with our build server.</p>
<p>3. Generating nuspec files</p>
<p>Keeping your packages up to date with versions can be a challenge when you have a lot of them. Ripple provides the ability to automatically generate version constraints for the dependencies in your nuspec files so that you never get out of sync.</p>
<p>&#8230;<a href="http://darthfubumvc.github.io/ripple/ripple/">and lots more.</a></p>
<p><strong>Getting Started:</strong></p>
<p>Ripple is published both as a Ruby Gem (ripple-cli) and as a NuGet package (Ripple) &#8212; which you can use with Chocolatey.</p>
<p>You can read the &#8220;Edge&#8221; documentation here: <a href="http://darthfubumvc.github.io/ripple">http://darthfubumvc.github.io/ripple<br />
</a><em><br />
Note:  The ripple docs are powered by our brand new &#8220;FubuDocs&#8221; tooling. Jeremy will likely be writing about that one soon. If he wasn&#8217;t planning on it&#8230;then I think I just volunteered him for it.</em>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2013/05/20/ripple-fubu-inspired-dependency-management/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Introducing FubuMVC.AutoComplete</title>
		<link>http://lostechies.com/josharnold/2013/02/01/introducing-fubumvc-autocomplete/</link>
		<comments>http://lostechies.com/josharnold/2013/02/01/introducing-fubumvc-autocomplete/#comments</comments>
		<pubDate>Fri, 01 Feb 2013 20:55:56 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[fubu]]></category>
		<category><![CDATA[fubumvc]]></category>
		<category><![CDATA[screencasts]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=251</guid>
		<description><![CDATA[In my previous post, I introduced FubuMVC.Validation and the power of the &#8220;drop in Bottles&#8221; found in FubuMVC. Today, I&#8217;m happy to continue that series by introducing FubuMVC.AutoComplete. This is a simplistic demonstration but I want to make note of&#160;&#8230; <a href="http://lostechies.com/josharnold/2013/02/01/introducing-fubumvc-autocomplete/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my previous post, I introduced FubuMVC.Validation and the power of the &#8220;drop in Bottles&#8221; found in FubuMVC. Today, I&#8217;m happy to continue that series by introducing FubuMVC.AutoComplete.</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/uUNl9QJc3_E" frameborder="0" allowfullscreen></iframe></p>
<p>This is a simplistic demonstration but I want to make note of two things:</p>
<ol>
<li>I didn&#8217;t have to change any of my markup or write any javascript</li>
<li>I didn&#8217;t have to write an endpoint to serve up the JSON data for the jquery plugin</li>
</ol>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2013/02/01/introducing-fubumvc-autocomplete/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Introducing FubuMVC.Validation. For real.</title>
		<link>http://lostechies.com/josharnold/2013/01/28/introducing-fubumvc-validation-for-real/</link>
		<comments>http://lostechies.com/josharnold/2013/01/28/introducing-fubumvc-validation-for-real/#comments</comments>
		<pubDate>Mon, 28 Jan 2013 14:00:11 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[fubu]]></category>
		<category><![CDATA[fubumvc]]></category>
		<category><![CDATA[screencasts]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=246</guid>
		<description><![CDATA[As some of you may already know, FubuMVC finally hit 1.0. In response to this milestone, Jeremy and I are hard at work on docs and trying to restrain the urge to write new features until those are done. Today&#160;&#8230; <a href="http://lostechies.com/josharnold/2013/01/28/introducing-fubumvc-validation-for-real/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As some of you may already know, <a href="http://jeremydmiller.com/2013/01/11/fubumvc-turns-1-0/">FubuMVC finally hit 1.0</a>. In response to this milestone, Jeremy and I are hard at work on docs and trying to restrain the urge to write new features until those are done.</p>
<p>Today I&#8217;m happy to announce the first installment of screencasts is ready to share with the world. Validation isn&#8217;t the most exciting thing to talk about but watch carefully. This illustrates some of the killer features of FubuMVC that you&#8217;re going to want to pay attention to in the coming weeks.<br />
<br/><br />
<iframe src="http://www.youtube.com/embed/5mlkKnxs6VQ" frameborder="0" width="480" height="360"></iframe>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2013/01/28/introducing-fubumvc-validation-for-real/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Investing in your tests&#8211;A lesson in object composition</title>
		<link>http://lostechies.com/josharnold/2012/12/22/investing-in-your-testsa-lesson-in-object-composition/</link>
		<comments>http://lostechies.com/josharnold/2012/12/22/investing-in-your-testsa-lesson-in-object-composition/#comments</comments>
		<pubDate>Sat, 22 Dec 2012 18:16:52 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=241</guid>
		<description><![CDATA[“Invest in your tests”. I say it all the time and it just never seems to carry the weight that I want it to. This bothers me. It bothers me so much that it’s generally in the back of my&#160;&#8230; <a href="http://lostechies.com/josharnold/2012/12/22/investing-in-your-testsa-lesson-in-object-composition/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>“Invest in your tests”. I say it all the time and it just never seems to carry the weight that I want it to. This bothers me. It bothers me so much that it’s generally in the back of my mind at any given point of my day. And then it happened…</p>
<p>In my last post, I talked about the joy of cleaning up code that I wrote two years ago. In the process of doing so, I made some observations about object composition and usability that gave me an “ah-ha” moment. I finally have a concrete example for this vague/abstract statement about quality and effort.</p>
<p>So, here it is: <strong>investing in your tests – a real life example</strong>. But let’s establish some context first.</p>
<h3>Validator Configuration</h3>
<p>The flexibility in composition of the Validator class in FubuValidation is something that we pushed for since the beginning. We have the concept of an IValidationSource that can provide a collection of rules for a given type. Some examples would be:</p>
<ul>
<li>A simple FI/DSL ala FluentValidation
<li>Attribute markers for rules
<li>Mapping NHibernate configuration into validation (e.g., required)</li>
</ul>
<p>One of the built in sources adapts the IValidationRule interface (which operates at the class level) into a separate configuration of field validation rules. The Field Validation configuration is similar and has its own IFieldValidationSource to aggregate rules. To top it all of, the ValidationGraph (the semantic model) essentially memoizes the various paths to validation for optimization purposes.</p>
<p>Naturally, this amount of flexibility makes the API…well, let’s just say it started to really suck.</p>
<h3>First Iteration: The “Basic” pattern</h3>
<p>One of the things we typically do for situations like this is expose a “Basic” static method on an implementation that composes the basic setup for a class. In addition to the static builders, the constructors of the various implementations add the default configuration.</p>
<p>This let’s us do something like:</p>
<p><script src="https://gist.github.com/4360250.js?file=Basic.cs"></script><br />
<h3>The Scenario Pattern</h3>
<p>This pattern originated from FubuCore’s model binding and it’s been valuable ever since. The idea is that you have a static builder that exposes a way to configure the composition of a particular component. Here’s an example of the ValidationScenario:</p>
<p><script src="https://gist.github.com/4360250.js?file=ValidationScenario.cs"></script>
<p>The lambda allows you to specify field rules, validation sources, inject services, etc. It’s all located in the core FubuValidation library. This ensures that the composition stays up to date but minimizes any impact on YOU when you’re writing tests for your custom rules.</p>
<h3>Wrapping Up</h3>
<p>“Investing in your tests” means exactly what it sounds like. Effort should be spent removing complexity, minimizing friction, and making sure that your tests are not brittle. Sometimes that means exposing helper methods on your APIs and other times it means building entirely different blocks of code to bootstrap tests.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2012/12/22/investing-in-your-testsa-lesson-in-object-composition/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Lessons from refactoring two year old code</title>
		<link>http://lostechies.com/josharnold/2012/12/16/lessons-from-refactoring-two-year-old-code/</link>
		<comments>http://lostechies.com/josharnold/2012/12/16/lessons-from-refactoring-two-year-old-code/#comments</comments>
		<pubDate>Sun, 16 Dec 2012 22:59:10 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=237</guid>
		<description><![CDATA[About two years ago I took my first swing at FubuValidation and FubuMVC.Validation. Jeremy and I have been playing chicken on a cleanup of both of them for a long time now. Thankfully, two years later, I finally found the&#160;&#8230; <a href="http://lostechies.com/josharnold/2012/12/16/lessons-from-refactoring-two-year-old-code/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>About two years ago I took my first swing at FubuValidation and FubuMVC.Validation. Jeremy and I have been playing chicken on a cleanup of both of them for a long time now. Thankfully, two years later, I finally found the time/motivation/energy to dive in and take care of some nasty old code.&nbsp; I’ve found it very freeing to dive in and chainsaw the majority of everything I did.</p>
<p>I’ll try my best to keep this specific and not too philosophical but I still wanted to share a few of my observations so far. Here it goes:</p>
<p><strong>1. Clumsy and brittle tests</strong></p>
<p>When you try to adhere to all those crazy principles and maximum flexibility, yada yada…it’s easy to completely miss the mark with regards to usability of your API. Knowing my approach to testing at the time I can safely say that the usability of your API is directly related to the quality of your tests (over time). That is, if your tests are brittle and hard to read…chances are, your usability sucks.</p>
<p><strong>2. Most of the time, lots of code means you’re doing it wrong</strong></p>
<p>There are times when you’re tackling a problem that will result in a ton of code. On the other hand, I’m a student of the school of thought that says “your first idea isn’t necessarily the best one”. I’m not the smartest guy (and I’m quite aware of this) so my first ideas are usually pretty…well, they’re usually trash. It takes a few iterations for me to simplify it. Without using the API (through vigorous testing), there’s just no way to see how it’s going to end up.</p>
<p><strong>3. Dogfooding is critical</strong></p>
<p>Cliché, but it still counts. </p>
<p><strong>4. YAGNI, YAGNI, YAGNI</strong></p>
<p>I’m horrible at this. I think “Oh, surely someone would want THIS, and THIS, and THAT!”. Pick the simplest possible thing that can work and work it until its done. Make sure your tests can hold up, aren’t terribly brittle, and you can iterate fast. When you get a request or you hit the need yourself (*ahem* dogfooding), then you add it in.</p>
<p>The key here is to never be afraid to reevaluate your design. That’s typically the driving force behind me adding far too much fluff.</p>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2012/12/16/lessons-from-refactoring-two-year-old-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Guidelines for Automated Testing: Defining Test Inputs</title>
		<link>http://lostechies.com/josharnold/2012/11/28/guidelines-for-automated-testing-defining-test-inputs/</link>
		<comments>http://lostechies.com/josharnold/2012/11/28/guidelines-for-automated-testing-defining-test-inputs/#comments</comments>
		<pubDate>Wed, 28 Nov 2012 16:45:40 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[automated-testing]]></category>
		<category><![CDATA[guidelines-automated-testing]]></category>
		<category><![CDATA[storyteller]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=230</guid>
		<description><![CDATA[There are several simple rules to follow when dealing with test setup for automated tests: Data setup should be declarative Data setup should be as easy as you can possibly make it The inputs for your test belong with your&#160;&#8230; <a href="http://lostechies.com/josharnold/2012/11/28/guidelines-for-automated-testing-defining-test-inputs/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are several simple rules to follow when dealing with test setup for automated tests:</p>
<ul>
<li>Data setup should be declarative</li>
<li>Data setup should be as easy as you can possibly make it</li>
<li>The inputs for your test belong with your test (it lives inside of it)</li>
</ul>
<p>Let’s walk through some examples of these rules being applied. As usual, I’m going to use StoryTeller for my examples.</p>
<h4>Data setup should be declarative</h4>
<p>We use tabular structures to construct our test inputs. It feels a little spreadsheet-like but it’s the most natural way to input a decent sample population.</p>
<p>Let’s consider a sample example of declaring inputs for “People” in a system. For any given person, you will likely need their first/last name and let’s also optionally capture an email address:</p>
<table width="400" border="2" cellspacing="1" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="133"><strong>First</strong></td>
<td valign="top" width="133"><strong>Last</strong></td>
<td valign="top" width="133"><strong>Email</strong></td>
</tr>
<tr>
<td valign="top" width="133">Josh</td>
<td valign="top" width="133">Arnold</td>
<td valign="top" width="133"><a href="mailto:josh@arnold.com">josh@arnold.com</a></td>
</tr>
<tr>
<td valign="top" width="133">Olivia</td>
<td valign="top" width="133">Arnold</td>
<td valign="top" width="133"><a href="mailto:olivia@arnold.com">olivia@arnold.com</a></td>
</tr>
<tr>
<td valign="top" width="133">Joel</td>
<td valign="top" width="133">Arnold</td>
<td valign="top" width="133"></td>
</tr>
</tbody>
</table>
<p>Another important note here: avoid unnecessary setup of data that is unrelated to the test at hand. For example, if lookup values are required for every single test then create a mechanism to automatically create them.</p>
<h4>Data setup should be as easy as you can possibly make it</h4>
<p>Often times the models that you are constructing aren’t as simple as “first/last/email”. You may have entities with various required inputs, variants, etc. You absolutely do <strong>not</strong> want to have to go through the ceremony of declaring them in every single test.</p>
<p>We beat this a couple of different ways:</p>
<ol>
<li>Use default values whenever we can (e.g., birthdate will always be 03/11/1979 unless otherwise specified)</li>
<li>Use string conversion techniques to build up more complex objects</li>
</ol>
<p>In my current project, we have a grid with 30+ fields to maintain. The input that we specify per test leverages default values for field values so that we don’t have to constantly repeat ourselves. This is particularly useful when creating sample populations large enough to test out paging mechanics.</p>
<p>On top of the various fields we must maintain, we have errors that we track per row. Each row can have zero or more errors. Naturally, our test input must be able to support the entry of such errors. Now, rather than creating a separate tabular structure for this, we decided to allow for a particular string syntax that looks something like this:</p>
<blockquote><p>{field name}: ErrorCode1[, ErrorCode2]  | {field name}: …</p></blockquote>
<p>This allows us to input data like:</p>
<table width="407" border="2" cellspacing="1" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="133"><strong>First Name</strong></td>
<td valign="top" width="133"><strong>Last Name</strong></td>
<td valign="top" width="133"><strong>Errors</strong></td>
</tr>
<tr>
<td valign="top" width="133">Josh</td>
<td valign="top" width="133">Arnold</td>
<td valign="top" width="133">FirstName: E100</td>
</tr>
<tr>
<td valign="top" width="133">Olivia</td>
<td valign="top" width="133">Arnold</td>
<td valign="top" width="133">NONE</td>
</tr>
<tr>
<td valign="top" width="133">Joel</td>
<td valign="top" width="133">Arnold</td>
<td valign="top" width="133">NONE</td>
</tr>
</tbody>
</table>
<p>We can accomplish this in StoryTeller with something like this:<br />
<script type="text/javascript" src="https://gist.github.com/4159088.js?file=Models.cs"></script><br />
<script type="text/javascript" src="https://gist.github.com/4159088.js?file=StringParsing.cs"></script></p>
<h4>The inputs for your test belong with your test (it lives inside of it)</h4>
<p>This is not an attack on the ObjectMother pattern by any means. However, I strongly believe that in automated testing scenarios, the ObjectMother just doesn’t fit. Consider the following acceptance criteria:</p>
<ol>
<li>Using the sample database</li>
<li>Open the grid screen</li>
<li>Click on 2nd row</li>
<li>There should be an error on the screen</li>
</ol>
<p>There are so many things wrong with this that it’s hard to count. Let’s forget about lack of detail and focus on the real question: “What value does this test have?”</p>
<p>If you’re focusing on defining system behavior, then you’ve failed. This doesn’t describe any behavior at all. If you’re focusing on removing flaws, I think you’ve still failed. You’ve identified a problem but you’ve failed to capture the state of the system associated with it.</p>
<p>Here’s my point: tests are most useful when they self-explanatory. I want to pull open a test and have everything that I need right at my finger tips. I don’t want to cross reference other systems, emails, wiki pages, etc. to figure out what data exists for the test.</p>
<p>A well-defined acceptance test should look like this (it should look familiar):</p>
<ol>
<li>Test input (system state)</li>
<li>Behavior</li>
<li>Expected results</li>
</ol>
<p>Using StoryTeller for my examples, here’s what a test looks like (a condensed snippet from my current project):</p>
<p><a href="http://lostechies.com/josharnold/files/2012/11/storyteller-test.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px 0px 24px; display: inline; padding-right: 0px; border: 0px;" title="storyteller-test" src="http://lostechies.com/josharnold/files/2012/11/storyteller-test_thumb.png" alt="storyteller-test" width="585" height="449" border="0" /></a></p>
<h3>Wrapping it up</h3>
<p>Let me reiterate my points here for sake of clarity. Automated tests that are easy to read, write, and maintain follow these rules:</p>
<ol>
<li>Data setup must be declarative (think tabular inputs)</li>
<li>Data setup must be as easy as possible</li>
<li>The inputs and dependencies of the test live within the expression (see the ST screenshot above for an example)</li>
</ol>
<p>Next time we’ll discuss how to standardize your UI mechanics.
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2012/11/28/guidelines-for-automated-testing-defining-test-inputs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Guidelines for Automated Testing</title>
		<link>http://lostechies.com/josharnold/2012/11/26/guidelines-for-automated-testing/</link>
		<comments>http://lostechies.com/josharnold/2012/11/26/guidelines-for-automated-testing/#comments</comments>
		<pubDate>Mon, 26 Nov 2012 16:30:40 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[automated-testing]]></category>
		<category><![CDATA[guidelines-automated-testing]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=222</guid>
		<description><![CDATA[Overview Continuing the theme of my most recent posts, I’ve decided to start a series on Automated Testing. I’ll be pulling from lessons learned on all of the crazy things that I’ve been involved with over the last year. It’s&#160;&#8230; <a href="http://lostechies.com/josharnold/2012/11/26/guidelines-for-automated-testing/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>Continuing the theme of my most recent posts, I’ve decided to start a series on Automated Testing. I’ll be pulling from lessons learned on all of the crazy things that I’ve been involved with over the last year.</p>
<blockquote><p><span style="background-color: #ffffff; font-size: medium;"><span style="font-size: medium;">It’s a known fact that preemptively writing a table of contents means that you will never get around to finishing a series. Don’t worry, I&#8217;ve already written and scheduled each post.</span></span></p></blockquote>
<h3>Table of Contents</h3>
<ol>
<li>Rapid feedback cycle (<a href="http://jeremydmiller.com/2012/10/11/test-with-the-finest-grai/">Jeremy covered this one</a>)</li>
<li><a href="http://lostechies.com/josharnold/2012/11/11/some-foundational-ideas-for-automated-testing/">System state</a></li>
<li><a href="http://lostechies.com/josharnold/2012/11/16/automated-testing-with-fubumvc-storyteller-and-serenity/">Collapsing your application into a single process</a></li>
<li><a href="http://lostechies.com/josharnold/2012/11/28/guidelines-for-automated-testing-defining-test-inputs/">Defining test inputs</a></li>
<li>Standardizing your UI mechanics</li>
<li>Separating test expression from screen drivers</li>
<li>Modeling steps for reuse</li>
<li>Providing contextual information about failures</li>
<li>Dealing with AJAX</li>
<li>Utilizing White-box testing for cheaper tests</li>
</ol>
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2012/11/26/guidelines-for-automated-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A lesson in automated testing via SlickGrid</title>
		<link>http://lostechies.com/josharnold/2012/11/23/a-lesson-in-automated-testing-via-slickgrid/</link>
		<comments>http://lostechies.com/josharnold/2012/11/23/a-lesson-in-automated-testing-via-slickgrid/#comments</comments>
		<pubDate>Fri, 23 Nov 2012 16:30:01 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[automated-testing]]></category>
		<category><![CDATA[fubumvc]]></category>
		<category><![CDATA[serenity]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=215</guid>
		<description><![CDATA[Overview Some time ago I became absolutely obsessed with testing – automated testing to be more specific. While I mostly blame Jeremy Miller for drilling the concepts and values into my skull, I’ve recently started wondering what changed in me.&#160;&#8230; <a href="http://lostechies.com/josharnold/2012/11/23/a-lesson-in-automated-testing-via-slickgrid/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>Some time ago I became absolutely obsessed with testing – automated testing to be more specific. While I mostly blame <a title="Jeremy Miller" href="http://jeremydmiller.com/" target="_blank">Jeremy Miller</a> for drilling the concepts and values into my skull, I’ve recently started wondering what changed in me. Where was the “ah-ha” moment? And then it finally hit me:</p>
<blockquote><p>Automated testing (for me) has always involved far too much friction.</p></blockquote>
<p>My development career has been a continuous mission to remove friction and avoid it at all costs. Rather than striving for quality in the realm of automated testing, I avoided the friction.</p>
<p><em>Until I learned how to do it <a href="http://lostechies.com/josharnold/2012/11/16/automated-testing-with-fubumvc-storyteller-and-serenity/">“the Fubu way”</a>.</em></p>
<p>As a result of some reflection over this last year, I’ve settled on one point that I feel is pivotal for frictionless testing.</p>
<h3>Invest in your tests</h3>
<p>In our last project, my team spent a significant portion of our development efforts working on testing infrastructure. This infrastructure allowed us to accomplish the things we needed to write our tests quickly but it was no small undertaking**. It paid off. Big time. We were able to add complex tests and build up an extremely extensive suite of regression tests.</p>
<p>My point is that if your team requires infrastructure for testing that does not exist, don’t be afraid to invest the time to create it. Believe it or not, there are areas of automated testing that have not yet been explored.</p>
<blockquote><p>** Of course, the benefit to YOU is that this infrastructure is available to you via our Serenity project <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-style: none;" src="http://lostechies.com/josharnold/files/2012/11/wlEmoticon-winkingsmile.png" alt="Winking smile" /></p></blockquote>
<h3>The principle in action</h3>
<p>In our current project we are working with SlickGrid. Luckily, we had a bit of infrastructure in place for working with it through Jeremy’s work on FubuMVC.Diagnostics which gave birth to the FubuMVC.SlickGrid project. This let us get up and running fairly quickly with a very basic grid. So we could render a grid from our read model. Great. Now what about testing?</p>
<p>Let me give you a little context here. This isn’t a grid with 4-5 columns. No, we have 72 columns. Each of which are displayed in various contexts (named groups, only columns with errors, etc.). We spiked out a couple of tests with StoryTeller/Serenity but it quickly became apparent that we needed to invest some time for this.</p>
<p>We needed the ability to programmatically point at particular rows in the grid. It wasn’t always as simple as “the row with this ID”, either. Naturally, FubuMVC.SlickGrid.Serenity was born.</p>
<p>The SlickGrid + Serenity project gives you helpers that hang off of the IWebDriver interface. The main “brain” is found in the GridAction&lt;T&gt; class that let’s you do stuff like this:<br />
<script type="text/javascript" src="https://gist.github.com/4132645.js?file=sample.cs"></script></p>
<p>You can access the underlying formatters, editors, and interact with the grid. More importantly, you can do all of that making use of the <strong>strongly-typed model</strong> that powers the conventions of the grid.</p>
<h3>Wrapping up</h3>
<p>Too often I see developers bumping into walls with frameworks, tools, and approaches that limit testing. The limits rarely make it impossible to test but the friction involved with the testing serves as a strong demotivator. Testing is a hard discipline to get your team to follow. The last thing you need is to make it needlessly hard and painful.
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2012/11/23/a-lesson-in-automated-testing-via-slickgrid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automated testing with FubuMVC, StoryTeller, and Serenity</title>
		<link>http://lostechies.com/josharnold/2012/11/16/automated-testing-with-fubumvc-storyteller-and-serenity/</link>
		<comments>http://lostechies.com/josharnold/2012/11/16/automated-testing-with-fubumvc-storyteller-and-serenity/#comments</comments>
		<pubDate>Fri, 16 Nov 2012 20:42:23 +0000</pubDate>
		<dc:creator>Josh Arnold</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[fubu]]></category>
		<category><![CDATA[fubumvc]]></category>
		<category><![CDATA[selfhost]]></category>
		<category><![CDATA[serenity]]></category>
		<category><![CDATA[storyteller]]></category>

		<guid isPermaLink="false">http://lostechies.com/josharnold/?p=206</guid>
		<description><![CDATA[Overview In my previous post I talked about some foundational ideas for automated testing. Rather than continuing on with conceptual points, let’s take a look at an example of how we do automated testing in the world of Fubu. Note:&#160;&#8230; <a href="http://lostechies.com/josharnold/2012/11/16/automated-testing-with-fubumvc-storyteller-and-serenity/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>In <a href="http://lostechies.com/josharnold/2012/11/11/some-foundational-ideas-for-automated-testing/">my previous post</a> I talked about some foundational ideas for automated testing. Rather than continuing on with conceptual points, let’s take a look at an example of how we do automated testing in the world of Fubu.</p>
<blockquote><p>Note:<br />
While some of the tools here are Fubu-specific, the approaches and StoryTeller are NOT Fubu-specific.</p></blockquote>
<h3>System State</h3>
<p>In most automated testing scenarios, you find yourself quickly bumping into issues like:</p>
<ul>
<li>Test data bleeding between tests (*ahem* shared databases)</li>
<li>Too many unknown data dependencies (hardcoded usernames, identifiers)</li>
</ul>
<p>The idea of “System State” is simply providing a declarative way for establishing the state of your system for *each* test.</p>
<p><strong>In-Memory Persistence</strong></p>
<p>One trick that my team has used in the past is changing our underlying persistence strategy from database to in-memory for automated testing. Some databases (i.e., RavenDB) provide a way for you to do this. We used a basic abstraction called FubuPersistence to do this**. This means that we simply modify our IoC container for these scenarios.</p>
<p><strong>SystemStateFixture</strong></p>
<p>As I mentioned, &#8220;System State&#8221; is all about declaratively specifying the state of your system for *each* test. In StoryTeller world, we do this via a Fixture.</p>
<p>If you’re unfamiliar with StoryTeller, then this will serve as a crash course. Let’s take a look at the following fixture:</p>
<p><script src="https://gist.github.com/4090516.js?file=SystemStateFixture.cs"></script></p>
<p>Turn your attention to line 35. This method allows us to create a test in StoryTeller like this:</p>
<p><a href="http://lostechies.com/josharnold/files/2012/11/system-state.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px 0px 24px; display: inline; padding-right: 0px; border-width: 0px;" title="system-state" src="http://lostechies.com/josharnold/files/2012/11/system-state_thumb.png" alt="system-state" width="244" height="103" border="0" /></a></p>
<h3>Example 1: Verify that the Subscription Plans are displayed</h3>
<p>One of the examples from my last post presented a test with the following steps:</p>
<ol>
<li>The available subscriptions are: “Subscription 1, Subscription 3”</li>
<li>Navigate to the Registration screen</li>
<li>The displayed subscriptions are: “Subscription 1, Subscription 3”</li>
</ol>
<p>Using our SystemStateFixture, let’s go ahead and define the state:</p>
<p><a href="http://lostechies.com/josharnold/files/2012/11/system-state-def.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px 0px 24px; display: inline; padding-right: 0px; border-width: 0px;" title="system-state-def" src="http://lostechies.com/josharnold/files/2012/11/system-state-def_thumb.png" alt="system-state-def" width="244" height="204" border="0" /></a></p>
<p><strong>RegistrationFixture</strong></p>
<p>Using the FubuMVC helpers in Serenity, the registration fixture is nice and simple:</p>
<p>&nbsp;</p>
<blockquote><p>Notice that before running the fixture, we instruct the test to navigate to the Registration screen. More notably, we are using our endpoint/actions to define the route. No magic strings here.</p></blockquote>
<p>We’re reusing the html conventions from our FubuMVC application by retrieving the select element: Driver.InputFor&lt;CreateAccount&gt;(x =&gt; x.Subscriptions); We then traverse this element and build up a list of plans from the options of the select tag.</p>
<p>Using our VerifySubscriptionPlans grammar, we can then define the following step:</p>
<p><a href="http://lostechies.com/josharnold/files/2012/11/verify-plans.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px 0px 24px; display: inline; padding-right: 0px; border-width: 0px;" title="verify-plans" src="http://lostechies.com/josharnold/files/2012/11/verify-plans_thumb.png" alt="verify-plans" width="244" height="213" border="0" /></a></p>
<h3>Example 2: After registering for an account, a confirmation email should be received</h3>
<p>One of the benefits to how the combination of FubuMVC, FubuMVC.SelfHost, Serenity, and StoryTeller works is that everything is in a single AppDomain. How is that beneficial, you might ask?</p>
<p>Let’s take a look at our email gateway class again:</p>
<p>We have a helper class here called SmtpServerController that wraps our usage of <a href="http://jmarnold.github.com/EmbeddedMail/">EmbeddedMail</a>:</p>
<p>We’re injecting our EmailSettings class (under the assumption that the settings need to vary). Because we’re operating under the same AppDomain, this means that we can configure our container and have it affect the behavior of our FubuMVC application.</p>
<p>Let’s turn attention to the StubEmailGateway method:</p>
<p>We start the server and the configure an instance of EmailSettings inside of our IoC container. Now when we make any calls it IEmailGateway.Send, we will be sending messages to our embedded SMTP server.</p>
<p>Let’s define our system state:</p>
<p><a href="http://lostechies.com/josharnold/files/2012/11/stub-email.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px 0px 24px; display: inline; padding-right: 0px; border: 0px;" title="stub-email" src="http://lostechies.com/josharnold/files/2012/11/stub-email_thumb.png" alt="stub-email" width="244" height="187" border="0" /></a></p>
<p>And now we’ll use our VerifyEmail grammar:</p>
<p><a href="http://lostechies.com/josharnold/files/2012/11/confirm-email.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px 0px 24px; display: inline; padding-right: 0px; border: 0px;" title="confirm-email" src="http://lostechies.com/josharnold/files/2012/11/confirm-email_thumb.png" alt="confirm-email" width="244" height="129" border="0" /></a></p>
<h3>Wrapping Up</h3>
<p>It’s a lot of information, I know. You’re better off pulling down the code and running through it yourself.</p>
<p><a title="https://github.com/jmarnold/SystemStateExample" href="https://github.com/jmarnold/SystemStateExample">https://github.com/jmarnold/SystemStateExample</a></p>
<p>Simply clone the repo, run rake to be sure you can compile, and then rake run_st. This will launch StoryTeller for you and you can browse for the project file located under src/SystemStateExample.StoryTeller/example.xml.
<p><font color="#B4B4B4" size="-2">Post Footer automatically generated by <a href="http://www.freetimefoto.com/add_post_footer_plugin_wordpress" style="color: #B4B4B4; text-decoration:underline;">Add Post Footer Plugin</a> for wordpress.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/josharnold/2012/11/16/automated-testing-with-fubumvc-storyteller-and-serenity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
