一句话:提出语义流图SFG、SemanticCodeBERT与层次动量对比方法HMCBL,提升缺陷定位性能。
该论文针对基于BERT的缺陷定位方法存在的两个问题:源代码预训练模型未能充分捕获程序深层语义,以及对比学习中忽略大规模负样本、并在相似度估计时忽视缺陷报告与变更集之间的词汇相似性。为此,作者提出有向多标签代码图——语义流图(Semantic Flow Graph, SFG),以紧凑且充分地表示代码语义;基于SFG设计并训练SemanticCodeBERT;并提出层次动量对比缺陷定位技术(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.