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

DeepFWI:基于多模态代码-警告语义的 bug 敏感警告识别

DeepFWI: Identifying Bug-Sensitive Warnings with Multi-Modal Code-Warning Semantics

Nankai University(南开大学);Beihang University(北京航空航天大学);Nanyang Technological University(南洋理工大学);Shanghai Jiaotong University(上海交通大学);Singapore Institute of Technology(新加坡科技工程研究学院);East China Normal University(华东师范大学);Xidian University(西安电子科技大学)

Han Liu, Jian Zhang, Cen Zhang, Xiaohan Zhang, Kaixuan Li, Sen Chen, Shang-Wei Lin, Yixiang Chen, Xinhua Li, Yang Liu

AI总结:

本文提出 DeepFWI,通过多模态语义学习识别细粒度的 bug 敏感警告,采用 LSTM 模型捕捉代码与警告的关联,实验表明其在 F1-score 上优于基线方法。

摘要:

静态分析工具已发展以帮助检测 bug,但过多的假警告会阻碍开发者的生产力和信心。先前研究尝试了基于学习的方法来识别 bug 警告,但其粒度粗,仅关注长期警告或函数级警报,对个别 bug 不敏感。此外,它们依赖于手动编写的特征或仅基于源代码语义,不足以有效学习。本文提出 DeepFWI,一种基于学习的方法,能够在细粒度上识别 bug 敏感警告。具体而言,我们设计了一个新颖的 LSTM 模型,捕捉静态分析工具(ASATs)的代码和警告的多模态语义,并通过交叉注意力突出其相关性。为解决训练和评估的数据稀缺问题,我们收集了 280,273 条警告的大规模数据集。我们在该数据集上进行了广泛实验,评估 DeepFWI。实验结果表明,我们的方法在确认 true 警告方面取得了 67.06% 的 F1-score,显著优于所有基线。此外,为验证 DeepFWI 从开发者的角度来看的实用性,我们将其应用于四个流行的开源项目。我们的方法过滤了大部分警告,同时仍成功地发现了 25 个通过手动分析确认的真正 bug 警告。

英文摘要:

Static analysis tools have evolved over time to assist in detecting bugs. However, the excessive false warnings can impede developers' productivity and confidence in the tools. Previous research efforts have explored learning-based approaches to identify bug warnings. Nevertheless, their coarse granularity, focusing on either long-term warnings or function-level alerts, is insensitive to individual bugs. Also, they rely on manually crafted features or solely on source code semantics, which is inadequate for effective learning. In this paper, we propose DeepFWI, a learning-based approach that identifies bug-sensitive warnings at a fine-grained granularity. Specifically, we design a novel LSTM-based model that captures multi-modal semantics of source code and warnings from automated static analysis tools (ASATs) and highlights their correlations with cross-attention. To tackle the data scarcity of training and evaluation, we collected a large-scale dataset of 280,273 warnings. We conducted extensive experiments on the dataset to evaluate DeepFWI. The experimental results demonstrate the effectiveness of our approach, with an F1-score 67.06% for confirming true warnings in a finer-grained manner, significantly outperforming all baselines. Additionally, to validate the practicality of DeepFWI from the perspective of developers, we applied DeepFWI to four popular open-source projects. Our approach filtered out the vast majority of warnings, while still successfully surfacing 25 true bug-related warnings that were confirmed through manual analysis.

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

↑