arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.02095cs.SEcs.AI
收藏

基于无监督相似度度量集成的源代码克隆高级检测

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

Software Competence Center Hagenberg GmbH(哈根贝格软件能力中心有限公司)

Jorge Martinez-Gil

AI总结:

提出一种集成多种无监督相似度度量的方法,用于代码克隆检测,在小数据集上性能媲美CodeBERT,且更具可解释性和低碳足迹。

摘要:

准确确定代码相似性的能力在软件开发的许多任务中至关重要。例如,识别代码重复对于执行软件维护可能是必不可少的。本研究引入了一种新颖的集成学习方法用于代码相似性评估,结合了多种无监督相似度度量的优势。关键思想在于,一组多样化的相似度度量的优势可以相互补充,并减轻各自的弱点,从而提升性能。初步结果表明,虽然基于Transformer的CodeBERT及其变体GraphCodeBERT在训练数据充足时无疑是最佳选择,但在特定小数据集(最多500个样本)的情况下,我们的集成方法达到了相似的结果,且不影响所得解决方案的可解释性,并且由于训练过程,其相关的碳足迹要低得多。这种新颖方法的源代码可以从https://github.com/jorge-martinez-gil/ensemble-codesim下载。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑