Various mature automated test generation tools exist for statically typed programming languages such as Java. Automatically generating 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. Our experiments confirm that evolutionary algorithms can outperform random test generation also in the context of Python, and similar to the Java world, MOSA and DynaMOSA yield the highest coverage results. However, our results demonstrate that there are still fundamental issues, such as inferring type information for code without this information, for test generation for Python to be solved.
翻译:对于静态打字编程语言,如爪哇,有各种成熟的自动测试生成工具。但是,由于Python等动态打字编程语言的动态性质以及缺少类型信息,自动生成测试难度更大。我们的Pynguin框架为Python提供自动单位生成测试。在本文中,我们扩展了我们以前关于Pynguin的工作,以支持Python语言的更多方面,并研究了多种成熟的艺术测试生成算法,即DynMOSA、MIO和MOSA。我们的实验证实,进化算法也可以在Python背景下超越随机生成的随机生成,类似Java世界、MOSA和DynamMOSA,产生最高覆盖结果。然而,我们的结果表明,对于Python的测试生成来说,仍然存在着一些根本性的问题,比如在没有这种信息的情况下为代码推断类型信息。