sota.ast.util
Class BIPathManager

java.lang.Object
  extended by sota.ast.util.BIPathManager

public class BIPathManager
extends java.lang.Object

Klasse mit statischen Methoden zur Berechnung der BI-Pfadüberdeckung.


Nested Class Summary
protected static class BIPathManager.BIPathInfo
           
 
Field Summary
protected static ASTFunctionNode currFunctionNode
           
protected static boolean INFO
           
protected static boolean VERBOSE
           
protected static boolean VERBOSE2
           
protected static boolean VERBOSE3
           
 
Constructor Summary
BIPathManager()
           
 
Method Summary
protected static long addDecisionToBIPath(long biPath, int nrDecisions, int i)
          Fügt eine Entscheidung an den BIPfad an.
protected static BIPathManager.BIPathInfo computeBIPaths(ASTNode start, ASTNode end)
          Berechnet PfadInfo für die BIPfade eines Quellcodeabschnitt
static void computeNrBIPaths(ASTFunctionNode fn)
          Berechnet die Anzahl der möglichen Pfade für den Boundary-Interior-Pfadtest.
static void createCoveredBIPathsSet(ASTManager ast)
          Erstellt für alle aktuellen TestLogs die BiPfade.
protected static void createCoveredBIPathsSet(ASTManager ast, TestCase t, java.util.ArrayList<java.lang.Integer> list)
          Erstellt für eine Pfadliste die BIPfade, d.h. berechnet ein Long-Zahl, welche eindeutig den BI-Pfad repräsentiert.
protected static BIPathManager.BIPathInfo joinExceptionPaths(BIPathManager.BIPathInfo head, BIPathManager.BIPathInfo tail, ASTNode endNode)
          Vereingt die Pfadinfos der vereinigten Pfade von Try + allen Catches mit den folgenden finally-Pfaden.
protected static BIPathManager.BIPathInfo joinIterationPath(BIPathManager.BIPathInfo head, BIPathManager.BIPathInfo loop, ASTIterationNode iterationNode)
          Berechnet die PfadInfo der Schleife.
protected static BIPathManager.BIPathInfo joinParallelPaths(BIPathManager.BIPathInfo first, BIPathManager.BIPathInfo second)
          Vereinigt die Pfadinfos zweier paralleler Pfade (true-false bei If, case bei Switch) Addiert Pfade zusammen.
protected static BIPathManager.BIPathInfo joinSequentialPaths(BIPathManager.BIPathInfo head, BIPathManager.BIPathInfo tail, ASTNode endNode)
          Vereingt die Pfadinfos zweier aufeinanderfolgender Pfadverläufe an einem Endknoten.
protected static java.lang.String pathToString(java.util.ArrayList<java.lang.Integer> l)
           
protected static void printBIPath(int f, long i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currFunctionNode

protected static ASTFunctionNode currFunctionNode

INFO

protected static boolean INFO

VERBOSE

protected static boolean VERBOSE

VERBOSE2

protected static boolean VERBOSE2

VERBOSE3

protected static boolean VERBOSE3
Constructor Detail

BIPathManager

public BIPathManager()
Method Detail

addDecisionToBIPath

protected static long addDecisionToBIPath(long biPath,
                                          int nrDecisions,
                                          int i)
Fügt eine Entscheidung an den BIPfad an.

Parameters:
biPath - - der aktuelle BIPfad
nrDecisions - - wie breit die Entscheidung ist (Switch, Try)
i - - die Entscheidung binär kodiert , 0/1 bei einfacher, sonst länger
Returns:
- der BIPfad mit angefügter Entscheidung

computeBIPaths

protected static BIPathManager.BIPathInfo computeBIPaths(ASTNode start,
                                                         ASTNode end)
Berechnet PfadInfo für die BIPfade eines Quellcodeabschnitt

Parameters:
start - - beginn des Abschnittes
end - - Ende des Abschnittes
Returns:
- die berechnete PfadInfo

computeNrBIPaths

public static void computeNrBIPaths(ASTFunctionNode fn)
Berechnet die Anzahl der möglichen Pfade für den Boundary-Interior-Pfadtest.

Parameters:
fn - - der ASTFunctionNode der entsprechenden Funktion

createCoveredBIPathsSet

public static void createCoveredBIPathsSet(ASTManager ast)
Erstellt für alle aktuellen TestLogs die BiPfade.

Parameters:
ast - - Der aktuelle ASTManager.

createCoveredBIPathsSet

protected static void createCoveredBIPathsSet(ASTManager ast,
                                              TestCase t,
                                              java.util.ArrayList<java.lang.Integer> list)
Erstellt für eine Pfadliste die BIPfade, d.h. berechnet ein Long-Zahl, welche eindeutig den BI-Pfad repräsentiert.

Parameters:
ast - der ASTManager
t - - Das entsprechende TestLog.
list - - Die Pfadliste aus dem TestLog.

joinExceptionPaths

protected static BIPathManager.BIPathInfo joinExceptionPaths(BIPathManager.BIPathInfo head,
                                                             BIPathManager.BIPathInfo tail,
                                                             ASTNode endNode)
Vereingt die Pfadinfos der vereinigten Pfade von Try + allen Catches mit den folgenden finally-Pfaden. Ruft joinSequentialPaths() mit gleichen Parametern auf, aber sorgt vorher dafür, dass alle Sprungpfade aus dem Try-Konstrukt auch durch den finallyNode laufen. Wichtig: Sprünge im finally überschreiben alle Sprünge der Try-Catchblöcke

Parameters:
head - - PfadInfo des Ursprungspfades (Try-Catch)
tail - - PfadInfo des Finally-Pfades
endNode - - der vereinigende Knoten des Try-Konstrukts
Returns:
- vereinigte PfadInfo

joinIterationPath

protected static BIPathManager.BIPathInfo joinIterationPath(BIPathManager.BIPathInfo head,
                                                            BIPathManager.BIPathInfo loop,
                                                            ASTIterationNode iterationNode)
Berechnet die PfadInfo der Schleife.

Parameters:
head - - die PfadInfo des Verlaufes bis zum Eingang der Iteration
loop - - die PfadInfo eines Loopdurchlaufes
iterationNode - - der entsprechende ASTIterationNode
Returns:
- die vereinigte PfadInfo

joinParallelPaths

protected static BIPathManager.BIPathInfo joinParallelPaths(BIPathManager.BIPathInfo first,
                                                            BIPathManager.BIPathInfo second)
Vereinigt die Pfadinfos zweier paralleler Pfade (true-false bei If, case bei Switch) Addiert Pfade zusammen.

Parameters:
first - - ein Pfad
second - - ein paralleler Pfad
Returns:
- die Vereinigung der Pfade

joinSequentialPaths

protected static BIPathManager.BIPathInfo joinSequentialPaths(BIPathManager.BIPathInfo head,
                                                              BIPathManager.BIPathInfo tail,
                                                              ASTNode endNode)
Vereingt die Pfadinfos zweier aufeinanderfolgender Pfadverläufe an einem Endknoten. Offene Pfade zum Endknoten werden dort wieder eingefügt.

Parameters:
head - - PfadInfo des Ursprungspfades
tail - - PfadInfo des Teilpfades
endNode - - der vereinigende Knoten des verzweigenden Konstrukts
Returns:
- vereinigte PfadInfo

pathToString

protected static java.lang.String pathToString(java.util.ArrayList<java.lang.Integer> l)

printBIPath

protected static void printBIPath(int f,
                                  long i)