Evidence-First Modernization: A Strategic Approach to Legacy Systems

Modernizing a legacy application is frequently approached as an immediate, high-stakes decision: which new framework should replace the existing one? This rush to select a target technology often bypasses the most critical phase of the process, which is understanding the actual state of the incumbent system. Before committing to a costly rewrite or a major architectural shift, it is essential to determine what functionality currently works, what has become obsolete, and what behaviors must be preserved. By adopting an "evidence-first" methodology, engineering teams can create a regression safety net that informs the modernization path and minimizes the risks inherent in altering established enterprise software.

This disciplined approach—collecting empirical evidence before choosing a modernization target—has been successfully applied to a range of software, from small-scale Node.js applications to complex Java-based enterprise resource planning (ERP) systems. While each project demands a unique treatment, the fundamental process of evidence gathering, experimental iteration, and identifying proof points remains consistent. This methodology not only yields a clearer roadmap for development but also provides a framework that can be codified into GitHub Copilot agent skills, allowing teams to automate the routine aspects of assessment while keeping high-level architectural judgment firmly in the hands of the human engineers responsible for the system.

Building an Evidence Inventory Before Selecting a Target

The labels typically applied to software, such as "Java microservices" or "legacy monolith," rarely provide the granular detail required for an informed modernization strategy. A label does not reveal which version of the Java Development Kit (JDK) is running in production, how that version is pinned, whether the existing test suites are functional, or which internal and external interfaces other critical systems rely upon. Similarly, characterizing a system as a "legacy monolith" fails to specify whether the core business logic is robust or if the entire application is being held back by a single, retired platform dependency.

Before suggesting a change, teams should construct a small but comprehensive evidence inventory. This process involves cataloging the runtime environment, identifying key dependencies, and documenting the state of the existing test suite. During this phase, it is vital to record uncertainties using clear, consistent labels such as "documented," "inferred," or "unverified." If two different configuration files present contradictory information regarding the JDK version, this must be resolved rather than ignored. Similarly, if it remains unclear whether a Continuous Integration (CI) check effectively blocks code merges, that ambiguity should be explicitly noted. By documenting the unknown rather than relying on educated guesses, teams build a concrete foundation for review with stakeholders before any irreversible changes are proposed.

Choosing the Least Disruptive Path

Once the application’s current state is understood, modernization decisions should be made at the component level rather than the system level. A large, complex system often contains a mix of code that should be preserved, dependencies that require swapping, and specific subsystems that genuinely necessitate a complete rewrite. The goal is to identify the least disruptive treatment that achieves the desired result.

The first step in this process is to determine whether a capability is still needed. Removing unused or superseded features is often the most effective way to simplify an application, provided that the decision is verified and confirmed with the system owners. For capabilities that must remain, the strategy should prioritize the smallest possible changes. Engineers should ask whether the evidence justifies a more disruptive option. A subjective assessment like "the code is old" is rarely a sufficient justification for a total rewrite. Conversely, objective factors—such as a known security vulnerability with no available patch, a dependency that fails on the required modern runtime, or a failure to meet measured reliability targets—provide clear, data-driven justifications for escalating the modernization effort.

Defining What Proof Is Possible

A recurring challenge in modernization is determining whether a legacy component can run well enough to produce useful evidence, especially when the original CI pipeline is broken or outdated. A time-boxed feasibility check is a highly effective way to address this. By attempting to install dependencies, build the project using an available toolchain, and execute at least one meaningful test within a strict time limit, teams can quickly decide their path forward.

How to choose the next safe step in application modernization

If the old application can still run at an acceptable cost, the strategy should be to capture its externally visible behavior, repair the existing test harness where practical, and use those checks as a baseline to verify future upgrades. If the component is so degraded that it cannot run until it is modified, the strategy shifts to building a "modern slice." In this scenario, the team moves the thinnest, most useful workflow to a supported technology, proves its functionality, and expands the effort from that core. Attempting to force a complete legacy test suite to pass in such a broken state is often a circular and unproductive exercise; in these cases, the restoration of the test suite must be treated as an integral part of the modernization project itself.

To navigate these risks, engineers can utilize a hierarchy of safety levels. At the lowest level, where no usable regression net exists, the old code and existing documentation must serve as the primary specification. As the project progresses, teams can move toward more robust protections, such as captured inputs and outputs, automated behavioral comparisons, and eventually, a full CI gate that integrates linting, unit tests, and end-to-end checks. It is critical to acknowledge that even the most comprehensive automated gate cannot prove that every possible behavior is correct. However, by identifying and protecting key APIs, database effects, and business workflows, teams can ensure that critical behaviors survive the transition to new frameworks or languages.

Lessons from Real-World Applications

The effectiveness of this evidence-first approach was demonstrated in the modernization of PiggyMetrics, a project that initially appeared unworkable due to its reliance on outdated libraries like Spring Boot 2.0.3 and the retired spring-security-oauth2. A feasibility check revealed that while many tests failed, the core configuration modules could still compile. This evidence prevented the team from making the "tidy but expensive mistake" of a complete architectural redesign. Instead, the team used the passing tests to establish a baseline, allowing for a phased capture-and-upgrade sequence that successfully modernized the stack while preserving the project’s core microservice decomposition.

Similar success was found with other projects, including the classic game BrowserQuest and the original DOOM engine. In each instance, the strategy differed based on the evidence: BrowserQuest required a significant upgrade of its Node.js environment and WebSocket stacks, while the DOOM project necessitated a platform-level swap to SDL2 while keeping the core game-simulation model intact. These examples underscore that the modernization method is not a static set of rules, but an evolving process that must adapt to the specific needs of the system being updated.

This method was further validated on a much larger scale with ADempiere, an expansive Java-based ERP suite. Despite the increased complexity, the core methodology held firm: the team established a reproducible build, migrated to a modern JDK, and introduced a new web path while carefully comparing outputs against legacy results. The effort resulted in dozens of successful pull requests and a clear demonstration of functionality, proving that even massive legacy systems can be modernized incrementally when the scope is bounded by empirical evidence.

Encoding Strategy into Agent Skills

To ensure that these best practices are repeatable and standardized across an organization, this decision-making logic can be encoded into a GitHub Copilot agent skill. By creating a SKILL.md file that outlines the assessment process, the feasibility check requirements, and the established safety levels, engineering teams can provide developers with a structured way to approach legacy systems.

An agent skill serves as a repository of instructions and scripts that can guide a developer through the initial phases of documentation and modernization. However, it is essential to distinguish between procedure and policy. While the agent skill can mandate that certain evidence be collected or that specific safety levels be met, it cannot replace the nuanced architectural judgment of the engineers involved. The skill acts as a facilitator, ensuring that critical questions are asked and that the path forward is data-driven, but the ultimate decision-making remains a human responsibility. By starting with one bounded application and applying this methodology with rigor, organizations can turn the daunting challenge of legacy modernization into a manageable, transparent, and highly effective engineering process.

Share:

Neng Nana writes for Tech Maze.