<?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: One assertion per test—always?</title>
	<atom:link href="http://blog.agilephp.com/2009/02/15/one-assertion-per-test%e2%80%94always/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.agilephp.com/2009/02/15/one-assertion-per-test%e2%80%94always/</link>
	<description>Dagfinn Reiersøl on PHP, agile development, Ruby and other addictive substances</description>
	<lastBuildDate>Fri, 23 Jul 2010 20:17:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: PHP Planet &#8212; One assertion per test—always?</title>
		<link>http://blog.agilephp.com/2009/02/15/one-assertion-per-test%e2%80%94always/comment-page-1/#comment-202</link>
		<dc:creator>PHP Planet &#8212; One assertion per test—always?</dc:creator>
		<pubDate>Fri, 20 Feb 2009 14:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.agilephp.com/?p=1468#comment-202</guid>
		<description>[...] Read more at One assertion per test—always? [...]</description>
		<content:encoded><![CDATA[<p>[...] Read more at One assertion per test—always? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Logosfera</title>
		<link>http://blog.agilephp.com/2009/02/15/one-assertion-per-test%e2%80%94always/comment-page-1/#comment-196</link>
		<dc:creator>Logosfera</dc:creator>
		<pubDate>Wed, 18 Feb 2009 07:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.agilephp.com/?p=1468#comment-196</guid>
		<description>I&#039;m using simpleTest for unit testing and a test is usually a class. Now if you develop your test class PERFECTLY you and up with X tests with exactly X assertions. But practically this situation is no different than having 1 test with X assertions because the assertion tells you what you&#039;re testing and the test are there just as markers (which can be written by comments). If the PERFECT way of writting tests is the same as the WORST way of writting tests there must be something wrong with a &quot;perfect&quot; test. :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m using simpleTest for unit testing and a test is usually a class. Now if you develop your test class PERFECTLY you and up with X tests with exactly X assertions. But practically this situation is no different than having 1 test with X assertions because the assertion tells you what you&#8217;re testing and the test are there just as markers (which can be written by comments). If the PERFECT way of writting tests is the same as the WORST way of writting tests there must be something wrong with a &#8220;perfect&#8221; test. <img src='http://blog.agilephp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mathias</title>
		<link>http://blog.agilephp.com/2009/02/15/one-assertion-per-test%e2%80%94always/comment-page-1/#comment-190</link>
		<dc:creator>Mathias</dc:creator>
		<pubDate>Mon, 16 Feb 2009 14:54:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.agilephp.com/?p=1468#comment-190</guid>
		<description>I agree that tests should be small and atomic and should only test one &quot;event&quot; or one &quot;change&quot; or however to call it, but I don&#039;t think using only one assertion is a good way to archieve this. Escpecially when you want to prevent hidden &quot;assertTrue(true)&quot; you&#039;ll need multiple assertions to make the test more robust.</description>
		<content:encoded><![CDATA[<p>I agree that tests should be small and atomic and should only test one &#8220;event&#8221; or one &#8220;change&#8221; or however to call it, but I don&#8217;t think using only one assertion is a good way to archieve this. Escpecially when you want to prevent hidden &#8220;assertTrue(true)&#8221; you&#8217;ll need multiple assertions to make the test more robust.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toby</title>
		<link>http://blog.agilephp.com/2009/02/15/one-assertion-per-test%e2%80%94always/comment-page-1/#comment-188</link>
		<dc:creator>Toby</dc:creator>
		<pubDate>Mon, 16 Feb 2009 09:07:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.agilephp.com/?p=1468#comment-188</guid>
		<description>That is true, yes. As you said: A lot of work for trivial gain. I just dislike this &quot;just to do it mantra-like correct&quot; way of doing things.

To teach unexperienced testers how to write tests, the base rule must be &quot;one assertion per test&quot;. For experienced testers, who know how to test properly and who re-check frequently if they did not become lazy, this is just an efficiency waddle.</description>
		<content:encoded><![CDATA[<p>That is true, yes. As you said: A lot of work for trivial gain. I just dislike this &#8220;just to do it mantra-like correct&#8221; way of doing things.</p>
<p>To teach unexperienced testers how to write tests, the base rule must be &#8220;one assertion per test&#8221;. For experienced testers, who know how to test properly and who re-check frequently if they did not become lazy, this is just an efficiency waddle.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dagfinn</title>
		<link>http://blog.agilephp.com/2009/02/15/one-assertion-per-test%e2%80%94always/comment-page-1/#comment-187</link>
		<dc:creator>dagfinn</dc:creator>
		<pubDate>Mon, 16 Feb 2009 07:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.agilephp.com/?p=1468#comment-187</guid>
		<description>I agree, although theoretically at least you could have a setup to create the object and then test different parts of it in different methods. That might be a lot of work for trivial gain, though. Alternatively, you can create custom assertions.</description>
		<content:encoded><![CDATA[<p>I agree, although theoretically at least you could have a setup to create the object and then test different parts of it in different methods. That might be a lot of work for trivial gain, though. Alternatively, you can create custom assertions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toby</title>
		<link>http://blog.agilephp.com/2009/02/15/one-assertion-per-test%e2%80%94always/comment-page-1/#comment-185</link>
		<dc:creator>Toby</dc:creator>
		<pubDate>Sun, 15 Feb 2009 20:55:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.agilephp.com/?p=1468#comment-185</guid>
		<description>It&#039;s pretty obvious that you sometimes need multiple assertions per test, since you need to assure that different parts of an object state have changed. That either means that you need to artificially create the very same object state in a different instance (which is not always possible) or you need multiple assertions, to ensure all expected parts of the object state changed and other parts did not.

Of course, such scenarios do not fit the typical &quot;dice roling game&quot; example used to illustrated unit testing.</description>
		<content:encoded><![CDATA[<p>It&#8217;s pretty obvious that you sometimes need multiple assertions per test, since you need to assure that different parts of an object state have changed. That either means that you need to artificially create the very same object state in a different instance (which is not always possible) or you need multiple assertions, to ensure all expected parts of the object state changed and other parts did not.</p>
<p>Of course, such scenarios do not fit the typical &#8220;dice roling game&#8221; example used to illustrated unit testing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
