public abstract class SuspiciousCombinationAlgorithm extends Object implements FaultCharacterizationAlgorithm
The class keeps two sets of suspicious combinations in memory: the current one, and one from last iteration. This
is needed to calculate differences. Additionally, the FaultCharacterizationConfiguration and all test results
are stored.
| Modifier and Type | Field and Description |
|---|---|
protected FaultCharacterizationConfiguration |
configuration |
protected Set<IntArrayWrapper> |
previousSuspiciousCombinations |
protected Set<IntArrayWrapper> |
suspiciousCombinations |
protected Map<IntArrayWrapper,TestResult> |
testResults |
| Modifier | Constructor and Description |
|---|---|
protected |
SuspiciousCombinationAlgorithm(FaultCharacterizationConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
List<int[]> |
computeNextTestInputs(Map<int[],TestResult> nextTestResults)
In the first iteration all relevant sub combinations of failed test inputs are calculated via the
getRelevantSubCombinations(int[]) method. |
protected abstract List<IntArrayWrapper> |
generateNextTestInputs(Map<int[],TestResult> newTestResults)
The concrete algorithm generates test for which it needs the result for better fault characterization.
|
protected ConstraintChecker |
getChecker() |
protected InputParameterModel |
getModel() |
protected abstract Set<IntArrayWrapper> |
getRelevantSubCombinations(int[] combination)
Defined which sub-combinations of any given combination can be part of the suspicious set.
|
protected Reporter |
getReporter() |
protected abstract boolean |
shouldGenerateFurtherTestInputs() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomputeFailureInducingCombinationsprotected final FaultCharacterizationConfiguration configuration
protected final Map<IntArrayWrapper,TestResult> testResults
protected Set<IntArrayWrapper> previousSuspiciousCombinations
protected Set<IntArrayWrapper> suspiciousCombinations
protected SuspiciousCombinationAlgorithm(FaultCharacterizationConfiguration configuration)
protected InputParameterModel getModel()
protected ConstraintChecker getChecker()
protected Reporter getReporter()
public List<int[]> computeNextTestInputs(Map<int[],TestResult> nextTestResults)
getRelevantSubCombinations(int[]) method. In every iteration the relevant sub combinations of all
successful test inputs are then subtracted from the suspicious combinations. Earlier, the suspicious set of last
iteration was saved to previousSuspiciousCombinations.
If the concrete algorithm now decides more test inputs should be generated
(shouldGenerateFurtherTestInputs()), this is done via generateNextTestInputs(java.util.Map<int[], de.rwth.swc.coffee4j.engine.TestResult>). Otherwise, an empty
list is returned.
computeNextTestInputs in interface FaultCharacterizationAlgorithmnextTestResults - the results of either the initial test suite in the first iteration, or all test inputs
generated in the previous generation. Must not be null nor emptyNullPointerException - if nextTestResults is nullIllegalArgumentException - if nextTestResults is emptyprotected abstract Set<IntArrayWrapper> getRelevantSubCombinations(int[] combination)
combination - for which the relevant sub-combinations are neededprotected abstract boolean shouldGenerateFurtherTestInputs()
FaultCharacterizationAlgorithm.computeFailureInducingCombinations()
will be called nextprotected abstract List<IntArrayWrapper> generateNextTestInputs(Map<int[],TestResult> newTestResults)
newTestResults - the results from the test inputs generated in the last iteration of the initially generated
test inputs if in the first iterationCopyright © 2019. All rights reserved.