:: End of manually writing unit tests. Why not generate test cases automatically and smartly?

CUTE :: A Concolic Unit Testing Engine for C and Java

Open System Laboratory | Computer Science Department | University of Illinois at Urbana Champaign

Please read before you download

  • The distribution does not contain support for instrumentation of library classes provided with JDK. The limitation is due to licensing issues. If you need to instrument JDK classes please contact us.
  • You need to tweak the various parameters of jCUTE to get optimal branch coverage and optimal running time. The default values do not ensure optimal branch coverage and optimal running time. Please contact us if you want to do some comparative study.

Download

jCUTE (CUTE for Java) can be downloaded here.

Requirement

windows 2000, XP with cygwin (optional) or Linux
Java 1.4 or above from http://java.sun.com/
bash shell (optional)

Release Notes

1.0.1
Released on 29th June, 2006.
  • Extended to symbolically handle values of type boolean, float, and double.
  • Fixed bug associated with JUnit test generation.
  • Fixed bug associated with the Kill button.
  • Partially upgraded to handle Java 1.5.
  • Increased memory to be used by SOOT to avoid getting "out of memory" error.
1.0
First release of jCUTE

Installation

Make sure that java and javac is in the PATH. Untar the distribution in a directory whose path has no space. For example, do not untar the distribution in C:\Program Files\; the path of this directory has a space. Try untaring it in C:\ .
tar zxvf jcute.tar.gz
cd jcute
./setup
You can run setup from a bash shell only. This is possible if you are using a linux desktop or a cygwin shell. Running setup provides you the command line scripts jcute and jcutec. If you have run setup, then the case studies can be executed by running
./runtests
./jpf_case_studies
./dtests
If you are only interested in the graphical user interface, then simply run jcutegui.bat in windows and jcutegui in linux as follows:
.\jcutegui.bat
or run
jcutegui
The src/ directory contains a number of examples. See the script runtests to know how to run these examples.

Graphical User Interface

In the Graphical user Interface, try selecting the directory src/ and the Java program tests/SwitchTest.java. Then "Compile" and "(Re)start" for testing. Click on a Path # to get Input and Trace log. To learn more about the graphical user interface, check out a flash demo here.

Command line Usage

jcutec is the instrumentor plus compiler script for concurrent Java programs under test.

jcute is the script to concolically test the executable of the instrumented program under test.

usage: ./jcutec source-directory main-java-file main-java-class [-concurrent|-sequential]
where  source-directory is the directory containing the sources of the Java program to be tested
    main-java-file is the name of the Java source file containing the main function
    main-java-class is the name of the class of the Java source file containing the main function
For example, to compile and instrument the Demo example in the directory src/tests in the package tests
./jcutec src/ src/tests/BSTree.java tests.BSTree -sequential
usage: ./jcute class [-i iterations] [-?] [-d depth=0] [-s seed] [-t debug_level=0] [-m mode=0] [-r] [-q] [-p] [-a] [-j] [-v] [-n number]

class is the name of the class corresponding to the Java source file containing the main function

-help,-?                displays help information
-d     Depth of search. Default is 0, which implies infinite depth
-s     Seed for random number generator in case -r option is given. Default is current system time.
-t     Various debug information and statistics. Default is 0 (no debug information printed).
        1 print trace of instrumentation function call's entry and exit.
        2 print info about instrumented function call inserted for concurrency.
        4 print input map after reading from disk.
        8 print history at every history change.
        16 print symbolic state at every state change.
        32 print path contraint whenever path constraint is updated.
        64 print old and new history at the end of execution.
        128 print old and new input map at the end of the execution.
        256 print path constraint at the end of the excution.
        512 print line number executed.
-m 

        0 - next path (depends on history),
        1 - replay last execution,
        2 - start fresh execution without looking at any history. Default is 0.
-r                      if -r is specified, inputs are randomly
                        initialized; else, inputs are set to 0. Objects are initialized to null in either cases.
-p 
                        search strategy to be invoked: 1 is DFS, 3 is quick, 4 is random (default). 
-a                      turn off Optimal Distrubuted Search
-j                      generate JUnit test cases
-v                      logs inputs and trace of execution
-n     Pass a single integer argument
For example, to test the Demo example run
./jcute tests.BSTree
To see the statistics about branch coverage and running time, execute
java  -classpath jcute.jar cute.concolic.BranchCoverage

Technical Support

Contact Koushik Sen (ksen@cs.uiuc.edu)

Copyright © 2006 University of Illinois at Urbana Champaign. All rights Reserved