Running the Σοφία Viewers

The viewers are used to display and save interpretable forms of the various output files generated by Σοφία tools. They are provided to facilitate understanding and reporting of the various analyses supported by Σοφία.

CFViewer

This viewer is used to view the control flow graphs produced for the methods in a class. You must first run the control flow graph builder on the class for which you want to view control flow information. Then run the command:

java sofya.viewers.CFViewer [-tag tag] <classname>.java [output_file]

Note that you should include the .java extension. The CFViewer will automatically locate the control flow file in the Σοφία database and display the formatted contents. If you specify a value for output_file, the data will be written to the specified file.

MapViewer

This viewer is used to view the mapping information produced for the methods in a class. This includes a list of the basic blocks in each method, their types, subtypes, bytecode start offsets and bytecode end offsets. You must first run the control flow graph builder on the class for which you want to view map information. Then run the command:

java sofya.viewers.MapViewer [-tag tag] <classname>.java [output_file]

Note that you should include the .java extension. The MapViewer will automatically locate the map file in the Σοφία database and display the formatted contents. If you specify a value for output_file, the data will be written to the specified file.

TraceViewer

This viewer is used to view the trace information collected from the execution of an instrumented program by a coverage tracer. If will display the trace events that were recorded during execution of the program. The type of the trace (currently either basic block or branch) is automatically detected and displayed appropriately. The viewer is run with the following command:

java sofya.viewers.TraceViewer <tracefile> [output_file]

The .tr extension and any qualifying path information should be included. This viewer does not automatically find the trace file in the database directory. It will display the formatted contents of the trace file, unless you specify a value for output_file, in which case the data will be written to the specified file instead.

TestHistoryViewer

This viewer is used to view a test history file generated by the test history builder. There are two possible ways to view a test history file. The first lists each block and the set of tests that exercised it during execution. The second lists each block, the number of tests that exercised it during execution, and the percentage of the total number of tests that exercised it. To use it, run the command:

java sofya.viewers.TestHistoryViewer <histfile> [LIST | COUNT] [output_file]

The LIST option produces the first view of the history file, whereas the COUNT option produces the second view. If specified, the output will be stored to output_file.

TestSelectionViewer

This viewer is used to display the stored results of test selection performed by DejaVu. There are three possible ways to view a test selection file. The first displays each method in the program contributing at least one test selection with a tabular list of all the test selections resulting the changes to that method. The second gives a "statistical" view that lists each method with the total number of tests and the corresponding percentage of the test suite selected as a result of the changes to that method. The final view simply lists all of the selected tests, and is intended primarily as an input to other tools. To use this viewer, run the command:

java sofya.viewers.TestSelectionViewer <selectionfile> [-t <t|s|l>] [output_file]

The parameter -t selects the output format, where t is the tabular format, s is the statistical format, and l is the list format. If you specify a value for output_file, the data will be written to the specified file.

ByteSourceViewer

This viewer is used to view the byte code instructions of a Java class. To use it, run the command:

java sofya.viewers.ByteSourceViewer <classname> [output_file]

If the .class extension is included, the viewer will treat the given name as an absolute path, otherwise it will attempt to load the class from the classpath. It will display the byte code instructions for each method in the class in a readable format. If you specify a value for output_file, the data will be written to the specified file.

SourceViewer

This viewer is used to display the contents of a Java source code file, annotated with line numbers. To use it, run the command:

java sofya.viewers.SourceViewer <sourcefile> [output_file]

The .java extension and any qualifying path information should be included. This viewer does not automatically find the file in the database directory. It will display the contents of the source file, annotated with line numbers. If you specify a value for output_file, the data will be written to the specified file.