Source-linked AI summary
An AI-Assisted Migration Framework for Transforming Legacy Scientific Applications into Reusable Cloud-Based Workflows
Nafiseh Soveizi, Sven Tesselaar, Hero Robinson Brouwer, Zhiming Zhao
TL;DR
Legacy scientific applications are difficult to reuse and migrate because their project-specific environments contain tightly coupled implementations and implicit dependencies. The paper combines RM-ODP-guided LLM decomposition, DSM-based iterative refinement, human validation, and LLM workflow generation. Across two applications from different scientific domains, the approach produced reusable cloud-native workflows while preserving original functionality.
Problem
Legacy applications contain tightly coupled implementations, hard-coded configurations, and undeclared dependencies, while existing approaches provide limited support for systematically transforming heterogeneous artifacts into reusable workflows.
Method
The framework uses RM-ODP to guide LLM identification of workflow structure, DSM to assess and refine it, and an LLM generator to produce containerized workflow artifacts and executable definitions.
Results
Across two legacy applications from different domains, the migrated workflows reproduced original behaviour and showed close agreement with independently constructed reference workflows.
Takeaways & Limitations
Combining architectural guidance, LLM generation, DSM assessment, and validation provides a feasible approach for producing reusable cloud-native workflows from heterogeneous legacy software.
Takeaways & Limitations
The evaluation covers two applications, uses manually constructed reference workflows, and still requires human expert review during iterative refinement.
Abstract
from arXiv · showhide
Legacy scientific applications remain valuable research assets but are often tightly coupled to project-specific execution environments, limiting their reuse, reproducibility, and deployment within modern scientific workflow systems and cloud-native Virtual Research Environments (VREs). Existing migration approaches primarily target individual artifacts, such as notebooks or containers, and provide limited support for systematically transforming heterogeneous legacy applications into reusable cloud-native workflows. This paper presents an AI-assisted migration framework that combines the Reference Model of Open Distributed Processing (RM-ODP)-guided architectural analysis, Large Language Models (LLMs), and Design Structure Matrix (DSM) analysis. The framework first uses RM-ODP to guide an LLM in identifying reusable workflow components, their interfaces, and execution dependencies from heterogeneous legacy applications. The resulting workflow structure is then iteratively evaluated and refined using DSM analysis. Finally, an LLM-based workflow generator implements the validated workflow components and produces containerized execution environments and executable workflow definitions for deployment in cloud-native workflow systems, including VREs. The framework was evaluated on two legacy scientific applications from different scientific domains. In both cases, the applications were successfully transformed into reusable cloud-native workflows while preserving their original functionality, demonstrating the feasibility of the proposed approach for modernizing legacy scientific software.
I. INTRODUCTION
Legacy scientific applications are valuable but often difficult to reuse, reproduce, and migrate because they were built around tightly coupled, project-specific environments. The paper proposes an AI-assisted framework that combines architectural analysis, LLMs, DSM refinement, and workflow generation to transform such applications into reusable cloud-native workflows.
- Motivation: Legacy scripts, notebooks, simulation codes, and domain-specific applications often embed scientific knowledge in project-specific execution environments.These artifacts commonly contain tightly coupled implementations, implicit execution logic, hard-coded configurations, and undeclared dependencies.
- Migration challenge: Migrating legacy applications requires identifying workflow components, reconstructing dependencies, externalizing environments, and preserving original scientific behaviour.The largely manual process demands substantial software engineering and domain expertise, limiting migration scalability across heterogeneous applications.
- Research gap: Existing approaches address isolated tasks but provide limited support for understanding legacy applications, defining reusable boundaries, and automatically generating executable workflows.The paper identifies a need to combine LLM capabilities with established architectural principles and objective structural assessment.
- Framework: The proposed framework combines RM-ODP-guided LLM analysis with DSM evaluation to identify and iteratively refine workflow components, interfaces, and execution dependencies.RM-ODP captures multiple architectural viewpoints, while DSM assesses dependencies, coupling, and modularity.
- Evaluation: Two legacy applications from different scientific domains were transformed into reusable cloud-native workflows while preserving the functionality of the original applications.The case studies used BGIS standalone Python scripts and FreVA Jupyter notebooks.
II. BACKGROUND AND RELATED WORK
Scientific workflow systems and VREs support reproducible, portable, and collaborative computational research, but legacy scripts and notebooks remain difficult to migrate. Existing methods improve execution and deployment yet largely assume workflow boundaries are already known, leaving decomposition dependent on expert knowledge.
- Workflow systems and VREs: Scientific workflow systems orchestrate tasks, datasets, and resources across distributed infrastructures, improving reproducibility, portability, and scalability.VREs extend these capabilities with shared data, computational resources, metadata, and collaboration services.
- Notebook migration: Notebooks combine executable code, documentation, and visualisation but were designed for interactive development rather than scalable workflow execution.NaaVRE addresses this limitation through feature extraction, component containerisation, workflow composition, and cloud-native execution.
- Legacy software: Standalone scripts and notebooks often contain implicit execution order, hidden state, undeclared dependencies, and tightly coupled implementations that complicate reuse.These characteristics also hinder reproducibility and portability.
- Migration gap: Notebook migration approaches improve portability and execution but generally assume workflow boundaries are known or manually defined.Determining reusable component boundaries therefore remains largely dependent on expert knowledge.
- Architectural and AI foundations: RM-ODP offers complementary architectural viewpoints, while DSM provides quantitative dependency analysis for evaluating cohesion, coupling, and alternative decompositions.LLMs add capabilities for program understanding, summarisation, documentation, and software transformation.
- Research gap: Workflow migration, architecture recovery, and AI-assisted software engineering have largely evolved separately, leaving a gap between software understanding and automatic workflow transformation.The paper addresses this gap by integrating RM-ODP, LLM decomposition, and DSM-based structural assessment.
III. RESEARCH METHODOLOGY
The study uses Design Science Research to derive an AI-assisted migration framework from recurring legacy workflow challenges and the requirements needed to address them. Its methodology first analyzes migration requirements and then translates them into a conceptual framework combining complementary methods.
- Methodology: The study adopts Design Science Research to develop an AI-assisted framework for migrating legacy applications into reusable cloud-native workflows.The framework architecture was systematically derived from migration requirements and selected software engineering methods.
- Two-stage process: The methodology has two stages: deriving functional and non-functional requirements, then integrating methods and AI techniques into a conceptual migration framework.The resulting design is presented as the AI-assisted Legacy Workflow Migration Framework.
- Requirements analysis: The first stage analyzes recurring challenges including incomplete documentation, implicit dependencies, tight coupling, limited modularity, poor reproducibility, and manual migration processes.These challenges inform requirements for decomposing legacy applications into workflows.
B. Conceptual Design
The conceptual design integrates architectural analysis, AI-assisted decomposition, structural assessment, expert validation, and automated workflow generation. These components collectively support migration from legacy applications to validated, executable workflows.
- Conceptual Design: The conceptual framework integrates architectural analysis, AI-assisted decomposition, structural quality assessment, expert validation, and automated workflow generation.It is designed as a unified process rather than a single migration technique.
- RM-ODP-Guided LLM Workflow Decomposer: The RM-ODP-guided decomposer uses five architectural viewpoints to identify workflow components from poorly documented legacy applications.The viewpoints are Enterprise, Information, Computational, Engineering, and Technology.
- DSM-Based Quality Assessor: The DSM-based quality assessor evaluates coupling, cohesion, component granularity, and dependencies to support iterative workflow refinement.It addresses structural properties that LLM generation alone does not guarantee.
- Human Validation: Human validation checks whether decomposed workflows preserve the original application's functionality and execution semantics, then reviews the workflow and quality report.Required revisions are returned with DSM feedback to the decomposer for iterative refinement.
- LLM-Based Workflow Generator: The LLM-based workflow generator receives a validated workflow specification and produces executable workflow components together with the workflow definition.The specification includes schemas, mapped modules, interfaces, dependencies, runtime libraries, and original artifacts.
IV. PROPOSED AI-ASSISTED LEGACY WORKFLOW MIGRATION FRAMEWORK
The framework combines three software components with expert validation checkpoints to decompose heterogeneous legacy applications into reusable workflow schemas. RM-ODP-guided LLM reasoning captures complementary architectural perspectives, while expert review verifies scientific fidelity before further assessment.
- The framework comprises an RM-ODP-Guided LLM Workflow Decomposer, DSM Quality Assessor, and LLM-Based Workflow Generator connected through two expert validation checkpoints.
- The decomposer embeds five RM-ODP viewpoints directly into the LLM prompt rather than introducing RM-ODP as a separate software component.
- It analyzes source code, notebooks, configurations, and documentation to identify scientific objectives, information flows, responsibilities, dependencies, deployment concerns, and runtime technologies.
- The resulting schema describes workflow components, responsibilities, mapped legacy modules, interfaces, inputs, outputs, dependencies, libraries, container suitability, and implementation metadata.
- Domain experts validate components, information flows, dependencies, deployment considerations, and boundaries for completeness, scientific correctness, and traceability before DSM assessment.
B. DSM Quality Assessor
The DSM Quality Assessor evaluates candidate workflow schemas structurally and produces recommendations for iterative refinement. After expert review, the approved schema and its implementation metadata proceed to workflow generation.
- The DSM Quality Assessor analyzes dependency relationships among workflow components using DSM analysis.
- Its quality report evaluates coupling, cohesion, cyclic dependencies, decomposition granularity, and overall dependency structure, then recommends architectural improvements.
- Domain experts review the schema and DSM Quality Report, returning feedback to the decomposer for repeated refinement while preserving validated scientific functionality.
- The approved schema, component descriptions, interfaces, dependencies, libraries, and implementation metadata are passed to the LLM-Based Workflow Generator.
- The generator implements validated components and produces workflow definitions specifying execution order and dependency relationships for reusable deployment.
V. RESULTS
The evaluation uses two scientifically and structurally different legacy applications, with identical GPT-4o settings across cases and refinement iterations. It assesses refinement, agreement with reference workflows, and functional correctness.
- The evaluation uses two representative legacy applications differing in scientific objectives and software structures to provide complementary migration scenarios.
- All LLM-assisted stages use GPT-4o through the OpenAI API with default generation settings for both case studies and all refinement iterations.
- The study assesses iterative refinement by analyzing how feedback improves generated workflow decompositions.
- Final generated workflows are compared with manually constructed reference workflows that are withheld from the LLM and refinement process.
- DSM recommendations are incorporated into subsequent generation iterations until an acceptable workflow is obtained or the maximum iteration limit is reached.
B. Generated Reusable Workflows
Both legacy applications were transformed into reusable containerized workflows executable in the NaaVRE Virtual Lab. The generated decompositions matched reference structures while adapting component boundaries to preserve correct execution.
- Both legacy applications became reusable containerized workflows executable in the NaaVRE Virtual Lab.
- Despite differing domains and implementations, both applications were decomposed into modular components with explicit interfaces and execution dependencies.
- BGIS was decomposed from two standalone Python scripts into five components covering major blue-green infrastructure analysis stages, while FreVA became three components.
- FreVA combined optimization-model construction and solver execution because its internal Pyomo model cannot be reliably transferred between containers.
- Explicit configurable interfaces allow reuse with different datasets, optimization objectives, and execution settings without changing the underlying source code.
C. Workflow Validation
The evaluation compared generated workflows with reference decompositions, assessed component reusability, and checked whether migrated workflows preserved original outputs and behavior. Results across BGIS and FreVA indicate successful transformation into reusable cloud-native workflows, with iterative DSM assessment improving workflow structures.
- Functional validation: No output differences were observed between migrated and legacy applications across BGIS and FreVA, preserving scientific functionality and execution semantics.BGIS matched on validation and real-world data, including approximately 72,000 land parcels; FreVA reproduced objective values and reports for both supported objectives.
- Evaluation design: The evaluation compared generated workflows with manually constructed references, assessed reusability metrics, and validated functional correctness against legacy outputs.Reusability was measured using Interface Complexity, Understandability, Rate of Component Customisability, and Reliability.
- Workflow refinement: Iterative DSM assessment and expert validation resolved inappropriate component boundaries and incorrect dependencies in initial decompositions.The final workflows showed close agreement with independently constructed references, supporting architectural assessment as feedback for LLM-based generation.
- Migration requirements: Successful migration required reconstructing undeclared dependencies, hard-coded paths, machine-specific configuration, and hidden execution dependencies in addition to identifying computational modules.The evaluation therefore characterizes migration as both software decomposition and environment reconstruction.
A. Lessons Learned
The case studies show that reusable workflow migration depends on explicit environments, portable inputs and storage, scientifically meaningful decomposition, and practical boundaries on modularity. These lessons address reproducibility and portability while retaining execution constraints where tightly coupled computations cannot be separated safely.
- Reproducibility: Containerization preserves the complete software environment required for reproducible execution of legacy scientific applications.Legacy applications often assume libraries and external tools are already installed on the developer’s machine.
- Portability: Replacing hard-coded filesystem paths and machine-specific configuration with parameterized inputs and persistent cloud storage improves portability across research infrastructures.The same workflow can execute across infrastructures without modifying source code.
- Decomposition principles: Workflow components should reflect scientific responsibilities rather than source-code structure or notebook cell boundaries alone.BGIS followed urban-planning analysis stages, while FreVA followed the logical optimization process.
- Modularity trade-offs: Workflow decomposition must balance modularity with implementation constraints because tightly coupled computations may resist separation without unnecessary complexity or communication overhead.FreVA kept model construction and solver execution together because the internal Pyomo model could not be reliably serialized across containers.
B. Limitations
The framework evaluation preserved original application functionality and improved workflow agreement and modularity, but its generality and automation remain limited. Future work targets broader applications, reduced expert dependence, richer workflow constructs, and platform interoperability.
- Scope limitations: The evaluation covered two legacy scientific applications from different domains and artifact types, so broader case studies are needed to assess generality.The applications were Python scripts and Jupyter notebooks.
- Evaluation limitations: Reference workflows were manually constructed, introducing expert judgement into the evaluation of workflow-generation accuracy.
- Automation limitations: The framework currently relies on a human expert to review workflow decompositions during iterative refinement.Automated architectural validation is identified as a future direction.
- Evaluation scope: Evaluation focused on functional correctness, workflow quality, and execution performance, leaving long-term maintainability and independent reuse for future study.
- Future directions: Future work will broaden application and programming-language coverage, automate architectural validation and self-refinement, and support loops, conditionals, and interoperability across workflow platforms.