<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>foomonger&#039;s blog &#187; refactoring</title>
	<atom:link href="http://blog.foomonger.com/tag/refactoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.foomonger.com</link>
	<description>Tips and Musings on Software Development, Flash, and Flex</description>
	<lastBuildDate>Wed, 14 Jul 2010 20:18:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Agile Refactoring</title>
		<link>http://blog.foomonger.com/2009/11/10/agile-refactoring/</link>
		<comments>http://blog.foomonger.com/2009/11/10/agile-refactoring/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 01:39:31 +0000</pubDate>
		<dc:creator>Sam Ahn</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://blog.foomonger.com/?p=33</guid>
		<description><![CDATA[There's always something to refactor. Requirements evolve, short-cuts are taken, code doesn't get reviewed, and anti-patterns emerge.   How does refactoring fit into agile development? How do you have to convince the product owner to make a refactoring system story a high priority for the next sprint? How do you address that crumbing design pattern [...]]]></description>
			<content:encoded><![CDATA[<p>There's always something to refactor. Requirements evolve, short-cuts are taken, code doesn't get reviewed, and anti-patterns emerge.   How does refactoring fit into agile development? How do you have to convince the product owner to make a refactoring system story a high priority for the next sprint? How do you address that crumbing design pattern a random contractor setup years ago?  Here are some practices to help address these issues:</p>
<p><strong>Document areas to refactor.</strong> When you have to take a short-cut to hit a deadline, first of all comment the code and then create a ticket to address the short-cut in another sprint. I also suggest tagging the ticket as "technical debt." This will give your team visibility into the amount of <a title="Technical Debt: When Agile Software Development Fails" href="http://cdan.posterous.com/technical-debt-when-agile-software-developmen" target="_blank">technical debt</a> that is accrued.</p>
<p><strong>Include refactoring into story estimations.</strong> If you know that a story would be best implemented if you refactored some code, don't start off by giving an estimate that assumes you'll use a short-cut. It can be natural to people-please and say things can be done sooner but try to avoid that and keep in the mind the goal of writing high quality software which includes refactoring.</p>
<p><strong>Clean up the small things when you see them.</strong> Refactoring doesn't have to be a clean sweep of the whole house, it can be just a good habit of picking up things along the way. I wouldn't recommend rewriting significant logic for fun, but if you're in some code and find that a minor change would significantly improve readability then it might be worth the few minutes to do the cleanup.</p>
<p><strong>Break down large refactoring changes into manageable tasks.</strong> You'll never have the time to do that gigantic overhaul of that terrible reporting system (or what-have-you) all at once. What you can do is break it down so that the work can be spread out across many sprints. This effort can be complex so I suggest starting by creating a task to outline all the changes that should be made.</p>
<p><strong>Evaluate and convey the business value of the refactoring need.</strong> It's likely difficult to find a product owner who will add a refactoring system story into a sprint just because you tell them it'll make the code better. There's no apparent business value in that reason.  Think of the issue from the product owner's perspective and consider the "so that" part of the system story. Ask yourself, "Would it improve system performance? lower technical debt? improve throughput? address the root causes of the growing list of bugs?" You may even find that the refactoring you wanted to do doesn't have significant business value and is <em>just</em> clean and maintainable enough the way it is.</p>
<p>One of the great things about agile development is the exposure and mitigation of risk. If a system needs significant refactoring then that's risk that the entire team should be mindful of. Refactoring can then be something that happens, not just something you want to do.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.foomonger.com%2F2009%2F11%2F10%2Fagile-refactoring%2F&amp;linkname=Agile%20Refactoring"><img src="http://blog.foomonger.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.foomonger.com/2009/11/10/agile-refactoring/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
