Menu

Korat2015

Kilnagar Bhaskar

Korat 2015 Wiki Page

Korat is a tool for constraint-based generation of structurally complex test inputs for Java programs.

Please see Korat for more information on the Korat application.

Korat 2015 includes the below enhancements to Korat:

  • Graphical User Interface using Java Swing
  • Graph Output Format using JUNG (Java Universal Network/Graph Framework)
  • Finite State Machine Domain
  • Graph Archival using JSON (JavaScript Object Notation)

The source code and other information can be found at Korat 2015
Hope this work provides a foundation that enables more developers and testers to benefit from automated test input generation offered by Korat.

Downloading

There are multiple ways to download the Korat 2015 application:

  • Download Korat 2015 bundle. This bundle contains the libraries including those for generating graphs. If you instead need to use GraphViz for graphs, it needs to be downloaded and installed separately.
  • Download Korat 2015 lite. This is just the core korat 2015, and does not contain the libraries. The following libraries need to be downloaded separately: alloy4viz.jar, collections-generic-4.01.jar, colt-1.2.0.jar, commons-cli-1.0.jar, concurrent-1.3.4.jar, gson-2.2.4.jar, javassist.jar, jung-algorithms-2.0.1.jar, jung-api-2.0.1.jar, jung-graph-impl-2.0.1.jar, jung-visualization-2.0.1.jar, and junit.jar.
  • Download source files and build. The source code can be used to build the korat2015.jar file, or a custom korat2015.jar file.

Installing

  1. The current directory/ folder that Korat 2015 runs, contains the korat2015.jar file.
  2. The korat2015.jar file can be obtained as described in the above section.
  3. The current directory contains two sub-directories, <target> and lib. </target>
  4. The <target> directory contains the <target>.jar file. </target></target>
  5. The lib sub-directory contains the library files.

In our GumBall target example, the folder structure is:
Folders
Current Folder --- korat2015.jar
|
--- lib --- Alloy4Viz.jar, etc.
|
--- gumball -- Gumball.java, Gumball.class

Libraries

Web Page URL
Alloy4Viz Download alloy-4.0 vizualizer (alloy.mit.edu)
Commons-Collections with Generics Download collections-generic-4.01 (sourceforge.net)
Colt Download colt-1.2.0 (dst.lbl.gov)
Jakarta Commons CLI library Download commons-cli 1.0
Concurrent library Download concurrent-1.3.4 (gee.cs.oswego.edu)
Google Gson Download gson-2.2.4 (google-gson.googlecode.com)
Javassist Download javassist-3.3 (umn.dl.sourceforge.net)
Jung Algorithms Download jung-algorithms-2.0.1 (jung.sourceforge.net)
Jung API Download jung-api-2.0.1 (jung.sourceforge.net)
Jung Graph Download jung-graph-impl-2.0.1 (jung.sourceforge.net)
Jung Visualization Download jung-visualization-2.0.1 (jung.sourceforge.net)
JUnit Download junit

Creating Target Class

You can download Gumball.java, and compile the target gumball.GumBall class :

  • (windows) javac -Xlint:deprecation -cp .;.\korat2015.jar .\gumball\GumBall.java
  • (linux) javac -Xlint:deprecation -cp .:./korat2015.jar ./gumball/GumBall.java

Running Korat 2015

FSM model
Linux

(Graphical user interface)
java -noverify -cp ./korat2015.jar:./lib/*:./gumball:. korat.Korat --gui
Enter following arguments in the Run screen:
--args = 3
--class = gumball.GumBall

(Command line interface)
java -noverify -cp ./korat2015.jar:./lib/*:./gumball:. korat.Korat -c gumball.GumBall -a 3

Windows

(Graphical user interface)
java -noverify -cp korat2015.jar;.\gumball;.\lib\*;. korat.Korat --gui
Enter following arguments in the Run screen:
--args = 3
--class = gumball.GumBall

(Command line interface)
java -noverify -cp korat2015.jar;.\gumball;.\lib\*;. korat.Korat -c gumball.GumBall -a 3

non-FSM model

The example targets provided in the Korat repository can be explored as shown below.

Windows

(Graphical user interface)
java -cp korat2015.jar;.\lib*;. korat.Korat --gui
Enter following arguments in the Run screen:
--args = 3,3,3
--class = korat.examples.binarytree.BinaryTree

(Command line interface)
java -cp korat2015.jar;.\lib*;. korat.Korat --class korat.examples.binarytree.BinaryTree --args 3,3,3

Korat 2015 generates the explorations in the viz_json folder. These files can also be directly loaded and viewed in graph format.



MongoDB Logo MongoDB