Skip to main navigation Skip to search Skip to main content

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
  • *Corresponding author for this work

Research output: Chapter in Book/Conference proceedings/Edited volume › Conference contribution › Scientific › peer-review

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 testgeneration 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.

Original languageEnglish
Title of host publicationProceedings - 2026 IEEE International Conference on Software Testing, Verification and Validation, ICST 2026
Place of PublicationPiscataway, NJ, USA
PublisherIEEE
Pages417-428
Number of pages12
ISBN (Electronic)9798319533081
DOIs
Publication statusPublished - 2026
Event19th IEEE International Conference on Software Testing, Verification and Validation, ICST 2026 - Daejeon, South Korea
Duration: 18 May 2026 → 22 May 2026

Publication series

NameProceedings - 2026 IEEE International Conference on Software Testing, Verification and Validation, ICST 2026

Conference

Conference19th IEEE International Conference on Software Testing, Verification and Validation, ICST 2026
Country/TerritorySouth Korea
CityDaejeon
Period18/05/26 → 22/05/26

Keywords

  • C-Extension
  • Fault Detection
  • Foreign Function Interface
  • Python
  • Subprocess
  • Test Generation

Fingerprint

Dive into the research topics of 'Real-World Fault Detection for C-Extended Python Projects with Automated Unit Test Generation'. Together they form a unique fingerprint.

Cite this