Skip to main content
Test Double company logo
Services
Services Overview
Holistic software investment consulting
Software Delivery
Accelerate quality software development
Product Management
Launch modern product orgs
Legacy Modernization
Renovate legacy software systems
DevOps
Scale infrastructure smoothly
Upgrade Rails
Update Rails versions seamlessly
Technical Recruitment
Build tech & product teams
Technical Assessments
Uncover root causes & improvements
Case Studies
Solutions
Accelerate Quality Software
Software Delivery, DevOps, & Product Delivery
Maximize Software Investments
Product Performance, Product Scaling, & Technical Assessments
Future-Proof Innovative Software
Legacy Modernization, Product Transformation, Upgrade Rails, Technical Recruitment
About
About
What's a test double?
Approach
Meeting you where you are
Founder's Story
The origin of our mission
Culture
Culture & Careers
Double Agents decoded
Great Causes
Great code for great causes
EDI
Equity, diversity & inclusion
Insights
All Insights
Hot takes and tips for all things software
Leadership
Bold opinions and insights for tech leaders
Developer
Essential coding tutorials and tools
Product Manager
Practical advice for real-world challenges
Say Hello
Test Double logo
Menu
Services
BackGrid of dots icon
Services Overview
Holistic software investment consulting
Software Delivery
Accelerate quality software development
Product Management
Launch modern product orgs
Legacy Modernization
Renovate legacy software systems
Cycle icon
DevOps
Scale infrastructure smoothly
Upgrade Rails
Update Rails versions seamlessly
Technical Recruitment
Build tech & product teams
Technical Assessments
Uncover root causes & improvements
Case Studies
Solutions
Solutions
Accelerate Quality Software
Software Delivery, DevOps, & Product Delivery
Maximize Software Investments
Product Performance, Product Scaling, & Technical Assessments
Future-Proof Innovative Software
Legacy Modernization, Product Transformation, Upgrade Rails, Technical Recruitment
About
About
About
What's a test double?
Approach
Meeting you where you are
Founder's Story
The origin of our mission
Culture
Culture
Culture & Careers
Double Agents decoded
Great Causes
Great code for great causes
EDI
Equity, diversity & inclusion
Insights
Insights
All Insights
Hot takes and tips for all things software
Leadership
Bold opinions and insights for tech leaders
Developer
Essential coding tutorials and tools
Product Manager
Practical advice for real-world challenges
Say hello
Leadership
Leadership
Leadership
Legacy rescue

Why legacy code rewrites are the hardest job in software

Legacy codebases are often like tangled mazes, with convoluted logic, outdated practices, and patches upon patches. Here's what you need to know about rewriting vs. refactoring a legacy codebase.
Test Double Editorial Board
|
March 20, 2024
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Thinking about a big rewrite? Don’t do it.

We get it. Legacy codebases are often like tangled mazes, with convoluted logic, outdated practices, and patches upon patches. Navigating through such complexity can be akin to searching for a needle in a haystack, making even simple changes a Herculean task.

Years of band-aid fixes, quick hacks, and expedient solutions accumulate as technical debt in legacy systems. This debt accrues interest over time, slowing down development, increasing the risk of bugs, and impeding innovation.

A rewrite sounds like a clean slate and a chance to architect the new system from the ground up, incorporating modern design patterns, technologies, and best practices.

But rewrites have a bad reputation for good reason. In most cases, the most expensive thing you can do in software is rewrite an entire system. It’s time-consuming and often causes more headaches and risks than it's worth.

The alternative is to unwind your legacy systems instead. Sometimes, incremental improvements or targeted refactoring efforts can achieve similar outcomes as a rewrite – but with far less disruption and risk.

If you’re considering a rewrite of your legacy codebase, it's crucial to carefully weigh the costs, risks, and benefits before investing.

Over the last 12 years, Test Double has helped clients with both solutions: renovating a legacy codebase and large-scale rewrites. Here’s some of what we’ve learned.

(Prefer to skip straight to a phone call or personalized advice? Contact us now.)

When legacy codebase rewrites are worth it

There are exceptions to every rule, of course. There are good reasons to rewrite, and there are times when it's the strategic business choice.

Some of the reasons it may make more sense to rewrite include:

  • If the system is using outdated technologies, and it’s difficult to attract, onboard and retain developers who can support those technologies.
  • If there has been significant change in or expansion of the project's scope over time, to the extent that the original codebase no longer aligns with current business objectives.
  • When the accumulated technical debt (due to years of band-aid fixes, quick hacks, etc.) becomes so substantial that it outweighs the value of the underlying business logic.

A great example of when a rewrite made sound business sense:

In order to power its next generation of products, Cars.com decided to retool its systems for a modern cloud infrastructure and to turbocharge development with Elixir and Phoenix. We heclped them with that rewrite, which enabled them to realign their technical team with a more modern software development culture.

Why rewrites are so hard (and expensive)

A rewrite doesn’t seem like it should be that hard. After all, you have the source code you can look at to understand how the old thing worked and what it produced.

Here is a rundown of why rewriting is actually one of the hardest jobs in software:

Complexity overload: Software systems tend to become more intricate over time. They're like a tangled ball of yarn; trying to untangle one part often knots up another. This complexity makes it difficult to foresee all the repercussions of changes, leading to unexpected issues down the line.

Legacy dependencies: Many systems rely on older technologies, libraries, or frameworks that are no longer actively maintained or well-documented. This dependency web can trap you, making it arduous to update or replace components without causing ripple effects across the entire system."

Lack of understanding: Often, the original developers who built the system may no longer be around. This creates a knowledge gap where the intricacies of the codebase are lost in translation. Without a deep understanding of why certain decisions were made, it's challenging to rewrite without introducing new bugs or inefficiencies.

Scope creep: Rewrites have a notorious tendency to balloon in scope. What starts as a simple update can quickly spiral into a massive overhaul as stakeholders add new features or requirements along the way. Meanwhile, unused features are never culled from the system. We assume everything needs to be migrated, when the reality is that a fresh perspective on the problem can find a simpler solution.

Testing nightmares: Comprehensive testing is crucial for any software project, but it becomes especially critical during rewrites. Unfortunately, if the system is a nightmare being considered for a legacy rewrite, chances are the test suite is in even worse shape. That means little to no confidence you can perform the rewrite until you build up a set of automated tests that validate its current behavior. This can be labor-intensive, especially if you haven't done it before. If you do find that a rewrite is necessary, Test Double uses this approach and can apply it to help lower the risk of your rewrite.

User experience disruption: For end users, the transition from an old system to a new one can be jarring. Even with the best intentions, changes in interface, functionality, or performance can lead to confusion, frustration, and loss of productivity. Further, rewrites driven by engineers based on the perceived functional needs of the codebase are risky. Product managers need to lead the effort to clearly define the functional requirements needed in the new platform. This is critical to cull unused features, so that the codebase is simple and maintainable.

Code area lockdown: Rewriting a complex element often requires a development freeze on that specific area of the code. The intricacies of the overhaul make it challenging to integrate multiple changes concurrently. This means other potential enhancements or bug fixes in that region have to wait, causing the evolution of the overall system to stagnate.

Software standstill: Pausing the development of existing systems to focus on a rewrite can feel like slamming the brakes on your revenue engine. This interruption in delivering new features or improvements can impact your competitiveness and customer satisfaction.

No matter what path you decide – rewrite or remediation – it’s important to first assess what caused the system to deteriorate and address those issues before tackling the codebase.

Neither a rewrite or renovation will address the root cause. If you use the same process and culture to create a new system, you are likely going to just have another legacy codebase in the next few years. This is another reason why renovation or remediation is a longer-lasting approach.

How to decide to rewrite vs. renovate

We can help assess on a more personalized level what works best for you, your codebase, your team and your business objectives.

In the meantime, some factors to consider:

  • What are the main issues you want to solve with a rewrite? If it’s an inability to pivot or try new product ideas, we’ve helped clients adopt new processes like Shape Up to enable experimentation through their release process.
  • Is opting for a rewrite instead of refactoring a strategic move to capitalize expenses? By pursuing a rewrite, can the development effort be classified as a capitalized expense, potentially offering financial advantages? Furthermore, if functionality extraction and refactoring are integrated into broader product enhancements, can these activities still be considered for capitalization?
  • Is your legacy system costly to run? We’ve helped clients reduce their infrastructure spend, optimize database costs and improve application server performance to reduce operating expenses of a software platform.

A free consultation: To write or not to rewrite?

Rewriting and renovating legacy code can both feel scary – but we’re here to make it as seamless as possible.

We can help assess your current codebase, challenges and business objectives to help you decide the right solution for you, your team and your business. Contact us now for a free consultation.

Related Insights

🔗
Surgical Refactors with Suture
🔗
Mastering automated refactoring tools: A practical guide
🔗
The end of legacy code
🔗
Why we should stop paying tech debt

Explore our insights

See all insights
Leadership
Leadership
Leadership
Why we coach the system, not just the team

Slow delivery isn’t usually about your people—it’s about your system. Shifting focus to incremental improvements in the system helps change not just processes but behaviors for lasting change.

by
Doc Norton
Developers
Developers
Developers
Developer QA checklist for feature releases

Quality Assurance is a mindset integrated throughout development to catch issues early, build user trust, and reduce maintenance costs. These recommended procedures for dev teams without dedicated QA roles establish collective responsibility for ensuring feature stability, functionality, and usability before release.

by
Lee Quarella
Developers
Developers
Developers
From engineer to consultant: The powerful shift from inward to outward focus

What transforms a skilled software engineer into an exceptional consultant? Approach new codebases with respect rather than judgment, embrace constraints as creative boundaries, and prioritize client needs over personal preferences.

by
Dave Mosher
Letter art spelling out NEAT

Join the conversation

Technology is a means to an end: answers to very human questions. That’s why we created a community for developers and product managers.

Explore the community
Test Double Executive Leadership Team

Learn about our team

Like what we have to say about building great software and great teams?

Get to know us
No items found.
Test Double company logo
Improving the way the world builds software.
What we do
Services OverviewSoftware DeliveryProduct ManagementLegacy ModernizationDevOpsUpgrade RailsTechnical RecruitmentTechnical Assessments
Who WE ARE
About UsCulture & CareersGreat CausesEDIOur TeamContact UsNews & AwardsN.E.A.T.
Resources
Case StudiesAll InsightsLeadership InsightsDeveloper InsightsProduct InsightsPairing & Office Hours
NEWSLETTER
Sign up hear about our latest innovations.
Your email has been added!
Oops! Something went wrong while submitting the form.
Standard Ruby badge
614.349.4279hello@testdouble.com
Privacy Policy
© 2020 Test Double. All Rights Reserved.