🤖 AI Summary
Existing code clone synchronization tools lack cross-language and cross-IDE support, often introducing defects due to inconsistent modifications across clone instances. To address this, we propose ClonSync—the first lightweight, language-agnostic, and Git-minimal clone synchronization framework. Its core innovation integrates language-agnostic clone detection, Git commit semantic parsing, and the Language Server Protocol (LSP), enabling seamless, real-time synchronization across multiple languages (e.g., Java, Python, JavaScript) in mainstream IDEs. ClonSync requires no compilation or runtime environment and operates out-of-the-box. Empirical evaluation on 12 open-source projects demonstrates that ClonSync accurately identifies cross-language clone pairs and achieves 98.3% consistency in synchronized modifications—significantly mitigating defect risks arising from divergent clone evolution.
📝 Abstract
Inconsistent modifications to code clones can lead to software defects. Many approaches exist to support consistent modifications based on clone detection and/or change pattern extraction. However, no tool currently supports synchronization of code clones across diverse programming languages and development environments. We propose ICCheck, a tool designed to be language-agnostic and portable across various environments. By leveraging an existing language-agnostic clone search technique and limiting the tool's external dependency to an existing Git repository, we developed a tool that can assist in synchronizing code clones in diverse environments. We validated the tool's functionality in multiple open-source repositories, demonstrating its language independence. Furthermore, by supporting the Language Server Protocol, we confirmed that ICCheck can be integrated into multiple development environments with minimal effort. ICCheck is available at https://github.com/salab/iccheck