<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Segment7: autotest Sucks</title>
    <link>http://blog.segment7.net/articles/2006/04/25/autotest-sucks</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>The Blog</description>
    <item>
      <title>autotest Sucks</title>
      <description>&lt;p&gt;You really might think this is a strange thing to say, despite how &lt;a href="http://nubyonrails.topfunky.com/articles/2006/04/19/autotest-rails#comments"&gt;awesome&lt;/a&gt; some people say it is, it still sucks.  It doesn&amp;#8217;t suck because it doesn&amp;#8217;t work well, it sucks because its insides still bear the scars of its birth.&lt;/p&gt;


	&lt;p&gt;My first version of autotest was written at &lt;span class="caps"&gt;OOPSLA 2005&lt;/span&gt; after seeing Don Roberts and John Brandt show off a Smalltalk class browser that would automatically run tests whenever methods where changed.&lt;/p&gt;


	&lt;p&gt;At that time I was TDDing a personal Rails project and realized a tool to automatically run my tests as I made changes would probably speed up my development as much as switching to &lt;span class="caps"&gt;TDD&lt;/span&gt; from web browser reloading development did, so I wrote the first version of autotest.&lt;/p&gt;


	&lt;p&gt;That first version of autotest was probably about 100 lines of code.  It was tied directly to my development process and got stuck occasionally, but it worked well for me.&lt;/p&gt;


	&lt;p&gt;Sometime in January I imported autotest into ZenTest and made it work for more generic ruby code.  To do that I took my tiny ruby script and wrapped it up in a class.  I pulled the Rails stuff out into a subclass and made a few other cleanups.&lt;/p&gt;


	&lt;p&gt;This didn&amp;#8217;t do anything for the cleanliness of the code, but I did manage to add a bunch of tests that I hadn&amp;#8217;t during my &lt;span class="caps"&gt;OOPSLA&lt;/span&gt; coding spree.  I still had bugs though, and those took another four months to shake out with a few minor refactorings along the way.&lt;/p&gt;


	&lt;p&gt;Now autotest is &lt;a href="http://rubyforge.org/tracker/index.php?group_id=419&amp;amp;atid=1678"&gt;nearly perfect&lt;/a&gt; functionally, but the implementation sucks.  Some methods that do two or three things when they should be doing one.  The test running algorithm is scattered across several methods.&lt;/p&gt;


	&lt;p&gt;autotest needs a major refactoring and I&amp;#8217;m hoping to get to it in May.  Refactoring will make the code cleaner, more straightforward and more maintainable.  I may even do something to better support custom testing styles.  I could add &lt;a href="http://rubyforge.org/tracker/?atid=1681&amp;amp;group_id=419&amp;amp;func=browse"&gt;features&lt;/a&gt; to autotest, but that would only make the refactoring harder, so I won&amp;#8217;t while adding those features will make the code more convoluted.&lt;/p&gt;


	&lt;p&gt;As autotest accumulated more suck it became less fun to work on.  I don&amp;#8217;t like the sound of software in pain so I&amp;#8217;m going to listen and fix its suckage before adding any more fanciness.&lt;/p&gt;
</description>
      <pubDate>Tue, 25 Apr 2006 16:51:58 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:c235500b-3813-4050-82e2-6755fa56ab78</guid>
      <author>drbrain@segment7.net (Eric Hodel)</author>
      <link>http://blog.segment7.net/articles/2006/04/25/autotest-sucks</link>
      <category>Hacking</category>
      <category>ZenTest</category>
    </item>
    <item>
      <title>"autotest Sucks" by Jonathan Brodsky</title>
      <description>&lt;p&gt;I just started doing TDD last night for the first time, and auto test was a really nice way to run things.&lt;/p&gt;


	&lt;p&gt;thanks for writing such a nice tool. I am looking forward to it getting faster.&lt;/p&gt;</description>
      <pubDate>Wed, 26 Apr 2006 12:25:05 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:cad16a4b-4f1a-4f28-8e3f-1d109c347d0e</guid>
      <link>http://blog.segment7.net/articles/2006/04/25/autotest-sucks#comment-221</link>
    </item>
    <item>
      <title>"autotest Sucks" by Eric Hodel</title>
      <description>&lt;p&gt;In perforce I&amp;#8217;ve dropped the timeout to 2 seconds as 1 second churns the CPU a bit much.  The five second thing was annoying.&lt;/p&gt;


	&lt;p&gt;Before pulling in ruby_fork I&amp;#8217;ll need to do a bunch of refactoring.  I already tried once and it got far too messy.  Maybe I&amp;#8217;ll get a chance to work on it at &lt;a href="http://seattlemind.com" rel="nofollow"&gt;Mindcamp&lt;/a&gt; this weekend.&lt;/p&gt;</description>
      <pubDate>Wed, 26 Apr 2006 12:13:47 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:7caadaf9-039f-4d04-afcf-b191efd256ed</guid>
      <link>http://blog.segment7.net/articles/2006/04/25/autotest-sucks#comment-219</link>
    </item>
    <item>
      <title>"autotest Sucks" by topfunky</title>
      <description>&lt;p&gt;I agree than autotest works well, and I also admire your goal to refactor it before adding more features.&lt;/p&gt;


	&lt;p&gt;That being said, it would be nice if the refactoring could also separate the change notification so that more fine-grained OS-specific tools could be used (like Mac OS X&amp;#8217;s kpoll file save notifier). For other OS&amp;#8217;es, the normal &amp;#8220;check every 5 seconds&amp;#8221; system could be used.&lt;/p&gt;


	&lt;p&gt;Other than using &lt;a href="http://michael-mccracken.net/blog/blosxom.pl/computers/mac/programming/stakeoutMeetGrowl.html" rel="nofollow"&gt;stakeout&lt;/a&gt;, I&amp;#8217;m not sure how this would be implemented&amp;#8230;maybe as part of an Observer pattern where the notifier was configurable.&lt;/p&gt;


	&lt;p&gt;On the other hand, it might be more worthwhile to put your development resources toward the forking system you have mentioned since an OS-specific change notifier would save a maximum of 5 seconds, whereas keeping Rails in memory could save 10-15 seconds for each run (but this only helps if you are using autotest for Rails).&lt;/p&gt;</description>
      <pubDate>Wed, 26 Apr 2006 11:56:30 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:1b31d8d2-d3e8-4a61-b004-4591e766b66f</guid>
      <link>http://blog.segment7.net/articles/2006/04/25/autotest-sucks#comment-218</link>
    </item>
  </channel>
</rss>
