Work

Enhancing Confidence in Software Refactoring by Tracking Dataflows in Code Property Graphs

Year: 2026
Type: preprint
Abstract: Software refactoring is an essential practice for reducing and managing technical debt in software projects, but it carries the inherent risk of inadvertently altering a program's external behavior. This paper introduces a novel approach to enhance refactoring confidence b y t racking d ataflows within Code Property Graphs. By defining software boundaries through internal and external function calls, our algorithm serializes dataflows between external sources and sinks before a refactoring operation and verifies t heir p ersistence a fterward. T o handle the complexity of real-world applications, we detail several algorithmic refinements, i ncluding c ompiler-aided e xternal function identification, d iff-based fi ltering, an d pa rallel pr ocessing. We evaluate our approach against the SWE-refactor benchmark, achieving an 86.5 percent successful verification r ate across 602 real-world Java refactoring operations. Additionally, an in-depth case study on the SQLite codebase demonstrated 95 percent accuracy in distinguishing between valid and intentionally broken refactorings generated by large language models. Our findings s uggest t hat t racking d ataflows vi a Co de Property Graphs provides a highly effective heuristic for human engineers and automated agents to ensure behavioral consistency during refactoring operations.
Language: English
Open Access status: green
OpenAlex ID: W7204069104
Cites: 12
Cited by:
Related to: 10