Tuning Random Generators: Property-Based Testing as Probabilistic Programming
Ryan Tjoa, Poorva Garg, Harrison Goldstein, Todd D. Millstein, Benjamin C. Pierce, Guy Van den Broeck
摘要
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 objective. We describe useful objective functions that allow users to ( 1) target desired distributions and (2) improve the diversity and validity of their test cases. We have implemented our approach in a novel discrete probabilistic programming system, Loaded Dice, that supports differentiation and parameter learning, and use it as a language for generators. We empirically demonstrate that our approach is effective at optimizing generator distributions according to the specified objective functions. We also perform a thorough evaluation on PBT benchmarks, demonstrating that, when automatically tuned for diversity and validity, the generators exhibit a 3.1-7.4× speedup in bug finding.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper2
- GradInf: Gradient Estimation as Probabilistic InferenceGaurav Arya, Mathieu Huot, Moritz Schauer, Alexander K. Lew 等PLDI 2026
- Testing Theorems, Fully AutomaticallySegev Elazar Mittelman, Harrison Goldstein, Leonidas LampropoulosOOPSLA 2026
它引用的顶会 Paper11
- Scaling exact inference for discrete probabilistic programsSteven Holtzen, Guy Van den Broeck, Todd D. MillsteinOOPSLA 2020 · 被引用 85 次
- Automatic Differentiation of Programs with Discrete RandomnessGaurav Arya, Moritz Schauer, Frank Schäfer, Christopher RackauckasNeurIPS 2022 · 被引用 56 次
- Input invariantsDominic Steinhöfel, Andreas ZellerFSE 2022 · 被引用 47 次
- Scallop: A Language for Neurosymbolic ProgrammingZiyang Li, Jiani Huang, Mayur NaikPLDI 2023 · 被引用 38 次
- Quickly generating diverse valid test inputs with reinforcement learningSameer Reddy, Caroline Lemieux, Rohan Padhye, Koushik SenICSE 2020 · 被引用 30 次
相关 Paper
- Fail Faster: Staging and Fast Randomness for High-Performance PBTCynthia Richey, Joseph W. Cutler, Harrison Goldstein, Benjamin C. PierceOOPSLA 2026 · 被引用 1 次
- The Search for Constrained Random GeneratorsHarrison Goldstein, Hila Peleg, Cassia Torczon, Daniel Sainati 等PLDI 2026 · 被引用 1 次
- Does a Program Yield the Right Distribution? - Verifying Probabilistic Programs via Generating FunctionsMingshuai Chen, Joost-Pieter Katoen, Lutz Klinkenberg, Tobias WinklerCAV 2022 · 被引用 14 次
- Programming and execution models for parallel bounded exhaustive testingNader Al Awar, Kush Jain, Christopher J. Rossbach, Milos GligoricOOPSLA 2021 · 被引用 4 次
- Property-Based Testing in PracticeHarrison Goldstein, Joseph W. Cutler, Daniel Dickstein, Benjamin C. Pierce 等ICSE 2024 · 被引用 21 次
