SEMay 18, 2020

Generating Unit Tests for Documentation

arXiv:2005.08750v221 citations
AI Analysis

This addresses the issue of degraded documentation quality for software developers, though it is incremental as it builds on existing template and artifact generation technologies.

The paper tackled the problem of redundancy and inconsistency between tests and documentation in software projects by introducing DScribe, a tool that generates consistent unit tests and documentation from a single source, achieving 97% automatic generation for exception handling specifications in the Apache Commons IO library.

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. 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.

Code Implementations2 repos
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes