Automated Unit Test Generation for Python
By Stephan Lukasczyk, Florian Kroiß, Gordon Fraser. 2020
68 citations recorded by the source corpus.
Automated unit test generation is an established research field, and mature test generation tools exist for statically typed programming languages such as Java. It is, however, substantially more difficult to automatically generate supportive tests for dynamically typed programming languages such as Python, due to the lack of type information and the dynamic nature of the language. In this paper, we describe a foray into the problem of unit test generation for dynamically typed languages. We introduce Pynguin, an automated unit test generation framework for Python. Using Pynguin, we aim to empirically shed light on two central questions: (1) Do well-established search-based test generation methods, previously evaluated only on statically typed languages, generalise to dynamically typed languages? (2) What is the influence of incomplete type information and dynamic typing on the problem of automated test generation? Our experiments confirm that evolutionary algorithms can outperform random test generation also in the context of Python, and can even alleviate the problem of absent type information to some degree. However, our results demonstrate that dynamic typing nevertheless poses a fundamental issue for test generation, suggesting future work on integrating type inference.
Subfields: Computational Theory and Mathematics, Computer Networks and Communications, Software, Program Analysis & Verification, Software Engineering
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Computational Theory and Mathematics
In Computer Networks and Communications
In Software
In Program Analysis & Verification
In Software Engineering
Citations in the corpus
- Execution-Based Evaluation for Open-Domain Code Generation (2022, neutral): “@4 @5 @6 @7 @8 @9 @10”
- Pynguin: Automated Unit Test Generation for Python (2022, methodology): “We therefore introduce Pynguin [10], which aims to use search-based test-generation techniques to automatically generate regression tests [22] with high code coverage, without requiring user input.”