Software Engineering
New scoring method helps developers map code across redesigned software projects
Researchers use semantic analysis to track and reuse code when modernizing legacy software systems, addressing a costly bottleneck in cross-repository redesigns.
When developers redesign software systems to modernize them while keeping functionality intact, they face a persistent problem: manually tracking which code corresponds between the old and new versions is tedious, time-consuming, and prone to mistakes—especially when changes span multiple repositories.
A new study published on arXiv examines this challenge through an action research methodology, combining field investigation with hands-on contributions to open-source projects. The researchers focused on static analyzers, where cross-repository redesigns frequently occur, using the ongoing overhaul of Soot into SootUp as their primary case study.
Key challenges in code migration#
The study uncovered several patterns that complicate redesign efforts. Rather than a straightforward linear migration, code often gets reused in non-linear ways. Developers defer some reuse decisions using TODO comments, while tests frequently go unported to the new system. Another concern: bugs can inadvertently propagate when code moves between versions without proper verification.
The central bottleneck is identifying which methods, classes, and other code units correspond between original and redesigned projects—a task that becomes exponentially harder without automated guidance.
A semantic-aware solution#
To address this mapping problem, the researchers retrofitted clone detection techniques to derive correspondences between old and new code. They then developed the Semantic Alignment Score (SAS), which incorporates semantic signals that traditional tools miss:
- Preserved identifiers (variable and function names)
- API documentation
- Comments and docstrings
Performance and validation#
Testing SAS on three redesigned project pairs—Soot/SootUp, FindBugs/SpotBugs, and ANTLR3/ANTLR4—the method achieved improvements of up to 0.34 F1 score for code mapping detection on a manually labeled benchmark of 1,805 method pairs. Interestingly, strong traditional detectors matched or outperformed large language model–based approaches.
The code mapping analysis uncovered real maintenance gaps, resulting in five issues and 10 pull requests submitted to the projects, of which eight were accepted and merged. This demonstrates the practical value of the approach beyond its technical metrics.