Detecting and tracking code clones can ease various software development and maintenance tasks when changes in a code fragment should be propagated over all its copies. Several deep learning based clone detection models have appeared in the literature for detecting syntactic and semantic clones, and these models have widely been evaluated with the BigCloneBench dataset. However, the class imbalance and small number of semantic clones make BigCloneBench less ideal when interpreting the model performances. Sometimes researchers use a few other semantic clone datasets such as GoogleCodeJam, OJClone and SemanticCloneBench to understand a model's generalizability. To overcome the limitations of the existing datasets, recently a GPT-assisted large semantic and cross-language clone dataset GPT-CloneBench has been released, but it is not clear how all these models would compare and contrast in terms of these datasets. In this paper, we propose a multi-step evaluation approach for five state-of-the-art clone detection models leveraging existing bench-mark datasets including the recently proposed GPTCloneBench and exploiting the mutation operators to study the extent of these clone detection models' ability. More specifically, we examined the performance of three highly-performing single-language clone detection models (ASTNN, GMN, CodeBERT) that use various code representations (e.g., AST, flow augmented AST with graph matching network, and bidirectional encoder representation) for detecting semantic clones. In addition to using BigCloneBench, we tested them on SemanticCloneBench and GPTCloneBench, investigated their robustness under mutation operations, and examined them against cutting-edge cross-language clone detection tools (C4, CLCDSA) that are also known to learn semantic clones. While all single-language models showed high F1 scores for BigCloneBench, their performances varied quite differently (sometimes over 20%) when tested on SemanticCloneBench. Interestingly, the cross-language model (C4) consistently showed superior performance (around 7%) on SemanticCloneBench over other models and performed similarly for BigCloneBench and GPTCloneBench. On mutation-based datasets, C4 appeared to have a more robust performance (less than 1% difference) whereas single-language models showed high variability.
Paper
References (34)
Scroll for more · 22 remaining