An empirical study of automated unit test generation for Python
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...
Saved in:
| Published in | Empirical software engineering : an international journal Vol. 28; no. 2; p. 36 |
|---|---|
| Main Authors | , , |
| Format | Journal Article |
| Language | English |
| Published |
New York
Springer US
01.03.2023
Springer Nature B.V |
| Subjects | |
| Online Access | Get full text |
| ISSN | 1382-3256 1573-7616 1573-7616 |
| DOI | 10.1007/s10664-022-10248-w |
Cover
| Summary: | 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. |
|---|---|
| Bibliography: | ObjectType-Article-1 SourceType-Scholarly Journals-1 ObjectType-Feature-2 content type line 14 |
| ISSN: | 1382-3256 1573-7616 1573-7616 |
| DOI: | 10.1007/s10664-022-10248-w |