Actively comparing clones inside the code editor

Tool support for code clones can improve software quality and maintainability. While significant research has been done in locating clones in existing source code, there has been less of a research focus on proactively tracking and supporting copy-paste-modify operations, even though copying and pasting is a major source of clone formation and the resulting clones are then often modified. We designed and implemented a programming editor, based on the Eclipse integrated development environment, named CSeR (Code Segment Reuse), which keeps a record of copy-and-paste-induced clones and then tracks and visualizes the changes made to a clone with distinct colors. The core of CSeR is an algorithm that actively compares two clones for detailed differences as a programmer edits either one of them. This edit-based comparison algorithm is unique to CSeR and produces more immediate, accurate, and natural results than other differencing tools.

[1]  Andreas Zeller,et al.  Mining version histories to guide software changes , 2005, Proceedings. 26th International Conference on Software Engineering.

[2]  Alan F. Blackwell,et al.  Cognitive Dimensions of Information Artefacts: a tutorial , 1998 .

[3]  Miryung Kim,et al.  Program element matching for multi-version program analyses , 2006, MSR '06.

[4]  Robert J. Walker,et al.  Determining detailed structural correspondence for generalization tasks , 2007, ESEC-FSE '07.

[5]  Wuu Yang,et al.  Identifying syntactic differences between two programs , 1991, Softw. Pract. Exp..

[6]  Gerardo Canfora,et al.  Identifying Changed Source Code Lines from Version Repositories , 2007, Fourth International Workshop on Mining Software Repositories (MSR'07:ICSE Workshops 2007).

[7]  Sunghun Kim,et al.  When functions change their names: automatic detection of origin relationships , 2005, 12th Working Conference on Reverse Engineering (WCRE'05).

[8]  Rob Miller,et al.  Interactive Simultaneous Editing of Multiple Text Regions , 2001, USENIX ATC, General Track.

[9]  J. Laski,et al.  Identification of program modifications and its applications in software maintenance , 1992, Proceedings Conference on Software Maintenance 1992.

[10]  Audris Mockus,et al.  Using version control data to evaluate the impact of software tools , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[11]  Vincent J. Kruskal Managing Multi-Version Programs with an Editor , 1984, IBM J. Res. Dev..

[12]  Robert J. Walker,et al.  Semi-automating small-scale source code reuse via structural correspondence , 2008, SIGSOFT '08/FSE-16.

[13]  Harald C. Gall,et al.  Change Distilling:Tree Differencing for Fine-Grained Source Code Change Extraction , 2007, IEEE Transactions on Software Engineering.

[14]  Daniel Jackson,et al.  Semantic Diff: a tool for summarizing the effects of modifications , 1994, Proceedings 1994 International Conference on Software Maintenance.

[15]  Jennifer Widom,et al.  Change detection in hierarchically structured information , 1996, SIGMOD '96.

[16]  David W. Binkley,et al.  Semantics Guided Regression Test Cost Reduction , 1997, IEEE Trans. Software Eng..

[17]  Eleni Stroulia,et al.  Differencing logical UML models , 2007, Automated Software Engineering.

[18]  Martin P. Robillard,et al.  Tracking Code Clones in Evolving Software , 2007, 29th International Conference on Software Engineering (ICSE'07).

[19]  Edwina L. Rissland,et al.  Examples and Learning Systems , 1984 .

[20]  Susan Horwitz,et al.  Identifying the semantic and textual differences between two versions of a program , 1990, PLDI '90.

[21]  Michael W. Godfrey,et al.  “Cloning considered harmful” considered harmful: patterns of cloning in software , 2008, Empirical Software Engineering.

[22]  Brad A. Myers,et al.  Design requirements for more flexible structured editors from a study of programmers' text editing , 2005, CHI Extended Abstracts.

[23]  Abraham Bernstein,et al.  Detecting similar Java classes using tree algorithms , 2006, MSR '06.

[24]  Andrew Begel,et al.  Managing Duplicated Code with Linked Editing , 2004, 2004 IEEE Symposium on Visual Languages - Human Centric Computing.

[25]  Andreas Zeller,et al.  05261 Summary - Multi-Version Program Analysis , 2005, Multi-Version Program Analysis.

[26]  Shinpei Hayashi,et al.  Supporting Refactoring Activities Using Histories of Program Modification , 2006, IEICE Trans. Inf. Syst..

[27]  Gerardo Canfora,et al.  Tracking Your Changes: A Language-Independent Approach , 2009, IEEE Software.

[28]  Miryung Kim,et al.  An ethnographic study of copy and paste programming practices in OOPL , 2004, Proceedings. 2004 International Symposium on Empirical Software Engineering, 2004. ISESE '04..

[29]  David W. Binkley,et al.  An implementation of and experiment with semantic differencing , 2001, Proceedings IEEE International Conference on Software Maintenance. ICSM 2001.

[30]  J. W. Hunt,et al.  An Algorithm for Differential File Comparison , 2008 .

[31]  Ferosh Jacob,et al.  Exploring the design space of proactive tool support for copy-and-paste programming , 2009, CASCON.

[32]  Michael W. Godfrey,et al.  Using origin analysis to detect merging and splitting of source code entities , 2005, IEEE Transactions on Software Engineering.

[33]  Hoan Anh Nguyen,et al.  Accurate and Efficient Structural Characteristic Feature Extraction for Clone Detection , 2009, FASE.

[34]  Andreas Zeller,et al.  Multi-Version Program Analysis , 2006 .

[35]  Miryung Kim,et al.  Discovering and representing systematic code changes , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[36]  Daqing Hou,et al.  CReN: a tool for tracking copy-and-paste code clones and renaming identifiers consistently in the IDE , 2007, eclipse '07.

[37]  Harald C. Gall,et al.  CVS release history data for detecting logical couplings , 2003, Sixth International Workshop on Principles of Software Evolution, 2003. Proceedings..

[38]  Ferosh Jacob CSeR - A Code Editor For Tracking & Visualizing Detailed Clone Dierences , 2009 .

[39]  Steven P. Reiss,et al.  Tracking source locations , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[40]  Alessandro Orso,et al.  A differencing algorithm for object-oriented programs , 2004 .

[41]  Françoise Détienne,et al.  Reasoning from a schema and from an analog in software code reuse , 2007, ArXiv.

[42]  Miryung Kim,et al.  Automatic Inference of Structural Changes for Matching across Program Versions , 2007, 29th International Conference on Software Engineering (ICSE'07).

[43]  Susan Horwitz,et al.  Incremental program testing using program dependence graphs , 1993, POPL '93.

[44]  David L. Atkins Version Sensitive Editing: Change History as a Programming Tool , 1998, SCM.