Tuning Random Generators: Property-Based Testing as Probabilistic Programming
Ryan Tjoa, Poorva Garg, Harrison Goldstein, Todd Millstein, Benjamin Pierce, Guy Van den Broeck

TL;DR
This paper introduces a method for automatically tuning property-based testing generators using probabilistic programming, leading to improved test input distributions and significantly faster bug detection.
Contribution
It presents a novel approach for automatic, offline tuning of generator weights via probabilistic programming, enhancing distribution control and testing efficiency.
Findings
Optimized generator distributions improve bug detection speed by 3.1-7.4x.
The approach effectively targets desired distributions and enhances test diversity.
Empirical results demonstrate the method's effectiveness in real benchmarks.
Abstract
Property-based testing validates software against an executable specification by evaluating it on randomly generated inputs. The standard way that PBT users generate test inputs is via generators that describe how to sample test inputs through random choices. To achieve a good distribution over test inputs, users must tune their generators, i.e., decide on the weights of these individual random choices. Unfortunately, it is very difficult to understand how to choose individual generator weights in order to achieve a desired distribution, so today this process is tedious and limits the distributions that can be practically achieved. In this paper, we develop techniques for the automatic and offline tuning of generators. Given a generator with undetermined symbolic weights and an objective function, our approach automatically learns values for these weights that optimize for the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsEvolutionary Algorithms and Applications · Computability, Logic, AI Algorithms · Logic, programming, and type systems
