Development and Benchmarking of Multilingual Code Clone Detector

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhu, Wenqing, Yoshida, Norihiro, Kamiya, Toshihiro, Choi, Eunjong, Takada, Hiroaki
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910606496366592
author Zhu, Wenqing
Yoshida, Norihiro
Kamiya, Toshihiro
Choi, Eunjong
Takada, Hiroaki
author_facet Zhu, Wenqing
Yoshida, Norihiro
Kamiya, Toshihiro
Choi, Eunjong
Takada, Hiroaki
contents The diversity of programming languages is growing, making the language extensibility of code clone detectors crucial. However, this is challenging for most existing clone detection detectors because the source code handler needs modifications, which require specialist-level knowledge of the targeted language and is time-consuming. Multilingual code clone detectors make it easier to add new language support by providing syntax information of the target language only. To address the shortcomings of existing multilingual detectors for language scalability and detection performance, we propose a multilingual code block extraction method based on ANTLR parser generation, and implement a multilingual code clone detector (MSCCD), which supports the most significant number of languages currently available and has the ability to detect Type-3 code clones. We follow the methodology of previous studies to evaluate the detection performance of the Java language. Compared to ten state-of-the-art detectors, MSCCD performs at an average level while it also supports a significantly larger number of languages. Furthermore, we propose the first multilingual syntactic code clone evaluation benchmark based on the CodeNet database. Our results reveal that even when applying the same detection approach, performance can vary markedly depending on the language of the source code under investigation. Overall, MSCCD is the most balanced one among the evaluated tools when considering detection performance and language extensibility.
format Preprint
id arxiv_https___arxiv_org_abs_2409_06176
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Development and Benchmarking of Multilingual Code Clone Detector
Zhu, Wenqing
Yoshida, Norihiro
Kamiya, Toshihiro
Choi, Eunjong
Takada, Hiroaki
Software Engineering
The diversity of programming languages is growing, making the language extensibility of code clone detectors crucial. However, this is challenging for most existing clone detection detectors because the source code handler needs modifications, which require specialist-level knowledge of the targeted language and is time-consuming. Multilingual code clone detectors make it easier to add new language support by providing syntax information of the target language only. To address the shortcomings of existing multilingual detectors for language scalability and detection performance, we propose a multilingual code block extraction method based on ANTLR parser generation, and implement a multilingual code clone detector (MSCCD), which supports the most significant number of languages currently available and has the ability to detect Type-3 code clones. We follow the methodology of previous studies to evaluate the detection performance of the Java language. Compared to ten state-of-the-art detectors, MSCCD performs at an average level while it also supports a significantly larger number of languages. Furthermore, we propose the first multilingual syntactic code clone evaluation benchmark based on the CodeNet database. Our results reveal that even when applying the same detection approach, performance can vary markedly depending on the language of the source code under investigation. Overall, MSCCD is the most balanced one among the evaluated tools when considering detection performance and language extensibility.
title Development and Benchmarking of Multilingual Code Clone Detector
topic Software Engineering
url https://arxiv.org/abs/2409.06176