Generating Unit Tests for Documentation
Preprint
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. 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.Keywords
All Related Versions
This publication has 7 references indexed in Scilit:
- Automated API Property Inference TechniquesIEEE Transactions on Software Engineering, 2012
- Mutation-Driven Generation of Unit Tests and OraclesIEEE Transactions on Software Engineering, 2011
- A REVIEW OF DESIGN PATTERN MINING TECHNIQUESInternational Journal of Software Engineering and Knowledge Engineering, 2009
- Static Specification Mining Using Automata-Based AbstractionsIEEE Transactions on Software Engineering, 2008
- JCrasher: an automatic robustness tester for JavaSoftware: Practice and Experience, 2004
- How software engineers use documentation: the state of the practiceIEEE Software, 2003
- Recovering traceability links between code and documentationIEEE Transactions on Software Engineering, 2002