An Empirical Study of Automated Unit Test Generation for Python
Not on the map. Why?
Abstract (arXiv)
Various mature automated test generation tools exist for statically typed programming languages such as Java. Automatically generating unit tests for dynamically typed programming languages such as Python, however, is substantially more difficult due to the dynamic nature of these languages as well as the lack of type information. Our Pynguin framework provides automated unit test generation for Python. In this paper, we extend our previous work on Pynguin to support more aspects of the Python language, and by studying a larger variety of well-established state of the art test-generation algorithms, namely DynaMOSA, MIO, and MOSA. Furthermore, we improved our Pynguin tool to generate regression assertions, whose quality we also evaluate. Our experiments confirm that evolutionary algorithms can outperform random test generation also in the context of Python, and similar to the Java world, DynaMOSA yields the highest coverage results. However, our results also demonstrate that there are still fundamental remaining issues, such as inferring type information for code without this information, currently limiting the effectiveness of test generation for Python.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). First posted on arXiv 9 Nov 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 3; 2024: 3; 2025: 3; 2026: 1.
10 papers.
- 2024CoverUp: Effective High Coverage Test Generation for Pythoncited by 36
- 2024On the Impacts of Contexts on Repository-Level Code Generationcited by 21
- 2023Unit Test Generation using Generative AI : A Comparative Performance Analysis of Autogeneration Toolscited by 13
- 2023The Program Testing Ability of Large Language Models for Codecited by 11
- 2023Automating the Correctness Assessment of AI-generated Code for Security Contextscited by 6
- 2025Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language Modelscited by 1
- 2024Generative Language Models Potential for Requirement Engineering Applications: Insights into Current Strengths and Limitationscited by 0
- 2025Unify and Triumph: Polyglot, Diverse, and Self-Consistent Generation of Unit Tests with LLMscited by 0
- 2025CUBETESTERAI: Automated JUnit Test Generation using the LLaMA Modelcited by 0
- 2026Can LLMs Test Terminal User Interfaces?cited by 0
- 2026Can LLMs Test Terminal User Interfaces?4 Aug 2026
- 2025Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language Models28 Sep 2025
- 2025Unify and Triumph: Polyglot, Diverse, and Self-Consistent Generation of Unit Tests with LLMs20 Mar 2025
- 2025CUBETESTERAI: Automated JUnit Test Generation using the LLaMA Model13 Mar 2025
- 2024Generative Language Models Potential for Requirement Engineering Applications: Insights into Current Strengths and Limitations1 Dec 2024
- 2024On the Impacts of Contexts on Repository-Level Code Generation17 Jun 2024
- 2024CoverUp: Effective High Coverage Test Generation for Python24 Mar 2024
- 2023Unit Test Generation using Generative AI : A Comparative Performance Analysis of Autogeneration Tools17 Dec 2023
- 2023Automating the Correctness Assessment of AI-generated Code for Security Contexts28 Oct 2023
- 2023The Program Testing Ability of Large Language Models for Code9 Oct 2023