TestEra-ASE-J - TestEra: Specification-based Testing of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: TestEra: Specification-based Testing of Java Programs Using SAT Sarfraz Khurshid and Darko Marinov ( { khurshid,marinov } @lcs.mit.edu ) MIT Lab for Computer Science, 200 Technology Square, Cambridge, MA 02139 Abstract. TestEra is a framework for automated specification-based testing of Java programs. TestEra requires as input a Java method (in sourcecode or byte- code), a formal specification of the pre- and post-conditions of that method, and a bound that limits the size of the test cases to be generated. Using the methods pre-condition, TestEra automatically generates all nonisomorphic test inputs up to the given bound. It executes the method on each test input, and uses the method postcondition as an oracle to check the correctness of each output. Specifications are first-order logic formulae. As an enabling technology, TestEra uses the Alloy toolset, which provides an automatic SAT-based tool for analyzing first-order logic formulae. We have used TestEra to check several Java programs including an architecture for dynamic networks, the Alloy-alpha analyzer, a fault-tree analyzer, and methods from the Java Collection Framework. 1. Introduction Manual software testing, in general, and test data generation, in partic- ular, are labor-intensive processes. Automated testing can significantly reduce the cost of software development and maintenance [6]. This pa- per describes TestEra, a framework for automated specification-based testing of Java programs. TestEra requires as input a Java method (in sourcecode or bytecode), a formal specification of the pre- and post- conditions of that method, and a bound that limits the size of the test cases to be generated; a test input is within a bound of k if at most k objects of any given class appear in it. Using the methods pre-condition, TestEra automatically generates all nonisomorphic test inputs up to the given bound. TestEra executes the method on each test input, and uses the method postcondition as a test oracle to check the correctness of each output. Specifications are first-order logic formulae. As an enabling technol- ogy, TestEra uses the Alloy toolset. Alloy [25] is a first-order declarative language based on sets and relations. The Alloy Analyzer [27] is a fully automatic tool that finds instances of Alloy specifications: an instance assigns values to the sets and relations in the specification such that all formulae in the specification evaluate to true. c 2004 Kluwer Academic Publishers. Printed in the Netherlands. 2 Khurshid and Marinov The key idea behind TestEra is to automate testing of Java pro- grams, requiring only that the structural invariants of inputs and the correctness criteria for the methods be formally specified, but not the body of the methods themselves. This is in contrast to previous work [30] on analyzing a naming architecture, we modeled both inputs and com- putation in Alloy. We discovered that manually modeling imperative computation is complicated due to Alloys declarative nature and lack...
View Full Document

Page1 / 38

TestEra-ASE-J - TestEra: Specification-based Testing of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online