<?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: Testing Hibernate mappings: Setting up test data</title>
	<atom:link href="http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/</link>
	<description>Thoughts on Software Development</description>
	<lastBuildDate>Sat, 11 Feb 2012 23:17:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: TDD: Driving from the assertion up at Mark Needham</title>
		<link>http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/comment-page-1/#comment-39327</link>
		<dc:creator>TDD: Driving from the assertion up at Mark Needham</dc:creator>
		<pubDate>Mon, 14 Jun 2010 23:17:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=561#comment-39327</guid>
		<description>[...] test in question was an integration test and we were following the approach of saving the test object directly through the NHibernate session and then loading it again through a [...]</description>
		<content:encoded><![CDATA[<p>[...] test in question was an integration test and we were following the approach of saving the test object directly through the NHibernate session and then loading it again through a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anders S</title>
		<link>http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/comment-page-1/#comment-1155</link>
		<dc:creator>Anders S</dc:creator>
		<pubDate>Thu, 06 Nov 2008 13:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=561#comment-1155</guid>
		<description>I agree with Kris. I would prefer doing it with Hibernate over SQL. I have experienced severe pain after refactorings on a project where too much was set up with SQL.</description>
		<content:encoded><![CDATA[<p>I agree with Kris. I would prefer doing it with Hibernate over SQL. I have experienced severe pain after refactorings on a project where too much was set up with SQL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Kemper</title>
		<link>http://www.markhneedham.com/blog/2008/10/30/testing-hibernate-mappings-setting-up-test-data/comment-page-1/#comment-1063</link>
		<dc:creator>Kris Kemper</dc:creator>
		<pubDate>Sat, 01 Nov 2008 22:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.markhneedham.com/blog/?p=561#comment-1063</guid>
		<description>I prefer the approach of using Hibernate to setup test data. Injecting data using sql quickly results in hard to maintain test code, and it won&#039;t tell you when you violate validation logic that happens on the domain object (if you validate before save).

Using sql to inject data is best used when you need to test some condition that you can can&#039;t get to via hibernate.

In practice, I&#039;m not too bothered by the fact that you test a save and a load, you can always write test helpers when the application save logic differs from what you want to do.

In the end, when you are using SQL to inject, you are really testing that the SQL works as well, but that check provides less value since it (probably) isn&#039;t used by the production code.</description>
		<content:encoded><![CDATA[<p>I prefer the approach of using Hibernate to setup test data. Injecting data using sql quickly results in hard to maintain test code, and it won&#8217;t tell you when you violate validation logic that happens on the domain object (if you validate before save).</p>
<p>Using sql to inject data is best used when you need to test some condition that you can can&#8217;t get to via hibernate.</p>
<p>In practice, I&#8217;m not too bothered by the fact that you test a save and a load, you can always write test helpers when the application save logic differs from what you want to do.</p>
<p>In the end, when you are using SQL to inject, you are really testing that the SQL works as well, but that check provides less value since it (probably) isn&#8217;t used by the production code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

