DeepTC-Enhancer

Improving the Readability of Automatically Generated Tests

Conference Paper (2020)
Author(s)

Devjeet Roy (Washington State University Pullman)

Ziyi Zhang (Washington State University Pullman)

Maggie Ma (Infra Supply Chain and Automation)

Venera Arnaoudova (Washington State University Pullman)

A. Panichella (TU Delft - Software Engineering)

Sebastiano Panichella (Zurich University of Applied Science (ZHAW))

Danielle Gonzalez (Rochester Institute of Technology)

Mehdi Mirakhorli (Rochester Institute of Technology)

Research Group
Software Engineering
Copyright
© 2020 Devjeet Roy, Ziyi Zhang, Maggie Ma, Venera Arnaoudova, A. Panichella, Sebastiano Panichella, Danielle Gonzalez, Mehdi Mirakhorli
DOI related publication
https://doi.org/10.1145/3324884.3416622
More Info
expand_more
Publication Year
2020
Language
English
Copyright
© 2020 Devjeet Roy, Ziyi Zhang, Maggie Ma, Venera Arnaoudova, A. Panichella, Sebastiano Panichella, Danielle Gonzalez, Mehdi Mirakhorli
Research Group
Software Engineering
Bibliographical Note
Accepted author manuscript@en
Pages (from-to)
287-298
ISBN (print)
978-1-7281-7281-1
ISBN (electronic)
978-1-4503-6768-4
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

Automated test case generation tools have been successfully proposed to reduce the amount of human and infrastructure resources required to write and run test cases. However, recent studies demonstrate that the readability of generated tests is very limited due to (i) uninformative identifiers and (ii) lack of proper documentation. Prior studies proposed techniques to improve test readability by either generating natural language summaries or meaningful methods names. While these approaches are shown to improve test readability, they are also affected by two limitations: (1) generated summaries are often perceived as too verbose and redundant by developers, and (2) readable tests require both proper method names but also meaningful identifiers (within-method readability). In this work, we combine template based methods and Deep Learning (DL) approaches to automatically generate test case scenarios (elicited from natural language patterns of test case statements) as well as to train DL models on path-based representations of source code to generate meaningful identifier names. Our approach, called DeepTC-Enhancer, recommends documentation and identifier names with the ultimate goal of enhancing readability of automatically generated test cases. An empirical evaluation with 36 external and internal developers shows that (1) DeepTC-Enhancer outperforms significantly the baseline approach for generating summaries and performs equally with the baseline approach for test case renaming, (2) the transformation proposed by DeepTC-Enhancer results in a significant increase in readability of automatically generated test cases, and (3) there is a significant difference in the feature preferences between external and internal developers.

Files

2020_ASE_DeepTC.pdf
(pdf | 1.17 Mb)
License info not available