<?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: Database Unit Testing</title> <atom:link href="http://blog.straylightrun.net/2009/08/27/database-unit-testing/feed/" rel="self" type="application/rss+xml" /><link>http://blog.straylightrun.net/2009/08/27/database-unit-testing/</link> <description>Software, Technology, PHP</description> <lastBuildDate>Sun, 25 Dec 2011 01:09:52 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Frank Glandorf</title><link>http://blog.straylightrun.net/2009/08/27/database-unit-testing/comment-page-1/#comment-2593</link> <dc:creator>Frank Glandorf</dc:creator> <pubDate>Mon, 31 Aug 2009 14:54:43 +0000</pubDate> <guid
isPermaLink="false">http://blog.straylightrun.net/?p=233#comment-2593</guid> <description>There are costs involved in maintaining sqlite and mysql but I can&#039;t quantify them. Small mysql installations seem easy to administer, especially if they are throw aways. If the unit tests are run on the same host as the db then the network traffic should be negligible. If you want a memory only db and avoid disk access, then try mysql&#039;s &quot;memory&quot; storage engine. http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html</description> <content:encoded><![CDATA[<p>There are costs involved in maintaining sqlite and mysql but I can&#8217;t quantify them. Small mysql installations seem easy to administer, especially if they are throw aways. If the unit tests are run on the same host as the db then the network traffic should be negligible. If you want a memory only db and avoid disk access, then try mysql&#8217;s &#8220;memory&#8221; storage engine. <a
href="http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html</a></p> ]]></content:encoded> </item> <item><title>By: gerard</title><link>http://blog.straylightrun.net/2009/08/27/database-unit-testing/comment-page-1/#comment-2565</link> <dc:creator>gerard</dc:creator> <pubDate>Sat, 29 Aug 2009 14:35:51 +0000</pubDate> <guid
isPermaLink="false">http://blog.straylightrun.net/?p=233#comment-2565</guid> <description>You could do that, but I guess the answer to that is 1) All databases require mainentenance, and that would be one more, while the SQLite database only exists while the test is running. And 2) now there is real network and disk operations, which will take longer the more tests you  have, while SQLite runs completely in memory.
I guess the answer is to use SQLite in production, which plenty of ppl do.</description> <content:encoded><![CDATA[<p>You could do that, but I guess the answer to that is 1) All databases require mainentenance, and that would be one more, while the SQLite database only exists while the test is running. And 2) now there is real network and disk operations, which will take longer the more tests you  have, while SQLite runs completely in memory.</p><p>I guess the answer is to use SQLite in production, which plenty of ppl do.</p> ]]></content:encoded> </item> <item><title>By: Frank Glandorf</title><link>http://blog.straylightrun.net/2009/08/27/database-unit-testing/comment-page-1/#comment-2554</link> <dc:creator>Frank Glandorf</dc:creator> <pubDate>Fri, 28 Aug 2009 15:45:48 +0000</pubDate> <guid
isPermaLink="false">http://blog.straylightrun.net/?p=233#comment-2554</guid> <description>It seems like a lot of extra work to develop under one database product and test under another. One could well spend time developing infrastructure and chasing bugs as a result of vendor differences. If one already has mysql installed, why not just create another database instance for testing?</description> <content:encoded><![CDATA[<p>It seems like a lot of extra work to develop under one database product and test under another. One could well spend time developing infrastructure and chasing bugs as a result of vendor differences. If one already has mysql installed, why not just create another database instance for testing?</p> ]]></content:encoded> </item> <item><title>By: gerard</title><link>http://blog.straylightrun.net/2009/08/27/database-unit-testing/comment-page-1/#comment-2540</link> <dc:creator>gerard</dc:creator> <pubDate>Thu, 27 Aug 2009 19:14:36 +0000</pubDate> <guid
isPermaLink="false">http://blog.straylightrun.net/?p=233#comment-2540</guid> <description>Cool. I wonder if this is as simple as adding a startTransaction() in the setUp() method, and a rollback() in the tearDown()?</description> <content:encoded><![CDATA[<p>Cool. I wonder if this is as simple as adding a startTransaction() in the setUp() method, and a rollback() in the tearDown()?</p> ]]></content:encoded> </item> <item><title>By: Chris Nelson</title><link>http://blog.straylightrun.net/2009/08/27/database-unit-testing/comment-page-1/#comment-2539</link> <dc:creator>Chris Nelson</dc:creator> <pubDate>Thu, 27 Aug 2009 18:33:34 +0000</pubDate> <guid
isPermaLink="false">http://blog.straylightrun.net/?p=233#comment-2539</guid> <description>This is all fine, but eventually your database tests tend to get very slow.  In the java and ruby worlds, we&#039;ve moved to the idea of transactional test cases, which I&#039;ve found to be a great thing.  The basic concept is all your test case methods get run in their own transaction, which gets rolled back after each test.  This way tests can insert, update, check the results, etc, all without actually changing the state of the database.  I don&#039;t know if this is available already in PHP, but if not I&#039;m sure it could be done.</description> <content:encoded><![CDATA[<p>This is all fine, but eventually your database tests tend to get very slow.  In the java and ruby worlds, we&#8217;ve moved to the idea of transactional test cases, which I&#8217;ve found to be a great thing.  The basic concept is all your test case methods get run in their own transaction, which gets rolled back after each test.  This way tests can insert, update, check the results, etc, all without actually changing the state of the database.  I don&#8217;t know if this is available already in PHP, but if not I&#8217;m sure it could be done.</p> ]]></content:encoded> </item> </channel> </rss>
