Wiki
Clone wikiJAID / UserManual
JAID User Manual
Command Line Arguments
Use the following command to launch JAID:
$ java -ea -cp <JAID_CLASSPATH> hk.polyu.comp.jaid.fixer.Application <JAID_Arguments>
where
-
<JAID_CLASSPATH>
is the path to the JAID binary Jar file, and -
<JAID_Arguments>
is a list of arguments to be passed to JAID.
The list of all supported command line arguments is shown in the table below.
Argument Name | Explanation |
---|---|
JaidSettingFile | Full path to a properties file containing the settings for running JAID. When specified, other command line arguments are ignored. |
Encoding | Encoding of the project source code files (Default: UTF8). |
ExpToExclude | List of expressions that should NOT be used for program state monitoring (Default: Empty list). |
JDKDir | Full path to the JDK installation. |
LogLevel | Verbosity level of generated logs. Valid values: OFF, ERROR, WARN, INFO, DEBUG, TRACE, ALL. |
ProjectRootDir | Full path to the project root directory. All other relative paths will be resolved against this path |
ProjectSourceDir | List of relative paths to the project source directories, separated by path separators (; for Windows and : for Mac OS or Linux). |
ProjectOutputDir | Relative path to the project output directory. |
ProjectTestOutputDir | Relative path to the project test output directory. |
ProjectLib | List of relative paths to the project libraries (e.g., jar files), separated by path separators (; for Windows and : for Mac OS or Linux). |
ProjectTestSourceDir | List of relative paths to the project test source directories, separated by path separators (; for Windows and : for Mac OS or Linux). |
ProjectTestsToInclude | List of tests that should be used for fixing. All tests will be used if not specified. Format: FullyQualifiedClassName;FullyQualifiedClassName#MethodName |
ProjectTestsToExclude | List of tests that should NOT be used for fixing. No test will be excluded if not specified. Format: FullyQualifiedClassName;FullyQualifiedClassName#MethodName |
ProjectExtraClasspath | List of extra classpaths. |
MethodToFix | Method to fix. Format: MethodName(Type1,Type2)@FullyQualifiedPackageName.ClassName$InnerClassName. |
TimeoutPerTest | Timeout in milli seconds for each test. |
TargetJavaVersion | Source code target java version(Default: 1.8). |
ProjectCompilationCommand | Command to compile the project. Only needed in special cases. |
ProjectExecutionCommand | Command to execute the project. Only needed in special cases. |
Outputs
JAID stores all its outputs in the jaid_output
folder under the root directory of the subject project. The output folder typically contains the following files and directories after a JAID fixing session (LogLevel = DEBUG
):
all_snapshots.log compilation_errors.log evaluated_fix_actions.log jaid.log formatted_src/ monitored_exps.log monitored_states.log monitored_test_results.log plausible_fix_actions.log pre4location_test_results.log suspicious_snapshots.log test_cases_files.txt tmp/ tmp_dest/ tmp_src/
From a user's point of view, two logs are the most important:
- jaid.log is the main log of JAID.
- plausible_fix_actions.log records the most useful information of each phase and all valid fixes generated by JAID. Everything in this log is also included in jaid.log.
Other logs record intermediate results produced in three different phases of fixing:
-
Fault Localization
Input tests are executed up to three times in this phase for fault localization. First, all the tests are executed to produce a list of program locations that are relevant to the failure under consideration. Next, tests are executed again, with state monitoring enabled, to identify expressions that are impure, or with side-effects. Last, pure expressions are used to abstract the program states during test executions. State snapshots are then constructed from the observed states and analyzed to pinpoint the likely fault locations.
- pre4location_test_results.log records the program locations covered by each test as well as the test results from their first execution.
- exe_locations.log records all the locations within the method-to-fix that are relevant to the failure.
- pre4exp_test_results.log records all the test results of the second monitor.
- monitored_exps.log records all the monitored expressions in different stages.
- monitored_test_results.log records the test results of each test of the third monitor.
- monitored_states.log records the states of all monitored expressions in each location of target method in each test during the fault localization phase.(This file can be large and is rarely inspected.)
- all_snapshots.log shows all snapshots generated based on those captured dynamic states.
- suspicious_snapshots.log shows the selected snapshots as the input of next phase (Fix Generation).
-
Fix Generation
In this phase, JAID generates fix actions targeting the most suspicious state snapshots and then produces candidate fixes by instantiating predefined fix schemas using fix actions, state snapshot expressions, and the old statement from the faulty method-to-fix.
- snippets.log records all generated snippets.
- raw_fix_actions.log records all generated fixes.
-
Fix Validation
All candidate fixes will be applied to the buggy program and checked against the input test cases. Only those that pass all test will be reported to the user, i.e., recorded in
plausible_fix_actions.log
.- evaluated_fix_actions.log records the evaluated result of each generated fixes.
JAID works on a pretty-printed version of the method-to-fix. Pretty-printing takes place before fault localization, and the result Java file is stored in $PROJECT_ROOT_DIR$/jaid_output/formatted_src
.
Copyright and License
JAID is distributed under the terms of the GNU General Public License. There is absolutely NO WARRANTY for JAID, its code and its documentation.
Updated