Real-World Fault Detection for C-Extended Python Projects with Automated Unit Test Generation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Berg, Lucas, Krodinger, Lukas, Lukasczyk, Stephan, Panichella, Annibale, Fraser, Gordon, Vanhoof, Wim, Devroey, Xavier
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910043581972480
author Berg, Lucas
Krodinger, Lukas
Lukasczyk, Stephan
Panichella, Annibale
Fraser, Gordon
Vanhoof, Wim
Devroey, Xavier
author_facet Berg, Lucas
Krodinger, Lukas
Lukasczyk, Stephan
Panichella, Annibale
Fraser, Gordon
Vanhoof, Wim
Devroey, Xavier
contents 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. Executing each generated test in an isolated subprocess prevents a crash from halting the test generation process itself. This allows us to (1) detect such faults, (2) generate reproducible crash-revealing test cases for them, (3) allow studying the underlying faults, and (4) enable test generation for non-crashing parts of the code. To evaluate our approach, we created a dataset consisting of 1648 modules from 21 popular Python libraries with C-extensions. Subprocess-execution allowed automated testing of up to 56.5% more modules and discovered 213 unique crash causes, revealing 32 previously unknown faults.
format Preprint
id arxiv_https___arxiv_org_abs_2603_06107
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Real-World Fault Detection for C-Extended Python Projects with Automated Unit Test Generation
Berg, Lucas
Krodinger, Lukas
Lukasczyk, Stephan
Panichella, Annibale
Fraser, Gordon
Vanhoof, Wim
Devroey, Xavier
Software Engineering
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. Executing each generated test in an isolated subprocess prevents a crash from halting the test generation process itself. This allows us to (1) detect such faults, (2) generate reproducible crash-revealing test cases for them, (3) allow studying the underlying faults, and (4) enable test generation for non-crashing parts of the code. To evaluate our approach, we created a dataset consisting of 1648 modules from 21 popular Python libraries with C-extensions. Subprocess-execution allowed automated testing of up to 56.5% more modules and discovered 213 unique crash causes, revealing 32 previously unknown faults.
title Real-World Fault Detection for C-Extended Python Projects with Automated Unit Test Generation
topic Software Engineering
url https://arxiv.org/abs/2603.06107