This document provides an overview of the usage of jFuzz and how to extend jFuzz using the built in extension points. Usage Documentation describes how to use jFuzz and the arguments. Development Documentation describes the architecture of jFuzz and the requirements for each extension point. Contents:Usage DocumentationThis describes how to obtain jFuzz, preparing an subject program, and how to use jFuzz. Obtaining jFuzz
jFuzz is included as an extension to Nasa Java PathFinder (JPF). Download JPF and compile the sources including the concolic extension (instructions below). This is the extension which includes jFuzz. svn -r 1918 co https://javapathfinder.svn.sourceforge.net/svnroot/javapathfinder javapathfinder cd javapathfinder/trunk/ build-tools/bin/ant run-tests build-tools/bin/ant -f extensions/symbc/build.xml build-tools/bin/ant -f extensions/concolic/build.xml compile-extension compile-extension-tests cp -r build/test/jfuzz/tests/ build/jpf/jfuzz/ extensions/concolic/simpleTest.sh Preparing the Subject ProgramTo prepare the subject program for jFuzz follow these steps:
jFuzz ArgumentsThis table contains the arguments which are required to run jFuzz:
The following table contains optional jFuzz arguments:
CacheStrategyCacheStrategy specifies how jFuzz caches PathConditions. Currently jFuzz has two available caching strategies: NameIndependentCache, and NoCache. See here for a description of how to implement a CacheStrategy.
NextFileStrategyNextFileStrategy specifies how jFuzz caches PathConditions. Currently jFuzz has four available next file strategies: Coverage, Newest, Oldest, and Random. See here for a description of how to implement a NextFileStrategy.
TerminationStrategyjFuzz with automatically stop when there are no unprocessed inputs available, if you wish to stop the execution of jFuzz sooner a TerminationStrategy should be used. Currently jFuzz has three available termination strategies: NeverTerminate, TimedTermination, and UptoFixedNumber. See here for a description of how to implement a TerminationStrategy.
Timing MeasurementIf the argument jFuzz.timing is set to true, as jFuzz executes it will keep track of the time several operations take. These include: Total time, JPF time, Fuzzing time, solving time, simplifying time, time creating inputs. These will be aggregated into the CSV file timeAgg.csv in the generated directory. Coverage MeasurementIf the argument jfuzz.coverage is passed a jar, as jFuzz executes it will run each input processed through EMMA to measure the aggregate coverage achieved. This will be aggregated into the CSV file coverage.csv in the generated directory. The jar passed to jfuzz.coverage should be an unmodified version of the subject program because otherwise the program will fail because fuzzPC will try to call JPF methods and fail. Usage ExamplesHere are jFuzz usage examples. These are the programs that were used in evaluating jFuzz. Please download our modified sources for jLex and SAT4J. Simple TestThis is a simple example on how to use jFuzz. To run this example, execute the following command from inside the JPF trunk folder. Remember to escape the parentheses if you are using the command line. For convenience, you can use the simpleTest.sh script in the main jFuzz directory.java -cp ./build/jpf jfuzz.JFuzz +jpf.basedir=. +search.class=gov.nasa.jpf.search.Simulation +jfuzz.input=extensions/concolic/test/txtfiles/largepc.txt +jfuzz.time=0,3,0,0 +jfuzz.del=false +jfuzz.nextfile=jfuzz.nextfile.Oldest +jfuzz.termination=jfuzz.termination.TimedTermination +jfuzz.cache=jfuzz.cache.NameIndependentCache +jfuzz.timing=false +vm.insn_factory.class=gov.nasa.jpf.concolic.ConcolicInstructionFactory +jpf.listener=jfuzz.ConcolicListener +symbolic.method=foo(sym) +jpf.report.console.finished= jfuzz.tests.LargePC SAT4JSAT4J is SAT solver written in Java. The code had to be slightly modified to to run with jFuzz. You can download the modified sources. There are two instructive changes:
When running our tests these are the arguments used: +jpf.basedir=../javapathfinder-trunk +jfuzz.input.cp=./lib/sat4j-apache.jar:. +search.class=gov.nasa.jpf.search.Simulation +jfuzz.input=test1.dimacs +jfuzz.termination=jfuzz.termination.TimedTermination +jfuzz.time=0,60,0,0 +jfuzz.cache=jfuzz.cache.NameIndependentCache +jfuzz.nextfile=jfuzz.nextfile.Coverage +jfuzz.coverage=sat4j.jar +jfuzz.timing=true +jfuzz.del=false +jfuzz.debug=false +vm.insn_factory.class=gov.nasa.jpf.concolic.ConcolicInstructionFactory +jpf.listener=jfuzz.ConcolicListener +symbolic.method=foo(sym) +jpf.report.console.finished= org.sat4j.Lanceur JLexJLex is a lexical analyzer generator, written for Java, in Java. The code had to be slightly modified to to run with jFuzz. You can download the modified sources. There are two instructive changes:
+jpf.basedir=../javapathfinder-trunk +jfuzz.input.cp=./bin +search.class=gov.nasa.jpf.search.Simulation +jfuzz.input=simple.lex +jfuzz.nextfile=jfuzz.nextfile.Coverage +jfuzz.termination=jfuzz.termination.TimedTermination +jfuzz.time=0,60,0,0 +jfuzz.cache=jfuzz.cache.NameIndependentCache +jfuzz.coverage=jlex.jar +jfuzz.timing=true +jfuzz.del=false +jfuzz.debug=false +vm.insn_factory.class=gov.nasa.jpf.concolic.ConcolicInstructionFactory +jpf.listener=jfuzz.ConcolicListener +symbolic.method=foo(sym) +jpf.report.console.finished= JLex.Main Developer DocumentationThis section provides an overview of the architecture of jFuzz and describes the requirements for each extention point. ArchitecturejFuzz architecture. Given the program under test and seed inputs, jFuzz generates new inputs by modifying (fuzzing) the seed inputs so that each new input executes a unique control-flow path. jFuzz is built as an extension to NASA Java PathFinder. Java PathFinder is an explicit state software model checker for Java bytecode, that also provides hooks for a variety of analysis techniques. The figure above illustrates the architecture of jFuzz. jFuzz works in three steps:
Extension PointsThere are three areas in which jFuzz is designed to be easily extended: TerminationStrategy, NextFileStrategy, and CacheStrategy. This section describes the function and interface of each of these extension points. CacheStrategyCacheStrategy specifies how jFuzz caches PathConditions. Currently jFuzz has two available caching strategies: NameIndependentCache, and NoCache. See here for a description of each of these and how to use them. Every CacheStrategy must implement the CacheStrategy interface. This means implementing the following methods:
NextFileStrategyNextFileStrategy specifies how jFuzz selects the next input to process. Currently jFuzz has four available next file strategies: Coverage, Newest, Oldest, and Random. See here for a description of each of these and how to use them. Every NextFileStrategy must implement the NextFileStrategy interface. This means implementing the following methods:
TerminationStrategyjFuzz with automatically stop when there are no unprocessed inputs available, if you wish to stop the execution of jFuzz sooner a TerminationStrategy should be used. Currently jFuzz has three available termination strategies: NeverTerminate, TimedTermination, and UptoFixedNumber. See here for a description of each of these and how to use them. Every TerminationStrategy must implement the TerminationStrategy interface. This means implementing the following methods:
Links
AuthorsjFuzz and the concolic execution JPF extension were created by David Harvison and Adam Kiezun. |
|