From the August 2014 Issue
Predicting Consistency-Maintenance Requirement of Code Clones at Copy-and-Paste Time
By Xiaoyin Wang, Yingnong Dang, Lu Zhang, Dongmei Zhang, Erica Lan, and Hong Mei
Code clones have always been a double edged sword in software development. On one hand, it is a very convenient way to reuse existing code, and to save coding effort. On the other hand, since developers may need to ensure consistency among cloned code segments, code clones can lead to extra maintenance effort and even bugs. Recently studies on the evolution of code clones show that only some of the code clones experience consistent changes during their evolution history. Therefore, if we can accurately predict whether a code clone will experience consistent changes, we will be able to provide useful recommendations to developers onleveraging the convenience of some code cloning operations, while avoiding other code cloning operations to reduce future consistency maintenance effort. In this paper, we define a code cloning operation as consistency-maintenance-required if its generated code clones experience consistent changes in the software evolution history, and we propose a novel approach that automatically predicts whether a code cloning operation requires consistency maintenance at the time point of performing copy-and-paste operations. Our insight is that whether a code cloning operation requires consistency maintenance may relate to the characteristics of the code to be cloned and the characteristics of its context. Based on a number of attributes extracted from the cloned code and the context of the code cloning operation, we use Bayesian Networks, a machine-learning technique, to predict whether an intended code cloning operation requires consistency maintenance. We evaluated our approach on four subjects—two large-scale Microsoft software projects, and two popular open-source software projects—under two usage scenarios: 1) recommend developers to perform only the cloning operations predicted to be very likely to be consistency-maintenance-free, and 2) recommend developers to perform all cloning operations unless they are predicted very likely to be consistency-maintenance-required. In the first scenario, our approach is able to recommend developers to perform more than 50 percent cloning operations with a precision of at least 94 percent in the four subjects. In the second scenario, our approach is able to avoid 37 to 72 percent consistency-maintenance-required code clones by warning developers on only 13 to 40 percent code clones, in the four subjects.
Editorials and Announcements
- According to Thomson Reuters' 2013 Journal Citation Report, TSE has an impact factor of 2.292.
- TSE celebrates its 40th Anniversary
- Get Your Journals as eBooks for Free
- eBooks of issues of TSE can now be downloaded from the Computer Society Digital Library
- In Memoriam: Mary Jean Harrold (1947-2013) (Nov 2013)
- Editorial (Sept 2013)
- In Memoriam—David Notkin (1953-2013) (June 2013)
- Editorial (May 2013)
- E-ditorial: State of the Journal (Feb 2013)
- State of the Journal (Jan/Feb 2012)
- Editorial: What Makes a Publication Archival? (March/April 2011)
- Editorial: State of the Journal (Jan/Feb 2011)
- Editorial (Nov/Dec 2010)
- How Special Should Issues Be? (Jul/Aug 2010)
- Special Section on the International Symposium on Software Testing and Analysis (March/April 2012)
- Special Section on the International Conference on Software Engineering (Jan/Feb 2012)
- Special Section on Socio-Technical Environment of Software Development Projects (May/June 2011)
- Search Based Software Engineering: Introduction to the Special Issue of the IEEE Transactions on Software Engineering (Nov/Dec 2010)
- 2008 Conference on the Foundations of Software Engineering (Sept/Oct 2010)
- The Best Papers of ISSTA (Jul/Aug 2010)
Access All Recently Published TSE Articles
Subscribe to the RSS feed of latest TSE content added to the digital library
Sign up to receive email alerts when a new issue of TSE is online.
A PrePrint is an article that has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication
The IEEE Transactions on Software Engineering (TSE) is an archival journal published bimonthly. We are interested in well-defined theoretical results and empirical studies that have potential impact on the construction, analysis, or management of software.
Read the full scope of TSE