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

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.

Institutions

Publication Details

Journal
Electronic System of Publishing Periodicals (Federal University of Rio Grande do Sul)
Published
2024-09-04
DOI
https://doi.org/10.22456/2175-2745.134925
Primary Topic
Computational Physics and Python Applications
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Electronic System of Publishing Periodicals (Federal University of Rio Grande do Sul)
Computational Physics and Python Applications
article

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

article en

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.

Electronic System of Publishing Periodicals (Federal University of Rio Grande do Sul)
Universidade Federal da Fronteira Sul (BR)
Openalex Percentile: Top 62%
Computational Physics and Python Applications
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.