Branching Processes for QuickCheck Generators
Paper in proceeding, 2018

In QuickCheck (or, more generally, random testing), it is challenging to control random data generators' distributions---specially when it comes to user-defined algebraic data types (ADT). In this paper, we adapt results from an area of mathematics known as branching processes, and show how they help to analytically predict (at compile-time) the expected number of generated constructors, even in the presence of mutually recursive or composite ADTs. Using our probabilistic formulas, we design heuristics capable of automatically adjusting probabilities in order to synthesize generators which distributions are aligned with users' demands. We provide a Haskell implementation of our mechanism in a tool called DRaGeN and perform case studies with real-world applications. When generating random values, our synthesized QuickCheck generators show improvements in code coverage when compared with those automatically derived by state-of-the-art tools.

Testing

QuickCheck

Branching process

Haskell

Author

Claudio Agustin Mista

Universidad Nacional de Rosario

Alejandro Russo

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

John Hughes

Chalmers, Computer Science and Engineering (Chalmers), Functional Programming

Haskell 2018 - Proceedings of the 11th ACM SIGPLAN International Symposium on Haskell, co-located with ICFP 2018

Vol. 53 7 1-13
978-145035835-4 (ISBN)

11th ACM SIGPLAN International Symposium on Haskell, Haskell 2018, co-located with ICFP 2018
St. Louis, USA,

Subject Categories

Computer Engineering

Computer Science

Computer Systems

Areas of Advance

Information and Communication Technology

DOI

10.1145/3242744.3242747

More information

Latest update

4/21/2023