Grammar-based generation and mutation of source code for fuzzing multiple programming languages
Abstract
Multi-language compilers such as GraalVM support the implementation of different programming languages. Testing every programming language implementation is essential to ensure that source code is compiled exactly as specified. Fuzzing, or random testing, tests a system with random inputs. Compiler fuzzing applies this principle to compilers, where random source code is given to the compiler to test for crashes, hangs or miscompilations. A previous project extended GraalVM's fuzzing infrastructure by a simple grammar-based source code generator that produces syntactically and semantically valid source code using an attribute grammar of a programming language. This thesis extends this source code generator with mechanisms to support more language features and increase output quality for fuzzing effectiveness. It extends the type system with compound types such as function types, product types and record types that can model multi-argument methods or classes and structs. Furthermore, this thesis also introduces the liveness constraint, which prevents dead assignments that would be thrown away in early compiler phases. The last contribution is an investigation into whether the same attribute grammar can be used to not only generate, but also mutate source code. Different mutation operations are presented, some working without any changes to the grammar, and also some which might require some additional attributes.
Fields of Study & Subjects
Software Testing and Debugging Techniques
Logic
programming
and type systems
Software Engineering Research
Publication details
- Journal / source
- University Library Linz repository (Johannes Kepler Universitat Linz)
- Publication date
- 1 January 2026
- Language
- EN
- Document type
- Thesis