sofya.apps.dejavu
Class BlockTestMapper

java.lang.Object
  extended by sofya.apps.dejavu.TestMapper
      extended by sofya.apps.dejavu.BlockTestMapper

public class BlockTestMapper
extends TestMapper

Test mapper which performs a mapping from basic blocks selected by DejaVu to the tests that hit those blocks.

Version:
11/30/2004
Author:
Alex Kinneer

Constructor Summary
BlockTestMapper(java.lang.String histFile)
          Standard constructor, initializes the edge mapper with the given test history file.
 
Method Summary
 int getTotalNumberOfTests()
          Returns the number of tests in the test history.
 sofya.apps.dejavu.SelectionData selectTests(java.lang.String methodName, Edge[] dangerousEdges)
          Selects tests based on the dangerous edge list for a given method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockTestMapper

public BlockTestMapper(java.lang.String histFile)
                throws java.io.FileNotFoundException,
                       BadFileFormatException,
                       java.io.IOException
Standard constructor, initializes the edge mapper with the given test history file.

Parameters:
histFile - Path to the test history file for the program, either absolute or relative to the current working directory.
Throws:
java.io.FileNotFoundException - If the specified test history file cannot be found.
BadFileFormatException - If the test history file is corrupted.
java.io.IOException - For any other IO error which prevents the test history file from being read successfully.
Method Detail

selectTests

public sofya.apps.dejavu.SelectionData selectTests(java.lang.String methodName,
                                                   Edge[] dangerousEdges)
                                            throws MethodNotFoundException
Description copied from class: TestMapper
Selects tests based on the dangerous edge list for a given method.

Specified by:
selectTests in class TestMapper
Parameters:
methodName - Name of the method for which test selection is occurring.
dangerousEdges - List of dangerous edges found in the method, to be mapped to corresponding tests.
Returns:
A selection data object containing information about the selected tests, most importantly the list of selected test numbers.
Throws:
MethodNotFoundException - If the method test descriptor references a method that cannot be found in the test history file.

getTotalNumberOfTests

public int getTotalNumberOfTests()
Description copied from class: TestMapper
Returns the number of tests in the test history.

Specified by:
getTotalNumberOfTests in class TestMapper
Returns:
The total number of tests.