sota.ast.util
Class ModBIPathManager

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

public class ModBIPathManager
extends java.lang.Object

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


Nested Class Summary
protected static class ModBIPathManager.ModBIPath
           
protected static class ModBIPathManager.ModBIPathInfo
          Hält die Informationen für den Iterationszustand Schleife (für Stack).
 
Field Summary
protected static ASTFunctionNode currFunctionNode
           
protected static boolean INFO
           
protected static boolean VERBOSE
           
protected static boolean VERBOSE_COVER
           
protected static boolean VERBOSE2
           
protected static boolean VERBOSE3
           
 
Constructor Summary
ModBIPathManager()
           
 
Method Summary
protected static void addDecisionToModBIPath(ModBIPathManager.ModBIPath modBIPath, int i, int width)
          Fügt eine Entscheidung an den BIPfad an.
protected static ModBIPathManager.ModBIPathInfo computeModBIPaths(ASTNode start, ASTNode end)
          Berechnet PfadInfo für MBIPfade eines Quellcodeabschnitt
static void computeNrModBIPaths(ASTFunctionNode fn)
          Berechnet die Anzahl der möglichen Pfade für den Modifizierten Boundary-Interior-Pfadtest.
static void createCoveredModBIPathsSet(ASTManager ast)
          Erstellt für alle Pfade des aktuellen TestLogs die ModBiPfade.
protected static void createCoveredModBIPathsSetForFunction(ASTManager ast, TestCase testCase, java.util.ArrayList<java.lang.Integer> list)
          Erstellt für einen Pfad die ModBIPfade, d.h. für den Funktion und für die Iterationen.
protected static int createCoveredModBIPathsSetForIteration(ASTManager ast, TestCase testCase, java.util.ArrayList<java.lang.Integer> list, int start)
           
protected static ModBIPathManager.ModBIPathInfo joinExceptionModBIPaths(ModBIPathManager.ModBIPathInfo head, ModBIPathManager.ModBIPathInfo tail, ASTNode endNode)
          Vereingt die Pfadinfos der vereinigten Pfade von Try + allen Catches mit den folgenden finally-Pfaden.
protected static ModBIPathManager.ModBIPathInfo joinParallelModBIPaths(ModBIPathManager.ModBIPathInfo first, ModBIPathManager.ModBIPathInfo second)
          Vereinigt die Pfadinfos zweier paralleler Pfade (true-false bei If, case bei Switch) Addiert Pfade zusammen.
protected static ModBIPathManager.ModBIPathInfo joinSequentialModBIPaths(ModBIPathManager.ModBIPathInfo head, ModBIPathManager.ModBIPathInfo 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 printModBIPath(int f, ModBIPathManager.ModBIPath p)
           
protected static ModBIPathManager.ModBIPathInfo transferLoopMaps(ModBIPathManager.ModBIPathInfo first, ModBIPathManager.ModBIPathInfo second)
          Überträgt die loopMaps von einer PathInfo auf die nächste, spart doppelte aus.
 
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

VERBOSE_COVER

protected static boolean VERBOSE_COVER

VERBOSE2

protected static boolean VERBOSE2

VERBOSE3

protected static boolean VERBOSE3
Constructor Detail

ModBIPathManager

public ModBIPathManager()
Method Detail

addDecisionToModBIPath

protected static void addDecisionToModBIPath(ModBIPathManager.ModBIPath modBIPath,
                                             int i,
                                             int width)
Fügt eine Entscheidung an den BIPfad an.

Parameters:
modBIPath - - der aktuelle BIPfad
i - - die Entscheidung binär kodiert , 0/1 bei einfacher, sonst länger

computeModBIPaths

protected static ModBIPathManager.ModBIPathInfo computeModBIPaths(ASTNode start,
                                                                  ASTNode end)
Berechnet PfadInfo für MBIPfade eines Quellcodeabschnitt

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

computeNrModBIPaths

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

Parameters:
fn - - der ASTFunctionNode der entsprechenden Funktion

createCoveredModBIPathsSet

public static void createCoveredModBIPathsSet(ASTManager ast)
Erstellt für alle Pfade des aktuellen TestLogs die ModBiPfade.

Parameters:
ast - - Der aktuelle ASTManager.

createCoveredModBIPathsSetForFunction

protected static void createCoveredModBIPathsSetForFunction(ASTManager ast,
                                                            TestCase testCase,
                                                            java.util.ArrayList<java.lang.Integer> list)
Erstellt für einen Pfad die ModBIPfade, d.h. für den Funktion und für die Iterationen. Ein Pfad wird durch eine long-Zahl repräsentiert.

Parameters:
ast - der ASTManager
testCase - - Das entsprechende TestLog.
list - - Die Pfadliste.

createCoveredModBIPathsSetForIteration

protected static int createCoveredModBIPathsSetForIteration(ASTManager ast,
                                                            TestCase testCase,
                                                            java.util.ArrayList<java.lang.Integer> list,
                                                            int start)

joinExceptionModBIPaths

protected static ModBIPathManager.ModBIPathInfo joinExceptionModBIPaths(ModBIPathManager.ModBIPathInfo head,
                                                                        ModBIPathManager.ModBIPathInfo 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. *

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

joinParallelModBIPaths

protected static ModBIPathManager.ModBIPathInfo joinParallelModBIPaths(ModBIPathManager.ModBIPathInfo first,
                                                                       ModBIPathManager.ModBIPathInfo 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

joinSequentialModBIPaths

protected static ModBIPathManager.ModBIPathInfo joinSequentialModBIPaths(ModBIPathManager.ModBIPathInfo head,
                                                                         ModBIPathManager.ModBIPathInfo 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)

printModBIPath

protected static void printModBIPath(int f,
                                     ModBIPathManager.ModBIPath p)

transferLoopMaps

protected static ModBIPathManager.ModBIPathInfo transferLoopMaps(ModBIPathManager.ModBIPathInfo first,
                                                                 ModBIPathManager.ModBIPathInfo second)
Überträgt die loopMaps von einer PathInfo auf die nächste, spart doppelte aus. (Switch-Catch ohne Break können Schleifen mehrmals auswerten)

Parameters:
first - - die erste PathInfo
second - - die zweite PathInfo
Returns:
- die erste PathInfo mit den Aufsummierten loopMaps der zweiten