Roast Publications

Unit Operations for Automated Class Testing

With the advent of object-oriented languages and the portability of Java, the development and use of reusable software components is becoming a reality. Effective component reuse depends on component reliability which in turn depends on thorough testing. The literature, however, provides few approaches to component testing that are practical for the input generation and output checking of the large number of test cases required. In this paper, we present the Roast tool and techniques for the testing of Java classes. Roast includes test case templates to define test cases, a set of four unit operations that facilitate automated class testing, and support for the generation of combinations of boundary values. The tool and techniques are illustrated on a number of non-trivial components, including a non-trivial GUI policy manager, and quantitative results are presented to substantiate the practicality and effectiveness of the approach.

Prose + Test Cases = Specifications

The rise of component-based software development has created a need for API documentation. Experience has shown that it is hard to create and maintain precise and readable documentation. Prose documentation can provide a good overview but lacks precision. Formal methods offer precision but the resulting documentation is expensive to write and modify. Worse, few developers have the skill or inclination to read formal documentation. We present a pragmatic solution to the problem of API documentation. We augment the current prose documentation with test cases, including expected outputs, and use the prose plus the test cases as the documentation. Typically there are one or two simple test cases for each likely question about API behavior. With this approach, the documentation is precise, albeit partial. Consistency between code and documentation is guaranteed by running the test cases. The readability of the test cases is of paramount importance because communication with API users is their primary purpose. We present a test script language that supports compact, readable test cases and generation of test drivers, and illustrate the approach with a detailed case study.