Affiliation:
1. Lund University, Sweden
Abstract
Static checker frameworks support software developers by automatically discovering bugs that fit general-purpose bug patterns. These frameworks ship with hundreds of detectors for such patterns and allow developers to add custom detectors for their own projects. However, existing frameworks generally encode detectors in imperative specifications, with extensive details of not only
what
to detect but also
how
. These details complicate detector maintenance and evolution, and also interfere with the framework’s ability to change how detection is done, for instance, to make the detectors incremental.
In this paper, we present JavaDL, a Datalog-based declarative specification language for bug pattern detection in Java code. JavaDL seamlessly supports both exhaustive and incremental evaluation from the same detector specification. This specification allows developers to describe local detector components via
syntactic pattern matching
, and nonlocal (e.g., interprocedural) reasoning via
Datalog-style logical rules
.
We compare our approach against the well-established SpotBugs and Error Prone tools by re-implementing several of their detectors in JavaDL. We find that our implementations are substantially smaller and similarly effective at detecting bugs on the Defects4J benchmark suite, and run with competitive runtime performance. In our experiments, neither incremental nor exhaustive analysis can consistently outperform the other, which highlights the value of our ability to transparently switch execution modes. We argue that our approach showcases the potential of
clear-box static checker frameworks
that constrain the bug detector specification language to enable the framework to adapt and enhance the detectors.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. An empirical study on bug severity estimation using source code metrics and static analysis;Journal of Systems and Software;2024-11
2. Clog: A Declarative Language for C Static Code Checkers;Proceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction;2024-02-17
3. PyBugHive: A Comprehensive Database of Manually Validated, Reproducible Python Bugs;IEEE Access;2024
4. JFeature: Know Your Corpus;2022 IEEE 22nd International Working Conference on Source Code Analysis and Manipulation (SCAM);2022-10