TITLE:
Obsidian: Pattern-Based Unit Test Implementations
AUTHORS:
James Bowring, Hunter Hegler
KEYWORDS:
Unit-Testing; Automated Testing; Testing Tool
JOURNAL NAME:
Journal of Software Engineering and Applications,
Vol.7 No.2,
February
14,
2014
ABSTRACT:
There exist many automated unit test-generator
tools for Java with the primary task of generating test cases, comprised of
inputs and a corresponding oracle, each of which is explicitly paired with a
specific supporting test implementation. The authors posit that this explicit
pairing, or conflating, of test implementation with test case is unnecessary
and counter-productive. The authors address this problem by separating the conflated
concerns into two distinct tasks: 1) instantiating test implementations and 2)
instantiating test cases. This paper focuses on automating the first task in
support of the second with the goal of freeing the test engineer to concentrate
on test case instantiation. The authors present a new open-source
test-preparation tool Obsidian that produces robust, comprehensive, and
maintainable unit test implementations. Obsidian, built on the JUnit framework,
uses a set of context patterns and associated algorithms
combined with information from the Java Reflection API to generate these unit
test implementations from Java byte code. These context patterns guide Obsidian
to prepare test implementations that guarantee compilation, support exception
handling, enable multiple test cases when required, and provide a suitable
location for assertions about the test case outcome(s). Obsidian supports regression
testing and test-driven development through its novel audits of the testing
process.