skip to main content
10.1145/1328279.1328283acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

CReN: a tool for tracking copy-and-paste code clones and renaming identifiers consistently in the IDE

Published:21 October 2007Publication History

ABSTRACT

Programmers often copy and paste code so that they can reuse the existing code to complete a similar task. Many times, modifications to the newly pasted code include renaming all instances of an identifier, such as a variable name, consistently throughout the fragment. When these modifications are done manually, undetected inconsistencies and errors can result in the code, for example, a single instance can be missed and mistakenly not renamed. To help programmers avoid making this type of copy-paste error, we created a tool, named CReN, to provide tracking and identifier renaming support within copy-and-paste clones in an integrated development environment (IDE). CReN tracks the code clones involved when copying and pasting occurs in the IDE and infers a set of rules based on the relationships between the identifiers in these code fragments. These rules capture the programmer's intentions, for example, that a particular group of identifiers should be renamed consistently together. Programmers can also provide feedback to improve the accuracy of the inferred rules by specifying that a particular instance of an identifier is to be renamed separately. We introduce our CReN tool, which is implemented as an Eclipse plug-in in Java.

References

  1. E. Duala-Ekoko and M. P. Robillard, "Tracking Code Clones in Evolving Software", ACM SIGSOFT-IEEE International Conference on Software Engineering (ICSE), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. L. Jiang, Z. Su, and E. Chiu, "Context-Based Detection of Clone-Related Bugs", European Software Engineering Conference (ESEC) and ACM SIGSOFT International Symposium on the Foundations of Software Engineering (FSE), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Z. Li, S. Lu, S. Myagmar, and Y. Zhou, "CP-Miner: A Tool for Finding Copy-paste and Related Bugs in Operating System Code", USENIX-ACM SIGOPS Symposium on Operating Systems Design and Implementation (OSDI), 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. Liblit, A. Aiken, A. X. Zheng, and M. I. Jordan, "Bug Isolation via Remote Program Sampling", ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Toomim, A. Begel, and S. L. Graham, "Managing Duplicated Code with Linked Editing", IEEE Symposium on Visual Languages -- Human Centric Computing (VLHCC), 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. CReN: a tool for tracking copy-and-paste code clones and renaming identifiers consistently in the IDE

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader