<?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 Oscillating Shrinking Window</title>
	<atom:link href="http://landofjosh.com/2009/08/the-oscillating-shrinking-window/feed/" rel="self" type="application/rss+xml" />
	<link>http://landofjosh.com/2009/08/the-oscillating-shrinking-window/</link>
	<description>software development under the big arch</description>
	<lastBuildDate>Sat, 30 Jan 2010 20:20:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: josh</title>
		<link>http://landofjosh.com/2009/08/the-oscillating-shrinking-window/comment-page-1/#comment-62</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Sun, 06 Sep 2009 23:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://landofjosh.com/?p=199#comment-62</guid>
		<description>Hi Scott.

On performance:  I opened a ~75 line method (the extract method implementation itself, ironically) and it tanked.  I left it to spin and went to bed.  After about 7 hours it still wasn&#039;t done.  I realized I needed a heuristic.  So, I modified the algorithm to only consider extraction windows whose size matches an existing method.  For example, don&#039;t bother extracting a three statement block if you&#039;re just going to compare the result to a four statement block.  This made scanning the big methods practical.  I think it  changes the algorithmic complexity to be linear, maybe even sub linear.

On robustifying:  My philosophy in this project is that I want to detect clones by proving two pieces of code functionally equivalent.  To prove that, I apply a series of strict refactorings, where strict means the refactored result has not changed it&#039;s inputs, outputs, or side effects.  If the code can be safely coerced to a perfect match of some other code then they are clones.  So to answer your question, the way I would solve your example is not by &quot;relaxing&quot; the comparison to say, disregard literal input values.  Instead I would apply an Introduce Local Variable refactoring to the literals.  Subsequent extract methods would exclude said variable definitions producing ASTs that when compared now do not fail due to different literal inputs.

It&#039;s a different way of accomplishing the same thing, but I think it has some advantages.  One is that refactoring implementations are external, sort of like plug-ins.  I can implement a new one (or accept someone else&#039;s) and just add it right to the list, improving the whole system without having to touch the core code.</description>
		<content:encoded><![CDATA[<p>Hi Scott.</p>
<p>On performance:  I opened a ~75 line method (the extract method implementation itself, ironically) and it tanked.  I left it to spin and went to bed.  After about 7 hours it still wasn&#8217;t done.  I realized I needed a heuristic.  So, I modified the algorithm to only consider extraction windows whose size matches an existing method.  For example, don&#8217;t bother extracting a three statement block if you&#8217;re just going to compare the result to a four statement block.  This made scanning the big methods practical.  I think it  changes the algorithmic complexity to be linear, maybe even sub linear.</p>
<p>On robustifying:  My philosophy in this project is that I want to detect clones by proving two pieces of code functionally equivalent.  To prove that, I apply a series of strict refactorings, where strict means the refactored result has not changed it&#8217;s inputs, outputs, or side effects.  If the code can be safely coerced to a perfect match of some other code then they are clones.  So to answer your question, the way I would solve your example is not by &#8220;relaxing&#8221; the comparison to say, disregard literal input values.  Instead I would apply an Introduce Local Variable refactoring to the literals.  Subsequent extract methods would exclude said variable definitions producing ASTs that when compared now do not fail due to different literal inputs.</p>
<p>It&#8217;s a different way of accomplishing the same thing, but I think it has some advantages.  One is that refactoring implementations are external, sort of like plug-ins.  I can implement a new one (or accept someone else&#8217;s) and just add it right to the list, improving the whole system without having to touch the core code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Wegner</title>
		<link>http://landofjosh.com/2009/08/the-oscillating-shrinking-window/comment-page-1/#comment-60</link>
		<dc:creator>Scott Wegner</dc:creator>
		<pubDate>Mon, 31 Aug 2009 21:33:29 +0000</pubDate>
		<guid isPermaLink="false">http://landofjosh.com/?p=199#comment-60</guid>
		<description>Very cool Josh.  A couple questions:

You point out that this won&#039;t really scale well, and I can see why.  Have you looked at any real-life performance results?  How large can the source file be for the refactoring to run in some bearable-amount of time?

Do you have plans for extending this refactoring to be more robust?  It might be neat to extract clones which only differ by input value, so you could extract things like MyClone(100), MyClose(200).  I imagine this would add some additional complexity to your AST representation..</description>
		<content:encoded><![CDATA[<p>Very cool Josh.  A couple questions:</p>
<p>You point out that this won&#8217;t really scale well, and I can see why.  Have you looked at any real-life performance results?  How large can the source file be for the refactoring to run in some bearable-amount of time?</p>
<p>Do you have plans for extending this refactoring to be more robust?  It might be neat to extract clones which only differ by input value, so you could extract things like MyClone(100), MyClose(200).  I imagine this would add some additional complexity to your AST representation..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
