Automated Unit Test Generation for Python

07/28/2020
by   Stephan Lukasczyk, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/09/2021

An Empirical Study of Automated Unit Test Generation for Python

Various mature automated test generation tools exist for statically type...
research
02/10/2022

Pynguin: Automated Unit Test Generation for Python

Automated unit test generation is a well-known methodology aiming to red...
research
12/21/2021

AmPyfier: Test Amplification in Python

Test Amplification is a method to extend handwritten tests into a more r...
research
08/12/2021

Small-Amp: Test Amplification in a Dynamically Typed Language

Test amplification is a novel technique which extends a manually created...
research
07/17/2018

Physical-type correctness in scientific Python

The representation of units and dimensions in informatics systems is bar...
research
05/24/2019

Type-Driven Automated Learning with Lale

Machine-learning automation tools, ranging from humble grid-search to hy...
research
02/14/2020

Lightweight Lexical Test Prioritization for Immediate Feedback

The practice of unit testing enables programmers to obtain automated fee...

Please sign up or login with your details

Forgot password? Click here to reset