<?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: Mocks versus stubs and fakes</title>
	<atom:link href="http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/</link>
	<description></description>
	<lastBuildDate>Fri, 07 Oct 2011 15:08: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: Louis Vuitton Handbags</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-208271</link>
		<dc:creator>Louis Vuitton Handbags</dc:creator>
		<pubDate>Tue, 26 Oct 2010 08:38:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-208271</guid>
		<description>Hi webmaster, commenters and everybody else !!! The blog was absolutely fantastic! Lots of great &lt;a href=&quot;http://www.ed-hardy.uk.com/ed-hardy-bags-c-43_39.html&quot; rel=&quot;nofollow&quot;&gt;ED Hardy Handbags&lt;/a&gt;information and inspiration, both of which we all need!b Keep &#039;em coming... you all do such a great job at such Concepts... can&#039;t tell you how much I, for one appreciate all you do!</description>
		<content:encoded><![CDATA[<p>Hi webmaster, commenters and everybody else !!! The blog was absolutely fantastic! Lots of great <a href="http://www.ed-hardy.uk.com/ed-hardy-bags-c-43_39.html" rel="nofollow">ED Hardy Handbags</a>information and inspiration, both of which we all need!b Keep &#8216;em coming&#8230; you all do such a great job at such Concepts&#8230; can&#8217;t tell you how much I, for one appreciate all you do!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Web Design Company</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-199292</link>
		<dc:creator>Web Design Company</dc:creator>
		<pubDate>Thu, 07 Jan 2010 06:07:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-199292</guid>
		<description>The terminology around the various kinds of Test Doubles is confusing and inconsistent. Different authors use different terms to mean the same thing. And sometimes they mean different things by the same term.</description>
		<content:encoded><![CDATA[<p>The terminology around the various kinds of Test Doubles is confusing and inconsistent. Different authors use different terms to mean the same thing. And sometimes they mean different things by the same term.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mendicant</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-196655</link>
		<dc:creator>mendicant</dc:creator>
		<pubDate>Tue, 13 Oct 2009 20:53:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-196655</guid>
		<description>The thing I often find is that when you start having to stub out framework implementations you&#039;re almost always better off to just create and pass in an instance tailored to your test. 

For example:
A) var customers = MockRepository.GenerateStub&lt;IEnumerable&gt;();
B) var customers = new List { new Customer() }; // Or a mock of the customer... whatever

I&#039;ll pick B every time because it just makes more sense. If I do A then do I have to start stubbing out an enumerator? access? I&#039;m willing to accept that MS will (should?) have the framework covered so I&#039;m not afraid to use actual implementations in my tests. 

I&#039;ve been down the mocking path before and I find that like you said, I just end up stubbing values that I really, really don&#039;t care about.</description>
		<content:encoded><![CDATA[<p>The thing I often find is that when you start having to stub out framework implementations you&#8217;re almost always better off to just create and pass in an instance tailored to your test. </p>
<p>For example:<br />
A) var customers = MockRepository.GenerateStub&lt;IEnumerable&gt;();<br />
B) var customers = new List { new Customer() }; // Or a mock of the customer&#8230; whatever</p>
<p>I&#8217;ll pick B every time because it just makes more sense. If I do A then do I have to start stubbing out an enumerator? access? I&#8217;m willing to accept that MS will (should?) have the framework covered so I&#8217;m not afraid to use actual implementations in my tests. </p>
<p>I&#8217;ve been down the mocking path before and I find that like you said, I just end up stubbing values that I really, really don&#8217;t care about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikola Malovic</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-196652</link>
		<dc:creator>Nikola Malovic</dc:creator>
		<pubDate>Tue, 13 Oct 2009 19:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-196652</guid>
		<description>Well, IMHO you should be mocking\stubing\faking only the dependencies not the SUT itself being tested.
In my code my unit tests would take care about behaviors such is &quot;make sure that in case x business logic made a call to mocked method Y on infrastructure.&quot;, but I would have separate integration test(s) for the implementation of method Y where (same as you in this post) I stay away as much as possible from any mocks and try to &quot;keep it real&quot; as much as I can.
Btw, I think I know why mocks “doesn’t make sense” to you. 
Based on your examples, you use the mocking framework to “setup the state” (completely valid usage of stubs) but the mocks itself are not supposed to be used in that scenarios but instead they should be used in behavior type of tests. 

I guess what I try to say is that I agree with you in finding that the mocks doesn’t make any sense used in this context :)</description>
		<content:encoded><![CDATA[<p>Well, IMHO you should be mocking\stubing\faking only the dependencies not the SUT itself being tested.<br />
In my code my unit tests would take care about behaviors such is &#8220;make sure that in case x business logic made a call to mocked method Y on infrastructure.&#8221;, but I would have separate integration test(s) for the implementation of method Y where (same as you in this post) I stay away as much as possible from any mocks and try to &#8220;keep it real&#8221; as much as I can.<br />
Btw, I think I know why mocks “doesn’t make sense” to you.<br />
Based on your examples, you use the mocking framework to “setup the state” (completely valid usage of stubs) but the mocks itself are not supposed to be used in that scenarios but instead they should be used in behavior type of tests. </p>
<p>I guess what I try to say is that I agree with you in finding that the mocks doesn’t make any sense used in this context <img src='http://www.lazycoder.com/weblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-196648</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Tue, 13 Oct 2009 16:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-196648</guid>
		<description>Oh, and SUT stands for &quot;System Under Test&quot;. It refers to the method you are testing at the time.</description>
		<content:encoded><![CDATA[<p>Oh, and SUT stands for &#8220;System Under Test&#8221;. It refers to the method you are testing at the time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-196645</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Tue, 13 Oct 2009 16:25:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-196645</guid>
		<description>Scott: Agreed, ideally I&#039;d like to see mocking/stubbing built INTO the framework. But the IDataReader interface itself is rather large. All those messy Get{type} methods. Bleh.

Nikola: Also agreed. But what if you are testing your data access layer? Even if you put it in a repository, you&#039;ll probably want test coverage on the repository right?</description>
		<content:encoded><![CDATA[<p>Scott: Agreed, ideally I&#8217;d like to see mocking/stubbing built INTO the framework. But the IDataReader interface itself is rather large. All those messy Get{type} methods. Bleh.</p>
<p>Nikola: Also agreed. But what if you are testing your data access layer? Even if you put it in a repository, you&#8217;ll probably want test coverage on the repository right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nikola Malovic</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-196644</link>
		<dc:creator>Nikola Malovic</dc:creator>
		<pubDate>Tue, 13 Oct 2009 16:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-196644</guid>
		<description>Nut sure what SUT is but IMHO your business logic shouldn&#039;t have a dependency on IDataReader at all (hiding it in Repository bowels is just one way to do that)

In toher words, if you ended mocking IDataReader maybe it is time to revisit your design one more time.</description>
		<content:encoded><![CDATA[<p>Nut sure what SUT is but IMHO your business logic shouldn&#8217;t have a dependency on IDataReader at all (hiding it in Repository bowels is just one way to do that)</p>
<p>In toher words, if you ended mocking IDataReader maybe it is time to revisit your design one more time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JonR</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-196637</link>
		<dc:creator>JonR</dc:creator>
		<pubDate>Tue, 13 Oct 2009 12:44:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-196637</guid>
		<description>i don&#039;t think i&#039;ve ever mocked or stubbed ADO.NET, isn&#039;t that considered a bit of a no-no?

(actuallly now i come to mention it, i can&#039;t remember the last time i used ADO.NET directly anyway. ignore me.)</description>
		<content:encoded><![CDATA[<p>i don&#8217;t think i&#8217;ve ever mocked or stubbed ADO.NET, isn&#8217;t that considered a bit of a no-no?</p>
<p>(actuallly now i come to mention it, i can&#8217;t remember the last time i used ADO.NET directly anyway. ignore me.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dew Drop &#8211; October 13, 2009 &#124; Alvin Ashcraft&#39;s Morning Dew</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-196636</link>
		<dc:creator>Dew Drop &#8211; October 13, 2009 &#124; Alvin Ashcraft&#39;s Morning Dew</dc:creator>
		<pubDate>Tue, 13 Oct 2009 12:21:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-196636</guid>
		<description>[...] Mocks versus stubs and fakes (Scott Koon) [...]</description>
		<content:encoded><![CDATA[<p>[...] Mocks versus stubs and fakes (Scott Koon) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Bellware</title>
		<link>http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/comment-page-1/#comment-196617</link>
		<dc:creator>Scott Bellware</dc:creator>
		<pubDate>Mon, 12 Oct 2009 22:08:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/2009/10/12/mocks-versus-stubs-and-fakes/#comment-196617</guid>
		<description>Can we conceive of a better design of the IDataReader that would make mocking it less verbose?</description>
		<content:encoded><![CDATA[<p>Can we conceive of a better design of the IDataReader that would make mocking it less verbose?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

