PET: Partial Evaluation-based Test Case Generator for Bytecode

In order to start using it straight away, you can either go to the Web interface tab and follow the instructions there provided, or download the tool following the instructions in the Download tab.

PET is a research prototype which aims at automatically generating test cases from Java bytecode programs by relying on the technique of partial evaluation. The system receives as input a bytecode program and a set of optional parameters, including a description of a coverage criterion; and yields as output a set of test cases which guarantee that the selected coverage criterion is achieved and, optionally, a test case generator.

The test case generation process consists of two phases. (1) The decompilation of bytecode into a Constraint Logic Program (CLP). The advantage of decompiling to CLP is that it handles most of the required constraints for free. (2) The generation of test-case generators from CLP decompiled bytecode. To carry out this phase, PET integrates a CLP partial evaluator which is able to solve the constraint system, in much the same way as a symbolic abstract machine would do. A unique feature of PET is that the test case generators it produces are CLP programs whose execution in CLP returns further test-cases on demand without the need to start the process from scratch. Another important feature of PET is that by using different control strategies of the partial evaluator we can obtain different degrees of coverage.

The PET system currently has three interfaces:

  1. The PET command line: This is the basic interface on which the other interfaces rely on.
  2. The PET web interface: This allows users to try out the system on a set of representative examples, without the need of installing it. It is also possible to upload new Java bytecode programs.
  3. The jPET eclipse plugin: This is the newest (and recommended) interface of PET. It includes many features like: graphical representation of the test-cases (including the objects and arrays involved), test-cases trace colouring, parsing of preconditions written in JML, etc.