Real-World Fault Detection for C-Extended Python Projects with Automated Unit Test Generation
Lucas Berg, Lukas Krodinger, Stephan Lukasczyk, Annibale Panichella, Gordon Fraser, Wim Vanhoof, Xavier Devroey

TL;DR
This paper enhances automated Python testing for C-extensions by executing tests in isolated subprocesses, enabling fault detection, reproducibility, and coverage of non-crashing code parts, thus improving fault detection in real-world projects.
Contribution
It adapts an existing test generation tool to subprocess execution, allowing detection and reproduction of faults caused by C-extensions in Python, which was previously challenging.
Findings
Detected 213 unique crash causes, including 32 new faults.
Automated testing coverage increased by up to 56.5%.
Enabled reproducible crash-revealing test cases.
Abstract
Many popular Python libraries use C-extensions for performance-critical operations allowing users to combine the best of the two worlds: The simplicity and versatility of Python and the performance of C. A drawback of this approach is that exceptions raised in C can bypass Python's exception handling and cause the entire interpreter to crash. These crashes are real faults if they occur when calling a public API. While automated test generation should, in principle, detect such faults, crashes in native code can halt the test process entirely, preventing detection or reproduction of the underlying errors and inhibiting coverage of non-crashing parts of the code. To overcome this problem, we propose separating the generation and execution stages of the test-generation process. We therefore adapt Pynguin, an automated test case generation tool for Python, to use subprocess-execution.…
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
TopicsSoftware Testing and Debugging Techniques · Software Engineering Research · Software System Performance and Reliability
