Tech Tip #35: Start with your legacy systems

60 to 80% of software in service is legacy.

Video created by explainapaper.com

The problem

Old systems were written when processor time was cheap and energy invisible. They run continuously, are replicated widely and have never been profiled, but nobody wants to touch them.

The fix you can use today

  • Rank systems by how much they run and how many instances exist.
  • Map and test the top candidates before changing them.
  • Fund modernisation as maintenance with a measured energy and cost outcome.

Published research puts legacy code at 60 to 80% of the software still in use. GreenCode's legacy work starts from this.

Tools that help

  • cloc: counts lines of code by language, a quick way to size a codebase
  • SonarQube: static analysis for code smells, bugs and security issues, with quality gates in CI
  • OpenRewrite: automated refactoring recipes applied across a whole codebase

How GreenCode helps

GreenCode helps tackle this by mapping a legacy codebase and generating the tests and documentation it never had. Only then does it refactor, returning each change as a pull request you can review. More on this.

Tags

#legacy#cost#refactoring

Sources

Transcript

Sixty to eighty percent of software still in use is legacy. That is the share that published research puts on old code. These systems were written when computer time was cheap and energy was invisible. They run all day and all night, often on many machines. Most have never been measured for energy. And nobody wants to touch them. So the biggest pool of avoidable energy is often the oldest code. Here is the fix you can use today. Rank your systems by how much they run, and how many copies exist. Map and test the top few before you change them. Fund the work as maintenance, with a measured energy and cost result. GreenCode's legacy work starts from this research. Size each codebase and find its bugs, using tools like cloc and SonarQube. Then refactor across the whole codebase, using tools like OpenRewrite. GreenCode helps tackle this by mapping old code, then writing its missing tests and documents. Only then does it refactor, and each change comes back for your review. That was GreenCode Tech Tip number thirty-five. Follow for the next tip, and find more on greencode.ai/tech-tips.

All GreenCode Tech Tips · All GreenCode videos

  • Tip #35
  • For CTOs and technical leads
  • Length 1:11
  • Category Strategy, reporting and procurement
GreenCode

Want this checked on your own system? Talk to the GreenCode team.

Get in touch