Dsc is a dynamic symbolic execution engine and test case generator for Java (bytecode) programs. This page describes Dsc's configuration options.
Warning
Options may change or disappear in subsequent Dsc releases.
Setup
Following is an example setup that works on my machine.
c:\java\dsc contains the contents of the Dsc binary distribution zip file, i.e.:
dsc.jar contains the main Dsc Java classes plus third-party Java libraries
instrument.jar contains the Dsc JvmAgent instrumentation agent class and the Asm library
z3.dll is the Z3 Windows x86 library
Z3Wrap.dll is the SWIG-generated Z3 wrapper library
conf_basic.txt is an example Dsc configuration file
c:\java\proj\bin\please contains a class file we want Dsc to analyze.
Cover.class is an example public class file that contains a public static method named me. This class file has been compiled from source file Cover.java. There are five distinct execution paths through the Cover.me method, if we take into account int overflow and implicit branches triggered by Jvm instructions throwing runtime exceptions. Pop quiz: Write down five test cases that cover the five execution paths through the Cover.me method :)
Now we do the following:
c:
cd \java\dsc
java -cp dsc.jar;c:\java\proj\bin -javaagent:instrument.jar edu.uta.cse.dsc.Dsc please.Cover me
Dsc should now be executing the Cover.me method several times and cover all execution paths through this particular method. (In general, Dsc obviously cannot cover all paths through any given method.) During execution, Dsc emits some logging information and writes each new execution path as a JUnit test case to disk. We now should have the following directory.
c:\java\dsc\generated\please contains the generated JUnit test classes, i.e.:
Roops is an attempt at providing a common benchmark for program analysis tools such as Pex and Dsc. Currently, Dsc supports only very basic Roops features.
RoopsDsc explores each public static method that is annotated with the roops.util.BenchmarkMethod annotation, if that method is contained in a public class annotated with the roops.util.BenchmarkClass annotation. Such a benchmark method may contain goal statements, in the form of calls of the roops.util.Goals.reached(int) method.
The Roops infrastructure counts the goals that are reached during a RoopsDsc exploration and RoopsDsc reports those goals to the user.
Configuration Options
Dsc and RoopsDsc have several configuration options. These can be set via a configuration text file (property file), for which Dsc and RoopsDsc currently search on the class path. An example configuration file is conf_basic.txt. In the above example, we can use the configuration file as follows.
Full directory of Z3Wrap.dll. Set this option if Dsc cannot locate Z3Wrap.dll
BASIC_DSC_CLASS_CP = please.Cover
Basic Dsc explores method BASIC_DSC_CLASS_CP_METHOD in this class from the class path. Ignored by RoopsDsc.
BASIC_DSC_CLASS_CP_METHOD = me
Basic Dsc explores this method in BASIC_DSC_CLASS_CP. Ignored by RoopsDsc.
ROOPS_DSC_CLASSES_CP =
RoopsDsc explores these Roops classes from the class path (independently of ROOPS_DSC_DIRS). Ignored by basic Dsc.
ROOPS_DSC_DIRS =
RoopsDsc explores all Roops classes in ROOPS_DSC_DIRS that match a pattern in the ROOPS_DSC_DIRS_PACKAGES property (independently of ROOPS_DSC_CLASSES). Ignored by basic Dsc.
ROOPS_DSC_DIRS_PACKAGES =
Patterns of package prefixes RoopsDsc uses for ROOPS_DSC_DIRS. E.g.,: 'a.' or 'a.b.' etc. Ignored by basic Dsc.
Do not instrument any of the classes that have any of these prefixes. IMPORTANT: InstrumentConfig maintains the same list. Both lists have to be updated for Dsc to work properly! TODO: Merge these two lists.
Prefixes of classes that will always be explored symbolically, regardless if they appear in DO_NOT_INSTRUMENT_PREFIXES. IMPORTANT: InstrumentConfig maintains the same list. Both lists have to be updated for Dsc to work properly! TODO: Merge these two lists.
Package name used for mock classes in case we cannot infer one.
ENCODE_HARD_TO_SUBCLASS_AS_FINAL = true
Encode hard-to-subclass classes as final
MODE = DSC
Dsc mode. Also see REPAIR_MODE and MOCK_MODE
REPAIR_MODE = false
Data-structure repair mode. Also see MODE. Maintained by Ishtiaque.
DUMPER_MODE = false
Only monitor execution and dump each symbolic expression immediately to disk.
REQ_1_MODE = false
REQ-1 mode.
REPAIR_ATTEMPTED = false
Simulate multiple repair by Dsc
REPAIR_LOG_REFLECTION = true
Log debug information during repair reflection
REPAIR_LOG_CONSTRAINTS = true
Log constraints collected during repair
REPAIR_NO_OF_NODES = 10
Repair: Number of nodes in a binary tree
CREST_MODE = false
CREST: Combinatorial testing with Dsc. Maintained by Ishtiaque.
CARFAST_MAX_ITERATION = 10
CarFast: Maximum iteration for CarFast
DUMP_FILE_NAME = cond.txt
File to which Dsc dumps its output in dumper mode.
MOCK_MODE = false
Mock class generation. Also see MODE. Maintained by Mainul.
USE_MAX = false
Guard for any bounds-checking for the following exploration bounds.
MAX_CALLBACKS_METHOD = 100000
USE_MAX ==> max #callbacks Dsc will process for one exploration (set of execution paths through a single user entry method)
MAX_CALLBACKS_PATH = 20000
USE_MAX ==> max #callbacks Dsc will process for a single execution path through user code
MAX_SAT_CALLS_METHOD = 20
USE_MAX ==> Maximum number of SAT calls Dsc will issue for any given exploration (= entry method)
MAX_ARRAY_SIZE_CREATION = 10000
Array creations with more elements will trigger to discard this path and search for a cheaper one.This is a coarse model of OutOfMemoryError triggered by JVM.
SIMPLIFY_SELECT_EXPRESSIONS = true
Rewrite select expressions
SUPPRESS_TRIVIAL_UNSAT_QUERIES = true
Do not ask SAT solver queries that are trivially UNSAT.Our own light-weight SAT checker.
ARRAY_LENGTH_MAX = 128
Maximum sum of array variable lengths to try
ARRAY_LENGTH_MINIMIZE = true
Try to minimize sum of array lengths in generated test cases
ARRAY_LENGTH_MINIMIZE_FACTOR = 4
Factor for subsequent array length
MAX_LOCALS_DEFAULT = 200
Artificial maximum number of local variables in a method/constructor
CONTEXT_HEIGHT_BASE_OF_ALL_EXPLORATIONS = 0
Base context shared by all explorations. At this level, Dsc persists, for example, types.
log number of times we ask Z3 to check SAT of a constraint system, how many of those Z3 found a model for, and how many of those lead to a new execution path.
LOG_MODEL_DSC = false
log each solution in Dsc notation
LOG_MODEL_Z3 = false
log each solution in the Z3 notation
LOG_NULL_CHECKS = false
log path condition on null check
LOG_PATH_COND_DSC_NOT_NULL = true
log (not (x==null)) conjuncts when logging the path condition in Dsc notation
LOG_ROOPS_FILE_NAME = c:\DscOutput.txt
File name for Roops output [Mainul]
LOG_ROOPS_TO_FILE = false
log Roops output to file
LOG_SUMMARY = true
log summary of the entire exploration
LOG_SUMMARY_INSTANCE_FIELDS = false
log instance fields with summary.
LOG_Z3_TIMES = false
log Z3 execution times
LOG_Z3_TRACE_FILE_NAME = log\z3-1319905598739.out
Filename for Z3 log, write file to LOG_DIR_NAME
LOG_Z3_TRACE_TO_FILE = false
Make Z3 log into a text file
LOG_Z3_TRACE_TO_STD_ERR = false
Log Z3 trace messages to standard error
Z3PARAM_SOFT_TIMEOUT = 5000
Approximate timeout for each solver query (milliseconds), 0 = no timeout.