paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Detecting Condition-Related Bugs with Control Flow Graph Neural Network

使用控制流图神经网络检测条件相关缺陷
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 4/10 · 该论文属于机器学习/图神经网络用于程序缺陷检测,与“机器学习与程序语言”有一般交集,并构建了条件相关缺陷数据集;但它不涉及 LLM/Agent、静态分析用于 ML/Agent 系统、浮点程序分析或贝叶斯程序分析,也不属于 LLM/Agent 改进静态分析/形式化验证的核心方向。引用 29 inbox
Jian Zhang, Xu Wang, Hongyu Zhang, Hailong Sun, Xudong Liu, Chunming Hu, Yang Liu
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出基于控制流图的图神经网络 CFGNN,结合图结构 LSTM 与 API 使用注意力,自动检测条件相关缺陷。

条件表达式在实践中极易出错,条件相关缺陷十分常见。传统自动缺陷检测方法通常局限于可编译代码且依赖繁琐的人工工作;近期深度学习方法多基于抽象语法树(AST)或现有程序图神经网络,但 AST 模型会丢失重要的控制流信息,而现有 GNN 往往只学习局部邻域结构。由于条件相关缺陷高度依赖控制流知识,本文提出一种新颖的基于控制流图的图神经网络(CFGNN),其中包含图结构 LSTM 单元,可有效学习控制流知识与长距离上下文信息,并采用 API 使用注意力机制来利用 API 知识。为评估该方法,作者从流行的 GitHub 仓库中收集真实缺陷,构建了大规模条件相关缺陷数据集。实验结果表明,所提方法在检测条件相关缺陷方面显著优于现有最先进方法。

问题
条件表达式容易出错,条件相关缺陷常见;现有基于 AST 或局部图神经网络的自动缺陷检测方法会丢失控制流信息,难以有效捕捉条件相关缺陷所依赖的控制流知识。
方法
提出基于控制流图的图神经网络 CFGNN,设计图结构 LSTM 单元以学习控制流与长距离上下文,并引入 API 使用注意力机制融合 API 知识来检测条件相关缺陷。
评估
从流行 GitHub 仓库收集真实缺陷,构建大规模条件相关缺陷数据集,并与现有最先进方法进行对比实验,结果表明 CFGNN 显著更优。
原文摘要(Abstract)

Automated bug detection is essential for high-quality software development and has attracted much attention over the years. Among the various bugs, previous studies show that the condition expressions are quite error-prone and the condition-related bugs are commonly found in practice. Traditional approaches to automated bug detection are usually limited to compilable code and require tedious manual effort. Recent deep learning-based work tends to learn general syntactic features based on Abstract Syntax Tree (AST) or apply the existing Graph Neural Networks over program graphs. However, AST-based neural models may miss important control flow information of source code, and existing Graph Neural Networks for bug detection tend to learn local neighbourhood structure information. Generally, the condition-related bugs are highly influenced by control flow knowledge, therefore we propose a novel CFG-based Graph Neural Network (CFGNN) to automatically detect condition-related bugs, which includes a graph-structured LSTM unit to efficiently learn the control flow knowledge and long-distance context information. We also adopt the API-usage attention mechanism to leverage the API knowledge. To evaluate the proposed approach, we collect real-world bugs in popular GitHub repositories and build a large-scale condition-related bug dataset. The experimental results show that our proposed approach significantly outperforms the state-of-the-art methods for detecting condition-related bugs.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{ZhangWZ0LHL23,
  title = {Detecting Condition-Related Bugs with Control Flow Graph Neural Network},
  author = {Jian Zhang and Xu Wang and Hongyu Zhang and Hailong Sun and Xudong Liu and Chunming Hu and Yang Liu},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598142}
}