<?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: Unit testing protected/private methods in a class</title>
	<atom:link href="http://nocarrier.co.uk/2009/06/unit-testing-protectedprivate-methods-in-a-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://nocarrier.co.uk/2009/06/unit-testing-protectedprivate-methods-in-a-class/</link>
	<description>PHP and some other bits...</description>
	<lastBuildDate>Sat, 21 Nov 2009 18:31:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Unit Testing &#8211; private methods. &#171; OwZone</title>
		<link>http://nocarrier.co.uk/2009/06/unit-testing-protectedprivate-methods-in-a-class/comment-page-1/#comment-13</link>
		<dc:creator>Unit Testing &#8211; private methods. &#171; OwZone</dc:creator>
		<pubDate>Tue, 02 Jun 2009 19:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://nocarrier.co.uk/?p=31#comment-13</guid>
		<description>[...] 2, 2009 by owzone    I read an interesting post from an ex-colleagues blog recently around the subject of unit testing private methods when testing object oriented code. I [...]</description>
		<content:encoded><![CDATA[<p>[...] 2, 2009 by owzone    I read an interesting post from an ex-colleagues blog recently around the subject of unit testing private methods when testing object oriented code. I [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Owain</title>
		<link>http://nocarrier.co.uk/2009/06/unit-testing-protectedprivate-methods-in-a-class/comment-page-1/#comment-12</link>
		<dc:creator>Owain</dc:creator>
		<pubDate>Tue, 02 Jun 2009 19:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://nocarrier.co.uk/?p=31#comment-12</guid>
		<description>I would normally say that if you think that a private method requires it&#039;s own unit test then this is a good pointer towards the need to refactor the class - usually pushing the functionality of the private method into it&#039;s own collaborating class. 

However that is easier said that done when it comes to working with legacy code. In that situation I would probablly refactor the method from private to protected and create tests in the correct package hierarchy (java specific I realise).

I suppose the answer depends on how pragmatic you&#039;re willing to be (and how much code is greenfield development).</description>
		<content:encoded><![CDATA[<p>I would normally say that if you think that a private method requires it&#8217;s own unit test then this is a good pointer towards the need to refactor the class &#8211; usually pushing the functionality of the private method into it&#8217;s own collaborating class. </p>
<p>However that is easier said that done when it comes to working with legacy code. In that situation I would probablly refactor the method from private to protected and create tests in the correct package hierarchy (java specific I realise).</p>
<p>I suppose the answer depends on how pragmatic you&#8217;re willing to be (and how much code is greenfield development).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
