Beginner's luck: a language for property-based generators
Autor: | Diane Gallois-Wong, John Hughes, Cătălin Hriţcu, Li-yao Xia, Leonidas Lampropoulos, Benjamin C. Pierce |
---|---|
Jazyk: | angličtina |
Předmět: |
FOS: Computer and information sciences
Domain-specific language Theoretical computer science Property (philosophy) Semantics (computer science) Computer science Formal semantics (linguistics) media_common.quotation_subject 02 engineering and technology Semantics computer.software_genre 020204 information systems 0202 electrical engineering electronic engineering information engineering media_common Soundness Computer Science - Programming Languages Programming language Random testing 020207 software engineering Computer Graphics and Computer-Aided Design Predicate (grammar) Luck Completeness (logic) Semantics of logic computer Software Programming Languages (cs.PL) |
Zdroj: | Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages-POPL 2017 POPL |
DOI: | 10.1145/3009837.3009868 |
Popis: | 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. long version of POPL 2017 camera ready with the missing ERC acknowledgements |
Databáze: | OpenAIRE |
Externí odkaz: |