Universität Passau
Automated Unit Test Generation for the Python Programming Language
Abstract
dc:description.abstractAutomated unit test generation is an attempt to minimise the effort of manually writing test cases for a software system from the developers. The Python programming language imposes additional challenges to the test-generation problem, such as the dynamic typing. Previous work has confirmed that type information is beneficial for a test generator. However, the type information is often not available. This thesis provides a comprehensive overview over the Pynguin test-generation framework for Python. Pynguin aims to generate high-coverage unit tests for Python libraries using state-of-the-art evolutionary algorithms. We provide an up-to-date description of the Pynguin framework reflecting its recent advances. Furthermore, we target two previously identified open research problems: (1) The used evolutionary algorithms provide many hyperparameters that allow the user to configure them. It is, however, not clear what the optimal values for these parameters are, thus, tools provide default values that are not necessarily backed by empirical evidence, to allow off-the-shelf usage. We overcome this limitation by tuning the DynaMOSA and MIO test-generation algorithms as implemented in Pynguin with two tuning algorithms: differential evolution and grid search. (2) To deal with lacking type information, we propose type tracing, an approach that extracts type-related information during test-case execution and gradually refines the available type information. For hyperparameter tuning, we were able to show that the default values used for Pynguin’s DynaMOSA algorithm were indeed not optimal. Furthermore, using differential evolution as a tuning algorithm outperforms grid search for tuning both in terms of providing the best result from tuning as well as consuming fewer resources. For type tracing, our approach leads to improved branch coverage and mutation score, and to type information of similar quality to what is produced by other state-of-the-art type-inference tools.
Degree
thesis:*- Level thesis:degree_level
- thesis.doctoral
- Grantor dc:publisher
- Universität Passau
- Year
- 2026
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Lukasczyk, Stephan
- Contributors dc:contributor
-
- Fraser, Gordon
- Gay, Gregory
Subjects
dc:subject × 3Rights
dc:rights- Statement dc:rights
-
- Creative Commons - CC BY - Namensnennung 4.0 International
Identifiers
dc:identifier.*- Repository record source_url
- https://opus4.kobv.de/opus4-uni-passau/frontdoor/index/index/docId/2109
- OAI identifier oai:identifier
- oai:kobv.de-opus4-uni-passau:2109