Beginner's Luck: A Language for Random Generators - INRIA - Institut National de Recherche en Informatique et en Automatique Accéder directement au contenu
Communication Dans Un Congrès Année : 2017

Beginner's Luck: A Language for Random Generators

Résumé

Property-based random testing a la QuickCheck requires building efficient generators for well-distributed random data satisfying complex logical predicates, but writing these generators can be difficult and error prone. We propose a domain-specific language in which generators are conveniently expressed by decorating predicates with lightweight annotations to control both the distribution of generated values and the amount of constraint solving that happens before each variable is instantiated. This language, called Luck, makes generators easier to write, read, and maintain. We give Luck a formal semantics and prove several fundamental properties, including the soundness and completeness of random generation with respect to a standard predicate semantics. We evaluate Luck on common examples from the property-based testing literature and on two significant case studies, showing that it can be used in complex domains with comparable bug-finding effectiveness and a significant reduction in testing code size compared to handwritten generators.

Dates et versions

hal-01424793 , version 1 (02-01-2017)

Identifiants

Citer

Leonidas Lampropoulos, Diane Gallois-Wong, Cătălin Hriţcu, John Hughes, Benjamin C. Pierce, et al.. Beginner's Luck: A Language for Random Generators. 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL), 2017, Paris, France. pp.114-129, ⟨10.1145/3009837.3009868⟩. ⟨hal-01424793⟩
159 Consultations
0 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More