Class AbstractGeneratingInterleavingManager
- java.lang.Object
-
- de.rwth.swc.coffee4j.algorithmic.interleaving.manager.AbstractGeneratingInterleavingManager
-
- All Implemented Interfaces:
GeneratingInterleavingCombinatorialTestManager
,InterleavingCombinatorialTestManager
- Direct Known Subclasses:
DefaultGeneratingInterleavingManager
public abstract class AbstractGeneratingInterleavingManager extends Object implements GeneratingInterleavingCombinatorialTestManager
Abstract class implementingGeneratingInterleavingCombinatorialTestManager
.Extends theAbstractInterleavingManager
and adds the capability to store exception-inducing combinations.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConstraintChecker
checker
protected List<int[]>
combinationsToCheck
protected CoverageMap
coverageMap
protected Phase
currentPhase
protected Set<int[]>
failureInducingCombinations
protected Set<int[]>
failureInducingCombinationsToCheck
protected IdentificationStrategy
identificationStrategy
protected Map<int[],Class<? extends Throwable>>
minimalExceptionInducingCombinations
protected Set<int[]>
minimalExceptionInducingCombinationsToCheck
protected InterleavingGenerationReporter
reporter
protected InterleavingCombinatorialTestGroup
testGroup
protected TestInputGenerationStrategy
testInputGenerationStrategy
protected boolean
testInputHasFailed
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
combinationIdentified()
protected abstract void
determineCombinationsToBeChecked()
Add all types of combinations tocombinationsToCheck
.protected Optional<int[]>
generateNextTestInput()
Method used when a new test input is needed during Generation-Phase.Optional<int[]>
generateNextTestInput(int[] testInput, TestResult result)
protected Optional<int[]>
generateNextTestInputForFeedbackChecking(int[] testInput, TestResult result)
Method used when a new test input is needed during Feedback-Checking-Phase.protected Optional<int[]>
generateNextTestInputForIdentification(int[] testInput, TestResult result)
Method used when a new test input is needed during Identification-Phase.Map<int[],Class<? extends Throwable>>
getMinimalExceptionInducingCombinations()
Optional<int[]>
initializeClassification(Map<int[],TestResult> errorConstraintExceptionCausingTestInputs)
Optional<int[]>
initializeFeedbackChecking()
initialize feedback-checking phase.Optional<int[]>
initializeIdentification(int[] testInput, TestResult result)
initialize identification phase for a failing test input.protected abstract boolean
noCombinationsToBeCheckedPresent()
protected List<int[]>
postProcessExceptionInducingCombinations()
Optional<int[]>
reinitializeIdentification()
reinitialize identification phase if feedback-checking phase was not successful.protected abstract void
resetCombinationsToBeChecked()
Clear the set of combinations for all types of combinations that need to be checked.protected abstract void
terminateIdentification()
split found combinations into different sets.protected abstract void
terminateInterleavingGroup()
Called when all t-tuples are covered.protected abstract void
updateCoverage()
CallupdateCoverageAfterFailureInducingCombinationIsIdentified(Set)
for each type of combination.void
updateCoverage(int[] combination)
updates the coverage map for a given (passing) test input-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.rwth.swc.coffee4j.algorithmic.interleaving.manager.InterleavingCombinatorialTestManager
combinationIdentified, initializeFeedbackChecking, initializeIdentification, reinitializeIdentification, updateCoverage
-
-
-
-
Field Detail
-
minimalExceptionInducingCombinations
protected Map<int[],Class<? extends Throwable>> minimalExceptionInducingCombinations
-
minimalExceptionInducingCombinationsToCheck
protected Set<int[]> minimalExceptionInducingCombinationsToCheck
-
reporter
protected final InterleavingGenerationReporter reporter
-
coverageMap
protected final CoverageMap coverageMap
-
checker
protected final ConstraintChecker checker
-
testInputGenerationStrategy
protected final TestInputGenerationStrategy testInputGenerationStrategy
-
identificationStrategy
protected final IdentificationStrategy identificationStrategy
-
testGroup
protected final InterleavingCombinatorialTestGroup testGroup
-
failureInducingCombinationsToCheck
protected Set<int[]> failureInducingCombinationsToCheck
-
failureInducingCombinations
protected final Set<int[]> failureInducingCombinations
-
combinationsToCheck
protected final List<int[]> combinationsToCheck
-
currentPhase
protected Phase currentPhase
-
testInputHasFailed
protected boolean testInputHasFailed
-
-
Method Detail
-
initializeClassification
public Optional<int[]> initializeClassification(Map<int[],TestResult> errorConstraintExceptionCausingTestInputs)
- Specified by:
initializeClassification
in interfaceGeneratingInterleavingCombinatorialTestManager
- Parameters:
errorConstraintExceptionCausingTestInputs
- all test inputs that triggered anErrorConstraintException
during testing.- Returns:
- next test input to execute or an empty Optional if no further tests are needed for classification
-
generateNextTestInput
public Optional<int[]> generateNextTestInput(int[] testInput, TestResult result)
- Specified by:
generateNextTestInput
in interfaceInterleavingCombinatorialTestManager
- Parameters:
testInput
- previously executed test input. Null if called for the first time.result
- result of previously executed test input. Null if called for the first time.- Returns:
- next test input needed for the current phase.
Empty Optional, if
- all t-tuples covered,
- or possibly exception/failure-inducing combination is identified,
- or feedback-checking finished.
-
generateNextTestInput
protected Optional<int[]> generateNextTestInput()
Method used when a new test input is needed during Generation-Phase.- Returns:
- next test input. Null, if all valid t-tuples are covered.
-
getMinimalExceptionInducingCombinations
public Map<int[],Class<? extends Throwable>> getMinimalExceptionInducingCombinations()
- Specified by:
getMinimalExceptionInducingCombinations
in interfaceGeneratingInterleavingCombinatorialTestManager
- Returns:
- set of all found (most-likely) error-combinations
-
postProcessExceptionInducingCombinations
protected List<int[]> postProcessExceptionInducingCombinations()
-
initializeIdentification
public Optional<int[]> initializeIdentification(int[] testInput, TestResult result)
Description copied from interface:InterleavingCombinatorialTestManager
initialize identification phase for a failing test input.- Specified by:
initializeIdentification
in interfaceInterleavingCombinatorialTestManager
- Parameters:
testInput
- failing test input to find exception/failure-inducing combination for.result
-TestResult
of the failing test case containing information needed to decide whether it is failure- or exception-inducing- Returns:
- first test input needed for identification.
-
reinitializeIdentification
public Optional<int[]> reinitializeIdentification()
Description copied from interface:InterleavingCombinatorialTestManager
reinitialize identification phase if feedback-checking phase was not successful.- Specified by:
reinitializeIdentification
in interfaceInterleavingCombinatorialTestManager
- Returns:
- first test input needed for identification.
-
initializeFeedbackChecking
public Optional<int[]> initializeFeedbackChecking()
Description copied from interface:InterleavingCombinatorialTestManager
initialize feedback-checking phase.- Specified by:
initializeFeedbackChecking
in interfaceInterleavingCombinatorialTestManager
- Returns:
- first test input needed for identification.
-
updateCoverage
public void updateCoverage(int[] combination)
Description copied from interface:InterleavingCombinatorialTestManager
updates the coverage map for a given (passing) test input- Specified by:
updateCoverage
in interfaceInterleavingCombinatorialTestManager
- Parameters:
combination
- to update coverage map for
-
combinationIdentified
public boolean combinationIdentified()
- Specified by:
combinationIdentified
in interfaceInterleavingCombinatorialTestManager
- Returns:
- true iff currently checked combination is most likely exception/failure-inducing
-
generateNextTestInputForIdentification
protected Optional<int[]> generateNextTestInputForIdentification(int[] testInput, TestResult result)
Method used when a new test input is needed during Identification-Phase.- Parameters:
testInput
- previously executed test input.result
- result of previously executed test input.- Returns:
- next test input. Null, if possibly failure-inducing combination is identified.
-
generateNextTestInputForFeedbackChecking
protected Optional<int[]> generateNextTestInputForFeedbackChecking(int[] testInput, TestResult result)
Method used when a new test input is needed during Feedback-Checking-Phase.- Parameters:
testInput
- previously executed test input.result
- result of previously executed test input.- Returns:
- next test input. Null, if maximum number of checks is executed or combination is not failure-inducing.
-
resetCombinationsToBeChecked
protected abstract void resetCombinationsToBeChecked()
Clear the set of combinations for all types of combinations that need to be checked. At leastfailureInducingCombinationsToCheck
must be reset.
-
updateCoverage
protected abstract void updateCoverage()
CallupdateCoverageAfterFailureInducingCombinationIsIdentified(Set)
for each type of combination. At leastfailureInducingCombinationsToCheck
must be used to update.
-
determineCombinationsToBeChecked
protected abstract void determineCombinationsToBeChecked()
Add all types of combinations tocombinationsToCheck
. At leastfailureInducingCombinationsToCheck
must be added.
-
noCombinationsToBeCheckedPresent
protected abstract boolean noCombinationsToBeCheckedPresent()
- Returns:
- true iff no combinations to check are available.
-
terminateInterleavingGroup
protected abstract void terminateInterleavingGroup()
Called when all t-tuples are covered. Post-processing possible. At leastreporter
.interleavingGroupFinished must be called.
-
terminateIdentification
protected abstract void terminateIdentification()
split found combinations into different sets. At leastfailureInducingCombinationsToCheck
must be filled andreporter
.identificationFinished must be called.
-
-