<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>refactoring « Plataformatec Blog</title>
	<atom:link href="/tag/refactoring/feed/" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>Plataformatec&#039;s place to talk about Ruby, Ruby on Rails, Elixir, and software engineering</description>
	<lastBuildDate>Mon, 24 Sep 2018 17:48:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.2</generator>
	<item>
		<title>Key points to consider when doing a big software refactoring</title>
		<link>/2016/07/key-points-to-consider-when-doing-a-big-software-refactoring/</link>
		
		<dc:creator><![CDATA[Hugo Baraúna]]></dc:creator>
		<pubDate>Wed, 13 Jul 2016 22:35:57 +0000</pubDate>
				<category><![CDATA[English]]></category>
		<category><![CDATA[CTO]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[software]]></category>
		<guid isPermaLink="false">/?p=4085</guid>

					<description><![CDATA[<p>The second post of Low Internal Software Quality series. Doing a big software refactor1 is not a simple thing. There are lots of points that you should think about, from planning and prioritizing to team motivation and execution. Understanding these points in a structured and clear way is part of the job. The good news ... <a class="read-more-link" href="/2016/07/key-points-to-consider-when-doing-a-big-software-refactoring/">»</a></p>
<p>The post <a href="/2016/07/key-points-to-consider-when-doing-a-big-software-refactoring/">Key points to consider when doing a big software refactoring</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></description>
										<content:encoded><![CDATA[<div style="text-align:center;font-size:.8em;color:#999;font-style:italic;margin-top:15px;">
The second post of Low Internal Software Quality series.
</div>
<p>Doing a big software refactor<sup id="fnref-refactor"><a href="#fn-refactor" rel="footnote">1</a></sup> is not a simple thing. There are lots of points that you should think about, from planning and prioritizing to team motivation and execution. Understanding these points in a structured and clear way is part of the job. The good news is that we’ve been in that situation before and have learned the key points you should worry about.</p>
<p>Here are the main points you should consider when planning and executing a big refactoring process.</p>
<h3>Define your business goals</h3>
<p>A big software refactoring process should not be started without clear business goals, otherwise it can suffer from a lack of commitment by your stakeholders. Here are some examples of goals:</p>
<ul>
<li>We&#8217;re doing a refactor so that we can plug in multiple payment gateways.</li>
<li>We&#8217;re doing a refactor so that we can improve velocity.</li>
<li>We&#8217;re doing a refactor so that we can have a multi-tenant architecture in order to simplify our infrastructure operations.</li>
</ul>
<h3>Measure progress</h3>
<p>By its very nature, a software refactoring process is a technical effort, which is why it&#8217;s common for people not to measure its progress in the same structured way that they measure progress on development of new features. Don&#8217;t fall into that trap.</p>
<p>As with every task in a project, a refactor should always be planned and <a href="/2016/02/why-we-love-metrics-learning-with-lead-time/">measured</a>.</p>
<h3>Pay attention to your team&#8217;s motivation</h3>
<p>Working on a legacy codebase can be demotivating for developers, especially if they don&#8217;t have a feeling of progress, or if they don&#8217;t know when it&#8217;s going to end. When going with a refactoring process, you should keep this in mind.</p>
<p>Show your team they&#8217;re moving forward. Plan for small deliverables, so that you can continually ship stuff and celebrate the good work done. Also, think about developer rotation, which can help by maintaining motivation and keeping fresh eyes on the task.</p>
<h3>Define your approach: pull or push?</h3>
<p>Are you going to improve your codebase only when touching some bad part of it, or are you going to proactively choose which parts you&#8217;re going to improve?</p>
<h3>Prioritizing</h3>
<p>If you have a clear business goal, it&#8217;s easier to proactively choose which parts need to be improved to make that goal a reality. With the parts listed, you can apply your usual prioritization techniques.</p>
<p>But if you&#8217;re going to do a constant and big software refactor because you know the whole codebase needs to be improved, it&#8217;s more difficult to prioritize. This is because there are not just one or two main parts that need improvement, but lots of them. It&#8217;s difficult to know where to start.</p>
<p>One way to prioritize in that situation is to instruct your team to evaluate which parts need to be refactored based on their complexity and churn. By that we mean, whenever they are evaluating if some part of the code should or should not be refactored, they should ask themselves:</p>
<ul>
<li>&#8220;Is the complexity of that class too high compared to the others?&#8221;</li>
<li>&#8220;Do we constantly need to make changes on that file?&#8221;</li>
</ul>
<p>If the answers are both yes, that part is a good candidate for refactoring. Plot a chart of &#8220;class complexity X churn&#8221; and prioritize the parts that are too complex and that you&#8217;re changing every time.</p>
<p>The parts that have big complexity but don&#8217;t need to change constantly are not good candidates to be refactored because they&#8217;re parts that are ugly but usually work, and nobody needs to change them to do their everyday job.</p>
<h3>Know when you&#8217;re done</h3>
<p>A software refactoring process can turn into an endless endeavor if you don&#8217;t plan, prioritize and measure progress. You should treat it as a project. It should have a beginning, a middle and an end.</p>
<h3>Test suite coverage</h3>
<p>Your refactoring process should improve stuff that is already working without breaking anything. Make sure you have good test coverage, otherwise the process can generate more bugs than quality improvements.</p>
<h3>Test suite performance</h3>
<p>If your test suite is too slow, it will slow down the refactoring process since a software refactor is greatly based on continuously running the tests. Make sure the test suite performance is not a bottleneck.</p>
<h3>Sponsors commitment</h3>
<p>A refactoring process can take a long time: weeks, months. During that time the velocity in which new features are delivered will be compromised. Make sure that every business stakeholder understands the goals and the nature of that kind of work, so that they don&#8217;t give up in the middle of it.</p>
<p>What about you? Do you have any more tips on what to worry about when doing a big software refactor? Share with us!</p>
<div style="padding: 0 15px 15px;border:dotted 1px #ccc;font-size:.8em;background-color:#f5f5f5;">
<h4 style="text-align:center;margin-bottom:2px;color:#666">Posts of the Low Internal Software Quality series</h4>
<ol>
<li><a href="/2014/06/the-symptoms-of-low-internal-software-quality/">The Symptoms of Low Internal Software Quality</a></li>
<li>Key points to consider when doing a big software refactoring</li>
<li><a href="/2016/07/key-points-to-consider-when-doing-a-software-rewrite/">Key points to consider when doing a software rewrite</a></li>
</ol>
</div>
<div class="footnotes">
<hr />
<ol>
<li id="fn-refactor">
<em>I prefer the term &#8220;code refurbishment,&#8221; but people aren’t generally used to it. So I’m using &#8220;refactor&#8221; in this blog post for the sake of clarity.&#160;<a href="#fnref-refactor" rev="footnote">&#8617;</a></em>
</li>
</ol>
</div>
<hr><p>The post <a href="/2016/07/key-points-to-consider-when-doing-a-big-software-refactoring/">Key points to consider when doing a big software refactoring</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The Symptoms of Low Internal Software Quality</title>
		<link>/2014/06/the-symptoms-of-low-internal-software-quality/</link>
					<comments>/2014/06/the-symptoms-of-low-internal-software-quality/#comments</comments>
		
		<dc:creator><![CDATA[Hugo Baraúna]]></dc:creator>
		<pubDate>Tue, 24 Jun 2014 12:00:14 +0000</pubDate>
				<category><![CDATA[English]]></category>
		<category><![CDATA[CTO]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[software]]></category>
		<guid isPermaLink="false">/?p=3934</guid>

					<description><![CDATA[<p>The first post of Low Internal Software Quality series. Not only physical matter deteriorates, software does too It&#8217;s known that physical matter deteriorates. People accept that and have always dealt with it. What people don&#8217;t accept so easily is that software &#8220;deteriorates&#8221; too. Unlike physical matter, it doesn&#8217;t happen due to some physical or chemical ... <a class="read-more-link" href="/2014/06/the-symptoms-of-low-internal-software-quality/">»</a></p>
<p>The post <a href="/2014/06/the-symptoms-of-low-internal-software-quality/">The Symptoms of Low Internal Software Quality</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></description>
										<content:encoded><![CDATA[<div style="text-align:center;font-size:.8em;color:#999;font-style:italic;margin-top:15px;">
The first post of Low Internal Software Quality series.
</div>
<h3>Not only physical matter deteriorates, software does too</h3>
<p>It&#8217;s known that physical matter deteriorates. People accept that and have always dealt with it. What people don&#8217;t accept so easily is that software &#8220;deteriorates&#8221; too. Unlike physical matter, it doesn&#8217;t happen due to some physical or chemical phenomenon. It usually happens because of some business change or people change. Let me give you an example.</p>
<p>Imagine you&#8217;re leading the tech or product team of a startup; you&#8217;re the CTO. You already launched your product&#8217;s first version, and it was a success. Your business model was validated, and now you&#8217;re in a growth stage. That&#8217;s awesome! But it has its costs, and it brings a new set of challenges.</p>
<p>The first version of your product is working, but the codebase is not in the shape you&#8217;ll need from now on. Maybe your team&#8217;s velocity is not as good as it used be. Your team keeps complaining about the code quality. The CEO and the product director want new features, and your current projections will not meet the business needs.</p>
<p>It&#8217;s not uncommon that one of the main sources of all these problems is the poor quality of your product&#8217;s codebase. You may need a <a href="/2016/07/key-points-to-consider-when-doing-a-big-software-refactoring/">refactoring</a> <sup id="fnref-refactor"><a href="#fn-refactor" rel="footnote">1</a></sup> or a <a href="/2016/07/key-points-to-consider-when-doing-a-software-rewrite/">rewrite</a>.</p>
<h3>When the codebase is not in good shape, everyone can get frustrated</h3>
<p>If the internal quality of your product is not good, everyone becomes frustrated.</p>
<p>Your whole team, including developers, will get frustrated because they would like to ship features faster, but the current code quality and architecture are not helping.</p>
<p>The IT, product, and software departments suffer because they&#8217;re not able to meet the expectations of the other departments.</p>
<p>The customer also suffers because of frequent bugs, how long it takes for them to be resolved, and how long it takes new features to be launched.</p>
<p>You get the picture.</p>
<h3>Identifying the symptoms</h3>
<p>It&#8217;s the leader&#8217;s job (let&#8217;s say the CTO) to identify when a <a href="/2016/07/the-key-points-to-consider-when-doing-a-big-refactor/">refactor</a> or a <a href="/2016/07/key-points-to-consider-when-doing-a-software-rewrite/">rewrite</a> is needed. In order to do that, he or she can look around for some symptoms, like the ones below:</p>
<ul>
<li><strong>Everything is hard:</strong> Almost every feature or bug fix your team needs to do is hard. It was not always like that. You remember the good old days when your team was fast and everything ran smoothly.</li>
<li><strong>Slow velocity:</strong> Your team&#8217;s velocity decreased or is decreasing. When you were building the first version of your product, it was fast to develop a new feature, and your team used to build lots of them every iteration. Now it&#8217;s different.</li>
<li><strong>Slow test suite:</strong> Your test suite takes 10x, 20x, 30x more time to run than before.</li>
<li><strong>Bugs that don&#8217;t go away:</strong> Your team fixes a bug, then in a week or so it appears again. Every now and then your team is fixing a regression bug.</li>
<li><strong>Your team is demotivated:</strong> Your team keeps complaining that working in the project is not as productive as it was in the past. A single person can&#8217;t build one feature alone; there are too many moving parts.</li>
<li><strong>Knowledge silos:</strong> There are some parts of the software that only a single developer knows well enough to maintain. It&#8217;s difficult for the rest of the team to work with that specific code.</li>
<li><strong>New developer ramp-up time is taking too long:</strong> When new developers join the team, it takes too much time for them to be fully productive.</li>
</ul>
<p>The reason you got into one of these situations is probably not a technical one. Maybe you needed to deliver too much, too fast while you were building the first version of your product. Maybe your team didn&#8217;t have the maturity and experience in the past they have now. Analyzing the root cause is important too, but you need to do something else. You need to solve your problem.</p>
<p>If you&#8217;re experiencing the symptoms above, <strong>you probably have a low internal software quality problem</strong>. Recognizing the symptoms is already a big step. The next step is to think of solutions. Some solutions you may take include <a href="/2016/07/the-key-points-to-consider-when-doing-a-big-refactor/">refactoring</a> or a <a href="/2016/07/key-points-to-consider-when-doing-a-software-rewrite/">rewrite</a> process.</p>
<h3>Refactor or rewrite?</h3>
<p>There&#8217;s no definitive guide about when you should do a <a href="/2016/07/the-key-points-to-consider-when-doing-a-big-refactor/">big refactor</a> or a <a href="/2016/07/key-points-to-consider-when-doing-a-software-rewrite/">rewrite</a>, because it depends on a lot on your context. That said, there are some rules of thumb that you should consider when evaluating which solution to go with:</p>
<p><strong>When to rewrite</strong></p>
<ul>
<li>The technology you use is outdated, and it&#8217;s not maintained anymore.</li>
<li>Your software is really slow, and changing the architecture is not enough or is not viable.</li>
<li>The supply of software developers that know the technology you use is low and decreasing.</li>
<li>There are new technologies that offer a significant advantage compared to what you&#8217;re using.</li>
</ul>
<p><strong>When to refactor</strong></p>
<ul>
<li>The technology you use is still maintained and relevant.</li>
<li>It&#8217;s viable to improve your application in an incremental fashion.</li>
<li>The problem you&#8217;re solving is just technical and not a business one.</li>
</ul>
<p>Choosing one of these options is not an easy decision, and once you go with one of them, there will be an entire new set of concerns you&#8217;ll encounter. Stay tuned, in our next blog posts we&#8217;ll talk about what to consider when doing a <a href="/2016/07/the-key-points-to-consider-when-doing-a-big-refactor/">big refactor</a> or a <a href="/2016/07/key-points-to-consider-when-doing-a-software-rewrite/">rewrite</a>.</p>
<p>Now I would like to know about your experiences. Have you ever been in a similar situation? How did you identify that your problem was low internal software quality? Please share with us!</p>
<div style="padding: 0 15px 15px;border:dotted 1px #ccc;font-size:.8em;background-color:#f5f5f5;">
<h4 style="text-align:center;margin-bottom:2px;color:#666">Posts of the Low Internal Software Quality series</h4>
<ol>
<li>The Symptoms of Low Internal Software Quality</li>
<li><a href="/2016/07/key-points-to-consider-when-doing-a-big-software-refactoring/">Key points to consider when doing a big software refactoring</a></li>
<li><a href="/2016/07/key-points-to-consider-when-doing-a-software-rewrite/">Key points to consider when doing a software rewrite</a></li>
</ol>
</div>
<div class="footnotes">
<hr>
<ol>
<li id="fn-refactor">
      <em>I prefer the term &#8220;code refurbishment,&#8221; but people aren’t generally used to it. So I’m using &#8220;refactoring&#8221; in this blog post for the sake of clarity.&nbsp;<a href="#fnref-refactor" rev="footnote"><img src="https://s.w.org/images/core/emoji/14.0.0/72x72/21a9.png" alt="↩" class="wp-smiley" style="height: 1em; max-height: 1em;" /></a></em>
    </li>
</ol>
</div>
<hr><p>The post <a href="/2014/06/the-symptoms-of-low-internal-software-quality/">The Symptoms of Low Internal Software Quality</a> first appeared on <a href="/">Plataformatec Blog</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>/2014/06/the-symptoms-of-low-internal-software-quality/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
