Abstract

Similar or identical code portions which are generated by copying and reusing code portions within the source code are named as code clones. While so many works have been conducted to detect these clones, they generally use string comparison techniques and very few of them take advantage of popular learning based approaches, such as deep learning. This paper proposes a new approach based on a popular and successful image classification technique named as convolutional neural network. It simply tokenizes each candidate clone pair in order to generate image files. Then, convolutional neural network is used to classify these image data with labels “clone” and “not clone”. In order to train and test the network, clone and not clone pairs are chosen from a public database including six million methods. As a result, the approach gives 99% accuracy, effectively detects clones and not clones with 2-5% false alarms rates at method granularity.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.