An Empirical Evaluation of Property-Based Testing in Python
Savitha Ravi, Michael Coblenz
Abstract
Property-based testing (PBT) is a testing methodology with origins in the functional programming community. In recent years, PBT libraries have been developed for non-functional languages, including Python. However, to date, there is little evidence regarding how effective property-based tests are at finding bugs, and whether some kinds of property-based tests might be more effective than others. To gather this evidence, we conducted a corpus study of 426 Python programs that use Hypothesis, Python's most popular library for PBT. We developed formal definitions for 12 categories of property-based test and implemented an intraprocedural static analysis that categorizes tests. Then, we evaluated the efficacy of test suites of 40 projects using mutation testing, and found that on average, each property-based test finds about 50 times as many mutations as the average unit test. We also identified the categories with the tests most effective at finding mutations, finding that tests that look for exceptions, that test inclusion in collections, and that check types are over 19 times more effective at finding mutations than other kinds of property-based tests. Finally, we conducted a parameter sweep study to assess the strength of property-based tests as a function of the number of random inputs generated, finding that 76% of mutations found were found within the first 20 inputs.
CCS Concepts: • Software and its engineering → Correctness; Software notations and tools.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 650ebd48-c046-4e38-9795-1d5939515acfBuilds on4
- Evaluating Fuzz TestingGeorge Klees, Andrew Ruef, Benji Cooper, Shiyi Wei et al.CCS 2018 · 753 citations
- Revisiting the Relationship Between Fault Detection, Test Adequacy Criteria, and Test Set SizeYiqun T. Chen, Rahul Gopinath, Anita Tadakamalla, Michael D. Ernst et al.ASE 2020 · 48 citations
- Property-Based Testing in PracticeHarrison Goldstein, Joseph W. Cutler, Daniel Dickstein, Benjamin C. Pierce et al.ICSE 2024 · 21 citations
- Tyche: Making Sense of PBT EffectivenessHarrison Goldstein, Jeffrey Tao, Zac Hatfield-Dodds, Benjamin C. Pierce et al.UIST 2024 · 4 citations
Related papers
- Hybrid Fault-Driven Mutation Testing for PythonSaba Alimadadi, Golnaz GharachorluICSE 2026
- PropCov: Effective Coverage Reporting for Property-Based TestingJesse Coultas, Joseph Wiseman, Luís PinaISSTA 2026
- General and Practical Property-based Testing for Android AppsYiheng Xiong, Ting Su, Jue Wang, Jingling Sun et al.ASE 2024 · 5 citations
- PyNose: A Test Smell Detector For PythonTongjie Wang, Yaroslav Golubev, Oleg Smirnov, Jiawei Li et al.ASE 2021 · 44 citations
- Fail Faster: Staging and Fast Randomness for High-Performance PBTCynthia Richey, Joseph W. Cutler, Harrison Goldstein, Benjamin C. PierceOOPSLA 2026 · 1 citation
