arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2109.03555cs.SE
收藏

BLESER:基于增强语义检索的缺陷定位

BLESER: Bug Localization Based on Enhanced Semantic Retrieval

Weiqin Zou, Enming Li, Chunrong Fang

摘要:

静态缺陷定位技术在方法粒度上定位缺陷,得到了研究者和实践者的广泛关注。对于静态方法级错误定位技术,一个关键但具有挑战性的步骤是完全检索方法和错误报告的语义。目前,已有的研究主要采用相同的词袋空间来表示方法和错误报告的语义,而没有考虑方法的结构信息和错误报告的文本上下文,这在很大程度上影响了错误本地化的性能。为了解决这个问题,我们开发了BLESER,一种新的基于增强语义检索的错误定位技术。具体来说,我们使用基于AST的代码嵌入模型(更好地捕获代码结构)来检索方法的语义,和词嵌入模型(更好地捕获文本上下文)来表示错误报告的语义。然后,在增强的语义表示上构建深度学习模型。在模型构建过程中,我们比较了五种典型的词嵌入模型在表示bug报告方面的效果,并尝试探索重采样策略和代价敏感策略在处理类不平衡问题方面的有效性。我们评估了我们的BLESER在五个Java项目从缺陷4J数据集。我们发现:(1)从整体上看,词嵌入模型ELMo优于其他四种模型(包括word 2 vec,BERT等)。在促进缺陷定位技术。(2)在解决班级不平衡问题的四种策略中,随机过抽样策略(ROS)的效果明显优于其他三种策略(包括随机欠抽样、焦点损失等)。(3)通过将ELMo和ROS集成到BLESER中,在方法级错误定位上,我们可以在五个Defects 4J项目上实现0.108-0.504的MAP,0.134-0.510的MRR和0.125-0.5的Accuracy@1。

英文摘要:

Static bug localization techniques that locate bugs at method granularity have gained much attention from both researchers and practitioners. For a static method-level bug localization technique, a key but challenging step is to fully retrieve the semantics of methods and bug reports. Currently, existing studies mainly use the same bag-of-word space to represent the semantics of methods and bug reports without considering structure information of methods and textual contexts of bug reports, which largely and negatively affects bug localization performance. To address this problem, we develop BLESER, a new bug localization technique based on enhanced semantic retrieval. Specifically, we use an AST-based code embedding model (capturing code structure better) to retrieve the semantics of methods, and word embedding models (capturing textual contexts better) to represent the semantics of bug reports. Then, a deep learning model is built on the enhanced semantic representations. During model building, we compare five typical word embedding models in representing bug reports and try to explore the usefulness of re-sampling strategies and cost-sensitive strategies in handling class imbalance problems. We evaluate our BLESER on five Java projects from the Defects4J dataset. We find that: (1) On the whole, the word embedding model ELMo outperformed the other four models (including word2vec, BERT, etc.) in facilitating bug localization techniques. (2) Among four strategies aiming at solving class imbalance problems, the strategy ROS (random over-sampling) performed much better than the other three strategies (including random under-sampling, Focal Loss, etc.). (3) By integrating ELMo and ROS into BLESER, at method-level bug localization, we could achieve MAP of 0.108-0.504, MRR of 0.134-0.510, and Accuracy@1 of 0.125-0.5 on five Defects4J projects.

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

↑