Using Relative Lines of Code to Guide Automated Test Generation for Python

03/11/2021
by   Josie Holmes, et al.
0

Raw lines of code (LOC) is a metric that does not, at first glance, seem extremely useful for automated test generation. It is both highly language-dependent and not extremely meaningful, semantically, within a language: one coder can produce the same effect with many fewer lines than another. However, relative LOC, between components of the same project, turns out to be a highly useful metric for automated testing. In this paper, we make use of a heuristic based on LOC counts for tested functions to dramatically improve the effectiveness of automated test generation. This approach is particularly valuable in languages where collecting code coverage data to guide testing has a very high overhead.We apply the heuristic to property-based Python testing using the TSTL (Template Scripting Testing Language) tool. In our experiments, the simple LOC heuristic can improve branch and statement coverage by large margins (often more than 20 fault detection by an even larger margin (usually more than 75 or more). The LOC heuristic is also easy to combine with other approaches, and is comparable to, and possibly more effective than, two well-established approaches for guiding random testing.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/04/2023

SlipCover: Near Zero-Overhead Code Coverage for Python

Coverage analysis is widely used but can suffer from high overhead. This...
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
05/19/2019

Model-based Automated Testing of JavaScript Web Applications via Longer Test Sequences

JavaScript has become one of the most widely used languages for Web deve...
research
02/23/2018

SmartUnit: Empirical Evaluations for Automated Unit Testing of Embedded Software in Industry

In this paper, we aim at the automated unit coverage-based testing for e...
research
06/28/2022

Improving Tese Case Generation for Python Native Libraries Through Constraints on Input Data Structures

Modern Python projects execute computational functions using native libr...
research
08/18/2020

Differential coverage: automating coverage analysis

While it is easy to automate coverage data collection, it is a time cons...
research
04/20/2018

Ticket Coverage: Putting Test Coverage into Context

There is no metric that determines how well the implementation of a tick...

Please sign up or login with your details

Forgot password? Click here to reset