<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: I need to write faster tests</title>
	<atom:link href="http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/</link>
	<description>Programming, gardening, economics, life in Cleveland Heights</description>
	<lastBuildDate>Sat, 04 Feb 2012 03:03:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-3393</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Sat, 19 Jul 2008 05:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-3393</guid>
		<description>The other thing that unit tests won&#039;t catch is when one unit alters its interface but the second unit doesn&#039;t find out about it.&lt;br&gt;&lt;br&gt;Incidentally, I don&#039;t agree with the idea that interfaces shouldn&#039;t change.  If I come up with a better way of doing something, I&#039;m going to do it.</description>
		<content:encoded><![CDATA[<p>The other thing that unit tests won&#39;t catch is when one unit alters its interface but the second unit doesn&#39;t find out about it.</p>
<p>Incidentally, I don&#39;t agree with the idea that interfaces shouldn&#39;t change.  If I come up with a better way of doing something, I&#39;m going to do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-3394</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Sat, 19 Jul 2008 05:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-3394</guid>
		<description>Yeah, I think maybe there&#039;s nothing wrong with these narrative-based tests, but I would like to separate them from my other split-second tests.</description>
		<content:encoded><![CDATA[<p>Yeah, I think maybe there&#39;s nothing wrong with these narrative-based tests, but I would like to separate them from my other split-second tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-1494</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Sat, 19 Jul 2008 01:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-1494</guid>
		<description>The other thing that unit tests won&#039;t catch is when one unit alters its interface but the second unit doesn&#039;t find out about it.&lt;br&gt;&lt;br&gt;Incidentally, I don&#039;t agree with the idea that interfaces shouldn&#039;t change.  If I come up with a better way of doing something, I&#039;m going to do it.</description>
		<content:encoded><![CDATA[<p>The other thing that unit tests won&#39;t catch is when one unit alters its interface but the second unit doesn&#39;t find out about it.</p>
<p>Incidentally, I don&#39;t agree with the idea that interfaces shouldn&#39;t change.  If I come up with a better way of doing something, I&#39;m going to do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-1497</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Sat, 19 Jul 2008 01:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-1497</guid>
		<description>Yeah, I think maybe there&#039;s nothing wrong with these narrative-based tests, but I would like to separate them from my other split-second tests.</description>
		<content:encoded><![CDATA[<p>Yeah, I think maybe there&#39;s nothing wrong with these narrative-based tests, but I would like to separate them from my other split-second tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Oliver</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-1493</link>
		<dc:creator>Aaron Oliver</dc:creator>
		<pubDate>Fri, 18 Jul 2008 20:51:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-1493</guid>
		<description>I like to think of tests in terms of cost/benefit.&lt;br&gt;&lt;br&gt;Longer (integration) tests cost more because they eat time, but in theory have greater benefit, because they reflect actual use more closely. ( &lt;a href=&quot;http://googletesting.blogspot.com/2008/03/cost-benefit-analysis-of-test.html&quot; rel=&quot;nofollow&quot;&gt;http://googletesting.blogspot.com/2008/03/cost-...&lt;/a&gt;).&lt;br&gt;&lt;br&gt;Teeny unit tests are cheap, but don&#039;t verify as much as the longer integration tests.&lt;br&gt;&lt;br&gt;So running cheap tests all the time is ok, just like paying for electricity in your house all the time is ok. It doesn&#039;t cost much. &lt;br&gt;&lt;br&gt;Expensive tests can run less often but give better payoff, just like only buying a car every couple of years.</description>
		<content:encoded><![CDATA[<p>I like to think of tests in terms of cost/benefit.</p>
<p>Longer (integration) tests cost more because they eat time, but in theory have greater benefit, because they reflect actual use more closely. ( <a href="http://googletesting.blogspot.com/2008/03/cost-benefit-analysis-of-test.html" rel="nofollow"></a><a href="http://googletesting.blogspot.com/2008/03/cost-.." rel="nofollow">http://googletesting.blogspot.com/2008/03/cost-..</a>.).</p>
<p>Teeny unit tests are cheap, but don&#39;t verify as much as the longer integration tests.</p>
<p>So running cheap tests all the time is ok, just like paying for electricity in your house all the time is ok. It doesn&#39;t cost much. </p>
<p>Expensive tests can run less often but give better payoff, just like only buying a car every couple of years.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Foord</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-1496</link>
		<dc:creator>Michael Foord</dc:creator>
		<pubDate>Fri, 18 Jul 2008 20:11:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-1496</guid>
		<description>+1 to separating unit and integration tests.&lt;br&gt;&lt;br&gt;Integration tests *should* use a real database (etc) - but will take long er and longer as your tests cover more things (although there are obviously techniques you can use to minimize this).&lt;br&gt;&lt;br&gt;Unit tests should mock out every they can in terms of contact with the &#039;outside world&#039; - as a result they can run much faster.&lt;br&gt;&lt;br&gt;You can run your functional tests in a loop on your integration machine (using a fresh checkout each time and emailing you failures - use something like CC.NET or just knock up an integration script tied to a post commit hook yourself).&lt;br&gt;&lt;br&gt;You can run your unit tests whenever you make a change (preferably before to see the test fail and then afterwards to see it pass of course).</description>
		<content:encoded><![CDATA[<p>+1 to separating unit and integration tests.</p>
<p>Integration tests *should* use a real database (etc) &#8211; but will take long er and longer as your tests cover more things (although there are obviously techniques you can use to minimize this).</p>
<p>Unit tests should mock out every they can in terms of contact with the &#39;outside world&#39; &#8211; as a result they can run much faster.</p>
<p>You can run your functional tests in a loop on your integration machine (using a fresh checkout each time and emailing you failures &#8211; use something like CC.NET or just knock up an integration script tied to a post commit hook yourself).</p>
<p>You can run your unit tests whenever you make a change (preferably before to see the test fail and then afterwards to see it pass of course).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Wyglendowski</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-1495</link>
		<dc:creator>Christian Wyglendowski</dc:creator>
		<pubDate>Fri, 18 Jul 2008 20:06:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-1495</guid>
		<description>In the main application that I work on, we have both unit (py.test) and functional (Selenium) tests.  &lt;br&gt;&lt;br&gt;The unit tests are quite fast and do all of the low-level library testing and stuff.  I run them often.  &lt;br&gt;&lt;br&gt;The Selenium tests take longer, but they really work the system over.  &lt;br&gt;&lt;br&gt;I think that is something that you can&#039;t avoid, really.  If you want to test your application like users are going to use it, it is bound to be slower, even with a computer at the wheel.</description>
		<content:encoded><![CDATA[<p>In the main application that I work on, we have both unit (py.test) and functional (Selenium) tests.  </p>
<p>The unit tests are quite fast and do all of the low-level library testing and stuff.  I run them often.  </p>
<p>The Selenium tests take longer, but they really work the system over.  </p>
<p>I think that is something that you can&#39;t avoid, really.  If you want to test your application like users are going to use it, it is bound to be slower, even with a computer at the wheel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-1492</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Fri, 18 Jul 2008 19:26:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-1492</guid>
		<description>Hi Kumar, thanks for the comment! I saw your fixture project earlier today on planetpython. Right now, my setup code doesn&#039;t go through the app to setup. It makes a database connection directly and monkeys around.&lt;br&gt;&lt;br&gt;All my tests use the same setup and teardown, so each test starts at the same state. That still might not let me run tests in parallel, however, since they&#039;re all working on the same user objects. If I could run all these in parallel, that would likely cut time way down. Maybe I could change my setup code so that each test gets objects created with names just for them.&lt;br&gt;&lt;br&gt;I&#039;ll be the first one to admit that I have a lot more to learn in terms of testing. Right now, I feel a lot of frustration waiting for these things to finish execution.&lt;br&gt;&lt;br&gt;I&#039;ll check out fixture over the weekend. Thanks for the tips.</description>
		<content:encoded><![CDATA[<p>Hi Kumar, thanks for the comment! I saw your fixture project earlier today on planetpython. Right now, my setup code doesn&#39;t go through the app to setup. It makes a database connection directly and monkeys around.</p>
<p>All my tests use the same setup and teardown, so each test starts at the same state. That still might not let me run tests in parallel, however, since they&#39;re all working on the same user objects. If I could run all these in parallel, that would likely cut time way down. Maybe I could change my setup code so that each test gets objects created with names just for them.</p>
<p>I&#39;ll be the first one to admit that I have a lot more to learn in terms of testing. Right now, I feel a lot of frustration waiting for these things to finish execution.</p>
<p>I&#39;ll check out fixture over the weekend. Thanks for the tips.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Wilson</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-1498</link>
		<dc:creator>Matt Wilson</dc:creator>
		<pubDate>Fri, 18 Jul 2008 19:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-1498</guid>
		<description>...</description>
		<content:encoded><![CDATA[<p>&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kumar McM illan</title>
		<link>http://blog.tplus1.com/index.php/2008/07/18/i-need-to-write-faster-tests/comment-page-1/#comment-1491</link>
		<dc:creator>Kumar McM illan</dc:creator>
		<pubDate>Fri, 18 Jul 2008 19:12:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.tplus1.com/?p=177#comment-1491</guid>
		<description>I&#039;ve found that two things you mentioned here tend to be problematic for functional testing.  &lt;br&gt;&lt;br&gt;First is using an actual interface to setup the data you need to test with.  Although this hides the implementation of how your data gets stored, which is nice, it is often slower than necessary.  You just need data in the db, right?  I actually created a module called fixture to load up just the data for such a test: &lt;a href=&quot;http://farmdev.com/projects/fixture/&quot; rel=&quot;nofollow&quot;&gt;http://farmdev.com/projects/fixture/&lt;/a&gt; :)&lt;br&gt;&lt;br&gt;Second, it&#039;s not a good idea to insert data in one test that a later test depends on.  This is because your tests are no longer modular so you couldn&#039;t, for example, re-run only one test that is failing or use a grid solution (like &lt;a href=&quot;http://selenium-grid.openqa.org/&quot; rel=&quot;nofollow&quot;&gt;http://selenium-grid.openqa.org/&lt;/a&gt; or like &lt;a href=&quot;http://code.google.com/p/python-nose/source/browse/branches/ticket-93/nose/plugins/multiprocess.py&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/python-nose/source/bro...&lt;/a&gt; -- running tests in parallel with nose).</description>
		<content:encoded><![CDATA[<p>I&#39;ve found that two things you mentioned here tend to be problematic for functional testing.  </p>
<p>First is using an actual interface to setup the data you need to test with.  Although this hides the implementation of how your data gets stored, which is nice, it is often slower than necessary.  You just need data in the db, right?  I actually created a module called fixture to load up just the data for such a test: <a href="http://farmdev.com/projects/fixture/" rel="nofollow">http://farmdev.com/projects/fixture/</a> <img src='http://blog.tplus1.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Second, it&#39;s not a good idea to insert data in one test that a later test depends on.  This is because your tests are no longer modular so you couldn&#39;t, for example, re-run only one test that is failing or use a grid solution (like <a href="http://selenium-grid.openqa.org/" rel="nofollow">http://selenium-grid.openqa.org/</a> or like <a href="http://code.google.com/p/python-nose/source/browse/branches/ticket-93/nose/plugins/multiprocess.py" rel="nofollow"></a><a href="http://code.google.com/p/python-nose/source/bro.." rel="nofollow">http://code.google.com/p/python-nose/source/bro..</a>. &#8212; running tests in parallel with nose).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

