Generating Unit Tests for Documentation

Mathieu Nassif, Alexa Hernandez, Ashvitha Sridharan, Martin P. Robillard
5/18/2020
23 citations
cs.SE

Official code: prmr/DScribe-Research (3 stars, Java, last commit 2021-04-21).

Abstract

Software projects capture information in various kinds of artifacts, including source code, tests, and documentation. Such artifacts routinely encode information that is redundant, i.e., when a specification encoded in the source code is also separately tested and documented.

Show full abstract

Without supporting technology, such redundancy easily leads to inconsistencies and a degradation of documentation quality. We designed a tool-supported technique, called DScribe, that leverages redundancy between tests and documentation to generate consistent and checkable documentation and unit tests based on a single source of information. DScribe generates unit tests and documentation fragments based on a novel template and artifact generation technology. By pairing tests and documentation generation, DScribe provides a mechanism to automatically detect and replace outdated documentation. Our evaluation of the Apache Commons IO library revealed that of 835 specifications about exception handling, 85% of them were not tested or correctly documented, and DScribe could be used to automatically generate 97% of the tests and documentation.

View on arXivView PDF

Code Implementations(1)

Data artifact for research on unit test generation for documentation

30JavaMay 14, 20205 years agoNOASSERTION

Similar Papers

Cite this paper

@article{nassif2020generating,
  title  = {Generating Unit Tests for Documentation},
  author = {Mathieu Nassif and Alexa Hernandez and Ashvitha Sridharan and Martin P. Robillard},
  year   = {2020},
  eprint = {2005.08750},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2005.08750}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2005.08750.svg)](https://codeofpaper.com/paper/2005.08750)

Discussion