2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE) (2015)
Lincoln, NE, USA
Nov. 9, 2015 to Nov. 13, 2015
DOI Bookmark: http://doi.ieeecomputersociety.org/10.1109/ASE.2015.39
Modern software development relies on code reuse, which software engineers typically realise through handwrittenabstractions, such as functions, methods, or classes. However, such abstractions can be challenging to develop andmaintain. One alternative form of re-use is copy-paste-modify, a methodology in which developers explicitly duplicate sourcecode to adapt the duplicate for a new purpose. We observethat copy-paste-modify can be substantially faster to use thanmanual abstraction, and past research strongly suggests that itis a popular technique among software developers. We therefore propose that software engineers should foregohand-written abstractions in favour of copying and pasting. However, empirical evidence also shows that copy-paste-modifycomplicates software maintenance and increases the frequency ofbugs. To address this concern, we propose a software tool thatmerges together similar pieces of code and automatically createssuitable abstractions. This allows software developers to get thebest of both worlds: custom abstraction together with easy re-use. To demonstrate the feasibility of our approach, we haveimplemented and evaluated a prototype merging tool for C++ ona number of near-miss clones (clones with some modifications) inpopular Open Source packages. We found that maintainers findour algorithmically created abstractions to be largely preferableto existing duplicated code.
Cloning, Software, Manuals, Software algorithms, Merging, Algorithm design and analysis, Face,Software evolution, Refactoring, Clone management, Software Engineering, Static Analysis
Krishna Narasimhan, Christoph Reichenbach, "Copy and Paste Redeemed (T)", 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE), vol. 00, no. , pp. 630-640, 2015, doi:10.1109/ASE.2015.39