Obsidian: Pattern-Based Unit Test Implementations

HTML  Download Download as PDF (Size: 590KB)  PP. 94-103  
DOI: 10.4236/jsea.2014.72011    4,585 Downloads   6,821 Views  Citations

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.

Share and Cite:

J. Bowring and H. Hegler, "Obsidian: Pattern-Based Unit Test Implementations," Journal of Software Engineering and Applications, Vol. 7 No. 2, 2014, pp. 94-103. doi: 10.4236/jsea.2014.72011.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.