<?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>Carbon Five Community</title>
	<atom:link href="http://blog.carbonfive.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.carbonfive.com</link>
	<description></description>
	<lastBuildDate>Wed, 10 Mar 2010 18:01:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Testing View Controllers</title>
		<link>http://blog.carbonfive.com/2010/03/testing/testing-view-controllers</link>
		<comments>http://blog.carbonfive.com/2010/03/testing/testing-view-controllers#comments</comments>
		<pubDate>Wed, 10 Mar 2010 18:01:08 +0000</pubDate>
		<dc:creator>jonah</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=864</guid>
		<description><![CDATA[I have been writing tests around my iPhone apps&#8217; view controllers in order to follow the same TDD practices we use in other environments. Writing tests first has changed the way I structure my code in a couple of ways which I think offer immediate and emergent benefits for my applications. Most of an iPhone [...]]]></description>
			<content:encoded><![CDATA[<p>I have been writing tests around my iPhone apps&#8217; view controllers in order to follow the same TDD practices we use in other environments. Writing tests first has changed the way I structure my code in a couple of ways which I think offer immediate and emergent benefits for my applications. Most of an iPhone application&#8217;s business logic is implemented in its view controllers. Testing those controllers is therefore a priority if I want to have a well tested application.<br />
Below are some examples of the sort of tests I have written for my view controllers using GTM, Hamcrest, and OCMock (our <a href="http://blog.carbonfive.com/2009/02/testing/iphone-unit-testing-toolkit">iPhone Unit Testing Toolkit</a>). Hopefully this can serve as a starting point for the tests you could be writing for your own projects.<br />
<span id="more-864"></span><br />
<strong>Testing Interface Builder Bindings</strong><br />
Broken nib bindings appear to be a common cause of application bugs during development. It is certainly easy enough to accidentally break or forget to create a binding while editing a nib file so let&#8217;s write some simple tests to assert that our actions and outlets are actually connected to objects in a nib file.<br />
These are really tests of the nib file itself. If the goal was to test the view controller&#8217;s use of these bound view objects I would replace the views with mock objects which could verify the controller&#8217;s behavior. (Erik Dörnenburg has provided a nice example of doing just that: <a href="http://erik.doernenburg.com/2008/07/testing-cocoa-controllers-with-ocmock/">Testing Cocoa Controllers with OCMock</a>)</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> testViewBinding <span style="color: #002200;">&#123;</span>
	TestableSimpleViewController <span style="color: #002200;">*</span>viewController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>TestableSimpleViewController alloc<span style="color: #002200;">&#93;</span> initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;color: blue;">&quot;TestableSimpleViewController&quot;</span> bundle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>viewController loadView<span style="color: #002200;">&#93;</span>; <span style="color: #11740a; font-style: italic;">//It is not strictly necessary to call loadView for this test as we access the view property which will call loadView if view is nil</span>
	assertThat<span style="color: #002200;">&#40;</span>viewController.view, isNot<span style="color: #002200;">&#40;</span>nilValue<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
	assertThat<span style="color: #002200;">&#40;</span>viewController.button, isNot<span style="color: #002200;">&#40;</span>nilValue<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> testUIButtonActionBinding <span style="color: #002200;">&#123;</span>
	TestableSimpleViewController <span style="color: #002200;">*</span>viewController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>TestableSimpleViewController alloc<span style="color: #002200;">&#93;</span> initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;color: blue;">&quot;TestableSimpleViewController&quot;</span> bundle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>viewController loadView<span style="color: #002200;">&#93;</span>; <span style="color: #11740a; font-style: italic;">//Here we must call loadView since we have not accessed the controller's view property to trigger view loading from the nib</span>
	assertThat<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>viewController.button actionsForTarget<span style="color: #002200;">:</span>viewController forControlEvent<span style="color: #002200;">:</span>UIControlEventTouchUpInside<span style="color: #002200;">&#93;</span>, onlyContains<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;color: blue;">&quot;testAction&quot;</span>, <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><strong>Testing View Reloading</strong><br />
View controllers should be able to unload their views if the application receives a memory warning while the view is not visible and then reload the view when it is needed again. We can reproduce that same sequence of messages in a test. For a non-trivial controller we would add additional assertions to test that any other view dependent properties were correctly released and recreated as the view was unloaded and reloaded.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> testViewUnloading <span style="color: #002200;">&#123;</span>
	TestableSimpleViewController <span style="color: #002200;">*</span>viewController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>TestableSimpleViewController alloc<span style="color: #002200;">&#93;</span> initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;color: blue;">&quot;TestableSimpleViewController&quot;</span> bundle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>viewController loadView<span style="color: #002200;">&#93;</span>;
	assertThat<span style="color: #002200;">&#40;</span>viewController.view, isNot<span style="color: #002200;">&#40;</span>nilValue<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
	<span style="color: #002200;">&#91;</span>viewController didReceiveMemoryWarning<span style="color: #002200;">&#93;</span>;
	assertThat<span style="color: #002200;">&#40;</span>viewController.button, is<span style="color: #002200;">&#40;</span>nilValue<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>; <span style="color: #11740a; font-style: italic;">//Note that while viewController.view is nil here we cannot test that directly as accessing view will trigger a call to loadView. Instead we can only test that our outlets have been released as expected.</span>
	<span style="color: #002200;">&#91;</span>viewController loadView<span style="color: #002200;">&#93;</span>;
	assertThat<span style="color: #002200;">&#40;</span>viewController.view, isNot<span style="color: #002200;">&#40;</span>nilValue<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><strong>Testing Switching Between View Controllers</strong><br />
View controllers frequently have dependencies on other view controllers. If those dependencies are tightly coupled it becomes very difficult to test the behavior of a single view controller. Instead we can expose those dependencies and replace them with mock objects in order to isolate the controller we are currently testing. Here we have a simple table view controller which presents a detail view controller when a table cell is selected. By mocking both the navigation controller used to present that detail view and the detail view itself we can capture and verify the table view controller&#8217;s behavior.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> testSelectingACellPushesADetailView <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">id</span> detailViewController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>OCMockObject niceMockForClass<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>GenericDetailViewController class<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #400080;">NSDictionary</span> <span style="color: #002200;">*</span>data <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDictionary</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	UINavigationController <span style="color: #002200;">*</span>navController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UINavigationController alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">id</span> navigationController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>OCMockObject partialMockForObject<span style="color: #002200;">:</span>navController<span style="color: #002200;">&#93;</span>;
&nbsp;
	TestableTableViewController <span style="color: #002200;">*</span>viewController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>TestableTableViewController alloc<span style="color: #002200;">&#93;</span> initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;color: blue;">&quot;TestableTableViewController&quot;</span> bundle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
	viewController.detailViewController <span style="color: #002200;">=</span> detailViewController;
	viewController.modelData <span style="color: #002200;">=</span> data;
&nbsp;
	<span style="color: #002200;">&#91;</span>navigationController pushViewController<span style="color: #002200;">:</span>viewController animated<span style="color: #002200;">:</span><span style="color: #a61390;">NO</span><span style="color: #002200;">&#93;</span>;
	assertThat<span style="color: #002200;">&#40;</span>viewController.navigationController, isNot<span style="color: #002200;">&#40;</span>nilValue<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>viewController loadView<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>detailViewController expect<span style="color: #002200;">&#93;</span> setModelData<span style="color: #002200;">:</span>data<span style="color: #002200;">&#93;</span>; <span style="color: #11740a; font-style: italic;">//expect that the detail view will be given some data to display</span>
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>navigationController expect<span style="color: #002200;">&#93;</span> pushViewController<span style="color: #002200;">:</span>detailViewController animated<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>; <span style="color: #11740a; font-style: italic;">//expect that the detail view will be pushed onto the nave controller</span>
	<span style="color: #002200;">&#91;</span>viewController tableView<span style="color: #002200;">:</span>viewController.tableView didSelectRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSIndexPath</span> indexPathForRow<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span> inSection<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>detailViewController verify<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>navigationController verify<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><strong>So what makes test-driven controllers different?</strong><br />
I certainly could have written these example controllers without any tests around them. However by writing tests I was encouraged to make a couple of changes to the way I structure my code.</p>
<ul>
<li>My controllers expose dependencies that might otherwise remain buried in their implementations. In the example above I exposed the detail view controller my controller used so that I could replace it with a mock object. That made it possible to test that the expected data was passed to the detail view but it will also make it easy to switch to a different detail view controller in the future.</li>
<li>By focusing on testing just one class at a time I am encouraged to create well defined interfaces and a clear set of responsibilities for each class. That in turn leads to more modular code which is easier to maintain and reuse.</li>
<li>I write bugs but if I write a test to reproduce them and then prove that they are fixed I shouldn&#8217;t ever see the same bug twice. It is much easier to catch a missing nib binding because a test failed than it is to see the app crash when displaying some view and have to track down that exc_bad_access error in the debugger.</li>
<li>Most importantly by writing tests I can have confidence that my code works as I expected, not only when I first write it but also every time I run my tests (which happens every time I build the app). With that feedback I can change one controller without fearing that I might have broken something somewhere else in the app.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/03/testing/testing-view-controllers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Testing Talk in Oakland</title>
		<link>http://blog.carbonfive.com/2010/03/software-design/javascript-testing-talk-in-oakland</link>
		<comments>http://blog.carbonfive.com/2010/03/software-design/javascript-testing-talk-in-oakland#comments</comments>
		<pubDate>Mon, 08 Mar 2010 17:40:13 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[JavaScript / AJAX]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[Speaking]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=903</guid>
		<description><![CDATA[Next week at EBig Jonah and I are wrapping up our world tour of talking about Javascript testing. March 17th in Oakland: &#8221;Recent evolutions in Javascript testing frameworks now allow creating test suites, test-driving development, and running tests on a continuous integration server. This allows us to support more complex Javascript, have confidence in the implementation, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ebig.org/index.cfm?fuseaction=Calendar.eventDetail&amp;eventID=158" target="_blank">Next week at EBig</a> Jonah and I are wrapping up our world tour of talking about Javascript testing. March 17th in Oakland: &#8221;Recent evolutions in Javascript testing frameworks now allow creating test suites, test-driving development, and running tests on a continuous integration server. This allows us to support more complex Javascript, have confidence in the implementation, and push more of the logic from the server into the browser, reducing the load on the server.&#8221; The focus of the talk is walking through a suite of tests we build for a real-world example.</p>
<p>For those of you who caught it last week at the SDForum, here are the links people requested:</p>
<ul>
<li><a href="http://code.google.com/p/javascript-test-maven-plugin/">Maven plugin for Javascript Unit Testing with Rhino/ScrewUnit</a> (from C5)</li>
<li><a href="http://github.com/ndp/wizardize">The current code for the &#8220;wizardize&#8221; example we walked through</a>.</li>
<li><a href="http://github.com/relevance/blue-ridge">Blue Ridge (Rails integration tool)</a></li>
<li><a href="http://pivotallabs.com/users/nick/blog/articles/455-better-javascript-testing-through-screwunit">ScrewUnit</a></li>
<li><a href="http://www.slideshare.net/jeresig/understanding-javascript-testing">JResig&#8217;s Presentation on JS Testing</a></li>
<li><a href="http://dl.dropbox.com/u/1399422/Javascript%20Unit%20Testing%2C%20Yes%20We%20Can%20Slides.pdf">The slides we used</a></li>
</ul>
<p>To sign up for next Wednesday, go to the <a href="http://www.ebig.org/index.cfm?fuseaction=Calendar.eventDetail&amp;eventID=158">EBig site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/03/software-design/javascript-testing-talk-in-oakland/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alon on Flash and Canvas at SXSW</title>
		<link>http://blog.carbonfive.com/2010/03/speaking/alon-on-flash-and-canvas-at-sxsw</link>
		<comments>http://blog.carbonfive.com/2010/03/speaking/alon-on-flash-and-canvas-at-sxsw#comments</comments>
		<pubDate>Mon, 01 Mar 2010 19:55:54 +0000</pubDate>
		<dc:creator>alon</dc:creator>
				<category><![CDATA[Speaking]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=897</guid>
		<description><![CDATA[
I&#8217;m looking forward to participating in a panel Is Canvas the End of Flash? this month at SXSW on the role the new HTML Canvas element is playing in web development and how it compares to Flash. Much of the perspective I have for this panel comes from my long history working with Flash and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sxsw.com"><img src="http://www.sxsw.com/files/conf-logos/ia-logo.gif" align="right" alt="SXSW" style="margin-left:20px;"></a></p>
<p>I&#8217;m looking forward to participating in a panel <a href="http://my.sxsw.com/events/event/561">Is Canvas the End of Flash?</a> this month at SXSW on the role the new HTML Canvas element is playing in web development and how it compares to Flash. Much of the perspective I have for this panel comes from my long history working with Flash and from our recent work with Canvas for Isilon Systems on <a href="http://www.isilon.com/isiBlogs/254">InsightIQ</a>.</p>
<p>The panel has been organized by Greg Veen of SmallBatch, Inc., creators of <a href="http://typekit.com">TypeKit</a> and includes Chet Haas from the Adobe Flex team, Nathan Germick from social gaming start up Wonderhill and Ben Galbraith from Palm and Mozilla, also lead of the ambitious <a href="">Bespin project</a>.</p>
<p>Come check us out if you&#8217;re going to be in Austin.</p>
<p>Also check out some of the presentations by friends of Carbon Five at SXSW:</p>
<p><a href="http://hottub.hotstudio.com/2010/03/sxsw-here-we-come-a-museum-convergence-success-story/">From Dinosaurs to Digital: A Museum Convergence Success Story</a> from Maria Giudice of <a href="http://www.hotstudio.com">Hot Studio</a> on her work with Jonathon Denholtz of the <a href="http://www.calacademy.org/">California Academy of Sciences</a>.</p>
<p><a href="http://my.sxsw.com/events/event/662">Social Search: A Little Help From My Friends</a> a panel on social search organized by Brynn Evans that includes CEO Max Ventilla from our recently acquired client <a href="http://vark.com">Aardvark</a>.</p>
<p><a href="http://my.sxsw.com/events/event/421">Beyond the Desktop: Embracing New Interaction Paradigms</a> a panel on interactions that go beyond keyboard+mouse includes Nathan Moody of <a href="http://www.stimulant.io">Stimulant</a>, masters of the multitouch Microsoft Surface and NUI design.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/03/speaking/alon-on-flash-and-canvas-at-sxsw/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test-Driven JavaScript with ScrewUnit and BlueRidge</title>
		<link>http://blog.carbonfive.com/2010/02/software-design/test-driven-javascript-with-screwunit-and-blueridge</link>
		<comments>http://blog.carbonfive.com/2010/02/software-design/test-driven-javascript-with-screwunit-and-blueridge#comments</comments>
		<pubDate>Fri, 26 Feb 2010 01:33:04 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript / AJAX]]></category>
		<category><![CDATA[Ruby (on Rails)]]></category>
		<category><![CDATA[Software Design]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=893</guid>
		<description><![CDATA[Jonah and I are taking our presentation about Javascript Testing on the road next Tuesday at 6:30 in Palo Alto, at the SDForum
The teaser for it&#8230; Recent evolutions in JavaScript testing frameworks now allow creating test suites, test-driving development, and running tests on a continuous integration server. This allows us to support more complex JavaScript, have [...]]]></description>
			<content:encoded><![CDATA[<p>Jonah and I are taking our presentation about Javascript Testing on the road <a href="http://www.sdforum.org/index.cfm?fuseaction=Calendar.eventDetail&amp;eventID=13629&amp;pageId=471">next Tuesday at 6:30 in Palo Alto, at the SDForum</a></p>
<p>The teaser for it&#8230; Recent evolutions in JavaScript testing frameworks now allow creating test suites, test-driving development, and running tests on a continuous integration server. This allows us to support more complex JavaScript, have confidence in the implementation, and push more of the logic from the server into the browser, reducing the load on the server&#8230;</p>
<p>Hope to see you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/02/software-design/test-driven-javascript-with-screwunit-and-blueridge/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screw.Unit JS Testing in Maven: javascript-test-maven-plugin</title>
		<link>http://blog.carbonfive.com/2010/02/testing/screw-unit-js-testing-in-maven-javascript-test-maven-plugin</link>
		<comments>http://blog.carbonfive.com/2010/02/testing/screw-unit-js-testing-in-maven-javascript-test-maven-plugin#comments</comments>
		<pubDate>Thu, 25 Feb 2010 03:29:31 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript / AJAX]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=878</guid>
		<description><![CDATA[I&#8217;ve written a maven plugin to integrate Screw.Unit javascript tests into a maven build.  The project is inspired by the Blue Ridge testing framework for Rails, but it&#8217;s a bit more light-weight by design.

To use the plugin you should start by downloading Screw.Unit and implement your tests according to their instructions.  Once you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a <a href="http://code.google.com/p/javascript-test-maven-plugin/">maven plugin</a> to integrate <a href="http://github.com/nkallen/screw-unit">Screw.Unit</a> javascript tests into a maven build.  The project is inspired by the <a href="http://blog.thinkrelevance.com/2009/5/12/blue-ridge-1-0-javascript-unit-testing-for-rails-scandalous">Blue Ridge</a> testing framework for Rails, but it&#8217;s a bit more light-weight by design.<br />
<span id="more-878"></span><br />
To use the plugin you should start by downloading Screw.Unit and implement your tests according to their instructions.  Once you have some tests implemented in html files, add the plugin to your maven pom file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goals<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javascript-test<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goal<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.carbonfive.javascript-test<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javascript-test-maven-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.0-beta1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;includes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>src/test/javascript/suite*.html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/include<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/includes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>You will probably also need to add Carbon Five&#8217;s public repository so that maven will know where to grab the plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pluginRepositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pluginRepository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>c5-public-repository<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Carbon Five Public Repository<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://mvn.carbonfive.com/public<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pluginRepository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pluginRepositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The &lt;configuration&gt; section contains <a href="http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html">standard</a> maven &lt;include&gt; and &lt;exclude&gt; tags to allow you to specify any Screw.Unit test suite html files you would like to include in your build.</p>
<p>Now when maven executes its test phase, it will include your javascript tests as well. Any test that fails will halt the build. When the test phase is complete the target directory will contain a &#8217;screw-unit&#8217; directory that contains the test reports. There will be two files for every file included in the test execution The first is an XML file named TEST-dir1.dir2.dir3.filename.html.xml that contains the test results for that file in a reasonable approximation of JUnit&#8217;s xml format. The other file will be named dir1.dir2.dir3.filename.html and will contain a sort of snapshot of the test suite&#8217;s html at the time the tests completed (the javascript will be removed and the css will be baked in).</p>
<p>Like Blue Ridge, the javascript-test-maven-plugin relies on the excellent <a href="http://ejohn.org/blog/bringing-the-browser-to-the-server/">env.js</a> project and the less-excellent <a href="http://www.mozilla.org/rhino/">Rhino</a> project to emulate a browser in Java.   Unfortunately this combination creates the possibility of discrepancies between the browser and build results, and the probability of relatively slow test execution.  To keep the simulation as realistic as possible, javascript-test-maven-plugin recreates the test environment for each Screw.Unit html file, so the more tests you can cram into a single file the faster your builds will run.</p>
<p>There are a few directions for future work.  I&#8217;d like for the plugin to handle other browser-based javascript testing frameworks.  Screw.Unit is popular, but seems suboptimal in many respects.  The only limiting factor here is the plugin&#8217;s ability to interpret the results.  If env.js could run in javascript interpreters other than Rhino, I&#8217;d like to give the the plugin the capability to fork out to <a href="http://www.mozilla.org/js/spidermonkey/">spidermonkey</a> for better compatibility and performance.  Modifying the plugin would be relatively easy, but env.js appears to have some significant dependencies on Java.</p>
<p>Check it out if you have a need for this kind of thing and let us know if you have any problems or suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/02/testing/screw-unit-js-testing-in-maven-javascript-test-maven-plugin/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DNA Direct Acquired by Medco Health Solutions</title>
		<link>http://blog.carbonfive.com/2010/02/clients/dna-direct-acquired-by-medco-health-solutions</link>
		<comments>http://blog.carbonfive.com/2010/02/clients/dna-direct-acquired-by-medco-health-solutions#comments</comments>
		<pubDate>Sat, 20 Feb 2010 01:26:51 +0000</pubDate>
		<dc:creator>alon</dc:creator>
				<category><![CDATA[Clients]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=865</guid>
		<description><![CDATA[Medco Health Solutions and Carbon Five client DNA Direct announced earlier this month that DNA Direct has been acquired by Medco. Congratulations to everyone on the DNA Direct team on this new opportunity to extend their genomic medicine and health care services to an exponentially greater audience.
Among other initiatives, Carbon Five worked with DNA Direct [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://medco.mediaroom.com/index.php?s=43&#038;item=424">Medco Health Solutions</a> and Carbon Five client <a href="http://www.dnadirect.com">DNA Direct</a> announced earlier this month that <a href="http://talk.dnadirect.com/2010/02/01/medco-acquires-dna-direct-a-great-step-for-personalized-medicine/">DNA Direct has been acquired by Medco</a>. Congratulations to everyone on the DNA Direct team on this new opportunity to extend their genomic medicine and health care services to an exponentially greater audience.</p>
<p>Among other initiatives, Carbon Five worked with DNA Direct to roll out their first release of, as founder and CEO Ryan Phelan describes it, &#8220;the first genetic guidance program for a top five health plan with Humana, facilitating prior authorization and providing clinical services to ensure appropriate testing with lower out of pocket costs from the right lab.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/02/clients/dna-direct-acquired-by-medco-health-solutions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solid State Disks</title>
		<link>http://blog.carbonfive.com/2010/02/uncategorized/solid-state-disks</link>
		<comments>http://blog.carbonfive.com/2010/02/uncategorized/solid-state-disks#comments</comments>
		<pubDate>Tue, 16 Feb 2010 18:05:35 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hard disk]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[ssd]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=829</guid>
		<description><![CDATA[I&#8217;m a bit of a hardware geek.  I tend to keep up on what&#8217;s new and neat.  I&#8217;m a bit conservative when it actually comes to buying the latest and greatest, but that doesn&#8217;t stop me from following the trends.
I&#8217;ve been eyeing solid state disks for the last year or so, speculating that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a bit of a hardware geek.  I tend to keep up on what&#8217;s new and neat.  I&#8217;m a bit conservative when it actually comes to buying the latest and greatest, but that doesn&#8217;t stop me from following the trends.</p>
<p>I&#8217;ve been eyeing solid state disks for the last year or so, speculating that they could have a huge impact on developer productivity once all of the major gotchas were worked out.  I specifically though that pairing a decent laptop with an SSD would be awesome, since laptops generally have significantly slower hard disks than workstations.  They&#8217;re also a bit slower across the board (cpu, memory bus, etc), so I thought the IO boost from an SSD might even things out.</p>
<p>In December I decided to end the speculation, so I bought an 80G Intel x25m (Gen 2) SSD for my 15&#8243; Unibody MacBook Pro.<br />
<span id="more-829"></span></p>
<p>As it turns out, the SSD is faster than the 7200 RPM disk that was in my laptop by every measure.  Though, for most of the day-to-day tasks that I benchmarked, it wasn&#8217;t <em>that</em> much faster. For my Java and Rails projects, building (Java only of course) and running test suites ran between 5-25% faster.  Deploying Java apps was about 5-10% faster.  Reindexing a whole project in IntelliJ IDEA was about 40% faster.  These are real improvements, but they&#8217;re not the knock-your-socks off speed improvements I thought I might get.</p>
<p>There are some benchmarks that were way-way-way faster.  Running migrations on a database: super fast.  I just don&#8217;t do those things that often.  When you read about SSD performance, you see charts that make them seem 10-20 times faster.  They are in some cases, just not for most of my regular usage patterns. </p>
<p>I learned that the <em>real</em> benefit wasn&#8217;t really speedier builds or faster tests.  An SSD simply makes the machine zippy all the time.  Applications launch as fast as they do once they&#8217;re already cached by the operating system, even when they&#8217;re not.  In fact, the difference between a warm and cold start for all apps is nearly gone.  Spotlight is essentially instantaneous.  Opening new windows, web browsing, pulling up preferences, switching between apps&#8230; it&#8217;s all snappier.  Even when you think it shouldn&#8217;t be &#8212; because the data has to already be in memory &#8212; it feels just a tiny bit faster.</p>
<p>You know that feeling when there are two apps vying for the disk at the same time?  Everything just slllooooowwwws down as the drive hops from one section of the disk to another, multiple times each second as it fetches disparate data.  Yeah, that doesn&#8217;t happen anymore.  Heavy disk IO and multitasking aren&#8217;t a drag.  For example, I don&#8217;t notice when Time Machine is running anymore because it doesn&#8217;t effect my work at all, even when I&#8217;ve got a number of my own disk heavy tasks going.</p>
<p>Sounds awesome, right?  Well, where prices are now you&#8217;re paying about 20 times more per storage unit than normal drives.  That&#8217;s way better than the 50x from 18 months ago, but it&#8217;s still a lot more.</p>
<p>Is it worth it?  Since I could get away with buying an 80G model (~$260), I totally think it&#8217;s worth it.  If I needed a bigger drive than I wouldn&#8217;t have been able to bite the bullet in principle ($500 for a 160G drive is crazy).  Luckily, it will become an easier decision later this year when the 3rd generation drives hit the market.  They&#8217;ll been even faster, offer more capacity, and come with a slightly more reasonable price tag.</p>
<p>If you&#8217;re thinking about it, get educated because there are drives that are good (Intel x25m) and many others that are not.  AnandTech is a great resource for benchmarks and <a href="http://anandtech.com/searchresults.aspx?keyword=ssd&#038;submit=search">all kinds of information</a> related to SSDs.  While most of the major gotchas have been worked out, it&#8217;s a good idea to make sure your hardware, operating system, and future SSD will be friendly.</p>
<p>In the end, I&#8217;m not getting tons more stuff done than before, but it&#8217;s certainly more fun to code when things are always snappy.<br />
Christian</p>
<p>PS: You can check out my limited development-centric benchmarks <a href="https://spreadsheets.google.com/ccc?key=0AlPWHm0Y7-GkdGxoOS15b2JpQ05naENUbjZCWjM1a1E&#038;hl=en">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/02/uncategorized/solid-state-disks/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multiple Environments in an iPhone Project</title>
		<link>http://blog.carbonfive.com/2010/02/iphone/multiple-environments-in-an-iphone-project</link>
		<comments>http://blog.carbonfive.com/2010/02/iphone/multiple-environments-in-an-iphone-project#comments</comments>
		<pubDate>Sat, 13 Feb 2010 03:02:31 +0000</pubDate>
		<dc:creator>jonah</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=823</guid>
		<description><![CDATA[I&#8217;ve been following a Rails convention and defining multiple environments for my iPhone projects. This allows me to quickly switch application wide settings when running a test, development, or production version of the app.

I already have build targets for each environment as part of the unit testing setup I have been using so adding target-specific [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been following a Rails convention and defining multiple environments for my iPhone projects. This allows me to quickly switch application wide settings when running a test, development, or production version of the app.<br />
<span id="more-823"></span><br />
I already have build targets for each environment as part of the unit testing setup I have been using so adding target-specific run-time settings turns out to be quite easy.</p>
<p>I created an &#8220;Environments&#8221; resource group in Xcode and added a copy of my project&#8217;s &#8220;Resource/Info.plist&#8221; file for each environment.</p>
<div id="attachment_834" class="wp-caption alignnone" style="width: 196px"><img class="size-full wp-image-834 " title="environment_plists" src="http://blog.carbonfive.com/wp-content/uploads/2010/02/Screen-shot-2010-02-12-at-6.17.12-PM.png" alt="Environment specific plist files in the project." width="186" height="104" /><p class="wp-caption-text">A plist for each environment.</p></div>
<p>These plists should not be members of any build target (just like the original Info.plist.</p>
<div id="attachment_841" class="wp-caption alignnone" style="width: 415px"><img class="size-full wp-image-841 " title="info_plist_targets" src="http://blog.carbonfive.com/wp-content/uploads/2010/02/Screen-shot-2010-02-12-at-6.17.47-PM1.png" alt="Info.plist files are not members of any build targets." width="405" height="173" /><p class="wp-caption-text">Info.plist files should not  be members of a build target.</p></div>
<p>In each build target&#8217;s settings I then set the &#8220;Info.plist File&#8221; to the plist I created for that target&#8217;s environment. Note that the path to this file is the actual path on disk relative to the project root; if you have an &#8216;Environments&#8217; group in the project but no actual &#8216;Environments&#8217; directory in your project then this path would be incorrect.</p>
<div id="attachment_836" class="wp-caption alignnone" style="width: 286px"><a href="http://blog.carbonfive.com/wp-content/uploads/2010/02/Screen-shot-2010-02-12-at-6.18.52-PM.png"><img class="size-full wp-image-836   " title="built_target_plist_settings" src="http://blog.carbonfive.com/wp-content/uploads/2010/02/Screen-shot-2010-02-12-at-6.18.52-PM.png" alt="Specifying a plist file in the build target settings." width="276" height="336" /></a><p class="wp-caption-text">Specifying the  plist for a build target.</p></div>
<p>In code I can then access the plist&#8217;s dictionary via the application bundle:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span> infoDictionary<span style="color: #002200;">&#93;</span></pre></div></div>

<p>Now I can define the domain name of an API I will be using in each plist and automatically connect to localhost when running tests, to a staging server when using a development build, and to the production server when building a release or adhoc build. Each environment has it&#8217;s own build target so I can also specify a different app product identifier for each target and install the different app versions side by side on the same device.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/02/iphone/multiple-environments-in-an-iphone-project/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Acquires Aardvark</title>
		<link>http://blog.carbonfive.com/2010/02/clients/google-acquires-aardvark</link>
		<comments>http://blog.carbonfive.com/2010/02/clients/google-acquires-aardvark#comments</comments>
		<pubDate>Fri, 12 Feb 2010 19:52:03 +0000</pubDate>
		<dc:creator>alon</dc:creator>
				<category><![CDATA[Clients]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=825</guid>
		<description><![CDATA[Google announced today that they have acquired our client Aardvark. Congratulations to the very talented team at Aardvark on this next big step toward bringing their social search service to a global audience.
Aarvark has more details on the acquisition. You can also read more about the work did helping the Aardvark bootstrap their team and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://googleblog.blogspot.com/2010/02/google-acquires-aardvark.html">Google announced today</a> that they have acquired our client Aardvark. Congratulations to the very talented team at Aardvark on this next big step toward bringing their social search service to a global audience.</p>
<p>Aarvark has <a href="http://blog.vark.com/?p=361">more details on the acquisition</a>. You can also read more about the work did helping the <a href="http://www.carbonfive.com/view/page.basic/project/content.project/aardvark">Aardvark bootstrap their team and product development</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/02/clients/google-acquires-aardvark/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recipe for 5 Whys with an Agile Software Team</title>
		<link>http://blog.carbonfive.com/2010/01/agile/recipe-for-5-whys-with-an-agile-software-team</link>
		<comments>http://blog.carbonfive.com/2010/01/agile/recipe-for-5-whys-with-an-agile-software-team#comments</comments>
		<pubDate>Wed, 27 Jan 2010 04:53:33 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[rapid development]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=818</guid>
		<description><![CDATA[5 Whys is a great way to get at the root of quality problems. On my last three projects, when I felt like code quality was dropping, I ran a &#8220;5 Whys&#8221; session. I have found it adds variety, solves a very specific problem, and plugs right in as an alternative to an agile reflection.
It&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>5 Whys is a great way to get at the root of quality problems. On my last three projects, when I felt like code quality was dropping, I ran a &#8220;5 Whys&#8221; session. I have found it adds variety, solves a very specific problem, and plugs right in as an alternative to an <a href="http://blog.carbonfive.com/2009/12/agile/recipe-for-simple-agile-retrospectives">agile reflection</a>.</p>
<p>It&#8217;s not in every agile software team&#8217;s bag of tricks. Asking around our fairy savvy office, I discovered it&#8217;s far from universal. In the <a href="http://www.versionone.com/whitepapers.asp">&#8220;State of Agile&#8221; report from Version One</a>, which includes survey results from 2500 software developers, it wasn&#8217;t mentioned. Since I haven&#8217;t seen it show up that much in other agile writings, I thought I&#8217;d share my experiences here.<span id="more-818"></span></p>
<p><strong>What is &#8220;5 Whys&#8221;?</strong> I picked up &#8220;5 Whys&#8221; from the lean software movement, which sprang from Toyota manufacturing.  You can read about its history on <a href="http://en.wikipedia.org/wiki/5_Whys">wikipedia</a>, but it&#8217;s pretty simple: at the end of the assembly line, when a widget comes out with a problem, you stop the line and ask &#8220;Why?&#8221; Whatever the reason, you ask the &#8220;Why?&#8221; again. Repeat at least 5 times. The goal is to discover the &#8220;root cause&#8221; of the defect, and fix the root cause, not just some symptom. Wikipedia has a good example around car repair. Here&#8217;s a software example:</p>
<blockquote><p>1. Why did Sheryl say the sign-up flow was broken?<br />
<em>A: Because she was trying to sign up a second time. Duh.</em><br />
2. Yeah, but why did the flow break if the user is already signed up?<br />
<em>A: It&#8217;s a bug. We didn&#8217;t have a test case for that.</em><br />
3. Why didn&#8217;t we have a test case for it?<br />
<em>A: I just didn&#8217;t think of it.</em><br />
4. Why didn&#8217;t you think about it?<br />
<em>A: The story seemed easy&#8211; I guess I didn&#8217;t think it through.</em><br />
5. Why do you think you didn&#8217;t think it through?&#8221;<br />
<em>A: I guess I was working alone and was in a hurry.</em><br />
&#8230;</p></blockquote>
<p>Obviously you don&#8217;t have ask &#8220;Why?&#8221; exactly five times, but that does seem to be a pretty good number. The point is you start articulating the behaviors and procedures that cause the problems.</p>
<p><strong>Taking It for a Spin. </strong> I&#8217;ve come up with exercise for agile software teams.  Like I mentioned, when quality drops below your comfort level, give it a try:</p>
<ol>
<li>(2 minutes) Make a list of the most recent bugs you&#8217;ve uncovered. I&#8217;ve found that the last 10 is usually enough&#8211; if not too much. You can put these on a white board, index cards or a wiki page&#8211; all will work.</li>
<li>(2 minutes) Prioritize them based on the ones you want to talk about. Which caused the most embarrassment or cost? You usually only have energy to talk about 5 or 6 of them.</li>
<li>(15 minutes) For each bug, ask &#8220;Why did this happen?&#8221; Then, probe deeper until you can&#8217;t get much further. Write the answers down where everyone can see.</li>
<li>(5 minutes) When you&#8217;re done with all the bugs (or out of time), circle common root causes.</li>
<li>(10 minutes) Brainstorm ways to mitigate or eliminate the root causes. Come of with one or two SMART goals for the team.</li>
</ol>
<p>Some of the root causes we&#8217;ve gotten to recently:</p>
<ul>
<li> we didn&#8217;t pair on hard features</li>
<li> we didn&#8217;t ask for clarifications on the requirements</li>
<li> one engineer didn&#8217;t understand the intent behind the code</li>
<li> nobody looked at the app on Internet Explorer 6</li>
</ul>
<p>Just like in agile reflections, the changes made coming out of these meetings stick with the team. During one session, the developers decided that there were just too many mistakes that someone else would have easily caught&#8211; so they always needed two sets of eyes on every checkin. I&#8217;d advocated this before, but it was never applied consistently. To my surprise though, after the reflection, everyone was  disciplined about this policy&#8211; and our quality was much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/01/agile/recipe-for-5-whys-with-an-agile-software-team/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Migrations: Fail when database is out of date</title>
		<link>http://blog.carbonfive.com/2010/01/java/database-migrations-fail-when-database-is-out-of-date</link>
		<comments>http://blog.carbonfive.com/2010/01/java/database-migrations-fail-when-database-is-out-of-date#comments</comments>
		<pubDate>Thu, 21 Jan 2010 05:41:15 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=811</guid>
		<description><![CDATA[The latest release of the Carbon Five Database Migration maven plugin supports a new goal: check.  The check goal fails the build if the database isn&#8217;t up to date.  That is, if there are pending migrations the plugin produces a clear message explaining that the database is out of date and lists the [...]]]></description>
			<content:encoded><![CDATA[<p>The latest release of the <a href="http://code.google.com/p/c5-db-migration/">Carbon Five Database Migration maven plugin</a> supports a new goal: check.  The check goal fails the build if the database isn&#8217;t up to date.  That is, if there are pending migrations the plugin produces a clear message explaining that the database is out of date and lists the pending migrations.  Run <code>mvn test</code> and see something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="console" style="font-family:monospace;">[INFO] ------------------------------------------------------------------------
[INFO] Building Gearlist - Data Access
[INFO]    task-segment: [test]
[INFO] ------------------------------------------------------------------------
[INFO] [db-migration:check {execution: default}]
[INFO] Checking jdbc:mysql://localhost/gearlist_test using migrations at src/main/db/migrations/.
[INFO] Loaded JDBC driver: com.mysql.jdbc.Driver
[WARNING] There are 2 pending migrations: 
&nbsp;
    20100116010256_audit_tracking.sql
    20100121052539_add_daily_reports.sql
&nbsp;
    Execute db-migration:migrate to apply pending migrations.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] There are 2 pending migrations, migrate your db and try again.</pre></div></div>

<p>It&#8217;s very easy to include the check goal in your build lifecycle if you&#8217;re already using the db-migration-maven-plugin.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">...
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.carbonfive.db-support<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>db-migration-maven-plugin<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.9.9-m2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>validate<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/phase<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>check<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/goals<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/execution<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/executions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jdbc:mysql://${db.host}/${db.name}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${db.username}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${db.password}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plugins<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/build<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Check out the <a href="http://code.google.com/p/c5-db-migration/">project home</a> for additional documentation and details.  There&#8217;s also a simple, complete <a href="http://svn.carbonfive.com/public/christian/migration-sample1/trunk/">example application</a> showing off this configuration.</p>
<p>Enjoy!<br />
Christian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/01/java/database-migrations-fail-when-database-is-out-of-date/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Erector views &#8211; undefined method `default_url_options&#8217;</title>
		<link>http://blog.carbonfive.com/2010/01/ruby-on-rails/erector-views-undefined-method-default_url_options</link>
		<comments>http://blog.carbonfive.com/2010/01/ruby-on-rails/erector-views-undefined-method-default_url_options#comments</comments>
		<pubDate>Wed, 20 Jan 2010 19:30:18 +0000</pubDate>
		<dc:creator>james</dc:creator>
				<category><![CDATA[Ruby (on Rails)]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=800</guid>
		<description><![CDATA[I&#8217;m posting this because it took me too long to figure this out. Hope it saves someone else some trouble. If you want to use named route helpers to generate urls in your erector widgets you need to include ActionController::UrlWriter in your class, like so:

class Views::Layouts::BasicPage &#60; Erector::Widgets::Page
include ActionController::UrlWriter
...
end
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m posting this because it took me too long to figure this out. Hope it saves someone else some trouble. If you want to use named route helpers to generate urls in your erector widgets you need to include ActionController::UrlWriter in your class, like so:</p>
<p><code><br />
class Views::Layouts::BasicPage &lt; Erector::Widgets::Page<br />
include ActionController::UrlWriter<br />
...<br />
end</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/01/ruby-on-rails/erector-views-undefined-method-default_url_options/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automatically deploying to Engine Yard Cloud</title>
		<link>http://blog.carbonfive.com/2010/01/ruby-on-rails/automatically-deploying-to-engine-yard-cloud</link>
		<comments>http://blog.carbonfive.com/2010/01/ruby-on-rails/automatically-deploying-to-engine-yard-cloud#comments</comments>
		<pubDate>Thu, 07 Jan 2010 19:04:14 +0000</pubDate>
		<dc:creator>jonah</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Ruby (on Rails)]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[Engine Yard Cloud]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rake]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=793</guid>
		<description><![CDATA[I&#8217;m working on a application which is deployed to Engine Yard&#8217;s Cloud infrastructure and I wanted to automatically redeploy the application whenever our tests passed on our continuous integration server.
Engine Yard will eventually allow us to push a branch to our cloud environment from git (ie &#8220;git push engineyard master&#8221;) but until that is available [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a application which is deployed to Engine Yard&#8217;s Cloud infrastructure and I wanted to automatically redeploy the application whenever our tests passed on our continuous integration server.</p>
<p>Engine Yard will eventually allow us to push a branch to our cloud environment from git (ie &#8220;git push engineyard master&#8221;) but until that is available the best option seems to be to trigger a github post receive hook directly.</p>
<p>To that end I rewrote an existing script to trigger post receive hooks as a rake task; <a href="http://gist.github.com/271433">http://gist.github.com/271433</a><br />
<span id="more-793"></span></p>
<pre lang=ruby>
require 'rubygems'
require 'json'
begin
  require 'restclient'
rescue Exception
end

namespace :ey do

  # Based on http://gist.github.com/114954
  # Discussed at https://cloud-support.engineyard.com/discussions/questions/83-deploying-to-solo-instance-from-automated-build
  desc 'Trigger a GitHub Post Receive Hook to deploy the app'
  task :deploy do
    post_receive_hook 'preview'
  end

  desc 'Trigger a GitHub Post Receive Hook to deploy and migrate the app'
  task :deploy_and_migrate do
    post_receive_hook 'preview', true
  end

  def post_receive_hook(envname, migrate=false)
    token = `git config --get cloud.token`.chomp

    if token.empty?
      token = ENV['cloud.token']
      end

    if token.empty?
      puts <<-EOT
The cloud token is not set.
To store the token, use:
$ git config --add cloud.token SOMETOKEN
or set the cloud.token environment variable.
EOT
      exit 2
    end

    commit = `git rev-parse HEAD`.chomp
    payload = {
        "commits" => [{"id" => commit, "message"=>"[deploy #{envname}#{migrate ? ' migrate' : ''}]"}],
        "ref" => "refs/heads/master",
        }

    puts "Triggering a deploy for #{commit} on #{envname}"
    begin
      response = RestClient.post("https://cloud.engineyard.com/github/#{token}",
                                 :payload => payload.to_json)
      puts "Successfully triggered the deploy"
    rescue RestClient::RequestFailed => e
      puts "Could not deploy your changes"
      puts e.response.code
      puts e.response.body
      exit 1
    end
  end
end
</pre>
<p>In setting this up I discovered a couple of potential stumbling points:</p>
<ul>
<li>The environment must have been deployed via the EY dashboard before you will be able to trigger a deploy using the post receive hook API.</li>
<li>The branch specified in the API call (and therefore the git branch you should be working in if running that rake task) must match the branch deployed using the EY dashboard.</li>
<li>If you make an API call to deploy the &#8216;master&#8217; branch EY will attempt to deploy branch &#8216;HEAD&#8217;.</li>
<li>If the branch specified in the API call does not match the branch specified on the dashboard the API will report success but not redeploy the environment.</li>
</ul>
<p>The folks at Engine Yard are working to correct some of those issues and now I&#8217;ve got a project which automatically pushes changes to the cloud every time our tests cycle.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2010/01/ruby-on-rails/automatically-deploying-to-engine-yard-cloud/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recipe for Simple Agile Retrospectives</title>
		<link>http://blog.carbonfive.com/2009/12/agile/recipe-for-simple-agile-retrospectives</link>
		<comments>http://blog.carbonfive.com/2009/12/agile/recipe-for-simple-agile-retrospectives#comments</comments>
		<pubDate>Thu, 17 Dec 2009 22:29:51 +0000</pubDate>
		<dc:creator>alon</dc:creator>
				<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=763</guid>
		<description><![CDATA[After my talk at the Commonwealth Club last week our good friend Darren from Stimulant followed up with me to get a summary of the simple agile retrospective technique I described.
I thought I&#8217;d just send him to Google but a search for agile retrospective returned descriptions that seemed too heavy weight for the small, skilled, [...]]]></description>
			<content:encoded><![CDATA[<p>After my talk at the Commonwealth Club last week our good friend Darren from <a href="http://stimulant.io">Stimulant</a> followed up with me to get a summary of the simple agile retrospective technique I described.</p>
<p>I thought I&#8217;d just send him to Google but a search for <a href="http://www.google.com/search?q=agile+retrospective">agile retrospective</a> returned descriptions that seemed too heavy weight for the small, skilled, agile-literate teams we employ at Carbon Five. </p>
<p>There is certainly a lot of valuable information and insight out there I and definitely suggest doing some reading to understand the fundamentals and options for running retrospectives. However, since we want to do retrospectives often, we need a practice that doesn&#8217;t take much time or effort. </p>
<p>Here&#8217;s a recipe we are using these days. You can do this in 30 minutes. I actually did this with our architect for a home renovation project I am working on. Great things came out of it. I think it might have blown their minds.</p>
<p><strong>Setup</strong></p>
<p>Get alll team members in a room with a few stickies each.</p>
<p>You&#8217;re here to talk about an iteration, project, or other unit&#8230; with the goal of improving the next time around.</p>
<p><strong>Thoughts: 5-10 min</strong></p>
<p> Smiley face on stickies with good things from the last iteration.<br />
 Frowny face with concerns, risks, fears,&#8230;<br />
 You don&#8217;t have to be exhaustive, use the time you allocate.</p>
<p><strong>Cluster: 5-10 min</strong></p>
<p> Create two teams.<br />
 Give the smiles to one and the frowns to the other.<br />
 Group the stickies into related clusters.</p>
<p><strong>Discuss: 20 min</strong></p>
<p> Identify the primary smiley clusters.<br />
 Confirm that you will continue to see these benefits, can you increase them?</p>
<p> Identify the primary frowny clusters and list the themes on a whiteboard.<br />
 Vote to discuss &#8211; each team member has 4 votes &#8211; put dots next to<br />
the issues you want to discuss.<br />
 Discuss the top 3 issues &#8211; identify SMART (http://en.wikipedia.org/wiki/SMART_criteria) steps to address them.</p>
<p>Rinse, wash, repeat. Don&#8217;t feel you have to talk about everything. You are trying to focus on top issues. Once you address those, the next most important issues will surface for discussion.</p>
<p>We do this every other week with our internal team and monthly including our clients.</p>
<p>If you have other recipes for simple reflection, I&#8217;d love to hear them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/12/agile/recipe-for-simple-agile-retrospectives/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fail Early and Often at the Commonwealth Club Wed Dec 9</title>
		<link>http://blog.carbonfive.com/2009/12/agile/fail-early-and-often-at-the-commonwealth-club-wed-dec-9</link>
		<comments>http://blog.carbonfive.com/2009/12/agile/fail-early-and-often-at-the-commonwealth-club-wed-dec-9#comments</comments>
		<pubDate>Mon, 07 Dec 2009 19:45:35 +0000</pubDate>
		<dc:creator>alon</dc:creator>
				<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=759</guid>
		<description><![CDATA[Please join us for an Evening Program at the Commonwealth Club in San Francisco for my presentation on techniques for creating a culture of learning, quality and collaboration in your organization. I will be sharing insights including failures and lessons learned from Carbon Five&#8217;s almost 10 years of creating web-based products. 
Light reception to follow. [...]]]></description>
			<content:encoded><![CDATA[<p>Please join us for an Evening Program at the Commonwealth Club in San Francisco for my presentation on techniques for creating a culture of learning, quality and collaboration in your organization. I will be sharing insights including failures and lessons learned from Carbon Five&#8217;s almost 10 years of creating web-based products. </p>
<p>Light reception to follow. We hope you can hang out after for a glass of wine and to catch up before the holidays.</p>
<p><a href="http://tickets.commonwealthclub.org/auto_choose_ga.asp?area=2&#038;shcode=1501">http://tickets.commonwealthclub.org/auto_choose_ga.asp?area=2&#038;shcode=1501</a></p>
<p><strong>Fail Early and Often: Innovative Practices for Online Development</strong><br />
Alon Salant, Principal, Carbon Five</p>
<p>Organizations today increasingly struggle to create compelling software products, web sites and social media while working with the daunting details of limited time and resources. Learn new ways of working and delivering early value with simple and easy-to-apply processes from a pioneering software development firm. Discover how agile techniques and tools have helped to sculpt new strategies and sustainable practices, leading to more success, faster turn-around and reduced expenses.</p>
<p><strong>Location:</strong><br />
Commonwealth Club Office<br />
585 Market Street, 2nd Floor<br />
San Francisco, CA 94105</p>
<p><strong>Telephone Reservations:</strong> (415) 597-6700</p>
<p><strong>Time:</strong> 5:30 p.m. networking, <strong>6 p.m. program</strong>, reception to follow<br />
<strong>Cost:</strong> $8 members, $15 non-members, $7 students (with valid ID)</p>
<p>This is an open invitation. Please share with others.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/12/agile/fail-early-and-often-at-the-commonwealth-club-wed-dec-9/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit testing JavaScript with Blue Ridge</title>
		<link>http://blog.carbonfive.com/2009/11/testing/unit-testing-javascript-with-blue-ridge</link>
		<comments>http://blog.carbonfive.com/2009/11/testing/unit-testing-javascript-with-blue-ridge#comments</comments>
		<pubDate>Sat, 14 Nov 2009 04:19:19 +0000</pubDate>
		<dc:creator>jonah</dc:creator>
				<category><![CDATA[JavaScript / AJAX]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=696</guid>
		<description><![CDATA[My current rails project is using Blue Ridge and the tool set it bundles together (Rhino, env.js, Screw.Unit, and Smoke) to write test driven JavaScript. The ability to write tests of my JavaScript, in JavaScript, as efficiently as I can test other languages has forced me to rethink how I structure my work and I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>My current rails project is using <a href="http://github.com/relevance/blue-ridge">Blue Ridge</a> and the tool set it bundles together (<a href="http://www.mozilla.org/rhino/">Rhino</a>, <a href="http://github.com/thatcher/env-js">env.js</a>, <a href="http://github.com/nkallen/screw-unit">Screw.Unit</a>, and <a href="http://github.com/andykent/smoke">Smoke</a>) to write test driven JavaScript. The ability to write tests of my JavaScript, in JavaScript, as efficiently as I can test other languages has forced me to rethink how I structure my work and I&#8217;m writing better code because of it.</p>
<p>There are a couple of different options for JS testing available at this point but Blue Ridge&#8217;s plugin is the first I have seen which made writing test driven code as easy as I have come to expect while still providing all the functionality I need. In particular;</p>
<ul>
<li>Running my tests in a browser is fast. Refreshing fixture pages to rerun tests is dramatically more efficient than waiting for selenium tests to cycle.</li>
<li>I can debug my tests as they run against their fixtures pages and inspect or manipulate the DOM at any point.</li>
<li>I have mock and fake objects available to test behavior and stub out dependencies.</li>
<li>My JS tests run in continuous integration, just like all the other tests.</li>
</ul>
<p>By writing fixtures pages and tests first I am immediately using all of my code in two locations and running it against slightly different DOMs. That has pushed me to encapsulate most of my code as jQuery plugins and think carefully about how much I depend on the page&#8217;s structure. I end up with terse selectors instead of using whatever attributes are readily available and a clear configuration point for my page&#8217;s behavior as I chain together plugin calls in $(document).ready().</p>
<p>We&#8217;d like to see what other developers have done and share what we have learned so far so Carbon Five is hosting an open discussion of JavaScript testing in our office this week.</p>
<p>Topic: Javascript Testing<br />
When: Tuesday Nov 17<br />
6pm: arrive/network<br />
6:30 &#8211; 8 presentation and discussion<br />
Where: Carbon Five office: <a href="http://maps.google.com/maps?f=q&#038;hl=en&#038;geocode=&#038;q=171+2nd+St+%23+4,+San+Francisco,+CA%E2%80%8E&#038;sll=36.738884,-118.432617&#038;sspn=13.579326,18.632813&#038;ie=UTF8&#038;hq=&#038;hnear=171+2nd+St,+San+Francisco,+California+94105&#038;z=14&#038;iwloc=r0">171 2nd Street, 4th Floor</a></p>
<p>Please <a href="https://spreadsheets.google.com/viewform?formkey=dDg5dl9zbHlhZXNpdzBxdVIzblhjN3c6MA">RSVP</a> if you would like to attend.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/11/testing/unit-testing-javascript-with-blue-ridge/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure Email with Spring&#8217;s JavaMailServer and Gmail</title>
		<link>http://blog.carbonfive.com/2009/11/java/secure-email-with-springs-javamailserver-and-gmail</link>
		<comments>http://blog.carbonfive.com/2009/11/java/secure-email-with-springs-javamailserver-and-gmail#comments</comments>
		<pubDate>Thu, 12 Nov 2009 21:38:16 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=737</guid>
		<description><![CDATA[Both Carbon Five and my ISP have moved email management over to Gmail.  While this has been a net improvement for me as an end user, it&#8217;s made it a bit more difficult to configure my applications to send outgoing mail.  It isn&#8217;t hard to find examples online that explain how to configure Spring&#8217;s JavaMailSender [...]]]></description>
			<content:encoded><![CDATA[<p>Both Carbon Five and my ISP have moved email management over to <a href="http://gmail.com">Gmail</a>.  While this has been a net improvement for me as an end user, it&#8217;s made it a bit more difficult to configure my applications to send outgoing mail.  It isn&#8217;t hard to find <a href="http://www.codinglabs.com/blog/?p=4">examples</a> <a href="http://stackoverflow.com/questions/854493/problem-configuring-springs-mailsender-for-our-smtp-server-but-gmail-works">online</a> that explain how to configure Spring&#8217;s <a href="http://static.springsource.org/spring/docs/1.1.x/api/org/springframework/mail/javamail/JavaMailSender.html">JavaMailSender</a> to work with Gmail.  But none of the examples I&#8217;ve found provide a configuration that can be switched between Gmail and an open SMTP server with a few reasonable external properties (an important feature in an application that needs to be deployed in varied environments).  What&#8217;s worse, the configurations tend to differ with no rational provided for the necessary parameters.  So I spent some time with the source and a debugger and came up with a simplified solution:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;color: blue;">&quot;mailSender&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;color: blue;">&quot;org.springframework.mail.javamail.JavaMailSenderImpl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;color: blue;">&quot;defaultEncoding&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;color: blue;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;color: blue;">&quot;host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;color: blue;">&quot;${mail.host}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;color: blue;">&quot;port&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;color: blue;">&quot;${mail.port}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;color: blue;">&quot;protocol&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;color: blue;">&quot;${mail.protocol}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;color: blue;">&quot;username&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;color: blue;">&quot;${mail.username}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;color: blue;">&quot;password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;color: blue;">&quot;${mail.password}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;color: blue;">&quot;javaMailProperties&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;color: blue;">&quot;mail.debug&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>${mail.debug}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;color: blue;">&quot;mail.${mail.protocol}.auth&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>${mail.smtp-auth}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The properties for an open server look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mail.host       = localhost
mail.port       = 25
mail.protocol   = smtp
mail.smtp-auth  = false
mail.username   =
mail.password   =
mail.debug      = false</pre></div></div>

<p>And the properties for gmail look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mail.host       = smtp.gmail.com
mail.port       = 465
mail.protocol   = smtps
mail.smtp-auth  = true
mail.username   = my.email@address.com
mail.password   = mypassword
mail.debug      = true</pre></div></div>

<p>The host, port, username, password and debug properties should be obvious.  The key is to change the protocol between &#8217;smtp&#8217; and &#8217;smpts&#8217;.  The only real difference between smtp and smtps is that the later causes JavaMail&#8217;s SMTPTransport object to open an SSL socket to the server.  Gmail only accepts SSL connections on port 465.  After figuring this out, I was glad to see that Gmail was accepting my connections, but immediately frustrated to find that JavaMail was no longer attempting to authenticate before sending mail.  The trick is that JavaMail checks its transport related parameters under &#8216;mail.[protocol].[parameter]&#8216;.  This appears to be an entirely <a href="http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html">undocumented</a> feature of JavaMail.  Fortunately, we can substitute the protocol name into the parameter key as well, so our auth parameter still works with either &#8217;smtp&#8217; or &#8217;smtps&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/11/java/secure-email-with-springs-javamailserver-and-gmail/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C5 Test Support new addition: FunctionalTestRunner</title>
		<link>http://blog.carbonfive.com/2009/10/testing/c5-test-support-new-addition-functionaltestrunner</link>
		<comments>http://blog.carbonfive.com/2009/10/testing/c5-test-support-new-addition-functionaltestrunner#comments</comments>
		<pubDate>Thu, 29 Oct 2009 01:54:03 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=702</guid>
		<description><![CDATA[We&#8217;re always looking for new ways to test our applications and we&#8217;ve been trying a few new things on our projects.  One of the recent additions is a JUnit test runner designed to help make writing and running functional tests easier.  In Javaland, we use Selenium and/or HtmlUnit for our functional tests.  [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re always looking for new ways to test our applications and we&#8217;ve been trying a few new things on our projects.  One of the recent additions is a JUnit test runner designed to help make writing and running functional tests easier.  In Javaland, we use Selenium and/or HtmlUnit for our functional tests.  These are the tests that run against a deployed application over the wire using a real or simulated browser.  Most of our functional tests work the application in the same way a real user would, testing sequences of realistic activity and often touching a number of pages.  Since our functional tests use either a real browser or a simulated one, Javascript is executed and assertions made on the results.  This gives us greater confidence that our app is really working, end to end.</p>
<p>Here&#8217;s the high-level flow that the functional test runner provides:</p>
<ol>
<li>Load fixture data from a DBUnit dataset.</li>
<li>Download and install the application server (if necessary).</li>
<li>Start the application server (using Cargo).</li>
<li>Deploy the application, waiting until it&#8217;s completely started.</li>
<li>Run one or more functional tests (using your preferred testing framework &#8211; Selenium, HTMLUnit, etc)&#8230;<br />
If a test dirties the database in a manner that must be reset, the test class can be marked with the @DirtiesDatabase annotation.  This will reload the database fixture and optionally restart the application.</li>
<li>Shutdown the application server.</li>
</ol>
<p><span id="more-702"></span><br />
It&#8217;s easy to use&#8230;  First add the maven dependency:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">  ...
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>c5-public-repository<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Carbon Five Public Repository<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://mvn.carbonfive.com/public<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repositories<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  ...
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.carbonfive.test-support<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>test-support<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.9.2-m1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>test<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  ...</pre></div></div>

<p>And then write your first functional test:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">@RunWith<span style="color: #009900;">&#40;</span>FunctionalTestRunner.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FunctionalTestRunnerTest
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// This field is automatically injected by the test runner and references</span>
    <span style="color: #666666; font-style: italic;">// the functional test properties (see below).</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399; font-weight: bold;">Properties</span> properties<span style="color: #339933;">;</span>
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> propertiesShouldBeSetByRunner<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        assertThat<span style="color: #009900;">&#40;</span>properties, not<span style="color: #009900;">&#40;</span>nullValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        assertThat<span style="color: #009900;">&#40;</span>properties.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, greaterThan<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> applicationShouldBeDeployed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399; font-weight: bold;">Exception</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Test using your preferred framework... just using URL as an example.</span>
        <span style="color: #003399; font-weight: bold;">URL</span> root = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">URL</span><span style="color: #009900;">&#40;</span>format<span style="color: #009900;">&#40;</span><span style="color: #0000ff;color: blue;">&quot;http://localhost:%s/&quot;</span>, properties.<span style="color: #006633;">getProperty</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;color: blue;">&quot;appserver.port&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399; font-weight: bold;">String</span> content = IOUtils.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span>root.<span style="color: #006633;">openStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        assertThat<span style="color: #009900;">&#40;</span>content, containsString<span style="color: #009900;">&#40;</span><span style="color: #0000ff;color: blue;">&quot;Orange&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Lastly, create the  configuration file that goes along with it.  By default, it&#8217;s called functional-test.properties and lives at the root of the classpath (src/test/resources/ for maven users).  Here&#8217;s an example:</p>

<div class="wp_syntax"><div class="code"><pre class="properties" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># Application server</span>
<span style="color: #000080; font-weight:bold;">appserver.container</span>         <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> tomcat6x</span>
<span style="color: #000080; font-weight:bold;">appserver.installer</span>         <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> http://www.apache.org/dist/tomcat/tomcat-<span style="">6</span>/v6.0.20/bin/apache-tomcat-6.0.20.zip</span>
<span style="color: #000080; font-weight:bold;">appserver.port</span>              <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> 8080</span>
<span style="color: #000080; font-weight:bold;">appserver.logging</span>           <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> false</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Application configuration</span>
<span style="color: #000080; font-weight:bold;">app.war</span>                     <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> ./gearlist-webapp/target/gearlist-webapp-<span style="">1.0</span>-SNAPSHOT.war</span>
<span style="color: #000080; font-weight:bold;">app.context</span>                 <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> ROOT</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Database fixtures</span>
<span style="color: #000080; font-weight:bold;">fixture.restart_application</span> <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> false</span>
<span style="color: #000080; font-weight:bold;">fixture.file</span>                <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> classpath:/database-fixture.xml</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;"># Application configuration (not used by the functional test runner)</span>
<span style="color: #000080; font-weight:bold;">db.driver</span>                   <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> com.mysql.jdbc.Driver</span>
<span style="color: #000080; font-weight:bold;">db.host</span>                     <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> localhost</span>
<span style="color: #000080; font-weight:bold;">db.name</span>                     <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> gearlist_func_test</span>
<span style="color: #000080; font-weight:bold;">db.url</span>                      <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> jdbc:mysql://$<span style="">&#123;</span>db.host<span style="">&#125;</span>/$<span style="">&#123;</span>db.name<span style="">&#125;</span></span>
<span style="color: #000080; font-weight:bold;">db.username</span>                 <span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"> root</span>
<span style="color: #000080; font-weight:bold;">db.password</span>                 <span style="color: #000000;">=</span></pre></div></div>

<p>Property values can reference other properties (e.g. db.url) and they&#8217;re all set as system properties so it&#8217;s easy to override your application properties for functional testing.</p>
<p>Both the database fixture loading and the application server steps can be customized by plugging in a new <a href="http://code.google.com/p/c5-test-support/source/browse/trunk/src/main/java/com/carbonfive/test/functional/DatabaseFixtureLoader.java">DatabaseFixtureLoader</a> or <a href="http://code.google.com/p/c5-test-support/source/browse/trunk/src/main/java/com/carbonfive/test/functional/ApplicationServerManager.java">ApplicationServerManager</a>, respectively.</p>
<p>Since it&#8217;s a JUnit extension, functional tests run exactly the same whether they&#8217;re triggered from the IDE or the command line.  This approach is a response to how clunky it felt using Maven to launch the application server before running the tests.  Also, with only one master orchestrator, it&#8217;s easier to handle redeploying the application if necessary.</p>
<p>Want to see a real example?  I&#8217;ve written a sample application called &#8220;gearlist&#8221; that&#8217;s available via <a href="http://svn.carbonfive.com/public/christian/gearlist/trunk">public svn</a> (press cancel if asked for authentication credentials).  It includes several HtmlUnit and Selenium functional tests, as well as other types of tests using some of the other test utils I&#8217;ve written.  Look for the readme for details.</p>
<p><a href="http://code.google.com/p/c5-test-support/">Carbon Five Test Support</a> is hosted on google code, where you can read what documentation there is and peruse the source.</p>
<p>There are a few things to work on, including better exception handling during initialization and some flexibility around the Cargo configuration, however, it&#8217;s pretty stable and there&#8217;s no reason not to use it now.  Give it it try and give me your feedback.  The plan is to tighten it up and write some documentation for the 0.9.2 release.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/10/testing/c5-test-support-new-addition-functionaltestrunner/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Agile Practices&#8230; visualized?</title>
		<link>http://blog.carbonfive.com/2009/10/javascript-ajax/agile-practices-visualized</link>
		<comments>http://blog.carbonfive.com/2009/10/javascript-ajax/agile-practices-visualized#comments</comments>
		<pubDate>Wed, 07 Oct 2009 16:19:35 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript / AJAX]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=684</guid>
		<description><![CDATA[Only pure agile devotees will find it interesting&#8230; Revisiting agile methodologies, I wanted to solidify my understanding of the differences between agile, scrum, XP, etc. I went through a mini-research project of reviewing the &#8220;canonical&#8221; sources of these practices, and then built a quick visualization to clarify my understanding:
http://ndpsoftware.com/agile_methods/agile_methods.html
Hint: Try dragging around the boxes to [...]]]></description>
			<content:encoded><![CDATA[<p>Only pure agile devotees will find it interesting&#8230; Revisiting agile methodologies, I wanted to solidify my understanding of the differences between agile, scrum, XP, etc. I went through a mini-research project of reviewing the &#8220;canonical&#8221; sources of these practices, and then built a quick visualization to clarify my understanding:</p>
<p><a title="Agile Methods Visualized" href="http://ndpsoftware.com/agile_methods/agile_methods.html">http://ndpsoftware.com/agile_methods/agile_methods.html</a></p>
<p><em>Hint: Try dragging around the boxes</em> to see how practices are related to each other.</p>
<p><em>Warning: If it doesn&#8217;t draw anything interesting for you, refresh your browser&#8230;</em> there&#8217;s a large component of &#8220;randomness&#8221; to the algorithm and it can get stuck easily.</p>
<p><em>Warning II: Don&#8217;t leave it running in your browser</em>, as it&#8217;s somewhat sluggish Javascript&#8230; this was a demo thrown together in a couple hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/10/javascript-ajax/agile-practices-visualized/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Web Application Testing @ SDForum October 6th</title>
		<link>http://blog.carbonfive.com/2009/09/testing/web-application-testing-sdforum-october-6th</link>
		<comments>http://blog.carbonfive.com/2009/09/testing/web-application-testing-sdforum-october-6th#comments</comments>
		<pubDate>Sat, 26 Sep 2009 18:20:07 +0000</pubDate>
		<dc:creator>christian</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=675</guid>
		<description><![CDATA[Updated: Added links to presentation and source code.
I&#8217;ll be down in Palo Alto speaking about Automated Web Application Testing Tuesday October 6th.  If you&#8217;re interest in getting a peek at the typical Carbon Five Java web architecture along with a variety of strategies and techniques for testing, c&#8217;mon down and join us.  The [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Updated: Added links to presentation and source code.</strong></p>
<p>I&#8217;ll be down in Palo Alto speaking about Automated Web Application Testing Tuesday October 6th.  If you&#8217;re interest in getting a peek at the typical Carbon Five Java web architecture along with a variety of strategies and techniques for testing, c&#8217;mon down and join us.  The session will be primarily code-driven.  I&#8217;ll implement a few features along with unit, integration and functional tests and show off some of the techniques and custom tools that help keep things simple and easy during development.  Some of the topics include:</p>
<ul>
<li>Brief overview of our typical web architecture and tools stack</li>
<li>Differences between Unit, Integration and Functional Tests</li>
<li>Dealing with the database (schema and fixtures)</li>
<li>Where does test coverage pay off the most?</li>
<li>In-browser and out-of-browser functional testing</li>
<li>Carbon Five best practices, custom tools and techniques</li>
<li>And more&#8230;</li>
</ul>
<p>You can find the gritty details on the <a href="http://www.sdforum.org/index.cfm?fuseaction=Calendar.eventDetail&#038;eventID=13525">SDForum site</a>.</p>
<p>Doors at 6:30 and the show begins at 7:00.  Hope to see you there!</p>
<h3>Here are the artifacts from the presentation:</h3>
<ul>
<li><a href="http://svn.carbonfive.com/public/christian/gearlist/branches/sdforum/docs/Web%20Application%20Testing.pdf">Presentation (.pdf)</a></li>
<li><a href="http://svn.carbonfive.com/public/christian/gearlist/branches/sdforum/">Source Code (svn)</a></li>
<li><a href="http://svn.carbonfive.com/public/christian/gearlist/branches/sdforum/docs/readme.txt">Build and Run Instructions (readme.txt)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/09/testing/web-application-testing-sdforum-october-6th/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Aardvark for iPhone on the App Store</title>
		<link>http://blog.carbonfive.com/2009/09/uncategorized/aardvark-for-iphone-on-the-app-store</link>
		<comments>http://blog.carbonfive.com/2009/09/uncategorized/aardvark-for-iphone-on-the-app-store#comments</comments>
		<pubDate>Fri, 18 Sep 2009 01:24:07 +0000</pubDate>
		<dc:creator>alon</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=668</guid>
		<description><![CDATA[We&#8217;re excited to see that the Aardvark iPhone app is now available on the app store. Since handing off an earlier version of the app to their internal team we&#8217;ve been waiting with baited breath for its release.
It has been very well received with TechCrunch claiming it the best way to use Aardvark and 4 [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re excited to see that the <a href="http://blog.vark.com/?p=188">Aardvark iPhone app</a> is now available on the app store. Since handing off an earlier version of the app to their internal team we&#8217;ve been waiting with baited breath for its release.</p>
<p>It has been very well received with <a href="http://www.techcrunch.com/2009/09/15/aardvarks-iphone-app-is-the-best-way-to-use-the-service-yet/">TechCrunch</a> claiming it the best way to use Aardvark and 4 1/2 stars from over 100 ratings in just a couple days. </p>
<p>Working on this project with the Aardvark team was great. We love their intensely user-driven approach for designing and validating features through iterative development. We also pioneered our own best practices for <a href="http://blog.carbonfive.com/2009/02/testing/iphone-unit-testing-toolkit">test driven development to the iPhone platform</a>, something that seems to be rare in the iPhone development community.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/09/uncategorized/aardvark-for-iphone-on-the-app-store/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Carbon Five at SXSW 2010</title>
		<link>http://blog.carbonfive.com/2009/08/agile/carbon-five-at-sxsw-2010</link>
		<comments>http://blog.carbonfive.com/2009/08/agile/carbon-five-at-sxsw-2010#comments</comments>
		<pubDate>Fri, 21 Aug 2009 00:31:42 +0000</pubDate>
		<dc:creator>alon</dc:creator>
				<category><![CDATA[Agile]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=665</guid>
		<description><![CDATA[We&#8217;re planning our return to Austin for the South by Southwest interactive conference with a session we have put together with the folks at Aardvark. Titled The Experiment is the Product: Innovation through Iteration, Rob Spiro and I are going to break down how we merged our Agile software development practices with their user-focused and [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re planning our return to Austin for the South by Southwest interactive conference with a session we have put together with the folks at <a href="http://vark.com">Aardvark</a>. Titled <a href="http://panelpicker.sxsw.com/ideas/view/4545">The Experiment is the Product: Innovation through Iteration</a>, Rob Spiro and I are going to break down how we merged our Agile software development practices with their user-focused and research-driven product design process. </p>
<p>There&#8217;s great stuff about cheap and fast prototyping and testing techniques, building feedback loops in to product design, and how to come up with emerging product definition that can drive an iterative software development process.</p>
<p>SXSW weights community input heavily in its panel selection process. Take a moment to <a href="http://panelpicker.sxsw.com/ideas/view/4545">give our proposal a thumbs up</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/08/agile/carbon-five-at-sxsw-2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Formatting in Xcode</title>
		<link>http://blog.carbonfive.com/2009/08/iphone/code-formatting-in-xcode</link>
		<comments>http://blog.carbonfive.com/2009/08/iphone/code-formatting-in-xcode#comments</comments>
		<pubDate>Fri, 07 Aug 2009 23:37:39 +0000</pubDate>
		<dc:creator>jonah</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=658</guid>
		<description><![CDATA[Working in Xcode I almost forgot how much I like IntelliJ&#8217;s code formatting tools. Luckily for me Mike Smith recently pointed out that UniversalIndentGUI can be used to setup your own code formatting in Xcode.

UniversalIndentGUI supports a large number of code formatting tools but Uncrustify seems to be the only one with objective-c support. An up to [...]]]></description>
			<content:encoded><![CDATA[<p>Working in Xcode I almost forgot how much I like IntelliJ&#8217;s code formatting tools. Luckily for me <a href="https://devforums.apple.com/people/MikeSmith">Mike Smith</a> recently pointed out that <a href="http://universalindent.sourceforge.net/index.php">UniversalIndentGUI</a> can be used to setup your own code formatting in Xcode.<br />
<span id="more-658"></span><br />
UniversalIndentGUI supports a large number of code formatting tools but <a href="http://uncrustify.sourceforge.net/">Uncrustify</a> seems to be the only one with objective-c support. An up to date build of Uncrustify (version 0.53) is included with UniversalIndentGUI so I did not need to build my own.</p>
<p>I setup a set of styling rules using UniversalIndentGUI&#8217;s live preview and saved the resulting config file. I was then able to add a set of custom user scripts in Xcode to run Uncrustify against the current file or selection. I found that I had to specify the source as objective-c to prevent Uncrustify form running some C/C++ styling rules which I did not want.</p>
<div id="attachment_660" class="wp-caption alignnone" style="width: 510px"><a href="http://blog.carbonfive.com/wp-content/uploads/2009/08/uncrustify-scripts.png"><img class="size-full wp-image-660" title="uncrustify-scripts" src="http://blog.carbonfive.com/wp-content/uploads/2009/08/uncrustify-scripts.png" alt="Uncrustify custom scripts in Xcode" width="500" height="332" /></a><p class="wp-caption-text">Uncrustify custom scripts in Xcode</p></div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
~<span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>UniversalIndentGUI<span style="color: #000000; font-weight: bold;">/</span>indenters<span style="color: #000000; font-weight: bold;">/</span>uncrustify <span style="color: #660033;">-l</span> OC <span style="color: #660033;">-q</span> <span style="color: #660033;">-c</span> ~<span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>UniversalIndentGUI<span style="color: #000000; font-weight: bold;">/</span>config<span style="color: #000000; font-weight: bold;">/</span>uncrustify_obj_c.cfg</pre></div></div>

<p>Now I can quickly clean up most of the minor formatting inconsistencies which creep into my code. Now I just need to polish my config file until it better matches my expectations for code formatting. In defining my preferred code style I have tried to follow the example provided by:</p>
<ul>
<li><a href="http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html">Coding Guidelines for Cocoa</a></li>
<li><a href="http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml">Google Objective-C Style Guide</a></li>
<li><a href="http://www.cocoadevcentral.com/articles/000082.php">Cocoa Style for Objective-C</a></li>
</ul>
<p>My current config file for Uncrustify is available here: <a href="http://svn.carbonfive.com/public/jonah/UniversalIndentGUI/config/uncrustify_obj_c.cfg">uncrustify_obj_c.cfg</a> if you would like to use it as a starting point.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/08/iphone/code-formatting-in-xcode/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Once Upon a School, Hot and C5 in Fast Company</title>
		<link>http://blog.carbonfive.com/2009/08/clients/once-upon-a-school-hot-and-c5-in-fast-company</link>
		<comments>http://blog.carbonfive.com/2009/08/clients/once-upon-a-school-hot-and-c5-in-fast-company#comments</comments>
		<pubDate>Tue, 04 Aug 2009 17:36:22 +0000</pubDate>
		<dc:creator>alon</dc:creator>
				<category><![CDATA[Clients]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=653</guid>
		<description><![CDATA[I was just forwarded a great writeup in Fast Company of the work Hot Studio and Carbon Five did for Dave Eggers and 826 Valencia on Once Upon a School. Truth be told, the article is primarily on Hot&#8217;s fantastic contribution to the project. Check it out!
]]></description>
			<content:encoded><![CDATA[<p>I was just forwarded a great <a href="http://www.fastcompany.com/blog/alissa-walker/designerati/once-upon-school-using-power-storytelling-connect-volunteers-and-stud">writeup in Fast Company</a> of the work <a href="http://www.hotstudio.com">Hot Studio</a> and Carbon Five did for Dave Eggers and 826 Valencia on <a href="http://www.onceuponaschool.org/">Once Upon a School</a>. Truth be told, the article is primarily on Hot&#8217;s fantastic contribution to the project. Check it out!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/08/clients/once-upon-a-school-hot-and-c5-in-fast-company/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resizing views around the keyboard</title>
		<link>http://blog.carbonfive.com/2009/07/iphone/resizing-views-around-the-keyboard</link>
		<comments>http://blog.carbonfive.com/2009/07/iphone/resizing-views-around-the-keyboard#comments</comments>
		<pubDate>Sat, 25 Jul 2009 00:31:24 +0000</pubDate>
		<dc:creator>jonah</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=644</guid>
		<description><![CDATA[Most of my iPhone apps need to accept keyboard input somewhere and that means I need to reposition my UI elements such that the keyboard does not hide the field the user is typing in. The iPhone Application Programming Guide offers one example of Moving Content That Is Located Under The Keyboard but this is [...]]]></description>
			<content:encoded><![CDATA[<p>Most of my iPhone apps need to accept keyboard input somewhere and that means I need to reposition my UI elements such that the keyboard does not hide the field the user is typing in. The iPhone Application Programming Guide offers one example of <a href="http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TextandWeb/TextandWeb.html#//apple_ref/doc/uid/TP40007072-CH20-SW7">Moving Content That Is Located Under The Keyboard</a> but this is not necessarily the best solution.<br />
<span id="more-644"></span></p>
<h3>Resizing a view&#8217;s frame</h3>
<p>One option is certainly to implement Apple&#8217;s example code and resize the view&#8217;s frame based on the dimensions of the keyboard every time the keyboard is shown or hidden.</p>
<h3>Resizing a view&#8217;s frame with a reference view</h3>
<p>When working with complex views, especially views that support rotation, I have found it convenient to add an extra empty view to my xib files to serve as a reference. I set this reference view to the dimensions I want my resizable view to match when the keyboard is hidden. I can then resize my view relative to this constant frame and not need to worry about reversing my resize calculations when the keyboard is hidden.</p>
<h3>Setting UIScrollView&#8217;s inset properties</h3>
<p>When working with a scroll view (or table view) I&#8217;ve found that the best option is to set the view&#8217;s content and scroll inset properties. Since this does not change the scroll view&#8217;s frame it eliminates the flicker the view resizing as the keyboard is dismissed (notable if the scroll view&#8217;s parent view has a different background color).</p>
<h3>Example code</h3>
<p>Examples of all three techniques are available as an Xcode project at <a href="http://svn.carbonfive.com/public/jonah/ManagingKeyboardExample/">http://svn.carbonfive.com/public/jonah/ManagingKeyboardExample/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2009/07/iphone/resizing-views-around-the-keyboard/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
