Work

A Random Generation of Haskell Programs Applied to Optimization Testing in Compilers

Year: 2024
Type: article
Abstract: Compilers and interpreters are essential for developing any system or application, so validating their functionality and properties is crucial. These tools are susceptible to failures, like any software artifact, which can introduce errors into programs developed using them. For example, a compiler or interpreter error that alters a program’s behavior can compromise a critical system, and the system impact can be costly. The literature reports several problems found in compilers and interpreters of different languages. When bugs are detected in early releases, they can be reported to the development team, who can fix them before the end user notices the problem. This work describes the procedure used to generate random Haskell programs, which serve as input for property-based tests. More specifically, this work aims to test the compilation and behavior properties of a program, comparing the compilation and execution results of programs generated with different levels of optimization of the Glasgow Haskell Compiler (GHC). From developing a tool that automates the tests, 10,000 random programs were generated, compiled, and executed, of which 57 presented compilation errors with different optimization levels. This result demonstrates that the used approach is promising for error detection and can be improved in further studies.
Authors: Graeff, Guilherme, Mello, Braulio, Duarte, Denio, Braga, Andrei, Braga, Sampaio, Feitosa, Samuel
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W6926468879
FWCI:
Cites:
Cited by:
Related to: