Computer Science and Artificial Intelligence Laboratory

Automatic Test Case Generation

Manual software testing, in general, and test case generation, in particular, are labor-intensive processes. Automated testing can significantly reduce the cost of software development and maintenance. To automate testing of Java programs, we explore systematic generation of test cases from models of program inputs given as first-order relational formulas in the Alloy Modelling Language.

Properties of Alloy models can be automatically analyzed using the Alloy Analyzer, which finds satisfying assignments for relational formulas by translating the formulas into boolean satisfiability formulas and using off-the-shelf SAT solvers. A satisfying assignment for a formula that relates values of program variables at a control point is simply an assignment of values to these variables such that the formula evaluates to true. Thus, for a formula that expresses a method precondition, a satisfying assignment corresponds to a valid input for the method. This observation forms the basis of the TestEra tool. TestEra implements a novel approach for automatic test case generation: (1) given a method precondition as a formula, generate all nonisomorphic satisfying assignments (within a given bound); (2) concretize these assignments to generate method inputs and execute the method on each input; (3) abstract the method's outputs and verify the correctness of each input/output pair by evaluating a formula that represents the method postcondition.

For more information, visit the MulSaw project page, the MulSaw homepage, or email khurshid@lcs.mit.edu.

Members

Publications

Related Publications