<?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: Factory tools for fixture replacement: a comparison</title>
	<atom:link href="http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<lastBuildDate>Wed, 18 Aug 2010 11:48:47 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Agile Ajax &#187; ChicagoRuby meeting &#8216;Test Prescriptions&#8217; recap &#187; Pathfinder Development</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6801</link>
		<dc:creator>Agile Ajax &#187; ChicagoRuby meeting &#8216;Test Prescriptions&#8217; recap &#187; Pathfinder Development</dc:creator>
		<pubDate>Wed, 24 Jun 2009 19:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6801</guid>
		<description>[...] solid review of different factory tools that go beyond standard fixtures (Factory Girl, Fixture Replacement, Machinist, and Object [...]</description>
		<content:encoded><![CDATA[<p>[...] solid review of different factory tools that go beyond standard fixtures (Factory Girl, Fixture Replacement, Machinist, and Object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dev Blog AF83 &#187; Blog Archive &#187; Veille technologique : Conditions d&#8217;utilisation, Lecture, HTML5, Mozilla, Vim, Git, Ruby, Rails, Javascript, Microframeworks, PHP, Python, Bases de données</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6637</link>
		<dc:creator>Dev Blog AF83 &#187; Blog Archive &#187; Veille technologique : Conditions d&#8217;utilisation, Lecture, HTML5, Mozilla, Vim, Git, Ruby, Rails, Javascript, Microframeworks, PHP, Python, Bases de données</dc:creator>
		<pubDate>Tue, 09 Jun 2009 12:09:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6637</guid>
		<description>[...] http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/ : une comparaison des outils pour remplacer les fixtures dans Rails [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/" rel="nofollow">http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/</a> : une comparaison des outils pour remplacer les fixtures dans Rails [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Myron Marston</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6558</link>
		<dc:creator>Myron Marston</dc:creator>
		<pubDate>Sun, 31 May 2009 01:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6558</guid>
		<description>@Noel-

In principle, I agree with you: you get the most benefits of a factory tool by creating the test data as close to the test as possible.  And if your primary reason to switch to a factory tool from fixtures is to be abel to see the data creation right next to the test, so that you don&#039;t have to switch to another file to see the contents of a test object...then preloading a bunch of data using my gem (or a similar solution) would be a bad idea.

In my case, my primary reason for hating fixtures and moving to a different tool is because I want all my test data to be created through the models themselves, rather than just being inserted directly into the database.  This means my test data has passed validations, and any associated records created by before/after save callbacks will also exist.  

The test suite on my current project is at 2500+ tests and counting.  I wish it was faster than it is.  My factory_data_preloader gem has been a big help in speeding it up, but it&#039;s still slower than I&#039;d like it (about 7-8 minutes total right now, I think).

I use mocks quite a bit too.  It&#039;s a technique I find myself using more and more.  Maybe we wouldn&#039;t have the speed issues if I had use mocking early on.</description>
		<content:encoded><![CDATA[<p>@Noel-</p>
<p>In principle, I agree with you: you get the most benefits of a factory tool by creating the test data as close to the test as possible.  And if your primary reason to switch to a factory tool from fixtures is to be abel to see the data creation right next to the test, so that you don&#8217;t have to switch to another file to see the contents of a test object&#8230;then preloading a bunch of data using my gem (or a similar solution) would be a bad idea.</p>
<p>In my case, my primary reason for hating fixtures and moving to a different tool is because I want all my test data to be created through the models themselves, rather than just being inserted directly into the database.  This means my test data has passed validations, and any associated records created by before/after save callbacks will also exist.  </p>
<p>The test suite on my current project is at 2500+ tests and counting.  I wish it was faster than it is.  My factory_data_preloader gem has been a big help in speeding it up, but it&#8217;s still slower than I&#8217;d like it (about 7-8 minutes total right now, I think).</p>
<p>I use mocks quite a bit too.  It&#8217;s a technique I find myself using more and more.  Maybe we wouldn&#8217;t have the speed issues if I had use mocking early on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus Derencius</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6555</link>
		<dc:creator>Marcus Derencius</dc:creator>
		<pubDate>Sat, 30 May 2009 20:29:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6555</guid>
		<description>I do like machinist a lot, and use extensively in my projects. Factory girls supports that machinist syntax, but I didn&#039;t feel the need to change. machinist works pretty well.

@myron Usually a avoid creating unnecessary data, I just call &quot;make&quot; when that record will be used. some auxiliary data, I may also use make_unsaved, and it will not hit the database.</description>
		<content:encoded><![CDATA[<p>I do like machinist a lot, and use extensively in my projects. Factory girls supports that machinist syntax, but I didn&#8217;t feel the need to change. machinist works pretty well.</p>
<p>@myron Usually a avoid creating unnecessary data, I just call &#8220;make&#8221; when that record will be used. some auxiliary data, I may also use make_unsaved, and it will not hit the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ruby on Rails &#187; Comparing Ruby Mock Object Libraries &#187; Pathfinder Development</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6548</link>
		<dc:creator>Ruby on Rails &#187; Comparing Ruby Mock Object Libraries &#187; Pathfinder Development</dc:creator>
		<pubDate>Fri, 29 May 2009 18:24:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6548</guid>
		<description>[...] on the theme of comparing similar things that I started last week, this week I&#039;ll be taking on Mock Object [...]</description>
		<content:encoded><![CDATA[<p>[...] on the theme of comparing similar things that I started last week, this week I&#8217;ll be taking on Mock Object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Rappin</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6541</link>
		<dc:creator>Noel Rappin</dc:creator>
		<pubDate>Thu, 28 May 2009 14:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6541</guid>
		<description>@Myron -- I&#039;d argue that in general if you are creating common data that is being reloaded in multiple tests that you aren&#039;t using the factory tool optimally. (That&#039;s from my experience, but I&#039;ll also grant that&#039;s kind of a purist argument rather than a pragmatic one)

The advantages of a factory tool are best realized if you create the fewest number of objects you need to expose each test, and if you create them as close to the actual test as possible. Creating more objects slows the tests down a lot. Creating the data away from the test has the same problem as fixtures -- test values that seem magical because you can&#039;t see the data that caused them.

Mocks are another alternative for speeding up tests... More on that tomorrow.</description>
		<content:encoded><![CDATA[<p>@Myron &#8212; I&#8217;d argue that in general if you are creating common data that is being reloaded in multiple tests that you aren&#8217;t using the factory tool optimally. (That&#8217;s from my experience, but I&#8217;ll also grant that&#8217;s kind of a purist argument rather than a pragmatic one)</p>
<p>The advantages of a factory tool are best realized if you create the fewest number of objects you need to expose each test, and if you create them as close to the actual test as possible. Creating more objects slows the tests down a lot. Creating the data away from the test has the same problem as fixtures &#8212; test values that seem magical because you can&#8217;t see the data that caused them.</p>
<p>Mocks are another alternative for speeding up tests&#8230; More on that tomorrow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Myron Marston</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6535</link>
		<dc:creator>Myron Marston</dc:creator>
		<pubDate>Thu, 28 May 2009 00:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6535</guid>
		<description>I&#039;ve been using factory girl for a while and like it a lot.  However, the issue I keep finding with these tools is they tend to slow down your test suite.  Unsurprisingly, creating the data for each test directly within the test is slower than preloading fixture data and then just reusing it in each test.

I tried to address this (with some success) with a gem:

http://github.com/myronmarston/factory_data_preloader/tree/master

It should be compatible with any fixture replacement, though I&#039;ve only personally used it with factory girl.

How have others solved the speed issue?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been using factory girl for a while and like it a lot.  However, the issue I keep finding with these tools is they tend to slow down your test suite.  Unsurprisingly, creating the data for each test directly within the test is slower than preloading fixture data and then just reusing it in each test.</p>
<p>I tried to address this (with some success) with a gem:</p>
<p><a href="http://github.com/myronmarston/factory_data_preloader/tree/master" rel="nofollow">http://github.com/myronmarston/factory_data_preloader/tree/master</a></p>
<p>It should be compatible with any fixture replacement, though I&#8217;ve only personally used it with factory girl.</p>
<p>How have others solved the speed issue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ennuyer.net &#187; Blog Archive &#187; 2009-05-25- Today’s Ruby/Rails Reading</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6517</link>
		<dc:creator>Ennuyer.net &#187; Blog Archive &#187; 2009-05-25- Today’s Ruby/Rails Reading</dc:creator>
		<pubDate>Mon, 25 May 2009 19:30:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6517</guid>
		<description>[...]  Agile Ajax » Factory tools for fixture replacement: a comparison » Pathfinder Development  [...]</description>
		<content:encoded><![CDATA[<p>[...]  Agile Ajax » Factory tools for fixture replacement: a comparison » Pathfinder Development  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Gay</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6508</link>
		<dc:creator>Jim Gay</dc:creator>
		<pubDate>Sun, 24 May 2009 01:49:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6508</guid>
		<description>Dataset deserves a mention http://aiwilliams.github.com/dataset/</description>
		<content:encoded><![CDATA[<p>Dataset deserves a mention <a href="http://aiwilliams.github.com/dataset/" rel="nofollow">http://aiwilliams.github.com/dataset/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Meehan</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6504</link>
		<dc:creator>Adam Meehan</dc:creator>
		<pubDate>Sat, 23 May 2009 02:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6504</guid>
		<description>woops. should read *don&#039;t need*

Commenting from iPhone can be sloppy</description>
		<content:encoded><![CDATA[<p>woops. should read *don&#8217;t need*</p>
<p>Commenting from iPhone can be sloppy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Meehan</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6503</link>
		<dc:creator>Adam Meehan</dc:creator>
		<pubDate>Sat, 23 May 2009 01:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6503</guid>
		<description>Great stuff.

A small correction for Machinist. You need to use a block to assign a simple value in a blueprint.

  name &#039;Test Data&#039;

works fine

Machinist FTW.</description>
		<content:encoded><![CDATA[<p>Great stuff.</p>
<p>A small correction for Machinist. You need to use a block to assign a simple value in a blueprint.</p>
<p>  name &#8216;Test Data&#8217;</p>
<p>works fine</p>
<p>Machinist FTW.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Taylor (smtlaissezfaire)</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6502</link>
		<dc:creator>Scott Taylor (smtlaissezfaire)</dc:creator>
		<pubDate>Sat, 23 May 2009 01:25:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6502</guid>
		<description>Great in-depth analysis of the various popular alternatives.

A few corrections about FixtureReplacement:

As of FixtureReplacement v 2.1, db/example_data.rb is no longer necessary. 

You can also call your factories inline, if you so please:

http://gist.github.com/116456

And define them that way, too:

http://gist.github.com/116457

You could also create your own wrappers around it:

http://gist.github.com/116459</description>
		<content:encoded><![CDATA[<p>Great in-depth analysis of the various popular alternatives.</p>
<p>A few corrections about FixtureReplacement:</p>
<p>As of FixtureReplacement v 2.1, db/example_data.rb is no longer necessary. </p>
<p>You can also call your factories inline, if you so please:</p>
<p><a href="http://gist.github.com/116456" rel="nofollow">http://gist.github.com/116456</a></p>
<p>And define them that way, too:</p>
<p><a href="http://gist.github.com/116457" rel="nofollow">http://gist.github.com/116457</a></p>
<p>You could also create your own wrappers around it:</p>
<p><a href="http://gist.github.com/116459" rel="nofollow">http://gist.github.com/116459</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Ostrom</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6500</link>
		<dc:creator>Erik Ostrom</dc:creator>
		<pubDate>Fri, 22 May 2009 22:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6500</guid>
		<description>Thanks for posting this. Right now it&#039;s useful to me in suppressing the shiny-object urge to try every new tool I see. Laid out this way, they don&#039;t seem different enough to be worth the effort of switching from factory_girl, which I&#039;m already using.

I think you got build and create reversed for factory_girl, by the way: Create saves, build doesn&#039;t, just like ActiveRecord.</description>
		<content:encoded><![CDATA[<p>Thanks for posting this. Right now it&#8217;s useful to me in suppressing the shiny-object urge to try every new tool I see. Laid out this way, they don&#8217;t seem different enough to be worth the effort of switching from factory_girl, which I&#8217;m already using.</p>
<p>I think you got build and create reversed for factory_girl, by the way: Create saves, build doesn&#8217;t, just like ActiveRecord.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Vincent</title>
		<link>http://www.pathf.com/blogs/2009/05/factory-tools-for-fixture-replacement-a-comparison/comment-page-1/#comment-6499</link>
		<dc:creator>Chris Vincent</dc:creator>
		<pubDate>Fri, 22 May 2009 19:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=2506#comment-6499</guid>
		<description>Awesome comprehensive play-by-play comparison. I also prefer Machinist.

I definitely gotta echo the point about creating the minimal data necessary for a good test. One colleague of mine once created a test which ran the same assertion against 1,000 different permutations of the data, basically testing that every input X between 0 and 1,000 would output the expected Y; I gotta hand it to him for being thorough, but not only was it unnecessary, but it made the test run so slowly that I had to comment it out just so I could be productive with autotest.</description>
		<content:encoded><![CDATA[<p>Awesome comprehensive play-by-play comparison. I also prefer Machinist.</p>
<p>I definitely gotta echo the point about creating the minimal data necessary for a good test. One colleague of mine once created a test which ran the same assertion against 1,000 different permutations of the data, basically testing that every input X between 0 and 1,000 would output the expected Y; I gotta hand it to him for being thorough, but not only was it unnecessary, but it made the test run so slowly that I had to comment it out just so I could be productive with autotest.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.360 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-05 19:12:27 -->
