Refactor Flow: AI-Based Semantic-Preserving Code Translation for Legacy Modernization

Legacy software systems form the backbone of modern digital infrastructure, yet their long-term maintainability is threatened by outdated language constructs, monolithic structure, and poor documentation. While recent Large Language Models (LLMs) demonstrate strong capabilities in code generation and transformation, their application to automated refactoring is limited by semantic drift and lack of formal verification. This paper presents Refactor Flow, an AI-assisted hybrid refactoring framework that integrates Abstract Syntax Tree (AST)–based structural validation with LLM-driven semantic modernization to enable behaviour-preserving code translation and refactoring. The system targets legacy Python codebases and supports modernization, modularization, and cross-language translation while enforcing syntactic and semantic correctness through deterministic verification layers. Through controlled experiments on legacy repositories, Refactor Flow achieves high semantic preservation, improved structural quality, and superior test pass rates compared to IDE refactorers, rule-based systems, and LLM-only baselines. The results demonstrate that hybrid symbolic–probabilistic refactoring offers a viable path toward safe, scalable legacy code modernization.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-01-25
DOI
https://doi.org/10.5281/zenodo.18366976
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Refactor Flow: AI-Based Semantic-Preserving Code Translation for Legacy Modernization

Aditya Bagari
Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
article

Refactor Flow: AI-Based Semantic-Preserving Code Translation for Legacy Modernization

Aditya Bagari
article en

Abstract

Legacy software systems form the backbone of modern digital infrastructure, yet their long-term maintainability is threatened by outdated language constructs, monolithic structure, and poor documentation. While recent Large Language Models (LLMs) demonstrate strong capabilities in code generation and transformation, their application to automated refactoring is limited by semantic drift and lack of formal verification. This paper presents Refactor Flow, an AI-assisted hybrid refactoring framework that integrates Abstract Syntax Tree (AST)–based structural validation with LLM-driven semantic modernization to enable behaviour-preserving code translation and refactoring. The system targets legacy Python codebases and supports modernization, modularization, and cross-language translation while enforcing syntactic and semantic correctness through deterministic verification layers. Through controlled experiments on legacy repositories, Refactor Flow achieves high semantic preservation, improved structural quality, and superior test pass rates compared to IDE refactorers, rule-based systems, and LLM-only baselines. The results demonstrate that hybrid symbolic–probabilistic refactoring offers a viable path toward safe, scalable legacy code modernization.

Zenodo (CERN European Organization for Nuclear Research)
Industry, innovation and infrastructure
Openalex Percentile: Top 85%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Refactor Flow: AI-Based Semantic-Preserving Code Translation for Legacy Modernization — Aditya Bagari · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS