Software Testing Meets Bayesian Workflow: A Literature-Driven Artifact Study of Probabilistic Programs
Oleg Jarma, Maja Dall, Raúl Pardo, Mahsa Varshosaz, Andrzej Wąsowski
Abstract
Automated testing is an effective software quality assurance method, but it is rarely used for probabilistic models. This is despite the heavy use of probabilistic programming for data analytics in research and engineering, where the consequences of errors are dire. A key obstacle is the specification of testable correctness properties for probabilistic models, known as the oracle problem. Like machine learning, probabilistic programming is used precisely where no analytical specification exists: had we been able to write one, we would have written an algorithm instead of fitting a model. An alternative is partial, proxy correctness specifications. The statistics literature already offers many, but as quality guidelines that require human judgment: comparing plots, visually analyzing shapes of distributions, assessing whether parameter values are ''far'' or ''close enough''. These guidelines are not systematically automated. In this work, we elicit, implement, and study testable correctness properties of probabilistic models. We extract 17 broadly applicable properties for probabilistic models from one of the most widely used textbooks in Bayesian data analysis, Statistical Rethinking by McElreath. For each property, we select and implement a test oracle, and study its utility for automatic testing, using a population of 59 probabilistic models from academic and industrial sources. We find realistic use cases (models under test) for all the properties. We observe that the vast majority of tests are not flaky in practice, despite the theoretical potential for flakiness. To the best of our knowledge, we are the first to investigate the effectiveness of mutation testing for probabilistic models, showing that standard mutation operators do not capture faults tracked by the probabilistic properties.
Create a lesson
Related papers
DeepGroundRepair: From API-Grounded Generation to Shape-Aware Repair for Deep Learning Programs
Xiangyue Ma, Zhen Wang, Xuhui Lu et al.
Domain-Knowledge Driven Configuration Tuning of Kubernetes Workloads
Federico Imberti, Luca Cavagnis, Stefano Cereda et al.
When Agent Evaluation Becomes Unreliable: An Empirical Study of Oracle Failures and Configuration-Dependent Measurement in an LLM Agent Benchmark
Junjie Chen
BRQGen: Towards Adaptive Completeness Assessment and Follow-Up Question Generation for Bug Reports
Tevfik Emre Sungur, Akif Emre Köşüş, Uğurcan Doğruçam et al.
Grounding Deep Learning Framework Testing in Data Flow
Jiatao Ge, Yanzhou Mu, Yinglong Zou et al.
A Decade in a Day: Synthesizing Agent-Native Interfaces from Human-Oriented Software Evolution
Alan Wu, Wei Tao, Yiwen Guo