Improving Maintenance-Consistency Prediction During Code Clone Creation
Developers frequently introduce code clones into software through the copy-and-paste operations during the software development phase in order to shorten development time. Not all such clone creations are beneficial to software maintenance, as they may introduce extra effort at the software maintena...
Main Authors: | , , |
---|---|
Format: | Article |
Language: | English |
Published: |
IEEE
2020-01-01
|
Series: | IEEE Access |
Subjects: | |
Online Access: | https://ieeexplore.ieee.org/document/9079507/ |
id |
doaj-3f297eaedf194249822a4b595835c016 |
---|---|
record_format |
Article |
spelling |
doaj-3f297eaedf194249822a4b595835c0162021-03-30T01:43:04ZengIEEEIEEE Access2169-35362020-01-018820858209910.1109/ACCESS.2020.29906459079507Improving Maintenance-Consistency Prediction During Code Clone CreationFanlong Zhang0https://orcid.org/0000-0003-1449-389XSiau-Cheng Khoo1Xiaohong Su2School of Computer, Guangdong University of Technology, Guangzhou, ChinaSchool of Computing, National University of Singapore, SingaporeSchool of Computer Science and Technology, Harbin Institute of Technology, Harbin, ChinaDevelopers frequently introduce code clones into software through the copy-and-paste operations during the software development phase in order to shorten development time. Not all such clone creations are beneficial to software maintenance, as they may introduce extra effort at the software maintenance phase, where additional care is needed to ensure consistent change among these clones; i.e., changes made to a piece of code may need to be propagated to other clones. Failure in doing so may risk introducing bugs into software, which are usually called consistent defect. In response to the rampant maintenance cost caused by the introduction of new clones, some researchers have advocated the use of machine-learning approach to predict the likelihood of consistent change requirement when clones are freshly introduced. Leading in this approach is the work by Wang et al., which uses Bayesian Network to model maintenance-consistency of newly introduced clones. In this work, we leverage the success of the above-mentioned work by providing a revised set of attributes that has been shown to strengthen the predictive power of the Bayesian network model, as determined more quantitatively by the precision and recall levels. We firstly provide the definition of clone consistency-maintenance requirement, which can help transfer this problem to a classification problem. Then, based on collecting all clone creation operations through traversing clone genealogies, we redesign the attribute sets for representing clone creation with more information in code and context perspective. We evaluate the effectiveness of our approach on four open source projects with more quantitative analysis, and the experimental results show that our approach possesses a powerful ability in predicting clone consistency. To transfer this work into practice, we develop an Eclipse plug-in tool of this prediction to aid developers in software development and maintenance.https://ieeexplore.ieee.org/document/9079507/Code clonesclone consistent changeclone consistency predictionsoftware maintenancemachine learning |
collection |
DOAJ |
language |
English |
format |
Article |
sources |
DOAJ |
author |
Fanlong Zhang Siau-Cheng Khoo Xiaohong Su |
spellingShingle |
Fanlong Zhang Siau-Cheng Khoo Xiaohong Su Improving Maintenance-Consistency Prediction During Code Clone Creation IEEE Access Code clones clone consistent change clone consistency prediction software maintenance machine learning |
author_facet |
Fanlong Zhang Siau-Cheng Khoo Xiaohong Su |
author_sort |
Fanlong Zhang |
title |
Improving Maintenance-Consistency Prediction During Code Clone Creation |
title_short |
Improving Maintenance-Consistency Prediction During Code Clone Creation |
title_full |
Improving Maintenance-Consistency Prediction During Code Clone Creation |
title_fullStr |
Improving Maintenance-Consistency Prediction During Code Clone Creation |
title_full_unstemmed |
Improving Maintenance-Consistency Prediction During Code Clone Creation |
title_sort |
improving maintenance-consistency prediction during code clone creation |
publisher |
IEEE |
series |
IEEE Access |
issn |
2169-3536 |
publishDate |
2020-01-01 |
description |
Developers frequently introduce code clones into software through the copy-and-paste operations during the software development phase in order to shorten development time. Not all such clone creations are beneficial to software maintenance, as they may introduce extra effort at the software maintenance phase, where additional care is needed to ensure consistent change among these clones; i.e., changes made to a piece of code may need to be propagated to other clones. Failure in doing so may risk introducing bugs into software, which are usually called consistent defect. In response to the rampant maintenance cost caused by the introduction of new clones, some researchers have advocated the use of machine-learning approach to predict the likelihood of consistent change requirement when clones are freshly introduced. Leading in this approach is the work by Wang et al., which uses Bayesian Network to model maintenance-consistency of newly introduced clones. In this work, we leverage the success of the above-mentioned work by providing a revised set of attributes that has been shown to strengthen the predictive power of the Bayesian network model, as determined more quantitatively by the precision and recall levels. We firstly provide the definition of clone consistency-maintenance requirement, which can help transfer this problem to a classification problem. Then, based on collecting all clone creation operations through traversing clone genealogies, we redesign the attribute sets for representing clone creation with more information in code and context perspective. We evaluate the effectiveness of our approach on four open source projects with more quantitative analysis, and the experimental results show that our approach possesses a powerful ability in predicting clone consistency. To transfer this work into practice, we develop an Eclipse plug-in tool of this prediction to aid developers in software development and maintenance. |
topic |
Code clones clone consistent change clone consistency prediction software maintenance machine learning |
url |
https://ieeexplore.ieee.org/document/9079507/ |
work_keys_str_mv |
AT fanlongzhang improvingmaintenanceconsistencypredictionduringcodeclonecreation AT siauchengkhoo improvingmaintenanceconsistencypredictionduringcodeclonecreation AT xiaohongsu improvingmaintenanceconsistencypredictionduringcodeclonecreation |
_version_ |
1724186529623965696 |