An Empirical Evaluation of Property-Based Testing in Python
Savitha Ravi, Michael Coblenz
摘要
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.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
它引用的顶会 Paper4
- Evaluating Fuzz TestingGeorge Klees, Andrew Ruef, Benji Cooper, Shiyi Wei 等CCS 2018 · 被引用 753 次
- Revisiting the Relationship Between Fault Detection, Test Adequacy Criteria, and Test Set SizeYiqun T. Chen, Rahul Gopinath, Anita Tadakamalla, Michael D. Ernst 等ASE 2020 · 被引用 48 次
- Property-Based Testing in PracticeHarrison Goldstein, Joseph W. Cutler, Daniel Dickstein, Benjamin C. Pierce 等ICSE 2024 · 被引用 21 次
- Tyche: Making Sense of PBT EffectivenessHarrison Goldstein, Jeffrey Tao, Zac Hatfield-Dodds, Benjamin C. Pierce 等UIST 2024 · 被引用 4 次
相关 Paper
- 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 等ASE 2024 · 被引用 5 次
- PyNose: A Test Smell Detector For PythonTongjie Wang, Yaroslav Golubev, Oleg Smirnov, Jiawei Li 等ASE 2021 · 被引用 44 次
- Fail Faster: Staging and Fast Randomness for High-Performance PBTCynthia Richey, Joseph W. Cutler, Harrison Goldstein, Benjamin C. PierceOOPSLA 2026 · 被引用 1 次
