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 facilita...

Descripción completa

Guardado en:
Detalles Bibliográficos
Autores principales: Muhammad Hammad, Önder Babur, Hamid Abdul Basit, Mark van den Brand
Formato: article
Lenguaje:EN
Publicado: PeerJ Inc. 2021
Materias:
Acceso en línea:https://doaj.org/article/bd00bf83c7514fdbb2914d05585a0d04
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
id oai:doaj.org-article:bd00bf83c7514fdbb2914d05585a0d04
record_format dspace
spelling oai:doaj.org-article:bd00bf83c7514fdbb2914d05585a0d042021-11-11T15:05:12ZClone-advisor: recommending code tokens and clone methods with deep learning and information retrieval10.7717/peerj-cs.7372376-5992https://doaj.org/article/bd00bf83c7514fdbb2914d05585a0d042021-11-01T00:00:00Zhttps://peerj.com/articles/cs-737.pdfhttps://peerj.com/articles/cs-737/https://doaj.org/toc/2376-5992Software 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.Muhammad HammadÖnder BaburHamid Abdul BasitMark van den BrandPeerJ Inc.articleLanguage modelingDeep learningCode cloneCode predictionInformation retrievalCode searchElectronic computers. Computer scienceQA75.5-76.95ENPeerJ Computer Science, Vol 7, p e737 (2021)
institution DOAJ
collection DOAJ
language EN
topic Language modeling
Deep learning
Code clone
Code prediction
Information retrieval
Code search
Electronic computers. Computer science
QA75.5-76.95
spellingShingle Language modeling
Deep learning
Code clone
Code prediction
Information retrieval
Code search
Electronic computers. Computer science
QA75.5-76.95
Muhammad Hammad
Önder Babur
Hamid Abdul Basit
Mark van den Brand
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.
format article
author Muhammad Hammad
Önder Babur
Hamid Abdul Basit
Mark van den Brand
author_facet Muhammad Hammad
Önder Babur
Hamid Abdul Basit
Mark van den Brand
author_sort Muhammad Hammad
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
publisher PeerJ Inc.
publishDate 2021
url https://doaj.org/article/bd00bf83c7514fdbb2914d05585a0d04
work_keys_str_mv AT muhammadhammad cloneadvisorrecommendingcodetokensandclonemethodswithdeeplearningandinformationretrieval
AT onderbabur cloneadvisorrecommendingcodetokensandclonemethodswithdeeplearningandinformationretrieval
AT hamidabdulbasit cloneadvisorrecommendingcodetokensandclonemethodswithdeeplearningandinformationretrieval
AT markvandenbrand cloneadvisorrecommendingcodetokensandclonemethodswithdeeplearningandinformationretrieval
_version_ 1718437170815959040