Martinicity: Tag ORUGMike Blaketag:www.martinicity.net,2005:TypoTypo2007-02-14T21:09:18+00:00Mike Blakeurn:uuid:d3a23de4-6d31-4890-aaf1-7e6e04e61f322007-02-14T21:07:00+00:002007-02-14T21:09:18+00:00The Unselfish Act of Writing Tests<p>
####ORUG
At this months <a href="http://www.orug.org">Orlando Ruby User’s Group</a> meeting, I did my <a href="http://www.apptrain.net/testing/img0.html">Testing on Rails</a> presentation. In it I touched on just some of the benefits of having an automated suite of Unit, Functional, and Integration tests.
<p>
<p>!<a href="http://www.apptrain.net/testing/img4.jpg">Benefits of Testing</a></p>
<p>
Later I thought of another major benefit. Tests help other people on the project, in addition to the author of the test.
<ol>
<li>Good Habits are Contagious</li>
</ol>
<p>Recently I had the opportunity to work on a project with <a href="http://blog.harrisreynolds.net/">Harris Reynolds</a>. Harris did something very important that sadly, you don’t see on every Rails Project. He wrote a unit test. Lot’s of us wrote tests , but this particular test stood out for two reasons. The first was when it was written.</p>
<ol>
<li>Writing Tests First</li>
</ol>
<p>Harris had found a bug in a model object that I had created. To notify me, he checked in an assertion that failed, then emailed me. This saved me time searching thought and remembering code I had written. I simply typed <code>rake test:recent</code> which runs all recently changed tests in a Rails application . The error took me right to the problem, and I immediately fixed the bug.</p>
<ol>
<li>Testing a Deployment</li>
</ol>
<p>The second reason I remember this test happened at least a month later. The application was being deployed to a new machine, and the test failed. The particular model object being tested pointed to a different database that the rest of the application, and it turned out that that database hadn’t been installed correctly on the new machine. Harris’s test told the problem straight away, and saved time once again.</p>
<p><b>Unit Testing: the gift that keeps on giving.</b></p>
<p>Thanks Harris!</p>Mike Blakeurn:uuid:cc7c8d73-4271-44eb-860e-545367b0a9d62006-09-12T14:30:00+00:002006-12-12T19:59:49+00:00Attend a Hackfest!<p>If you’re a programmer like me you’re a little intimidated by the <a href="http://www.flickr.com/photos/45241414@N00/sets/72157594276834801/">Hackfest</a>. That is , you’ve had several programming gigs over the years, attended a few more day <a href="http://www.pluckthepetal.com/blackdaisies/2004/02/long_meetings/">long meetings</a> than you’d have liked, and fear that you’ll be embarrassed by your perceived lack of skill compared to the young <a href="http://www.rubyonrails.org/core">whiz kids</a> with a burning passion for creating software.</p>
<p>We’ll let me assure you, the spirit of the hackfest is one of <a href="http://redhanded.hobix.com/cult/everyoneIsHereInTheFuture2.html">learning and cooperation</a> and not at all that of oneupmanship or competition. At least not at the <a href="http://www.orug.org"><span class="caps">ORUG</span></a> .</p>
<p>I had a blast this past weekend and learned a lot from my piers, and left with the feeling that I had helped out as well.</p>
<p>So my advice, fear not and attend a Hackfest!</p>