arrow
Return

A machine learning based framework for code clone validation

delete2020-11-01
delete10
delete
OA
AI
G
Golam Mostaeen
B
Banani Roy
C
Chanchal K. Roy *
Kevin A. Schneider cover
Kevin A. Schneider (Kevin A. Schneider)
J
Jeffrey Svajlenko
DOI:10.1016/j.jss.2020.110686delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
A code clone is a pair of code fragments, within or between software systems that are similar. Since code clones often negatively impact the maintainability of a software system, several code clone detection techniques and tools have been proposed and studied over the last decade. However, the clone detection tools are not always perfect and their clone detection reports often contain a number of false positives or irrelevant clones from specific project management or user perspective. To detect all possible similar source code patterns in general, the clone detection tools work on the syntax level while lacking user-specific preferences. This often means the clones must be manually inspected before analysis in order to remove those false positives from consideration. This manual clone validation effort is very time-consuming and often error-prone, in particular for large-scale clone detection. In this paper, we propose a machine learning approach for automating the validation process. First, a training dataset is built by taking code clones from several clone detection tools for different subject systems and then manually validating those clones. Second, several features are extracted from those clones to train the machine learning model by the proposed approach. The trained algorithm is then used to automatically validate clones without human inspection. Thus the proposed approach can be used to remove the false positive clones from the detection results, automatically evaluate the precision of any clone detectors for any given set of datasets, evaluate existing clone benchmark datasets, or even be used to build new clone benchmarks and datasets with minimum effort. In an experiment with clones detected by several clone detectors in several different software systems, we found our approach has an accuracy of up to 87.4% when compared against the manual validation by multiple expert judges. The proposed method also shows better results in several comparative studies with the existing related approaches for clone classification. (C) 2020 Elsevier Inc. All rights reserved.
Keywords:
Code clones
Validation
Machine learning
Clone management
Classification model for code clones based on machine learning
err2014-05-29
err33
errOAAI
errYang, Jiachen; Hotta, Keisuke; Higo, Yoshiki; Igaki, Hiroshi; Kusumoto, Shinji
errShare
errSave
Challenging Machine Learning-Based Clone Detectors via Semantic-Preserving Code Transformations
err2023-05-01
err8
errOAAI
errZhang, Weiwei; Guo, Shengjian; Zhang, Hongyu; Sui, Yulei; Xue, Yinxing; Xu, Yun
errShare
errSave
Clones in deep learning code: what, where, and why?
err2022-04-08
err4
PREAI
errJebnoun, Hadhemi; Rahman, Md Saidur; Khomh, Foutse; Muse, Biruk Asmare
errShare
errSave
Eler: Ensemble Learning-Based Automated Verification of Code Clones
err2026-03-01
err0
PREAI
errDou, Shihan; Hu, Yutao; Feng, Siyue; Wu, Yueming; Zou, Deqing
errShare
errSave
Exploring the Impact of Code Clones on Deep Learning Software
err2023-09-28
err1
errOAAI
errMo, Ran; Zhang, Yao; Wang, Ush Uo; Zhang, Uan; Xiong, Pu; Li, Zengyang; Zhao, Yang
errShare
errSave
Deep learning application on code clone detection: A review of current knowledge
err2022-02-01
err29
PREAI
errLei, Maggie; Li, Hao; Li, Ji; Aundhkar, Namrata; Kim, Dae-Kyoo
errShare
errSave

Journal

Journal of Systems and Software cover
Journal of Systems and Software
IF:
4.1
Papers:
5.5K
Citations:
1.0W

Organization

U
University of Saskatchewan
Scholars:
744
Papers: 331
Citations: 9.3K
Cited Papers

Cited Papers

The content of imagery use in youth sport
err2007-01-01
err0
PREAI
errKrista J. Munroe‐Chandler; Craig. R. Hall; Graham Fishburne; Jenny O; Nathan Hall
errShare
errSave
Nr2f1a balances atrial chamber and atrioventricular canal size via BMP signaling-independent and -dependent mechanisms
err2018-02-01
err0
errOAAI
errTiffany B. Duong; Padmapriyadarshini Ravisankar; Yuntao Charlie Song; Jacob T. Gafranek; Ariel B. Rydeen; Tracy E. Dohn; Lindsey A. Barske; J. Gage Crump; Joshua S. Waxman
errShare
errSave
Comparison and evaluation of clone detection tools
err2007-09-01
err510
errOAAI
errBellon, Stefan; Koschke, Rainer; Antoniol, Giuliano; Krinke, Jens; Merlo, Ettore
errShare
errSave
Comparison of machine learning techniques for predicting porosity of chalk
err2022-02-01
err0
errOAAI
errMeysam Nourani; Najeh Alali; Saeed Samadianfard; Shahab S. Band; Kwok-wing Chau; Chi-Min Shu
errShare
errSave
Bayesian network classifiers
err1997-01-01
err3.8K
errOAAI
errFriedman, N; Geiger, D; Goldszmidt, M
errShare
errSave
A Survey on Transfer Learning
err2010-10-01
err1.4W
PREAI
errPan, Sinno Jialin; Yang, Qiang
errShare
errSave
researcher View more