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 theAbstractInterleavingManagerand adds the capability to store exception-inducing combinations.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConstraintCheckercheckerprotected List<int[]>combinationsToCheckprotected CoverageMapcoverageMapprotected PhasecurrentPhaseprotected Set<int[]>failureInducingCombinationsprotected Set<int[]>failureInducingCombinationsToCheckprotected IdentificationStrategyidentificationStrategyprotected Map<int[],Class<? extends Throwable>>minimalExceptionInducingCombinationsprotected Set<int[]>minimalExceptionInducingCombinationsToCheckprotected InterleavingGenerationReporterreporterprotected InterleavingCombinatorialTestGrouptestGroupprotected TestInputGenerationStrategytestInputGenerationStrategyprotected booleantestInputHasFailed
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancombinationIdentified()protected abstract voiddetermineCombinationsToBeChecked()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 booleannoCombinationsToBeCheckedPresent()protected List<int[]>postProcessExceptionInducingCombinations()Optional<int[]>reinitializeIdentification()reinitialize identification phase if feedback-checking phase was not successful.protected abstract voidresetCombinationsToBeChecked()Clear the set of combinations for all types of combinations that need to be checked.protected abstract voidterminateIdentification()split found combinations into different sets.protected abstract voidterminateInterleavingGroup()Called when all t-tuples are covered.protected abstract voidupdateCoverage()CallupdateCoverageAfterFailureInducingCombinationIsIdentified(Set)for each type of combination.voidupdateCoverage(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:
initializeClassificationin interfaceGeneratingInterleavingCombinatorialTestManager- Parameters:
errorConstraintExceptionCausingTestInputs- all test inputs that triggered anErrorConstraintExceptionduring 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:
generateNextTestInputin 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:
getMinimalExceptionInducingCombinationsin 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:InterleavingCombinatorialTestManagerinitialize identification phase for a failing test input.- Specified by:
initializeIdentificationin interfaceInterleavingCombinatorialTestManager- Parameters:
testInput- failing test input to find exception/failure-inducing combination for.result-TestResultof 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:InterleavingCombinatorialTestManagerreinitialize identification phase if feedback-checking phase was not successful.- Specified by:
reinitializeIdentificationin interfaceInterleavingCombinatorialTestManager- Returns:
- first test input needed for identification.
-
initializeFeedbackChecking
public Optional<int[]> initializeFeedbackChecking()
Description copied from interface:InterleavingCombinatorialTestManagerinitialize feedback-checking phase.- Specified by:
initializeFeedbackCheckingin interfaceInterleavingCombinatorialTestManager- Returns:
- first test input needed for identification.
-
updateCoverage
public void updateCoverage(int[] combination)
Description copied from interface:InterleavingCombinatorialTestManagerupdates the coverage map for a given (passing) test input- Specified by:
updateCoveragein interfaceInterleavingCombinatorialTestManager- Parameters:
combination- to update coverage map for
-
combinationIdentified
public boolean combinationIdentified()
- Specified by:
combinationIdentifiedin 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 leastfailureInducingCombinationsToCheckmust be reset.
-
updateCoverage
protected abstract void updateCoverage()
CallupdateCoverageAfterFailureInducingCombinationIsIdentified(Set)for each type of combination. At leastfailureInducingCombinationsToCheckmust be used to update.
-
determineCombinationsToBeChecked
protected abstract void determineCombinationsToBeChecked()
Add all types of combinations tocombinationsToCheck. At leastfailureInducingCombinationsToCheckmust 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 leastfailureInducingCombinationsToCheckmust be filled andreporter.identificationFinished must be called.
-
-