<?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: Parent-Child Unit Tests</title>
	<atom:link href="http://www.jeffongames.com/2008/04/parent-child-unit-tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeffongames.com/2008/04/parent-child-unit-tests/</link>
	<description>This is Jeff.  This is Jeff On Games.</description>
	<lastBuildDate>Tue, 31 Jan 2012 21:30:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jeff</title>
		<link>http://www.jeffongames.com/2008/04/parent-child-unit-tests/comment-page-1/#comment-20564</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Wed, 16 Apr 2008 17:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffongames.com/2008/04/parent-child-unit-tests/#comment-20564</guid>
		<description>The setup / teardown are actually extremely slow, because they all involve generating code.  It&#039;s not slow, but it&#039;s not fast either, so generating before each test isn&#039;t an option if I want the tests to finish in a reasonable amount of time.

As for using mock objects, unfortunately that&#039;s not an option because what I&#039;m testing is the generated syntax against the actual database.  A mock object can&#039;t actually tell me if the database syntax is *actually* correct.  These are technically integration or functional tests, but they&#039;re using the same unit test library anyway.</description>
		<content:encoded><![CDATA[<p>The setup / teardown are actually extremely slow, because they all involve generating code.  It&#8217;s not slow, but it&#8217;s not fast either, so generating before each test isn&#8217;t an option if I want the tests to finish in a reasonable amount of time.</p>
<p>As for using mock objects, unfortunately that&#8217;s not an option because what I&#8217;m testing is the generated syntax against the actual database.  A mock object can&#8217;t actually tell me if the database syntax is *actually* correct.  These are technically integration or functional tests, but they&#8217;re using the same unit test library anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Ludwig</title>
		<link>http://www.jeffongames.com/2008/04/parent-child-unit-tests/comment-page-1/#comment-20456</link>
		<dc:creator>David Ludwig</dc:creator>
		<pubDate>Sun, 13 Apr 2008 18:11:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffongames.com/2008/04/parent-child-unit-tests/#comment-20456</guid>
		<description>I have not yet run into a case whereby I needed to have data be shared among several unit tests.  If I was doing work with large databases, I might want to do this, however most of the unit tests I&#039;ve needed to write ran fairly quickly.

Just how slow would it be to do a set up and tear down for each test case you are working with?  Could some of those cases use mocks instead of a real DB, or is that infeasible?

Regarding hierarchical fixtures, I&#039;ve used such in a C++ library, UnitTest++.  With this library, fixtures were still set up as classes, however the set up and tear down code would be placed in the class&#039; constructor and destructor, as opposed to separate, &quot;SetUp()&quot; and &quot;TearDown()&quot; methods.  Child fixtures would either subclass the parent fixture, or include the parent using aggregation.  In either case, it was the C++ compiler&#039;s job to make sure that each class&#039; set up and tear down code was called in the correct order.</description>
		<content:encoded><![CDATA[<p>I have not yet run into a case whereby I needed to have data be shared among several unit tests.  If I was doing work with large databases, I might want to do this, however most of the unit tests I&#8217;ve needed to write ran fairly quickly.</p>
<p>Just how slow would it be to do a set up and tear down for each test case you are working with?  Could some of those cases use mocks instead of a real DB, or is that infeasible?</p>
<p>Regarding hierarchical fixtures, I&#8217;ve used such in a C++ library, UnitTest++.  With this library, fixtures were still set up as classes, however the set up and tear down code would be placed in the class&#8217; constructor and destructor, as opposed to separate, &#8220;SetUp()&#8221; and &#8220;TearDown()&#8221; methods.  Child fixtures would either subclass the parent fixture, or include the parent using aggregation.  In either case, it was the C++ compiler&#8217;s job to make sure that each class&#8217; set up and tear down code was called in the correct order.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

