5 Keys To Successfully Managing Legacy Code

Legacy code can be challenging to maintain. The trick to efficiently maintaining that code is to understand that there is more to it than simply managing the code.

I feel like there is always a big focus on developing new features, launching the next product or the next big thing, but once those things are successful there is an extraordinary challenge that teams face in managing their legacy code. Even the latest and greatest software at some point becomes legacy and it isn’t always possible to just drop the product line and move on to something else (unless of course you are Google).

legacy code, managing legacy code
Image source: Jacom Beningo

Once there is a user base, the code may need to be maintained for a decade or more. In my travels and online conversations, I encounter a lot of teams who struggle to maintain their code. I’ve found that they often are solely focused on the code, but it turns out that there are actually five keys to successfully managing legacy software in a timely and cost-effective manner. In this post, we will briefly explore these five keys.

Key #1 – People Management

The first key to successfully managing legacy code is to manage the people on the team. Now I’m not necessarily talking about day to day management of developers, but I have seen a lot of very successful developers whose skillset have become frozen in time. They start out with the latest and greatest skills and processes, but from constant work, pressures to deliver the product and updates to it, they fall out of sync with the rest of the industry and before anyone realizes it, they are frozen relics using outdated processes, tools and techniques. These developers may still be successful, but they may not be as efficient as they could be and depending on the processes and skills it may make it very hard to collaborate on the code or make changes to it within a predictable timeframe.

Now before anyone gets embarrassed thinking that I may be describing them, this is something that can happen to any development team. I’ve been working in embedded systems now professionally for over 15 years and I’ve found myself occasionally starting to become a frozen relic if I allow myself to get too heads down on project work. Several times throughout my career I’ve scheduled considerable time to learn, test and implement new processes, techniques, technologies and so forth. No team is immune and therefore should have a plan in place to not just help their team stay up on the latest industry trends and techniques, but to also have the time to test and implement those skills and make improvements. New skills are critical to ensuring that developers can successfully leverage the latest skills and techniques when managing and developing software.

Key #2 – Process Management

I’ve found throughout my career so far that processes are the necessary evil that can generate consistent, predictable results. Industry processes change over time. Some processes that gather a large following may be found to not produce the desired result and might be abandoned. Others may prove to be a foundational cornerstone that no team should go without. The teams that I have worked with that have been the most successful are teams that carefully manage the development and business processes.

Over time, processes tend to accumulate to a point that they can choke out innovation and cause more headaches than they fix. This is why it’s important that teams remain flexible with their process management by performing annual spring cleaning on their processes. If certain processes are tying developers’ hands too much, remove them. If developers have too much freedom and are tripping over themselves, find an effective process that can produce reliable and repeatable results. Carefully balancing the processes that a team uses and making sure that they are updated over time can help to ensure that legacy software is updated and maintained in such a way that it is evolving with the times, which can minimize large modernization efforts.

Key #3 – Technology Management

Managing the technology that a product is based on can have a dramatic effect on how easy it is to manage legacy code. I’ve found that sometimes once the hardware is designed for a product, developers become accustomed to working with that single microcontroller, or that toolchain, or that framework. Technology evolves at a rapid rate and just because we used a particular development environment five years ago when we first developed the product doesn’t mean that is best or most effective environment for us to be working in. It may be the most comfortable for the moment, but there could be others that allow us to work faster and more efficiently. Just in the past three years I’ve seen huge leaps in compiler efficiency, code tracing technology, memory management and even security technologies.

Teams should be carefully reviewing what technologies they are using to maintain their software and evaluating what the latest and greatest technologies are. A team may decide to continue on the path they are on, but just being aware of what is there and planning for it to be implemented can help developers to plan for those changes and technologies. Then when the time comes, it’s not a major overhaul but just a seamless transition that was expected and garners new value to the team.

Key #4 – Tools Management

The tools that we use to develop and manage our software is so crucial that it’s often hard for me to come up with the right words to describe it. Imagine for instance that there are two home builders who are building identical homes. Each needs to frame the house but they decide to use different tools. Builder one decides to use hammer and nails because it’s what he’s most familiar with, it’s the way he has always done it and he doesn’t have time to learn any other way of doing it. Builder two, who is also familiar with using a hammer and nails, decides to purchase a nail gun. If they both start at the same time, who do you think will have their home frame first? Undoubtedly it would be the builder with the nail gun, even if he had to spend a little time at the start to learn how to use it.

Legacy code can be maintained and updated successfully if the right tools are used. These tools do change over time as there are always innovative companies and open source developers who are providing solutions to all sorts of problems. This is why there also has to be a process in place to learn about new tools, how they work and to outfit developers with them. Proper tool management can make things so much easier. For example, I’ve come across legacy code bases there were hundreds of thousands of lines of code. No documentation, monolithic, a nightmare if I were to try to understand the architecture and pieces only by doing a code review. Instead, I use a tool like Understand or Lattix or some other tool that helps me to quickly visualize the code, understand the architecture and then I can start asking the right questions (and far faster than if I did it manually). The right tool for the right job.  

Key #5 – Code Management

Finally, we come to the actual code management. The code itself, and even the software architecture should evolve over time. We often look at the code and the software architecture as fixed, but they do not necessarily need to be. For example, I often come across monolithic, tightly coupled code. The application code directly makes calls to the hardware which would make changing processors or hardware a major rewrite of the software.

As I encounter code like this, I’ll often draw up how the current architecture looks and then draw up how I would like it to look. This usually involves identifying architectural boundaries and then within the code, with each release, making minor improvements and evolving the code towards the preferred architecture. I’ve found that this approach is very effective at evolving a legacy code base architecturally and that it minimizes major rewrites and headaches but still brings the code up to a modern standard. (Obviously with quite a few other things going on but I hope you get the picture).

Conclusions

Legacy code can be challenging to maintain. The trick to successfully and efficiently maintaining that code though is to understand that there is more to it than simply managing the code! We’ve examined the five keys to successfully managing legacy code:

  • People
  • Processes
  • Technologies
  • Tools
  • Code

All five areas to be managed successfully in order to make legacy code management not only successful but cost effective and efficient.

Jacob Beningo is an embedded software consultant who currently works with clients in more than a dozen countries to dramatically transform their businesses by improving product quality, cost and time to market. He has published more than 200 articles on embedded software development techniques, is a sought-after speaker and technical trainer, and holds three degrees which include a Masters of Engineering from the University of Michigan. Feel free to contact him at [email protected], at his website, and sign-up for his monthly Embedded Bytes Newsletter.

Pacific Design & Manufacturing is the West coast's leading trade show for design engineers offering the latest in 3D printing, automation, and CAD/CAM software from igus, Protolabs, and Smalley and hundreds more. Register now!

 

Comments (0)

Please log in or to post comments.
  • Oldest First
  • Newest First
Loading Comments...