Class Aifl
- java.lang.Object
-
- de.rwth.swc.coffee4j.engine.characterization.SuspiciousCombinationAlgorithm
-
- de.rwth.swc.coffee4j.engine.characterization.aifl.Aifl
-
- All Implemented Interfaces:
FaultCharacterizationAlgorithm
- Direct Known Subclasses:
IterationBasedIterAifl
public class Aifl extends SuspiciousCombinationAlgorithm
The implementation of the AIFL fault characterization algorithm as described in "A Software Debugging Method Based on Pairwise Testing". Generates only one set of new test inputs if necessary. As a result, all following iterations will return an empty set of test inputs. Failure-inducing combinations are calculated by subtracting all sub- combinations of failed test inputs and then subtracting those in successful ones.Additional test inputs are generated by mutating values in failed tests one by one. This means an additional n test inputs per failed test input (n being the number of parameters). For example, if test input (0, 1, 2, 0, 1) failed, 5 new test inputs would be generated: (-, 1, 2, 0, 1), (0, -, 1, 2, 0, 1), (0, 1, -, 0, 1), (0, 1, 2, -, 1), (0, 1, 2, 0, -). "-" stands for an arbitrary different other value.
Important Information: -Generates many additional test inputs if there are many parameters -Generates many additional test inputs if there are many failing test inputs -Does not order failure-inducing combinations by probability and can return quite a few of them -Does not consider constraints
-
-
Field Summary
-
Fields inherited from class de.rwth.swc.coffee4j.engine.characterization.SuspiciousCombinationAlgorithm
configuration, previousSuspiciousCombinations, suspiciousCombinations, testResults
-
-
Constructor Summary
Constructors Constructor Description Aifl(FaultCharacterizationConfiguration configuration)Builds a new instance of the algorithm for a given configuration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FaultCharacterizationAlgorithmFactoryaifl()Can be used as a convenience method to describe that AIFL should be used as aFaultCharacterizationAlgorithmFactory.java.util.List<int[]>computeFailureInducingCombinations()Computes a list of most likely failure inducing combinations refined from previous calls toFaultCharacterizationAlgorithm.computeNextTestInputs(Map).java.util.List<IntArrayWrapper>generateNextTestInputs(java.util.Map<int[],TestResult> newTestResults)The concrete algorithm generates test for which it needs the result for better fault characterization.java.util.Set<IntArrayWrapper>getRelevantSubCombinations(int[] combination)Defined which sub-combinations of any given combination can be part of the suspicious set.booleanshouldGenerateFurtherTestInputs()-
Methods inherited from class de.rwth.swc.coffee4j.engine.characterization.SuspiciousCombinationAlgorithm
computeNextTestInputs, getChecker, getModel, getReporter
-
-
-
-
Constructor Detail
-
Aifl
public Aifl(FaultCharacterizationConfiguration configuration)
Builds a new instance of the algorithm for a given configuration. The constraints checker in this configuration will be ignored.- Parameters:
configuration- for knowing which combinations can be failure-inducing/which test inputs can be generated. Must not benull- Throws:
java.lang.NullPointerException- if configuration isnull
-
-
Method Detail
-
aifl
public static FaultCharacterizationAlgorithmFactory aifl()
Can be used as a convenience method to describe that AIFL should be used as aFaultCharacterizationAlgorithmFactory.- Returns:
- a factory using the constructor (
Aifl(FaultCharacterizationConfiguration)) to create newFaultCharacterizationAlgorithminstances
-
getRelevantSubCombinations
public java.util.Set<IntArrayWrapper> getRelevantSubCombinations(int[] combination)
Description copied from class:SuspiciousCombinationAlgorithmDefined which sub-combinations of any given combination can be part of the suspicious set. For example, BEN only works on all t-value-combinations while AIFL considers all possible sub-combinations.- Specified by:
getRelevantSubCombinationsin classSuspiciousCombinationAlgorithm- Parameters:
combination- for which the relevant sub-combinations are needed- Returns:
- all sub-combination the concrete algorithm considers
-
shouldGenerateFurtherTestInputs
public boolean shouldGenerateFurtherTestInputs()
- Specified by:
shouldGenerateFurtherTestInputsin classSuspiciousCombinationAlgorithm- Returns:
- Whether further test inputs should be generated. If not,
FaultCharacterizationAlgorithm.computeFailureInducingCombinations()will be called next
-
generateNextTestInputs
public java.util.List<IntArrayWrapper> generateNextTestInputs(java.util.Map<int[],TestResult> newTestResults)
Description copied from class:SuspiciousCombinationAlgorithmThe concrete algorithm generates test for which it needs the result for better fault characterization. If no further characterization is needed, an empty list should be returned.- Specified by:
generateNextTestInputsin classSuspiciousCombinationAlgorithm- Parameters:
newTestResults- the results from the test inputs generated in the last iteration of the initially generated test inputs if in the first iteration- Returns:
- test inputs for which the result is needed
-
computeFailureInducingCombinations
public java.util.List<int[]> computeFailureInducingCombinations()
Description copied from interface:FaultCharacterizationAlgorithmComputes a list of most likely failure inducing combinations refined from previous calls toFaultCharacterizationAlgorithm.computeNextTestInputs(Map). The combinations returned by this method are not guaranteed to be faulty, but it is guaranteed that no test input executed which contained this combination was successful.- Returns:
- a list of faulty combinations. The list may be ranked, depending on the underlying algorithm. If this list is ranked the combinations on positions with smaller indices are more likely to be failure inducing
-
-