arrow
Return

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

delete2020-09-26
delete4
delete
OA
AI
J
Josie Holmes *
I
Iftekhar Ahmed
C
Caius Brindescu
R
Rahul Gopinath
H
He Zhang
A
Alex Groce
DOI:10.1145/3408896delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
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 article, 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%, up to 40% or more) and improve fault detection by an even larger margin (usually more than 75% and up to 400% 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.
Keywords:
Automated test generation
static code metrics
testing heuristics
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

O
Oregon State University
Scholars:
1.7W
Papers: 1.5W
Citations: 2.4W
University of California System cover
University of California System
Scholars:
37.5W
Papers: 33.7W
Citations: 6.6K
N
Northern Arizona University
Scholars:
4.4K
Papers: 3.6K
Citations: 8.6K
U
university of california irvine
Scholars:
2.3W
Papers: 1.7W
Citations: 55
researcher View more organizations