Forecasting Independent Evolution Possibilities of Code Clones

This paper is the first to forecast whether a code clone fragment’s next change will propagate to its sibling copies (dependent evolution) or happen alone (independent evolution), predicted before the change is made using only prior revision history. Existing approaches predict consistency only at copy-and-paste time, cover only copy-paste clones, and rely on shuffled cross-validation that leaks future data into training. We instead consider every clone fragment in a system, predict a recurring modification-level event across the clone’s entire lifetime, and enforce a strict walk-forward protocol that retrains after every revision with no look-ahead. Each fragment is described by 52 features capturing its edit history, pairwise coupling with siblings, and how that coupling decays over time. Across 33,003 modification events in four open-source C and Java systems, our best classifier reaches MCC 0.705 and balanced accuracy 0.850. All datasets and tools are publicly released.