Martinicity: Tag ORUG http://www.martinicity.net/articles_controller.rb/tag?tag=orug en-us 40 Mike Blake The Unselfish Act of Writing Tests <p> ####ORUG At this months <a href="http://www.orug.org">Orlando Ruby User&#8217;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&#8217;t see on every Rails Project. He wrote a unit test. Lot&#8217;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&#8217;t been installed correctly on the new machine. Harris&#8217;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> Wed, 14 Feb 2007 21:07:00 +0000 urn:uuid:d3a23de4-6d31-4890-aaf1-7e6e04e61f32 Mike Blake http://www.martinicity.net/articles/2007/02/14/the-unselfish-act-of-writing-tests Create rails ruby unit tests ORUG Attend a Hackfest! <p>If you&#8217;re a programmer like me you&#8217;re a little intimidated by the <a href="http://www.flickr.com/photos/45241414@N00/sets/72157594276834801/">Hackfest</a>. That is , you&#8217;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&#8217;d have liked, and fear that you&#8217;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&#8217;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> Tue, 12 Sep 2006 14:30:00 +0000 urn:uuid:cc7c8d73-4271-44eb-860e-545367b0a9d6 Mike Blake http://www.martinicity.net/articles/2006/09/12/attend-a-hackfest Create ruby rails hackfest ORUG