Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval

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. Subjects Data Mining and Machine Learning, Software Engineering

Saved in:
Bibliographic Details
Main Authors: Hammad, Muhammad, Babur, Önder, Basit, Hamid Abdul, van den Brand, Mark
Format: Article/Letter to editor biblioteca
Language:English
Subjects:Code clone, Code prediction, Code search, Deep learning, Information retrieval, Language modeling,
Online Access:https://research.wur.nl/en/publications/clone-advisor-recommending-code-tokens-and-clone-methods-with-dee
Tags: Add Tag
No Tags, Be the first to tag this record!
id dig-wur-nl-wurpubs-593822
record_format koha
spelling dig-wur-nl-wurpubs-5938222024-12-04 Hammad, Muhammad Babur, Önder Basit, Hamid Abdul van den Brand, Mark Article/Letter to editor PeerJ Computer Science 7 (2021) ISSN: 2376-5992 Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval 2021 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. Subjects Data Mining and Machine Learning, Software Engineering en application/pdf https://research.wur.nl/en/publications/clone-advisor-recommending-code-tokens-and-clone-methods-with-dee 10.7717/peerj-cs.737 https://edepot.wur.nl/563981 Code clone Code prediction Code search Deep learning Information retrieval Language modeling https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/ Wageningen University & Research
institution WUR NL
collection DSpace
country Países bajos
countrycode NL
component Bibliográfico
access En linea
databasecode dig-wur-nl
tag biblioteca
region Europa del Oeste
libraryname WUR Library Netherlands
language English
topic Code clone
Code prediction
Code search
Deep learning
Information retrieval
Language modeling
Code clone
Code prediction
Code search
Deep learning
Information retrieval
Language modeling
spellingShingle Code clone
Code prediction
Code search
Deep learning
Information retrieval
Language modeling
Code clone
Code prediction
Code search
Deep learning
Information retrieval
Language modeling
Hammad, Muhammad
Babur, Önder
Basit, Hamid Abdul
van den Brand, Mark
Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval
description 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. Subjects Data Mining and Machine Learning, Software Engineering
format Article/Letter to editor
topic_facet Code clone
Code prediction
Code search
Deep learning
Information retrieval
Language modeling
author Hammad, Muhammad
Babur, Önder
Basit, Hamid Abdul
van den Brand, Mark
author_facet Hammad, Muhammad
Babur, Önder
Basit, Hamid Abdul
van den Brand, Mark
author_sort Hammad, Muhammad
title Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval
title_short Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval
title_full Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval
title_fullStr Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval
title_full_unstemmed Clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval
title_sort clone-advisor: recommending code tokens and clone methods with deep learning and information retrieval
url https://research.wur.nl/en/publications/clone-advisor-recommending-code-tokens-and-clone-methods-with-dee
work_keys_str_mv AT hammadmuhammad cloneadvisorrecommendingcodetokensandclonemethodswithdeeplearningandinformationretrieval
AT baburonder cloneadvisorrecommendingcodetokensandclonemethodswithdeeplearningandinformationretrieval
AT basithamidabdul cloneadvisorrecommendingcodetokensandclonemethodswithdeeplearningandinformationretrieval
AT vandenbrandmark cloneadvisorrecommendingcodetokensandclonemethodswithdeeplearningandinformationretrieval
_version_ 1819143327224692736