<?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: The Only Way To Test Private Methods</title>
	<atom:link href="http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/</link>
	<description>Trying to walk that thin line between intelligence and ignorance</description>
	<lastBuildDate>Thu, 11 Mar 2010 20:14:47 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: How do you test private methods? - Garry Pilkington</title>
		<link>http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/comment-page-1/#comment-5352</link>
		<dc:creator>How do you test private methods? - Garry Pilkington</dc:creator>
		<pubDate>Fri, 21 Nov 2008 16:42:15 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=597#comment-5352</guid>
		<description>[...] morning I read a post by Davy Brion who was explaining a technique to test private methods. Although the post was interesting, it was a [...]</description>
		<content:encoded><![CDATA[<p>[...] morning I read a post by Davy Brion who was explaining a technique to test private methods. Although the post was interesting, it was a [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/comment-page-1/#comment-5321</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Fri, 21 Nov 2008 06:44:57 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=597#comment-5321</guid>
		<description>@Alex

Just so we&#039;re clear on this, i&#039;m not saying that every private method should become a public method in a new class or anything like that. The backward compatibility burden you&#039;re talking about is more of an issue when you&#039;re writing reusable libraries or frameworks. In that case you could just make the &#039;new&#039; classes internal.  But i don&#039;t think it&#039;s that big of an issue when writing applications.</description>
		<content:encoded><![CDATA[<p>@Alex</p>
<p>Just so we&#8217;re clear on this, i&#8217;m not saying that every private method should become a public method in a new class or anything like that. The backward compatibility burden you&#8217;re talking about is more of an issue when you&#8217;re writing reusable libraries or frameworks. In that case you could just make the &#8216;new&#8217; classes internal.  But i don&#8217;t think it&#8217;s that big of an issue when writing applications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rafferty Uy</title>
		<link>http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/comment-page-1/#comment-5303</link>
		<dc:creator>Rafferty Uy</dc:creator>
		<pubDate>Fri, 21 Nov 2008 00:28:40 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=597#comment-5303</guid>
		<description>One of the things we do is that we change the methods to protected and have the test class inherit this class.</description>
		<content:encoded><![CDATA[<p>One of the things we do is that we change the methods to protected and have the test class inherit this class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Simkin</title>
		<link>http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/comment-page-1/#comment-5297</link>
		<dc:creator>Alex Simkin</dc:creator>
		<pubDate>Thu, 20 Nov 2008 22:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=597#comment-5297</guid>
		<description>Private methods are my &quot;implementation details&quot; that I want to keep for myself and do not want to be reused otherwise I will implicitly assume &quot;backward compatibility&quot; burden.</description>
		<content:encoded><![CDATA[<p>Private methods are my &#8220;implementation details&#8221; that I want to keep for myself and do not want to be reused otherwise I will implicitly assume &#8220;backward compatibility&#8221; burden.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Davy Brion</title>
		<link>http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/comment-page-1/#comment-5282</link>
		<dc:creator>Davy Brion</dc:creator>
		<pubDate>Thu, 20 Nov 2008 19:45:58 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=597#comment-5282</guid>
		<description>moving them to public methods of the same class is something i generally wouldn&#039;t recommend.

but like i said, if you feel the need to specifically test something that is implemented in a private method of a class, it&#039;s usually a strong indication that something is wrong in the design.  In a lot of cases, it really does mean that there is a new class just waiting to be discovered.  And in those cases, who cares if people start using the functionality that was once in a private method but is now in a new class? If you did it right, the functionality of the new class is now properly reusable... so is there really a problem with people reusing that functionality?</description>
		<content:encoded><![CDATA[<p>moving them to public methods of the same class is something i generally wouldn&#8217;t recommend.</p>
<p>but like i said, if you feel the need to specifically test something that is implemented in a private method of a class, it&#8217;s usually a strong indication that something is wrong in the design.  In a lot of cases, it really does mean that there is a new class just waiting to be discovered.  And in those cases, who cares if people start using the functionality that was once in a private method but is now in a new class? If you did it right, the functionality of the new class is now properly reusable&#8230; so is there really a problem with people reusing that functionality?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Simkin</title>
		<link>http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/comment-page-1/#comment-5280</link>
		<dc:creator>Alex Simkin</dc:creator>
		<pubDate>Thu, 20 Nov 2008 19:00:02 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=597#comment-5280</guid>
		<description>Private methods are private for a reason. Moving them to public methids of the same or other class tempts other developers to reuse them. 

After a while when you decide to change OrderLineParser class you can find out that InvoiceParser, ReceiptParser, BOLParser and other document parsers unexpectedly changed their behavior too.</description>
		<content:encoded><![CDATA[<p>Private methods are private for a reason. Moving them to public methids of the same or other class tempts other developers to reuse them. </p>
<p>After a while when you decide to change OrderLineParser class you can find out that InvoiceParser, ReceiptParser, BOLParser and other document parsers unexpectedly changed their behavior too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dew Drop - November 20, 2008 &#124; Alvin Ashcraft's Morning Dew</title>
		<link>http://davybrion.com/blog/2008/11/the-only-way-to-test-private-methods/comment-page-1/#comment-5269</link>
		<dc:creator>Dew Drop - November 20, 2008 &#124; Alvin Ashcraft's Morning Dew</dc:creator>
		<pubDate>Thu, 20 Nov 2008 15:10:52 +0000</pubDate>
		<guid isPermaLink="false">http://davybrion.com/blog/?p=597#comment-5269</guid>
		<description>[...] The Only Way to Test Private Methods (Davy Brion) [...]</description>
		<content:encoded><![CDATA[<p>[...] The Only Way to Test Private Methods (Davy Brion) [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
