How to Build Static Checking Systems Using Orders of Magnitude Less Code
Authors:
Open Access
- 25 March 2016
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 143-157
Abstract
Modern static bug finding tools are complex. They typically consist of hundreds of thousands of lines of code, and most of them are wedded to one language (or even one compiler). This complexity makes the systems hard to understand, hard to debug, and hard to retarget to new languages, thereby dramatically limiting their scope. This paper reduces checking system complexity by addressing a fundamental assumption, the assumption that checkers must depend on a full-blown language specification and compiler front end. Instead, our program checkers are based on drastically incomplete language grammars ("micro-grammars") that describe only portions of a language relevant to a checker. As a result, our implementation is tiny-roughly 2500 lines of code, about two orders of magnitude smaller than a typical system. We hope that this dramatic increase in simplicity will allow people to use more checkers on more systems in more languages. We implement our approach in μchex, a language-agnostic framework for writing static bug checkers. We use it to build micro-grammar based checkers for six languages (C, the C preprocessor, C++, Java, JavaScript, and Dart) and find over 700 errors in real-world projects.Keywords
Funding Information
- Defense Advanced Research Projects Agency (1190029-276707)
This publication has 35 references indexed in Scilit:
- A few billion lines of code laterCommunications of the ACM, 2010
- Context- and path-sensitive memory leak detectionACM SIGSOFT Software Engineering Notes, 2005
- SLAM and Static Driver Verifier: Technology Transfer of Formal Methods inside Microsoft2004
- CCuredACM SIGPLAN Notices, 2002
- NPI licensing, Strawson entailment, and context dependencyJournal of Semantics, 1999
- Software Model Checking1999
- Reduced instruction set computersCommunications of the ACM, 1985
- End-to-end arguments in system designACM Transactions on Computer Systems, 1984
- SELECT—a formal system for testing and debugging programs by symbolic executionACM SIGPLAN Notices, 1975
- The UNIX time-sharing systemCommunications of the ACM, 1974