Automatic Unit Test Generation Tool for Python
Pynguin (IPA: ˈpɪŋɡuiːn), the PYthoN General UnIt test geNerator, is a tool that allows developers to generate unit tests automatically.
Pynguin is developed at the Chair of Software Engineering II of the University of Passau.
About
Pynguin is a command line tool written in Python that allows to automatically generate unit tests for Python programs. It aims to remove the burden of crafting tests manually from the developer. For that Pynguin is an extensible tool that allows the implementation of various test-generation approaches; this enables the usage of Pynguin not only for developers but also for researchers.
Quick Links
- Download the source code from GitHub
- Download the project from PyPI
- Read the documentation
- A list of bugs found using Pynguin
News
We list at most the five latest posts here. Consider having a look at our Blog for further posts.
Key Publications on Pynguin
S. Lukasczyk, F. Kroiß, and G. Fraser. An Empirical Study of Automated Unit Test Generation for Python. Empirical Software Engineering 28(2): 36, 2023. DOI: 10.1007/S10664-022-10248-W arXiv:2111.05003
BibTeX entry:
1@Article{journals/ese/LukasczykKF23, 2 author = {Stephan Lukasczyk and Florian Kroi{\ss} and Gordon Fraser}, 3 title = {An empirical study of automated unit test generation for 4 Python}, 5 journal = {Empirical Software Engineering}, 6 volume = {28}, 7 number = {2}, 8 pages = {36}, 9 year = {2023}, 10 doi = {10.1007/S10664-022-10248-W}, 11}
Extends the SSBSE paper on Pynguin by enhancing the description of Pynguin and its implemented algorithms. Furthermore provides an enriched empirical evaluation of Pynguin.
S. Lukasczyk and G. Fraser. Pynguin: Automated Unit Test Generation for Python. In Proceedings of the 44th International Conference on Software Engineering Companion. pp. 168–172. ACM, 2022. DOI: 10.1145/3510454.3516829 arXiv:2202.05218
BibTeX entry:
1@InProceedings{conf/icse/LukasczykF22, 2 author = {Stephan Lukasczyk and Gordon Fraser}, 3 title = {Pynguin: Automated Unit Test Generation for Python}, 4 booktitle = {ICSE'22: Proceedings of the ACM/IEEE 44th International Conference 5 on Software Engineering: Companion Proceedings}, 6 pages = {168--172}, 7 year = {2022}, 8 publisher = {{ACM}}, 9 doi = {10.1145/3510454.3516829}, 10}
Describes Pynguin as a tool, its internal structure and workings, as well as possibilities to enhance it and how to use it.
S. Lukasczyk, F. Kroiß, and G. Fraser. Automated Unit Test Generation for Python. In Proceedings of the 12th Symposium on Search-based Software Engineering. Lecture Notes in Computer Science, vol. 12420, pp. 9–24. Springer, 2020. DOI: 10.1007/978-3-030-59762-7_2. arXiv:2007.14049
BibTeX entry:
1@InProceedings{conf/ssbse/LukasczykKF20, 2 author = {Stephan Lukasczyk and Florian Kroi{\ss} and Gordon Fraser}, 3 title = {Automated Unit Test Generation for Python}, 4 booktitle = {Proceedings of the 12th Symposium on Search-based Software 5 Engineering (SSBSE 2020, Bari, Italy, October 7–8)}, 6 year = {2020}, 7 publisher = {Springer}, 8 series = {Lecture Notes in Computer Science}, 9 volume = {12420}, 10 pages = {9--24}, 11 doi = {10.1007/978-3-030-59762-7\_2}, 12}
The initial publication on Pynguin. Describes test generation with random and whole-suite generation approaches and introduces several challenges to the community.
Publications using Pynguin
This is an incomplete list of publications that use Pynguin. If your work is missing here, drop Stephan a note that he can add it here.
- C. Lemieux, J. P. Inala, S. K. Lahiri, and S. Sen. CodaMosa: Escaping Coverage Plateaus in Test Generation with Pre-trained Large Language Models. Proceedings of the 45th International Conference on Software Engineering. 2023.
- D. Trübenbach, S. Müller, and L. Grunske. A Comparative Evaluation on the Quality of Manual and Automatic Test Case Generation Techniques for Scientific Software—A Case Study of a Python Project for Material Science Workflows. Proceedings of the 15th International Workshop on Search-Based Software Testing. 2022.
Further Links on Pynguin
- ICSE 2022 Demo Extended Video
- ICSE 2022 Demo Short Video
- Podcast episode for Podcast.__init__ on Pynguin
- Discussion thread on Hacker News after publishing Pynguin to GitHub
- SSBSE 2020 Presentation Recording