Juzi Download Example Publications Email me

 

Overview:

Juzi is a tool for automatic repair of complex data structures. Juzi takes a Java class representing the data structure as well as a predicate method that specifies the structural integrity constraints as inputs, instruments its inputs, and generates a new Java class which behaves similarly to the original class, yet automatically repairs itself when the predicate representing the structural constraints is asserted.

Juzi implements a novel repair algorithm. Given a structure that violates its integrity constraints, Juzi performs a systematic search based on symbolic execution to repair the structure, i.e., mutate it such that the resulting structure satisfies the given constraints.

 

Download:

The binary files for Juzi can be found here

Extract the tar file using the following command: tar -xvf juzi.tar.gz

The directory Juzi will be created and will contain the following:
  • Juzi.jar: An archive file containing the Juzi binaries
  • lib: The lib directory holds the libraries that Juzi depends on.
  • resources: The resources directory holds external icons that Juzi uses.
  • examples: The examples directory holds a set of data structure examples.
Please look at the example section for an illustration on how to use Juzi.

 

Example:

The following example illustrates how to use Juzi to repair corrupt doubly linked lists.

The examples directory holds a set of data structures example. To be repaired by Juzi, a class defining a data structure MUST implement the "Repairable" interface which forces the class to implement the boolean method "repOk" which represents a predicate that defines the structural integrity constraints of the data structure.

To illustrate, the "linkedlist" directory holds the class "LinkedList.Java" which implements a circular doubly linked list. The class implements the "Repairable" interface and in turn the "repOk" method which checks for the circularity property of the list, the transpose relationship between the "next" and "prev" fields, as well as the consistency of the size field.

To check for the validity of a data structure Juzi defines a new assertion "assertRepair" which uses the Java assert on repOk to check the validity of the structure. To enable repair, Juzi instruments the data structure class and generates a new class where an assertion violation (a violation of the assertRepair call) triggers a repair algorithm that mutates the corrupt structure to satisfy the structural integrity constraints given by repOk.

To illustrate, the LinkedList class implements a "buggy" add method, and a createList method which constructs a list of a given size and asserts the validity of the list after each element addition.

Check the output of running the linkedlist example when creating a list with three nodes:

To compile linked list.java, from the examples directory run the following command:

javac -sourcepath linkedlist/ -classpath ../Juzi.jar linkedlist/LinkedList.java

To run the main method, from the examples directory run the following command:

java -ea -classpath ../Juzi.jar:./: linkedlist.LinkedList

Exception in thread "main" java.lang.AssertionError at repair.Juzi.assertRepair(Unknown Source) at linkedlist.LinkedList.createList(LinkedList.java:55) at linkedlist.LinkedList.main(LinkedList.java:109)

Note how a java assertion exception is thrown due to a corruption in the list detected upon teh first addition.

To enable repair (error recovery) from the assertion violation, instrument the class using Juzi using the following steps:
  1. Double click the Juzi.jar file to launch Juzi
  2. Goto File -> generateConfig: select the linkedlist directory to generate the some configurations for the project. Juzi enables user control as to which fields to mutate as some fields might hold critical data that must not be mutated. The list of classes as well as the solver and logger configurations will show up on the Juzi GUI.
  3. Goto run -> transform: to instrument the class. If no error occurs the classes will be written to the parent directory of the given root under a new directory called "symbolic"
Now run the example again with the instrumented code using the following command from the examples directory:

java -ea -classpath ../Juzi.jar:./: symbolic.linkedlist.LinkedList

Performing Repair: C:\Users\bkarablieh\Desktop\demo\Juzi\examples\linkedlist\logs\repair_7_26_18_806_1PM.log
Performing Repair: C:\Users\bkarablieh\Desktop\demo\Juzi\examples\linkedlist\logs\repair_7_26_18_829_3PM.log
Performing Repair: C:\Users\bkarablieh\Desktop\demo\Juzi\examples\linkedlist\logs\repair_7_26_18_835_5PM.log
List: size = 3 Entries = 2 1 0

Note how instead of terminating the code, the repair routine is triggered with every element addition and the program proceeds with its execution. Three log files are created to present the performed by the repair routine. Such logs helps debugging the source of the errors in the code.

Juzi enables configuring the log files. For example, to visualize the repair actions, in the Juzi GUI select double click the "logging" tree node. A logging dialog will pop up. Select visualize from the drop down menu, click ok, transform the code and run it again.

A visualization of the doubly linked list graph occurs with every trigger of the repair routine. Here are some screenshots for the output of the visualization.

 

Publications:

  1. B. Elkarablieh, S. Khurshid. Juzi: A Tool for Repairing Complex Data Structures. 30th International Conference on Software Engineering. Leipzig, Germany. May 2008.
  2. B. Elkarablieh, S. Khurshid, D. Vu, and K. McKinley. STARC: Static Analysis for Efficient Repair of Complex Data. ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA 2007). Montreal, Canada. Oct 2007.
  3. B. Elkarablieh, I. Garcia, Y. Suen, and S. Khurshid. Assertion-based Repair of Complex Data Structures. 22nd IEEE/ACM International Conference on Automated Software Engineering (ASE 2007). Atlanta, GA. Nov 2007.