CPL - Chalmers Publication Library
| Utbildning | Forskning | Styrkeområden | Om Chalmers | In English In English Ej inloggad.

Beginner's luck: a language for property-based generators

Leonidas Lampropoulos ; Diane Gallois-Wong ; Cătălin Hriţcu ; John Hughes (Institutionen för data- och informationsteknik, Programvaruteknik (Chalmers)) ; Benjamin C. Pierce ; Li-yao Xia
Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (ACM SIGPLAN NOTICES) (0362-1340). Vol. 52 (2017), 1, p. 114-129.
[Konferensbidrag, refereegranskat]

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.

Nyckelord: random testing; property-based testing; narrowing; constraint solving; domain specific language



Den här publikationen ingår i följande styrkeområden:

Läs mer om Chalmers styrkeområden  

Denna post skapades 2017-02-03. Senast ändrad 2017-09-28.
CPL Pubid: 247987

 

Läs direkt!


Länk till annan sajt (kan kräva inloggning)