Generating Random Structurally Rich Algebraic Data Type Values
Paper in 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

Haskell

Author

Claudio Agustin Mista

Chalmers, Computer Science and Engineering (Chalmers), Information Security

Alejandro Russo

Chalmers, Computer Science and Engineering (Chalmers), Information Security

Proceedings - 2019 IEEE/ACM 14th International Workshop on Automation of Software Test, AST 2019

48-54 8822136
978-1-7281-2237-3 (ISBN)

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

WebSec: Securing Web-driven Systems

Swedish Foundation for Strategic Research (SSF) (RIT17-0011), 2018-03-01 -- 2023-02-28.

Octopi: Säker Programering för Sakernas Internet

Swedish Foundation for Strategic Research (SSF) (RIT17-0023), 2018-03-01 -- 2023-02-28.

Areas of Advance

Information and Communication Technology

Subject Categories

Bioinformatics (Computational Biology)

Computer Science

Computer Systems

DOI

10.1109/AST.2019.00013

More information

Latest update

3/21/2023