Advanced Detection of Source Code Clones via an Ensemble of Unsupervised Similarity Measures

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: Martinez-Gil, Jorge
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866917996550684672
author Martinez-Gil, Jorge
author_facet Martinez-Gil, Jorge
contents The capability of accurately determining code similarity is crucial in many tasks related to software development. For example, it might be essential to identify code duplicates for performing software maintenance. This research introduces a novel ensemble learning approach for code similarity assessment, combining the strengths of multiple unsupervised similarity measures. The key idea is that the strengths of a diverse set of similarity measures can complement each other and mitigate individual weaknesses, leading to improved performance. Preliminary results show that while Transformers-based CodeBERT and its variant GraphCodeBERT are undoubtedly the best option in the presence of abundant training data, in the case of specific small datasets (up to 500 samples), our ensemble achieves similar results, without prejudice to the interpretability of the resulting solution, and with a much lower associated carbon footprint due to training. The source code of this novel approach can be downloaded from https://github.com/jorge-martinez-gil/ensemble-codesim.
format Preprint
id arxiv_https___arxiv_org_abs_2405_02095
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Advanced Detection of Source Code Clones via an Ensemble of Unsupervised Similarity Measures
Martinez-Gil, Jorge
Software Engineering
Artificial Intelligence
The capability of accurately determining code similarity is crucial in many tasks related to software development. For example, it might be essential to identify code duplicates for performing software maintenance. This research introduces a novel ensemble learning approach for code similarity assessment, combining the strengths of multiple unsupervised similarity measures. The key idea is that the strengths of a diverse set of similarity measures can complement each other and mitigate individual weaknesses, leading to improved performance. Preliminary results show that while Transformers-based CodeBERT and its variant GraphCodeBERT are undoubtedly the best option in the presence of abundant training data, in the case of specific small datasets (up to 500 samples), our ensemble achieves similar results, without prejudice to the interpretability of the resulting solution, and with a much lower associated carbon footprint due to training. The source code of this novel approach can be downloaded from https://github.com/jorge-martinez-gil/ensemble-codesim.
title Advanced Detection of Source Code Clones via an Ensemble of Unsupervised Similarity Measures
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2405.02095