<?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: Top 10 things which make your code hard to test</title>
	<atom:link href="http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/feed/" rel="self" type="application/rss+xml" />
	<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/</link>
	<description>Testability Explorer</description>
	<lastBuildDate>Fri, 30 Jul 2010 03:59:03 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Testbarkeit als Code-Metrik &#171; techscouting through the news</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-3776</link>
		<dc:creator>Testbarkeit als Code-Metrik &#171; techscouting through the news</dc:creator>
		<pubDate>Wed, 21 Jul 2010 07:17:58 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-3776</guid>
		<description>[...] oder Unsicherheit. Dazu gibt es jedoch mittlerweile gute Quellen im Netz, beispielweise Top 10 things which make your code hard to test oder How to Think About the ?new? Operator with Respect to Unit [...]</description>
		<content:encoded><![CDATA[<p>[...] oder Unsicherheit. Dazu gibt es jedoch mittlerweile gute Quellen im Netz, beispielweise Top 10 things which make your code hard to test oder How to Think About the ?new? Operator with Respect to Unit [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2569</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Tue, 08 Dec 2009 17:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2569</guid>
		<description>@Killan,

Think of the view portion (Window) as a factory, whose job it is to instantiate the buttons and than wire them so that the call appropriate methods on the Controller class. This way your view has only one dependency, the controller. Yes, view becomes hard to test, but if all it does is forward the call to the controller there is nothing to test, really, so we focus on testing the controller.</description>
		<content:encoded><![CDATA[<p>@Killan,</p>
<p>Think of the view portion (Window) as a factory, whose job it is to instantiate the buttons and than wire them so that the call appropriate methods on the Controller class. This way your view has only one dependency, the controller. Yes, view becomes hard to test, but if all it does is forward the call to the controller there is nothing to test, really, so we focus on testing the controller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Killian</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2563</link>
		<dc:creator>Killian</dc:creator>
		<pubDate>Tue, 08 Dec 2009 10:35:27 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2563</guid>
		<description>Hi Misko,

I totally agree with your article, and apply these principles in my own code.

But in the case of GUI components, it can be hard to respect the point 2.  Let imagine a &quot;Window&quot; class, containing a lot a &quot;Button&quot; objects.  Pressing on some buttons calls a business service which executes SQL queries.

If buttons (which are the collaborators) are instantiated in the Window constructor, it becomes very hard to test. On the other hand, it becomes hardly maintainable if the Window constructor expects an arguments list of 50 buttons, instantiated by a DI container...

How would you proceed in this case ?

Thanks !</description>
		<content:encoded><![CDATA[<p>Hi Misko,</p>
<p>I totally agree with your article, and apply these principles in my own code.</p>
<p>But in the case of GUI components, it can be hard to respect the point 2.  Let imagine a &#8220;Window&#8221; class, containing a lot a &#8220;Button&#8221; objects.  Pressing on some buttons calls a business service which executes SQL queries.</p>
<p>If buttons (which are the collaborators) are instantiated in the Window constructor, it becomes very hard to test. On the other hand, it becomes hardly maintainable if the Window constructor expects an arguments list of 50 buttons, instantiated by a DI container&#8230;</p>
<p>How would you proceed in this case ?</p>
<p>Thanks !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r.</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2400</link>
		<dc:creator>r.</dc:creator>
		<pubDate>Fri, 20 Nov 2009 10:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2400</guid>
		<description>Hi,
Why some of the items are &#039;do this&#039; (2, 7, 8) and other are &#039;don&#039;t do that&#039; (others)? Wouldn&#039;t it be easier to read if all item bold sentence was a &#039;don&#039;t&#039; (regarding the post title) ?
Thanks,
r.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Why some of the items are &#8216;do this&#8217; (2, 7, <img src='http://misko.hevery.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> and other are &#8216;don&#8217;t do that&#8217; (others)? Wouldn&#8217;t it be easier to read if all item bold sentence was a &#8216;don&#8217;t&#8217; (regarding the post title) ?<br />
Thanks,<br />
r.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2387</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Thu, 19 Nov 2009 14:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2387</guid>
		<description>@29a,

Singletons are a pattern, which people use. But just because it is a pattern does not make it good. Singleton is an anti-pattern.</description>
		<content:encoded><![CDATA[<p>@29a,</p>
<p>Singletons are a pattern, which people use. But just because it is a pattern does not make it good. Singleton is an anti-pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 29a</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2386</link>
		<dc:creator>29a</dc:creator>
		<pubDate>Thu, 19 Nov 2009 09:18:46 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2386</guid>
		<description>&quot;Singletons (global state in sheep’s clothing): It amazes me that many developers will agree that global state is bad yet their code is full of singletons.&quot;

I concur! This was especially obvious to me in Java World. Using globals is like saying Jehova to many Java programmers. But singletons are considered a &#039;pattern&#039; and patterns are good.</description>
		<content:encoded><![CDATA[<p>&#8220;Singletons (global state in sheep’s clothing): It amazes me that many developers will agree that global state is bad yet their code is full of singletons.&#8221;</p>
<p>I concur! This was especially obvious to me in Java World. Using globals is like saying Jehova to many Java programmers. But singletons are considered a &#8216;pattern&#8217; and patterns are good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel E. Renfer (duck1123) 's status on Thursday, 19-Nov-09 00:26:36 UTC - Identi.ca</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2383</link>
		<dc:creator>Daniel E. Renfer (duck1123) 's status on Thursday, 19-Nov-09 00:26:36 UTC - Identi.ca</dc:creator>
		<pubDate>Thu, 19 Nov 2009 00:26:44 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2383</guid>
		<description>[...]  http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/        a few seconds ago  from  twidroid [...]</description>
		<content:encoded><![CDATA[<p>[...]  <a href="http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/" rel="nofollow">http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/</a>        a few seconds ago  from  twidroid [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: misko</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2378</link>
		<dc:creator>misko</dc:creator>
		<pubDate>Wed, 18 Nov 2009 16:09:39 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2378</guid>
		<description>I never said that a value object can not have behvior, I even give HashMap as an example which has lots of behavior. Read http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/ for more in depth discussion on this.</description>
		<content:encoded><![CDATA[<p>I never said that a value object can not have behvior, I even give HashMap as an example which has lots of behavior. Read <a href="http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/" rel="nofollow">http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/</a> for more in depth discussion on this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miško Hevery about the benefits of testable code at geekcloud.org</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2376</link>
		<dc:creator>Miško Hevery about the benefits of testable code at geekcloud.org</dc:creator>
		<pubDate>Wed, 18 Nov 2009 16:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2376</guid>
		<description>[...] for test driven development is making sure that your code is testable. Miško Hevery wrote an article about this very topic a while back. I thought he would be the ideal person to talk to me about [...]</description>
		<content:encoded><![CDATA[<p>[...] for test driven development is making sure that your code is testable. Miško Hevery wrote an article about this very topic a while back. I thought he would be the ideal person to talk to me about [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naaka</title>
		<link>http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/comment-page-1/#comment-2372</link>
		<dc:creator>Naaka</dc:creator>
		<pubDate>Wed, 18 Nov 2009 13:17:22 +0000</pubDate>
		<guid isPermaLink="false">http://misko.hevery.com/?p=139#comment-2372</guid>
		<description>Hi Misko,
really nice article !

About the 9th &quot;rule&quot; (Mixing Service Objects with Value Objects)... i agree that this might make the code harder to test, but completely separating the two clearly breaks the OO principle of keeping together data and logic.

Separating data and logic brings to breaking encapsulation.

I have seen a lot of project following blindly this separation philosophy and ending up in writing procedural code under the mask of oo.

And this concern is at the heart of a whole philosophy, domain driven design.

What do you think about it ?</description>
		<content:encoded><![CDATA[<p>Hi Misko,<br />
really nice article !</p>
<p>About the 9th &#8220;rule&#8221; (Mixing Service Objects with Value Objects)&#8230; i agree that this might make the code harder to test, but completely separating the two clearly breaks the OO principle of keeping together data and logic.</p>
<p>Separating data and logic brings to breaking encapsulation.</p>
<p>I have seen a lot of project following blindly this separation philosophy and ending up in writing procedural code under the mask of oo.</p>
<p>And this concern is at the heart of a whole philosophy, domain driven design.</p>
<p>What do you think about it ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
