Catalog
concept#Software engineering#Architecture#DevOps#Reliability

Legacy Code

Existing source code that works but is hard to maintain, test, or extend. The concept focuses on assessment, prioritization, and safe modernization strategies.

Legacy code refers to existing source code that continues to work but is difficult to maintain, test, or extend.
Established
High

Classification

  • High
  • Technical
  • Architectural
  • Intermediate

Technical context

CI/CD pipeline (Jenkins, GitHub Actions, Azure DevOps)Monitoring and logging tools (Prometheus, ELK)Code analysis tools (SonarQube, linters)

Principles & goals

Prioritize by business value and risk.Act incrementally: small, safe improvements.Invest in tests and automated validation.
Run
Team, Domain, Enterprise

Use cases & scenarios

Compromises

  • Regressions and operational incidents during changes.
  • Budget and schedule overruns.
  • Knowledge loss when key personnel leave.
  • Small, verifiable steps instead of large rewrites.
  • Establish automated tests before major changes.
  • Prioritize by business relevance and risk.

I/O & resources

  • Source code repositories and branch history
  • Operational and error logs
  • Stakeholder requirements and business criteria
  • Prioritized action list
  • Modernization roadmap and pilot plan
  • Metrics to monitor improvement

Description

Legacy code refers to existing source code that continues to work but is difficult to maintain, test, or extend. It results from historical choices, missing documentation, and accumulated technical debt. The concept supports assessing risk, prioritizing refactoring or modernization efforts, and choosing strategies for safe migration and long-term maintainability.

  • Improved maintainability and reduced failure risk.
  • Higher development velocity after stabilization.
  • Better predictability and lower operational costs long-term.

  • High short-term effort and investment required.
  • Some legacy dependencies cannot be removed immediately.
  • Risk of regressions with incomplete tests.

  • Test coverage

    Share of code covered by automated tests; important to measure safety when changing code.

  • Time to fix

    Average time to remediate bugs in legacy components; an indicator of maintainability.

  • Technical debt index

    Relative assessment of unresolved issues, code quality and required effort to modernize.

Monolithic legacy application

Old monolithic web application with tight coupling, low test coverage and growing operational issues.

Legacy undocumented API

Service interface heavily used internally but poorly documented and rarely changed.

Old batch jobs on deprecated platform

Batch processes run on deprecated infrastructure; migration requires coordination with ops and tests.

1

Analyze and inventory legacy components.

2

Assess by risk and business value.

3

Set up tests and CI for critical paths.

4

Apply incremental refactoring or strangler pattern.

5

Continuous monitoring and metrics to measure success.

⚠️ Technical debt & bottlenecks

  • Tight coupling between modules
  • Insufficient test coverage of critical paths
  • Outdated build and deployment processes
Missing tests and high couplingSlow builds and deploymentsLittle documentation and knowledge concentrated in few people
  • Complete rewrite for cosmetic issues.
  • Immediate shutdown of critical legacy functions without fallback.
  • Cutting testing budget during major modernization projects.
  • Underestimating dependencies on third-party libraries.
  • Missing migration paths for data and schema changes.
  • Loss of historical knowledge when personnel changes.
Reverse engineering and code comprehensionTest automation and CI experienceArchitecture and refactoring skills
Minimizing technical debtEnsuring operational safety and stabilityEnabling faster feature delivery
  • Budget and time constraints
  • Dependencies on third-party or legacy platforms
  • Production external operating conditions and SLAs