Abstract:
Testing is an integral part of the development of compilers and other language processors. To automatically create large sets of test programs, random program generators,...Show MoreMetadata
Abstract:
Testing is an integral part of the development of compilers and other language processors. To automatically create large sets of test programs, random program generators, or fuzzers, have emerged. Unfortunately, existing approaches are either language-specific (and thus require a rewrite for each language) or may generate programs that violate rules of the respective programming language (which limits their usefulness). This work introduces *Smith, a language-agnostic framework for the generation of valid, compilable test programs. It takes as input an abstract attribute grammar that specifies the syntactic and semantic rules of a programming language. It then creates test programs that satisfy all these rules. By aggressively pruning the search space and keeping the construction as local as possible, *Smith can generate huge, complex test programs in short time. We present four case studies covering four real-world programming languages (C, Lua, SQL, and SMT-LIB 2) to show that *Smith is both efficient and effective, while being flexible enough to support programming languages that differ considerably. We found bugs in all four case studies. For example, *Smith detected 165 different crashes in older versions of GCC and LLVM. *Smith and the language grammars are available online.
Published in: 2020 IEEE 13th International Conference on Software Testing, Validation and Verification (ICST)
Date of Conference: 24-28 October 2020
Date Added to IEEE Xplore: 05 August 2020
ISBN Information:
Print on Demand(PoD) ISSN: 2159-4848