Class DefaultGeneratingInterleavingManager
- java.lang.Object
-
- de.rwth.swc.coffee4j.algorithmic.interleaving.manager.AbstractGeneratingInterleavingManager
-
- de.rwth.swc.coffee4j.algorithmic.interleaving.manager.DefaultGeneratingInterleavingManager
-
- All Implemented Interfaces:
GeneratingInterleavingCombinatorialTestManager,InterleavingCombinatorialTestManager
public class DefaultGeneratingInterleavingManager extends AbstractGeneratingInterleavingManager
Default implementation of the interfaceGeneratingInterleavingCombinatorialTestManager.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConstraintCheckercheckerprotected List<int[]>combinationsToCheckprotected CoverageMapcoverageMapprotected PhasecurrentPhaseprotected Set<int[]>failureInducingCombinationsprotected Set<int[]>failureInducingCombinationsToCheckprotected IdentificationStrategyidentificationStrategyprotected InterleavingGenerationReporterreporterprotected InterleavingCombinatorialTestGrouptestGroupprotected TestInputGenerationStrategytestInputGenerationStrategyprotected booleantestInputHasFailed-
Fields inherited from class de.rwth.swc.coffee4j.algorithmic.interleaving.manager.AbstractGeneratingInterleavingManager
minimalExceptionInducingCombinations, minimalExceptionInducingCombinationsToCheck
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancombinationIdentified()protected voiddetermineCombinationsToBeChecked()Add all types of combinations tocombinationsToCheck.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.Optional<int[]>initializeFeedbackChecking()initialize feedback-checking phase.Optional<int[]>initializeIdentification(int[] testInput, TestResult result)initialize identification phase for a failing test input.static GeneratingInterleavingManagerFactorymanagerFactory()protected booleannoCombinationsToBeCheckedPresent()Optional<int[]>reinitializeIdentification()reinitialize identification phase if feedback-checking phase was not successful.protected voidresetCombinationsToBeChecked()Clear the set of combinations for all types of combinations that need to be checked.protected voidterminateIdentification()split found combinations into different sets.protected voidterminateInterleavingGroup()Called when all t-tuples are covered.protected 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 de.rwth.swc.coffee4j.algorithmic.interleaving.manager.AbstractGeneratingInterleavingManager
generateNextTestInput, generateNextTestInput, getMinimalExceptionInducingCombinations, initializeClassification, postProcessExceptionInducingCombinations
-
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
-
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
-
terminateInterleavingGroup
protected void terminateInterleavingGroup()
Called when all t-tuples are covered. Post-processing possible. At leastreporter.interleavingGroupFinished must be called.
-
terminateIdentification
protected void terminateIdentification()
split found combinations into different sets. At leastfailureInducingCombinationsToCheckmust be filled andreporter.identificationFinished must be called.
-
resetCombinationsToBeChecked
protected void resetCombinationsToBeChecked()
Clear the set of combinations for all types of combinations that need to be checked. At leastfailureInducingCombinationsToCheckmust be reset.
-
noCombinationsToBeCheckedPresent
protected boolean noCombinationsToBeCheckedPresent()
- Returns:
- true iff no combinations to check are available.
-
determineCombinationsToBeChecked
protected void determineCombinationsToBeChecked()
Add all types of combinations tocombinationsToCheck. At leastfailureInducingCombinationsToCheckmust be added.
-
updateCoverage
protected void updateCoverage()
CallupdateCoverageAfterFailureInducingCombinationIsIdentified(Set)for each type of combination. At leastfailureInducingCombinationsToCheckmust be used to update.
-
managerFactory
public static GeneratingInterleavingManagerFactory managerFactory()
- Returns:
- returns an
GeneratingInterleavingManagerFactoryto create this class.
-
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.
-
-