sofya.apps
Class DejaVu

java.lang.Object
  extended by sofya.apps.DejaVu

public class DejaVu
extends java.lang.Object

DejaVu is a regression test selection tool for Java, implemented as part of the Sofya toolset.

Usage: java sofya.apps.DejaVu <prog1> <prog2> <thist> -t [slt] -tag1 <tag1> -tag2 <tag2>
     <prog1>: prog file for version one of the program
     <prog2>: prog file for version two of the program
     <thist>: full path to test history file.
     -t <[s]tatistical | [l]ist | [t]abular>: output format
     -tag1: Database tag for version one of the program
     -tag2: Database tag for version two of the program

The first three parameters must be in the order shown. The order of the remaining parameters is not important.

Version:
05/13/2005
Author:
Rogan Creswick, Alex Kinneer

Constructor Summary
DejaVu()
          Standard constructor for DejaVu.
DejaVu(boolean saveDangerousEdges)
          Constructs an instance of DejaVu, specifying whether it should generate an output file containing the dangerous edges selected by the graph traverser.
 
Method Summary
static void main(java.lang.String[] argv)
          Entry point for DejaVu.
 void print(int format)
          Stores the selected test information in the database directory as '/<tag2>/output-<tag1>-<tag2>.dejavu', and displays the results on screen in the specified format.
static void printUsage()
          Prints the usage message for DejaVu and exits.
 void selectTests(java.lang.String file1, java.lang.String file2, java.lang.String thist, java.lang.String oldTag, java.lang.String newTag)
          Selects the tests which traverse changes between the two versions of the subject program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DejaVu

public DejaVu()
Standard constructor for DejaVu.


DejaVu

public DejaVu(boolean saveDangerousEdges)
Constructs an instance of DejaVu, specifying whether it should generate an output file containing the dangerous edges selected by the graph traverser.

Parameters:
saveDangerousEdges - Flag specifying whether the dangerous edges should be saved to an output file.
Method Detail

selectTests

public void selectTests(java.lang.String file1,
                        java.lang.String file2,
                        java.lang.String thist,
                        java.lang.String oldTag,
                        java.lang.String newTag)
                 throws java.io.FileNotFoundException,
                        BadFileFormatException,
                        MethodNotFoundException,
                        java.io.IOException
Selects the tests which traverse changes between the two versions of the subject program. This method encapsulates the core functionality of DejaVu.

The following preconditions must be true:

  1. Control flow and map files must exist for all classes specified in the prog files.
  2. The path provided on the first line of each prog file must specify a valid location to the base of the subject program's source tree (it must be equivalent to the classpath that would be used to run the program). Package names are used to complete paths to actual class files named in the prog file.
  3. A test history file must exist for the subject, constructed from traced execution of the first version of the program.

Parameters:
file1 - Name of the prog file for the first version of the program
file2 - Name of the prog file for the second version of the program
thist - Path to the test history file, which may be either absolute or relative to current directory.
oldTag - Database tag for the first version of the program.
newTag - Database tag for the second version of the program.
Throws:
java.io.FileNotFoundException - If an input file cannot be found.
BadFileFormatException - If an input file is corrupted.
MethodNotFoundException - If some input files reference different classes than others, or are otherwise inconsistent in some manner that prevents method data from being properly correlated.
java.io.IOException - For any other type of IO error that prevents successful reading of any input file.

print

public void print(int format)
           throws java.io.IOException
Stores the selected test information in the database directory as '/<tag2>/output-<tag1>-<tag2>.dejavu', and displays the results on screen in the specified format.

Note: You must first call selectTests(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String).

Parameters:
format - Specifies the format of the output to be displayed to the console. The following values are acceptable: database file is an empty string.
Throws:
java.io.IOException - For any IO error that prevents successful writing of the database file or display of the test selection results.

printUsage

public static void printUsage()
Prints the usage message for DejaVu and exits.


main

public static void main(java.lang.String[] argv)
Entry point for DejaVu.

Parameters:
argv - Command-line arguments.