arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2308.12773cs.SE
收藏

利用语义流图预训练代码表示以实现高效缺陷定位

Pre-training Code Representation with Semantic Flow Graph for Effective Bug Localization

Yali Du, Zhongxing Yu

AI总结:

针对现有基于BERT的缺陷定位方法存在的代码语义捕获不足、对比学习负样本缺失及相似度估计忽略词汇相似性的问题,提出语义流图表示、SemanticCodeBERT模型及分层动量对比缺陷定位技术,实现了缺陷定位的当前最优性能。

摘要:

受自然语言处理领域预训练技术取得巨大成功的启发,近年来面向编程语言的预训练模型已被广泛用于推进代码智能研究。其中,BERT已被应用于缺陷定位任务并取得了可观的效果。然而,这类基于BERT的缺陷定位技术存在两个问题:首先,在源代码上预训练的BERT模型无法充分捕获程序代码的深层语义;其次,现有整体缺陷定位模型既忽略了变更集表示的对比学习中大规模负样本的必要性,也未在相似度估计阶段考虑缺陷报告与变更集之间的词汇相似性。针对上述问题,我们提出三项解决方案:1)提出一种名为Semantic Flow Graph(SFG,语义流图)的新型有向多标签代码图表示,可紧凑且充分地捕获代码语义;2)基于SFG设计并训练了SemanticCodeBERT模型;3)设计了新型Hierarchical Momentum Contrastive Bug Localization(HMCBL,分层动量对比缺陷定位)技术。评估结果表明,我们的方法在缺陷定位任务上达到了当前最优性能。

英文摘要:

Enlightened by the big success of pre-training in natural language processing, pre-trained models for programming languages have been widely used to promote code intelligence in recent years. In particular, BERT has been used for bug localization tasks and impressive results have been obtained. However, these BERT-based bug localization techniques suffer from two issues. First, the pre-trained BERT model on source code does not adequately capture the deep semantics of program code. Second, the overall bug localization models neglect the necessity of large-scale negative samples in contrastive learning for representations of changesets and ignore the lexical similarity between bug reports and changesets during similarity estimation. We address these two issues by 1) proposing a novel directed, multiple-label code graph representation named Semantic Flow Graph (SFG), which compactly and adequately captures code semantics, 2) designing and training SemanticCodeBERT based on SFG, and 3) designing a novel Hierarchical Momentum Contrastive Bug Localization technique (HMCBL). Evaluation results show that our method achieves state-of-the-art performance in bug localization.

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

↑