Automatically Inspecting Thousands of Static Bug Warnings with Large Language Model: How Far Are We?
Top Cited Papers
Open Access
- 19 June 2024
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Knowledge Discovery From Data
- Vol. 18 (7) , 1-34
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 trustworthinessKeywords
Funding Information
- National Natural Science Foundation of China (62372304, 62302375, 62192734)
- China Postdoctoral Science Foundation (2023M723736)
- Fundamental Research Funds for the Central Universities
This publication has 74 references indexed in Scilit:
- A Compositional Deadlock Detector for Android Java2021
- How developers engage with static analysis tools in different contextsEmpirical Software Engineering, 2019
- Performance-Boosting Sparsification of the IFDS Algorithm with Applications to Taint Analysis2019
- SMOKE: Scalable Path-Sensitive Memory Leak Detection for Millions of Lines of Code2019
- State-taint analysis for detecting resource bugsScience of Computer Programming, 2018
- Coccinelle: Tool support for automated CERT C Secure Coding Standard certificationScience of Computer Programming, 2014
- CBMC – C Bounded Model Checker2014
- Why don't software developers use static analysis tools to find bugs?2013
- Infer: An Automatic Program Verifier for Memory Safety of C Programs2011
- Precise interprocedural dataflow analysis with applications to constant propagationTheoretical Computer Science, 1996