cascon
DESCRIPTION
TRANSCRIPT
Exploring the Design Space of Proactive Tool Support for Copy-and-Paste Programming
Daqing Hou, Ferosh Jacob, and Patricia JablonskiClarkson University
CASCON 2009November 5, 2009
Code Clone Management
Code clones are similar code fragments Often a result of copying, pasting, & modifying
Clone detection & removal (retroactive) But clones also need to be managed
Proactive clone management Provide programmers with tools to support &
manage clones throughout their entire life cycle (from creation to extinction)
We made a PCM Eclipse plug-in named CnP
Clone Life Cycle & Tool Support
Clone Life Cycle & Tool Support
Clone Life Cycle & Tool Support
Clone Life Cycle & Tool Support
Diff View (CSeR)
Context Interaction View
Clone Life Cycle & Tool Support
Intra-Clone Editing (CReN)
Rename Refactoring vs. CReN
Clone Life Cycle & Tool Support
Case Studies of Clones
Study the clones in real-world systems Used CCFinder and SimScan clone detection
tools on SCL and Eclipse JDT UI source code
1). To what extent is PCM needed? For SCL, 50/70 of the intentional, useful clone
groups could have been supported by PCM For JDT UI, PCM is useful and thus needed PCM has to be able to import detected clones,
but clone detection tools are not adequate for clone management
Case Studies of Clones
Study the clones in real-world systems Identified correspondences and changes
between class clones (ex. 33 changes) Found cases of renamed identifiers in clones
1). To what extent is PCM needed? Tedious comparisons could have been
avoided with CSeR The identifiers could have been renamed
consistently with CReN
Case Studies of Clones
2). How can PCM be best designed? Side-by-side comparison of multiple clones Support for “clone-overlapping” Script for modifying new clones based on past
changes Support for “symmetrical code patterns” Make clones with a small number of paired
differences (type or expression) visible to the programmer
Conclusion
PCM tool support is needed throughout the clone life cycle as the clone evolves
Certain design elements are needed, and others desired, in a PCM environment
Questions