|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.uds.cs.st.dd.core.DD
Main Delta Debugging class. Provides functionality to apply the Delta Debugging algorithm to any configuration.
Field Summary | |
static int |
ADD
Resolving direction: Adds more deltas. |
private boolean |
assumeAxiomsHold
If set to true, c[initialfail] == fail and c[initialpass] == pass. |
private boolean |
cacheOutcomes
If set to true, test results are stored in a cache. |
private TConfiguration |
cc
Used to store a temporary configuration. |
static int |
FAIL
Delta Debugging test outcome: the test has failed. |
private TConfiguration |
failingSubset
Used to store the failing subset of the ddDiff algorithm. |
private static int |
INITIAL_PARTITION_SIZE
Initial partition size of the Delta Debugging algorithm. |
private int |
lastReportedLength
Helper variable to indicate the last state of the algorithm that has been displayed on screen. |
private boolean |
maximize
Maximize the input. |
private boolean |
minimize
Minimize the input. |
private boolean |
monotony
If set to true, Delta Debugging assumes that any subset of a passing test also passes and any superset of a failing test also fails. |
static int |
NONE
Delta Debugging test outcome: no outcome exists (the test has not been performed, yet). |
private Object[] |
originalConfig
An array containing the original configuration data. |
private OutcomeCache |
outcomeCache
The outcome cache stores all previously calculated test outcomes. |
static int |
PASS
Delta Debugging test outcome: the test has successfully passed. |
private TConfiguration |
passingSubset
Used to store the passing subset of the ddDiff algorithm. |
static int |
REMOVE
Resolving direction: Removes some deltas. |
private Resolver |
resolver
Resolving functionality. |
private int |
resolveType
Currently not used. |
private boolean |
resolving
Is set to true as soon as the algorithm is resolving a configuration. |
private Splitter |
splitter
Splitting functionality. |
private TConfiguration |
temporary
Used to store a temporary configuration. |
private Tester |
tester
Testing functionality. |
static int |
UNRESOLVED
Delta Debugging test outcome: the test had an unresolved outcome. |
private Vector |
viewers
Stores all registered ISimpleViewers. |
Constructor Summary | |
DD(Tester tester)
Creates a new DD object and initializes the variables to defaults. |
|
DD(Tester tester,
ISimpleViewer viewer)
Creates a new DD object and initializes the variables to defaults. |
Method Summary | |
void |
addViewer(ISimpleViewer viewer)
Adds a viewer to the registered viewers of this class. |
private void |
createOriginalConfig(TConfiguration c,
TConfiguration c2)
Creates a copy of the original configurations and stores the elements in an array. |
private TConfiguration |
dd(TConfiguration c,
int n)
The main Delta Debugging algorithm: This function applies Delta Debugging to the specified configuration. |
TConfiguration |
ddDiff(TConfiguration c)
Calculates a 1-minimal failure-inducing difference by applying the Delta Debugging algorithm. |
TConfiguration |
ddDiff(TConfiguration pass,
TConfiguration fail)
Calculates a 1-minimal failure-inducing difference by applying the * Delta Debugging algorithm. |
private TConfiguration |
ddGen(TConfiguration c,
boolean minimize,
boolean maximize)
Calls the Delta Debugging algorithm with initialized minimizing and maximizing parameters. |
TConfiguration |
ddMax(TConfiguration c)
Calls the Delta Debugging algorithm. |
TConfiguration |
ddMin(TConfiguration c)
Calls the Delta Debugging algorithm. |
TConfiguration |
ddMix(TConfiguration c)
Calls the Delta Debugging algorithm. |
private TConfiguration |
ddResolve(TConfiguration csub,
TConfiguration c,
int direction)
Resolves a configuration that produced an unresolved test outcome. |
private TConfiguration |
ddSplit(TConfiguration c,
int n)
Splits the given configuration into n subsets by calling the split method of the attached Splitter object. |
private int |
ddTest(TConfiguration c)
Testing functionality of the Delta Debugging algorithm. |
private TConfiguration |
diff(TConfiguration c1,
TConfiguration c2,
int n)
The Delta Debbuging algorithm to calculate a 1-minimal failure-inducing difference. |
ISimpleViewer[] |
getAttachedViewers()
Returns all currently attached viewers as an array or null if no viewers * are attached. |
TConfiguration |
getFailingSubset()
Returns the failing subset of a 1-minimal failure inducing difference. |
TConfiguration |
getPassingSubset()
Returns the passing subset of a 1-minimal failure-inducing difference. |
private TConfiguration |
getRealConfig(TConfiguration indexc)
Retrieves the original elements of the test case according to the specified index configuration. |
Resolver |
getResolver()
Returns the current resolver object of this DD object. |
Splitter |
getSplitter()
Returns the current splitter object of this DD object. |
Tester |
getTester()
Returns the current tester object of this DD object. |
private void |
initialize()
Initializes the class fields with default values. |
boolean |
isAssumingAxiomsHold()
Returns true if the algorithm assumes that axioms hold, false otherwise. |
boolean |
isCachingOutcomes()
Returns if test outcomes are cached. |
boolean |
isMonotone()
Returns if the algorithm assumes monotony. |
boolean |
isResolving()
Checks, if the algorithm is currently resolving. |
private void |
reportProgress(TConfiguration c,
String title)
Reports a progress information to all registered viewers. |
private void |
sendText(String message)
Convenience method to send the specified message to all attached viewers. |
void |
setAssumeAxiomsHold(boolean assumeAxiomsHold)
Sets assumeAxiomsHold. |
void |
setCacheOutcomes(boolean cacheOutcomes)
Sets the cacheOutcomes variables. |
void |
setMonotony(boolean monotony)
Sets the monotony. |
void |
setResolver(Resolver resolver)
Sets the current resolver of this DD object. |
void |
setSplitter(Splitter splitter)
Sets the current splitter of this DD object. |
void |
setTester(Tester tester)
Sets the current tester of this DD object. |
private int |
testAndResolve(TConfiguration csub,
TConfiguration r,
TConfiguration c,
int direction)
Tests a configuration as long as its test outcome is unresolved. |
private int |
testMix(TConfiguration csub,
TConfiguration c,
int direction)
Performs a testing of subsets. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PASS
public static final int FAIL
public static final int UNRESOLVED
public static final int NONE
public static final int ADD
public static final int REMOVE
private static final int INITIAL_PARTITION_SIZE
private boolean minimize
private boolean maximize
private boolean monotony
private boolean cacheOutcomes
private boolean assumeAxiomsHold
private boolean resolving
private int lastReportedLength
private int resolveType
private Object[] originalConfig
private TConfiguration failingSubset
private TConfiguration passingSubset
private TConfiguration temporary
private TConfiguration cc
private Resolver resolver
private Splitter splitter
private Tester tester
private OutcomeCache outcomeCache
private Vector viewers
Constructor Detail |
public DD(Tester tester)
public DD(Tester tester, ISimpleViewer viewer)
tester
- test class that will be used to execute tests.
* @param viewer a viewer that will be used to display information.Method Detail |
private void initialize()
private void createOriginalConfig(TConfiguration c, TConfiguration c2)
c
- the initial configuration of the passing test.
* @param c2 the initial configuration of the failing test.private TConfiguration getRealConfig(TConfiguration indexc)
indexc
- indices into the real configuration.
private int ddTest(TConfiguration c)
c
- configuration to test.
private TConfiguration ddSplit(TConfiguration c, int n)
c
- configuration to split.n
- number of subsets to create.
private TConfiguration ddResolve(TConfiguration csub, TConfiguration c, int direction)
csub
- subset of the configuration to start the resolving process.c
- configuration to be resolved.direction
- add or remove deltas to resolve the problem.
private int testAndResolve(TConfiguration csub, TConfiguration r, TConfiguration c, int direction)
csub
- initial test subset of the configuration.r
- subset that is added to the initial subset.c
- r and c form the "upper baseline".direction
- add or remove deltas.
public boolean isResolving()
private void sendText(String message)
private void reportProgress(TConfiguration c, String title)
c
- current configuration.title
- title of the information.private int testMix(TConfiguration csub, TConfiguration c, int direction)
csub
- subset of the current configuration. Will be tested.c
- complete set of subsets.direction
- add or remove deltas from the subset.
private TConfiguration ddGen(TConfiguration c, boolean minimize, boolean maximize)
c
- configuration to test.minimize
- true, if deltas are to be removed from c, false
otherwise.maximize
- true, if deltas are to be added to c, false otherwise.
private TConfiguration dd(TConfiguration c, int n)
c
- configuration to test.n
- granularity of the splitting
public TConfiguration ddMin(TConfiguration c)
c
- configuration to analyze.
public TConfiguration ddMax(TConfiguration c)
c
- configuration to analyze.
public TConfiguration ddMix(TConfiguration c)
c
- configuration to analyze.
public TConfiguration ddDiff(TConfiguration c)
c
- failing configuration to analyze.
public TConfiguration ddDiff(TConfiguration pass, TConfiguration fail)
private TConfiguration diff(TConfiguration c1, TConfiguration c2, int n)
c1
- initial passing configuration.c2
- initial failing configuration.n
- initial split size.
public boolean isAssumingAxiomsHold()
public boolean isCachingOutcomes()
public boolean isMonotone()
public ISimpleViewer[] getAttachedViewers()
public void setAssumeAxiomsHold(boolean assumeAxiomsHold)
assumeAxiomsHold
- the value to set.public void setCacheOutcomes(boolean cacheOutcomes)
cacheOutcomes
- the value to set.public void setMonotony(boolean monotony)
monotony
- the value to set.public void addViewer(ISimpleViewer viewer)
viewer
- the viewer to add.public TConfiguration getPassingSubset()
public TConfiguration getFailingSubset()
public Tester getTester()
public void setTester(Tester tester)
tester
- current tester.public Splitter getSplitter()
public void setSplitter(Splitter splitter)
splitter
- current splitter.public Resolver getResolver()
public void setResolver(Resolver resolver)
resolver
- current resolver.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |