edu.umd.cs.findbugs.ba
Class DataflowTestDriver<Fact,AnalysisType extends AbstractDataflowAnalysis<Fact>>

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.DataflowTestDriver<Fact,AnalysisType>

public abstract class DataflowTestDriver<Fact,AnalysisType extends AbstractDataflowAnalysis<Fact>>
extends java.lang.Object

A test driver for dataflow analysis classes. It runs the dataflow analysis on the methods of a single class, and has options (properties) to restrict the analysis to a single method, and to print out a CFG annotated with dataflow values.

Author:
David Hovemeyer
See Also:
Dataflow, DataflowAnalysis

Constructor Summary
DataflowTestDriver()
           
 
Method Summary
abstract  Dataflow<Fact,AnalysisType> createDataflow(ClassContext classContext, org.apache.bcel.classfile.Method method)
          Downcall method to create the dataflow driver object and execute the analysis.
 void examineResults(CFG cfg, Dataflow<Fact,AnalysisType> dataflow)
          Downcall method to inspect the analysis results.
 void execute(ClassContext classContext, org.apache.bcel.classfile.Method method)
          Execute the analysis on a single method of a class.
 void execute(java.lang.String filename)
          Execute the analysis on a single class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataflowTestDriver

public DataflowTestDriver()
Method Detail

execute

public void execute(java.lang.String filename)
             throws DataflowAnalysisException,
                    CFGBuilderException,
                    java.io.IOException
Execute the analysis on a single class.

Parameters:
filename - the name of the class file
Throws:
DataflowAnalysisException
CFGBuilderException
java.io.IOException

execute

public void execute(ClassContext classContext,
                    org.apache.bcel.classfile.Method method)
             throws DataflowAnalysisException,
                    CFGBuilderException
Execute the analysis on a single method of a class.

Throws:
DataflowAnalysisException
CFGBuilderException

createDataflow

public abstract Dataflow<Fact,AnalysisType> createDataflow(ClassContext classContext,
                                                           org.apache.bcel.classfile.Method method)
                                                                                           throws CFGBuilderException,
                                                                                                  DataflowAnalysisException
Downcall method to create the dataflow driver object and execute the analysis.

Parameters:
classContext - ClassContext for the class
method - the Method
Returns:
the Dataflow driver
Throws:
CFGBuilderException
DataflowAnalysisException

examineResults

public void examineResults(CFG cfg,
                           Dataflow<Fact,AnalysisType> dataflow)
Downcall method to inspect the analysis results. Need not be implemented by subclasses.

Parameters:
cfg - the control flow graph
dataflow - the analysis results