Abstract
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 this https URL.
Abstract (translated)
准确确定代码相似性的能力在许多与软件开发相关的任务中至关重要。例如,识别代码复制是进行软件维护必不可少的。这项研究引入了一种新颖的集成学习方法来评估代码相似性,结合多个无监督相似度的优势。关键思想是,多样化的相似度度量具有相互补充的优势,并减轻了各个弱点的负面影响,从而提高了性能。初步结果表明,尽管Transformer-based CodeBERT和其变体GraphCodeBERT在大量训练数据存在的情况下无疑是最佳选择,但在具体小数据集(最多500个样本)情况下,我们的集成方法同样可以达到类似的结果,而不会影响所得到解决方案的可解释性,同时训练导致的附带碳足迹要低得多。这种新颖方法的源代码可以从以下链接下载:https://github.com/your-username/your-repo-name
URL
https://arxiv.org/abs/2405.02095