<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"	>
<channel>
	<title>Comments on: Five unit testing tips #4: Don&#8217;t mock your way into accidental complexity</title>
	<atom:link href="http://johannesbrodwall.com/2009/02/24/five-unit-testing-tips-4-dont-mock-your-way-into-accidental-complexity/feed/" rel="self" type="application/rss+xml" />
	<link>http://johannesbrodwall.com/2009/02/24/five-unit-testing-tips-4-dont-mock-your-way-into-accidental-complexity/</link>
	<description>Johannes Brodwall&#039;s Musings on Software Architecture and Programming</description>
	<lastBuildDate>Thu, 29 Jul 2010 15:37:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jon</title>
		<link>http://johannesbrodwall.com/2009/02/24/five-unit-testing-tips-4-dont-mock-your-way-into-accidental-complexity/comment-page-1/#comment-127579</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Fri, 06 Mar 2009 04:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://brodwall.com/johannes/blog/?p=324#comment-127579</guid>
		<description>This isn&#039;t perhaps the best example for your case (I&#039;m assuming here that your source is &lt;a href=&quot;http://www.ryangreenhall.com/articles/bdd-by-example.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ryangreenhall.com/articles/bdd-by-ex...&lt;/a&gt;).  It is not the mocks that cause the Tab class to be created but rather the customer test itself. The first reference to the Tab class is created while specifying what &quot;Given tab &lt;tab&gt;&quot; means. Both TabBehaviour and the Tab class itself should give the clue that, given the current requirements, a tab is really just a List&lt;Notes&gt; with no additional behaviour. However no refactoring was done in the tutorial (whether because of out of scope, oversight or author error i won&#039;t speculate).&lt;br&gt;&lt;br&gt;I personally don&#039;t have a problem with mocks but it highly depends on the testing strategy being used. I think the problem is less about &quot;mocks&quot; and more about not hearing what the code is saying. I don&#039;t think using whatever is currently fad-tool-of-the-month is going to change that problem for better or for worse. I do know that when i&#039;m trying to build things in isolation it&#039;s much clearer to use mocks like mockito than it is to roll my own.</description>
		<content:encoded><![CDATA[<p>This isn&#39;t perhaps the best example for your case (I&#39;m assuming here that your source is <a href="http://www.ryangreenhall.com/articles/bdd-by-example.html" rel="nofollow"></a><a href="http://www.ryangreenhall.com/articles/bdd-by-ex.." rel="nofollow">http://www.ryangreenhall.com/articles/bdd-by-ex..</a>.).  It is not the mocks that cause the Tab class to be created but rather the customer test itself. The first reference to the Tab class is created while specifying what &#8220;Given tab &lt;tab&gt;&#8221; means. Both TabBehaviour and the Tab class itself should give the clue that, given the current requirements, a tab is really just a List&lt;Notes&gt; with no additional behaviour. However no refactoring was done in the tutorial (whether because of out of scope, oversight or author error i won&#39;t speculate).</p>
<p>I personally don&#39;t have a problem with mocks but it highly depends on the testing strategy being used. I think the problem is less about &#8220;mocks&#8221; and more about not hearing what the code is saying. I don&#39;t think using whatever is currently fad-tool-of-the-month is going to change that problem for better or for worse. I do know that when i&#39;m trying to build things in isolation it&#39;s much clearer to use mocks like mockito than it is to roll my own.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://johannesbrodwall.com/2009/02/24/five-unit-testing-tips-4-dont-mock-your-way-into-accidental-complexity/comment-page-1/#comment-109352</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Thu, 05 Mar 2009 20:52:53 +0000</pubDate>
		<guid isPermaLink="false">http://brodwall.com/johannes/blog/?p=324#comment-109352</guid>
		<description>This isn&#039;t perhaps the best example for your case (I&#039;m assuming here that your source is &lt;a href=&quot;http://www.ryangreenhall.com/articles/bdd-by-example.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ryangreenhall.com/articles/bdd-by-ex...&lt;/a&gt;).  It is not the mocks that cause the Tab class to be created but rather the customer test itself. The first reference to the Tab class is created while specifying what &quot;Given tab &lt;tab&gt;&quot; means. Both TabBehaviour and the Tab class itself should give the clue that, given the current requirements, a tab is really just a List&lt;Notes&gt; with no additional behaviour. However no refactoring was done in the tutorial (whether because of out of scope, oversight or author error i won&#039;t speculate).&lt;br&gt;&lt;br&gt;I personally don&#039;t have a problem with mocks but it highly depends on the testing strategy being used. I think the problem is less about &quot;mocks&quot; and more about not hearing what the code is saying. I don&#039;t think using whatever is currently fad-tool-of-the-month is going to change that problem for better or for worse. I do know that when i&#039;m trying to build things in isolation it&#039;s much clearer to use mocks like mockito than it is to roll my own.</description>
		<content:encoded><![CDATA[<p>This isn&#39;t perhaps the best example for your case (I&#39;m assuming here that your source is <a href="http://www.ryangreenhall.com/articles/bdd-by-example.html" rel="nofollow"></a><a href="http://www.ryangreenhall.com/articles/bdd-by-ex.." rel="nofollow">http://www.ryangreenhall.com/articles/bdd-by-ex..</a>.).  It is not the mocks that cause the Tab class to be created but rather the customer test itself. The first reference to the Tab class is created while specifying what &#8220;Given tab &lt;tab&gt;&#8221; means. Both TabBehaviour and the Tab class itself should give the clue that, given the current requirements, a tab is really just a List&lt;Notes&gt; with no additional behaviour. However no refactoring was done in the tutorial (whether because of out of scope, oversight or author error i won&#39;t speculate).</p>
<p>I personally don&#39;t have a problem with mocks but it highly depends on the testing strategy being used. I think the problem is less about &#8220;mocks&#8221; and more about not hearing what the code is saying. I don&#39;t think using whatever is currently fad-tool-of-the-month is going to change that problem for better or for worse. I do know that when i&#39;m trying to build things in isolation it&#39;s much clearer to use mocks like mockito than it is to roll my own.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pramatr</title>
		<link>http://johannesbrodwall.com/2009/02/24/five-unit-testing-tips-4-dont-mock-your-way-into-accidental-complexity/comment-page-1/#comment-107797</link>
		<dc:creator>Pramatr</dc:creator>
		<pubDate>Wed, 25 Feb 2009 05:51:59 +0000</pubDate>
		<guid isPermaLink="false">http://brodwall.com/johannes/blog/?p=324#comment-107797</guid>
		<description>Completely agree with the overuse, I spent a couple of hours yesterday just trying to understand what was going on in one unit test. This was all due to the nature of the unit test using mocks. They are great for &quot;some&quot; things but use responsibly.</description>
		<content:encoded><![CDATA[<p>Completely agree with the overuse, I spent a couple of hours yesterday just trying to understand what was going on in one unit test. This was all due to the nature of the unit test using mocks. They are great for &#8220;some&#8221; things but use responsibly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Me</title>
		<link>http://johannesbrodwall.com/2009/02/24/five-unit-testing-tips-4-dont-mock-your-way-into-accidental-complexity/comment-page-1/#comment-107745</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Wed, 25 Feb 2009 02:24:59 +0000</pubDate>
		<guid isPermaLink="false">http://brodwall.com/johannes/blog/?p=324#comment-107745</guid>
		<description>I can&#039;t find the source of this example so I don&#039;t understand the reason behind the Tab class. Maybe you could explain how this class came about.</description>
		<content:encoded><![CDATA[<p>I can&#39;t find the source of this example so I don&#39;t understand the reason behind the Tab class. Maybe you could explain how this class came about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Kua</title>
		<link>http://johannesbrodwall.com/2009/02/24/five-unit-testing-tips-4-dont-mock-your-way-into-accidental-complexity/comment-page-1/#comment-107581</link>
		<dc:creator>Patrick Kua</dc:creator>
		<pubDate>Tue, 24 Feb 2009 10:09:01 +0000</pubDate>
		<guid isPermaLink="false">http://brodwall.com/johannes/blog/?p=324#comment-107581</guid>
		<description>I agree with you that a lot of people tend to overuse mocks. In fact, I blogged about this late last year (&lt;a href=&quot;http://www.thekua.com/atwork/2008/10/the-world-mocks-too-much/&quot; rel=&quot;nofollow&quot;&gt;http://www.thekua.com/atwork/2008/10/the-world-...&lt;/a&gt;). I still think there is value in mocking, it just takes a while to understand where to use them appropriately. Unfortunately I find a lot of people don&#039;t reach this level, listening to their tests about what it&#039;s telling them about their design.</description>
		<content:encoded><![CDATA[<p>I agree with you that a lot of people tend to overuse mocks. In fact, I blogged about this late last year (<a href="http://www.thekua.com/atwork/2008/10/the-world-mocks-too-much/" rel="nofollow"></a><a href="http://www.thekua.com/atwork/2008/10/the-world-.." rel="nofollow">http://www.thekua.com/atwork/2008/10/the-world-..</a>.). I still think there is value in mocking, it just takes a while to understand where to use them appropriately. Unfortunately I find a lot of people don&#39;t reach this level, listening to their tests about what it&#39;s telling them about their design.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bjørn Nordlund</title>
		<link>http://johannesbrodwall.com/2009/02/24/five-unit-testing-tips-4-dont-mock-your-way-into-accidental-complexity/comment-page-1/#comment-107565</link>
		<dc:creator>Bjørn Nordlund</dc:creator>
		<pubDate>Tue, 24 Feb 2009 07:47:40 +0000</pubDate>
		<guid isPermaLink="false">http://brodwall.com/johannes/blog/?p=324#comment-107565</guid>
		<description>I totally agree with you about misuse of mocks and you are correct that the Tab class does not do anything. &lt;br&gt;&lt;br&gt;But I&#039;m not sure I understand, I think the example Tab class is just an illustration of something that uses the TabParser. Of cource the example could be better if the Tab class actually did something. What if the example had a class GuitarPlayer instad of Tab that actually produced music from notes using a TabParser?</description>
		<content:encoded><![CDATA[<p>I totally agree with you about misuse of mocks and you are correct that the Tab class does not do anything. </p>
<p>But I&#39;m not sure I understand, I think the example Tab class is just an illustration of something that uses the TabParser. Of cource the example could be better if the Tab class actually did something. What if the example had a class GuitarPlayer instad of Tab that actually produced music from notes using a TabParser?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
