<?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: How I Use Autotest</title>
    <link>http://blog.segment7.net/articles/2007/11/26/how-i-use-autotest</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>The Blog</description>
    <item>
      <title>How I Use Autotest</title>
      <description>&lt;p&gt;During the Q&amp;#38;A portion of my talk, I was asked a very important question about autotest, something like &amp;#8220;How often do you save when using autotest?&amp;#8221;  I save all the time when using autotest.  There was a followup question, something like &amp;#8220;Don&amp;#8217;t you get syntax errors?&amp;#8221; and I don&amp;#8217;t.&lt;/p&gt;


	&lt;p&gt;Before I wrote autotest I was making fine-grained saves that were syntactically correct.  I wrote autotest to automate the running of tests so I wouldn&amp;#8217;t have to choose which tests to run.  My changes were so small that I spent an annoying fraction of my time editing my command line.&lt;/p&gt;


	&lt;p&gt;When I&amp;#8217;m using autotest, rather than writing all of a method&amp;#8217;s tests, I start by performing the setup (which should cause an error), add a flunk, and save, which is usually four lines:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;  def test_blah
    result = @thingy.blah
    flunk
  end&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;When the tests run they&amp;#8217;ll see the method &lt;code&gt;blah&lt;/code&gt; doesn&amp;#8217;t exist and fail, so I define the method, (the &lt;code&gt;def blah&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; lines), and save.  Then I write an assertion and save the test, which will fail, so I implement what I need to make the assertion pass, and save.  Now I repeatedly perform the minimum changes to go from failure to flunking until my test is complete, remove the flunk, and start over with the next method.&lt;/p&gt;


	&lt;p&gt;Each save I do is a handful of lines, so it&amp;#8217;s easy to keep them syntactically correct.  I know I&amp;#8217;m going from working state to working state as I work towards my end goal so I can easily roll back my changes with undo.&lt;/p&gt;
</description>
      <pubDate>Mon, 26 Nov 2007 14:33:23 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:e845d5d1-c6f4-487d-98aa-bc54537abd8d</guid>
      <author>drbrain@segment7.net (Eric Hodel)</author>
      <link>http://blog.segment7.net/articles/2007/11/26/how-i-use-autotest</link>
      <category>Testing</category>
      <category>ZenTest</category>
    </item>
    <item>
      <title>"How I Use Autotest" by Bryan</title>
      <description>&lt;p&gt;I love autotest.. it&amp;#8217;s essentially made testing enjoyable for me now.  Having the autotest window constantly updating (I save often&amp;#8230;) has made me nearly obsessed with making sure it&amp;#8217;s green.  Thanks for awesome tool.&lt;/p&gt;</description>
      <pubDate>Sun, 09 Dec 2007 22:04:06 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:8bb0dd0e-6c4b-48b3-8e92-e37d6c49e4ad</guid>
      <link>http://blog.segment7.net/articles/2007/11/26/how-i-use-autotest#comment-814</link>
    </item>
  </channel>
</rss>
