TY - JOUR
T1 - Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval
AU - Hammad, Muhammad
AU - Babur, Önder
AU - Basit, Hamid Abdul
AU - van den Brand, Mark G.J.
PY - 2021/11/9
Y1 - 2021/11/9
N2 - Software developers frequently reuse source code from repositories as it saves development time and effort. Code clones (similar code fragments) accumulated in these repositories represent often repeated functionalities and are candidates for reuse in an exploratory or rapid development. To facilitate code clone reuse, we previously presented DeepClone, a novel deep learning approach for modeling code clones along with non-cloned code to predict the next set of tokens (possibly a complete clone method body) based on the code written so far. The probabilistic nature of language modeling, however, can lead to code output with minor syntax or logic errors. To resolve this, we propose a novel approach called Clone-Advisor. We apply an information retrieval technique on top of DeepClone output to recommend real clone methods closely matching the predicted clone method, thus improving the original output by DeepClone. In this paper we have discussed and refined our previous work on DeepClone in much more detail. Moreover, we have quantitatively evaluated the performance and effectiveness of Clone-Advisor in clone method recommendation.
AB - Software developers frequently reuse source code from repositories as it saves development time and effort. Code clones (similar code fragments) accumulated in these repositories represent often repeated functionalities and are candidates for reuse in an exploratory or rapid development. To facilitate code clone reuse, we previously presented DeepClone, a novel deep learning approach for modeling code clones along with non-cloned code to predict the next set of tokens (possibly a complete clone method body) based on the code written so far. The probabilistic nature of language modeling, however, can lead to code output with minor syntax or logic errors. To resolve this, we propose a novel approach called Clone-Advisor. We apply an information retrieval technique on top of DeepClone output to recommend real clone methods closely matching the predicted clone method, thus improving the original output by DeepClone. In this paper we have discussed and refined our previous work on DeepClone in much more detail. Moreover, we have quantitatively evaluated the performance and effectiveness of Clone-Advisor in clone method recommendation.
KW - Code clone
KW - Code prediction
KW - Code search
KW - Deep learning
KW - Information retrieval
KW - Language modeling
UR - http://www.scopus.com/inward/record.url?scp=85122038219&partnerID=8YFLogxK
U2 - 10.7717/peerj-cs.737
DO - 10.7717/peerj-cs.737
M3 - Article
C2 - 34909463
SN - 2376-5992
VL - 7
JO - PeerJ Computer Science
JF - PeerJ Computer Science
M1 - e737
ER -