Generating Random Structurally Rich Algebraic Data Type Values
Paper i proceeding, 2019

Automatic generation of random values described by algebraic data types (ADTs) is often a hard task. State-of-the-art random testing tools can automatically synthesize random data generators based on ADTs definitions. In that manner, generated values comply with the structure described by ADTs, something that proves useful when testing software which expects complex inputs. However, it sometimes becomes necessary to generate structural richer ADTs values in order to test deeper software layers. In this work we propose to leverage static information found in the codebase as a manner to improve the generation process. Namely, our generators are capable of considering how programs branch on input data as well as how ADTs values are built via interfaces. We implement a tool, responsible for synthesizing generators for ADTs values while providing compiletime guarantees about their distributions. Using compile-time predictions, we provide a heuristic that tries to adjust the distribution of generators to what developers might want. We report on preliminary experiments where our approach shows encouraging results.

algebraic data types

random testing



Claudio Agustin Mista

Chalmers, Data- och informationsteknik, Informationssäkerhet

Alejandro Russo

Chalmers, Data- och informationsteknik, Informationssäkerhet

14th IEEE/ACM International Workshop on Automation of Software Test
Montreal, Canada,

WebSec: Säkerhet i webb-drivna system

Stiftelsen för Strategisk forskning (SSF), 2018-03-01 -- 2023-02-28.

Octopi: Säker Programering för Sakernas Internet

Stiftelsen för Strategisk forskning (SSF), 2018-03-01 -- 2023-02-28.


Informations- och kommunikationsteknik


Bioinformatik (beräkningsbiologi)

Datavetenskap (datalogi)


Mer information