Evolutionary Generative Fuzzing for Differential Testing of the Kotlin Compiler
Preprint
Abstract
Compiler correctness is a cornerstone of reliable software development. However, systematic testing of compilers is infeasible, given the vast space of possible programs and the complexity of modern programming languages. In this context, differential testing offers a practical methodology as it addresses the oracle problem by comparing the output of alternative compilers given the same set of programs as input. In this paper, we investigate the effectiveness of differential testing in finding bugs within the Kotlin compilers developed at JetBrains. We propose a black-box generative approach that creates input programs for the K1 and K2 compilers. First, we build workable models of Kotlin semantic (semantic interface) and syntactic (enriched context-free grammar) language features, which are subsequently exploited to generate random code snippets. Second, we extend random sampling by introducing two genetic algorithms (GAs) that aim to generate more diverse input programs. Our case study shows that the proposed approach effectively detects bugs in K1 and K2; these bugs have been confirmed and (some) fixed by JetBrains developers. While we do not observe a significant difference w.r.t. the number of defects uncovered by the different search algorithms, random search and GAs are complementary as they find different categories of bugs. Finally, we provide insights into the relationships between the size, complexity, and fault detection capability of the generated input programs.Keywords
All Related Versions
This publication has 14 references indexed in Scilit:
- Generating Class-Level Integration Tests Using Call Site InformationIEEE Transactions on Software Engineering, 2022
- SBST Tool Competition 20212021
- V-Fuzz: Vulnerability Prediction-Assisted Evolutionary Fuzzing for Binary ProgramsIEEE Transactions on Cybernetics, 2020
- RESTful API Automated Test Case Generation with EvoMasterACM Transactions on Software Engineering and Methodology, 2019
- An empirical evaluation of evolutionary algorithms for unit test suite generationInformation and Software Technology, 2018
- Automated Test Case Generation as a Many-Objective Optimisation Problem with Dynamic Selection of the TargetsIEEE Transactions on Software Engineering, 2017
- 1600 faults in 100 projects: automatically finding faults while achieving high coverage with EvoSuiteEmpirical Software Engineering, 2013
- An orchestrated survey of methodologies for automated software test case generationJournal of Systems and Software, 2013
- Parameter tuning or default values? An empirical investigation in search-based software engineeringEmpirical Software Engineering, 2013
- A sentence generator for testing parsersBIT Numerical Mathematics, 1972