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

利用预训练语言模型支持跨语言跨项目缺陷定位

Supporting Cross-language Cross-project Bug Localization Using Pre-trained Language Models

Mahinthan Chandramohan, Dai Quoc Nguyen, Padmanabhan Krishnan, Jovan Jancic

AI总结:

本文提出基于PLM、对比学习、提交信息与代码片段排序及知识蒸馏的跨语言跨项目缺陷定位方法,提升准确率、泛化性与CPU部署效率。

摘要:

在大型代码库中自动定位缺陷对开发者而言仍是一项重大挑战。现有技术由于依赖特定应用数据和庞大的模型规模,往往在泛化能力和部署方面遇到困难。本文提出一种新颖的基于预训练语言模型(PLM)的缺陷定位技术,该技术能够跨越项目和语言边界。我们的方法利用对比学习来增强缺陷报告和源代码的表示,随后采用一种结合提交信息和代码片段的新颖排序方法。此外,我们引入一种知识蒸馏技术,在不损失性能的情况下缩小模型规模,以便实际部署。本文展现了若干关键优势。通过在传统文件级检查之外纳入代码片段和提交信息分析,我们的技术取得了更高的缺陷定位准确率。此外,我们的模型在泛化能力方面表现出色——在来自各种项目和语言的代码上进行训练后,它能够有效识别未见过代码库中的缺陷。为解决计算限制,我们提出一种兼容 CPU 的解决方案。本质上,所提出的工作提供了一种高效、可泛化且具备实际部署潜力的缺陷定位技术。

英文摘要:

Automatically locating a bug within a large codebase remains a significant challenge for developers. Existing techniques often struggle with generalizability and deployment due to their reliance on application-specific data and large model sizes. This paper proposes a novel pre-trained language model (PLM) based technique for bug localization that transcends project and language boundaries. Our approach leverages contrastive learning to enhance the representation of bug reports and source code. It then utilizes a novel ranking approach that combines commit messages and code segments. Additionally, we introduce a knowledge distillation technique that reduces model size for practical deployment without compromising performance. This paper presents several key benefits. By incorporating code segment and commit message analysis alongside traditional file-level examination, our technique achieves better bug localization accuracy. Furthermore, our model excels at generalizability - trained on code from various projects and languages, it can effectively identify bugs in unseen codebases. To address computational limitations, we propose a CPU-compatible solution. In essence, proposed work presents a highly effective, generalizable, and efficient bug localization technique with the potential to real-world deployment.

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

↑