<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>objectoriented &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/objectoriented/</link>
	<description>Feed of posts on WordPress.com tagged "objectoriented"</description>
	<pubDate>Fri, 18 Jul 2008 20:44:26 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Michael Feathers on testing private methods]]></title>
<link>http://xplayer.wordpress.com/2008/02/08/michael-feathers-on-testing-private-methods/</link>
<pubDate>Fri, 08 Feb 2008 16:59:11 +0000</pubDate>
<dc:creator>stoner</dc:creator>
<guid>http://xplayer.wordpress.com/2008/02/08/michael-feathers-on-testing-private-methods/</guid>
<description><![CDATA[Da un articolo di InfoQ, la posizione di M.Feathers sul testare i metodi privati:
Michael Feathers s]]></description>
<content:encoded><![CDATA[<p>Da <a href="http://www.infoq.com/news/2008/01/private-methods-tdd-design">un articolo di InfoQ,</a> la posizione di M.Feathers sul testare i metodi privati:</p>
<p>Michael Feathers suggested last year in <a href="http://michaelfeathers.typepad.com/michael_feathers_blog/2007/09/the-deep-synerg.html">The Deep Synergy Between Testability and Good Design</a> that TDD encourages good design and, conversely, code that is not testable should make us think twice:</p>
<blockquote><p><i>When I write tests and I have the urge to test a private method, I take it as a hint. The hint tells me that my class is encapsulating so much that it has ceased to be "understandable" by tests through its public interface. I listen to the hint, and factor my design differently. Usually, I end up moving the private method (and possibly some methods around it) to a new class where it can be non-private and accessible to tests.</i></p></blockquote>
<p>Condivido al 100%!</p>
<p>E interessante anche quello che dice dopo, nel post originale, riguardo alla relazione tra coupling, cohesion e testabilita'.</p>
<blockquote><p><i>In the end, it all comes down to cohesion and coupling.  If classes are deeply coupled with their neighbors, it is hard to control them in a test or observe them independently.  If a class isn't cohesive, it may have some logic which is not easily exercisable through its public interface.</i></p>
<p><i>It seems that reverse is true also.  Classes which are hard to instantiate and use in a test harness are more coupled than they could be, and classes with private methods that you feel the urge to test, invariably have some sort of cohesion problem: they have more than one responsibility.</i></p></blockquote>
]]></content:encoded>
</item>

</channel>
</rss>
