Skip to main navigation Skip to search Skip to main content

Beginner's Luck: A Language for Property-Based Generators

  • Leonidas Lampropoulos
  • , Diane Gallois-Wong
  • , Cătălin Hriţcu
  • , John Hughes
  • , Benjamin C. Pierce
  • , Li-yao Xia

Research output: Chapter in Book/Report/Conference proceeding › Conference contribution

Abstract

Property-based random testing à 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.
Original languageEnglish
Title of host publicationProceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages
EditorsGiuseppe Castagna, Andrew D. Gordon
Place of PublicationNew York, NY, USA
PublisherAssociation for Computing Machinery, Inc
Pages114–129
Number of pages16
ISBN (Print)9781450346603
DOIs
Publication statusPublished - 1 Jan 2017
Event44th ACM SIGPLAN Symposium on Principles of Programming Languages 2017 - Paris, France
Duration: 15 Jan 2017 → 21 Jan 2017
https://conf.researchr.org/home/POPL-2017

Publication series

NamePOPL '17
PublisherAssociation for Computing Machinery

Conference

Conference44th ACM SIGPLAN Symposium on Principles of Programming Languages 2017
Abbreviated titlePOPL 2017
Country/TerritoryFrance
CityParis
Period15/01/17 → 21/01/17
Internet address

Keywords / Materials (for Non-textual outputs)

  • random testing
  • property-based testing
  • narrowing
  • domain specific language
  • constraint solving

Fingerprint

Dive into the research topics of 'Beginner's Luck: A Language for Property-Based Generators'. Together they form a unique fingerprint.

Cite this