Automatically Inspecting Thousands of Static Bug Warnings with Large Language Model: How Far Are We?

Author:

Wen Cheng1ORCID,Cai Yuandao2ORCID,Zhang Bin3ORCID,Su Jie1ORCID,Xu Zhiwu3ORCID,Liu Dugang4ORCID,Qin Shengchao1ORCID,Ming Zhong3ORCID,Cong Tian5ORCID

Affiliation:

1. Guangzhou Institute of Technology & ICTT and ISN Laboratory, Xidian University, Guangzhou, China

2. Fermat Labs, Huawei Technologies Co., Ltd, Hong Kong, China

3. College of Computer Science and Software Engineering, Shenzhen University, Shenzhen, China

4. Guangdong Laboratory of Artificial Intelligence and Digital Economy (SZ), Shenzhen University, Shenzhen, China

5. ICTT and ISN Laboratory & Guangzhou Institute of Technology, Xi'an, China

Abstract

Static analysis tools for capturing bugs and vulnerabilities in software programs are widely employed in practice, as they have the unique advantages of high coverage and independence from the execution environment. However, existing tools for analyzing large codebases often produce a great deal of false warnings over genuine bug reports. As a result, developers are required to manually inspect and confirm each warning, a challenging, time-consuming, and automation-essential task. This article advocates a fast, general, and easily extensible approach called Llm4sa that automatically inspects a sheer volume of static warnings by harnessing (some of) the powers of Large Language Models (LLMs). Our key insight is that LLMs have advanced program understanding capabilities, enabling them to effectively act as human experts in conducting manual inspections on bug warnings with their relevant code snippets. In this spirit, we propose a static analysis to effectively extract the relevant code snippets via program dependence traversal guided by the bug warning reports themselves. Then, by formulating customized questions that are enriched with domain knowledge and representative cases to query LLMs, Llm4sa can remove a great deal of false warnings and facilitate bug discovery significantly. Our experiments demonstrate that Llm4sa is practical in automatically inspecting thousands of static warnings from Juliet benchmark programs and 11 real-world C/C++ projects, showcasing a high precision (81.13%) and a recall rate (94.64%) for a total of 9,547 bug warnings. Our research introduces new opportunities and methodologies for using the LLMs to reduce human labor costs, improve the precision of static analyzers, and ensure software trustworthiness

Funder

National Natural Science Foundation of China

China Postdoctoral Science Foundation

Fundamental Research Funds for the Central Universities

Publisher

Association for Computing Machinery (ACM)

Reference98 articles.

1. Toufique Ahmed and Premkumar Devanbu. 2023. Better patching using LLM prompting, via self-consistency. In Proceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering (ASE’23). IEEE, 1742–1746.

2. Conversion of control dependence to data dependence

3. FlowDroid

4. A few billion lines of code later

5. RacerD: compositional static race detection

Cited by 4 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Secure Cryptographic Technology Framework for Data Element Circulation Transactions;2024 IEEE 11th International Conference on Cyber Security and Cloud Computing (CSCloud);2024-06-28

2. Interleaving Static Analysis and LLM Prompting;Proceedings of the 13th ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis;2024-06-20

3. Enchanting Program Specification Synthesis by Large Language Models Using Static Analysis and Program Verification;Lecture Notes in Computer Science;2024

4. CFStra: Enhancing Configurable Program Analysis Through LLM-Driven Strategy Selection Based on Code Features;Lecture Notes in Computer Science;2024

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3