





















Abstract:Direct Code2Code transformation remains challenging to control because it can preserve surface-level syntax while introducing semantic drift, hidden behavioral changes, loss of traceability, non-idiomatic target implementations, or incomplete reconstruction of domain logic. This paper proposes a specification-based Code2Text2Code reengineering framework for LLM-mediated software evolution. The central idea is to transform source code into a neutral textual specification that captures program behavior, identifiers, computational flow, conditions, side effects, data dependencies, and domain-specific intent without directly transferring the source language syntax. The proposed framework combines factual context extraction, Code2Text generation, iterative verification between source code and text specification, Text2Code generation, target code verification, retrieval-augmented grounding, and semantic-aware chunking, and transformation loss estimation. The knowledge representation layer integrates metadata derived from AST, graph-based dependency structures, neutral natural language specifications, technical documentation, business documentation, and architecture-level representations. The conducted experiments include a Code2Text2Code dataset built from multiple programming languages and SQL dialects, comparison of intermediate representations, retrieval evaluation, documentation transformation evaluation, and prompt tuning using DSPy. A graph formalization using structural preservation, reverse compatibility, interface stability, and total graph similarity is implemented to estimate transformation losses. The results support the interpretation of the Code2Text2Code approach not as a simple code transformation, but as a controlled specification-based reengineering process for LLM-mediated software evolution.
| Comments: | 15 pages, 9 figures, 7 tables, 39 references |
| Subjects: | Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Logic in Computer Science (cs.LO) |
| MSC classes: | 68T07 (Primary), 03G99 (Secondary) |
| ACM classes: | C.5; D.2; E.4; F.2; F.3; F.4; H.1; H.4; H.5; J.1 |
| Cite as: | arXiv:2605.25232 [cs.SE] |
| (or arXiv:2605.25232v1 [cs.SE] for this version) | |
| https://doi.org/10.48550/arXiv.2605.25232 arXiv-issued DOI via DataCite (pending registration) |
From: Vasyl Lyashkevych Yaremovych [view email]
[v1]
Sun, 24 May 2026 19:36:04 UTC (2,487 KB)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。