cascon

16
Exploring the Design Space of Proactive Tool Support for Copy-and-Paste Programming Daqing Hou, Ferosh Jacob, and Patricia Jablonski Clarkson University CASCON 2009 November 5, 2009

Upload: patricia-deshane

Post on 24-Dec-2014

430 views

Category:

Documents


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: CASCON

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

Page 2: CASCON

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

Page 3: CASCON

Clone Life Cycle & Tool Support

Page 4: CASCON

Clone Life Cycle & Tool Support

Page 5: CASCON

Clone Life Cycle & Tool Support

Page 6: CASCON

Clone Life Cycle & Tool Support

Page 7: CASCON

Diff View (CSeR)

Page 8: CASCON

Context Interaction View

Page 9: CASCON

Clone Life Cycle & Tool Support

Page 10: CASCON

Intra-Clone Editing (CReN)

Rename Refactoring vs. CReN

Page 11: CASCON

Clone Life Cycle & Tool Support

Page 12: CASCON

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

Page 13: CASCON

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

Page 14: CASCON

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

Page 15: CASCON

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

Page 16: CASCON

Questions