Tests from Traces: Automated Unit Test Extraction for R
Creators
Description
Unit tests are labor-intensive to write and maintain. This paper looks into how well unit tests for a target software package can be extracted from the execution traces of client code. Our objective is to reduce the effort involved in creating test suites while minimizing the number and size of individual tests, and maximizing coverage.To evaluate the viability of our approach, we select a challenging target for automated test extraction, namely R, a programming language that is popular for data science applications. The challenges presented by R are its extreme dynamism, coerciveness, and lack of types. This combination decrease the efficacy of traditional test extraction techniques. We present Genthat, a tool developed over the last couple of years to non-invasively record execution traces of R programs and extract unit tests from those traces. We have carried out an evaluation on 1,545 packages comprising 1.7M linesof code. The tests extracted by Genthat improved code coverage from the original rather low value of 267,496 lines to 700,918 lines.The running time of the generated tests is 1.9 times faster than the code they came from.
Files
issta18.pdf
Files
(287.4 kB)
Name | Size | Download all |
---|---|---|
md5:76725d1cec1a8b02aa23b3c72a0df9fe
|
287.4 kB | Preview Download |