A method for proactive moderation of code clones in IDEs
Radhika D. Venkatasubramanyam, Himanshu Kumar Singh, K. Ravikanth · 2012
Duplicating code and modifying it is a useful convenience when editing within an IDE. This sequence of operations, termed copy-paste-modify, has the downside of proliferating nearly identical code segments or code clones and could lead to rapid degeneration of code. Although techniques for proactive identification of clones and differences between them have been studied, no clear method to control clone formation, based on acceptability criteria, is known. In this paper, we present a technique to moderate the genesis of clones through copy-paste-modify operations. Our approach is guided by associating constraints formulated from predefined guidelines, and checking for their satisfaction at the time of copy and upon modification. By encoding acceptability criteria as constraints, our approach provides the means necessary for controlled creation of clones.