Class CachingDelegatingSequentialCombinatorialTestManager
- java.lang.Object
-
- de.rwth.swc.coffee4j.algorithmic.sequential.manager.CachingDelegatingSequentialCombinatorialTestManager
-
- All Implemented Interfaces:
SequentialCombinatorialTestManager
public class CachingDelegatingSequentialCombinatorialTestManager extends Object implements SequentialCombinatorialTestManager
ASequentialCombinatorialTestManager
which does not generate test inputs by itself but delegates this to another manager. However, it does add caching capability to any given manager. This means no test input is returned twice across all two methods. For example, if the initial test input [0, 0, 0] has been returned, it will not be returned again for fault characterization. Instead the cached result is used. With an appropriate cache, results can even be shared over multiple runs if that should ever be desirable.
-
-
Constructor Summary
Constructors Constructor Description CachingDelegatingSequentialCombinatorialTestManager(TestResultCache cache, SequentialCombinatorialTestManager generator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<int[]>
generateAdditionalTestInputsWithResult(int[] testInput, TestResult testResult)
Generates additional test inputs based on results of previous test inputs normally generated by eitherSequentialCombinatorialTestManager.generateInitialTests()
or this method in a previous iteration.List<int[]>
generateInitialTests()
Generates all initial test inputs for execution.SequentialCombinatorialTestManager
getGenerator()
-
-
-
Constructor Detail
-
CachingDelegatingSequentialCombinatorialTestManager
public CachingDelegatingSequentialCombinatorialTestManager(TestResultCache cache, SequentialCombinatorialTestManager generator)
-
-
Method Detail
-
generateInitialTests
public List<int[]> generateInitialTests()
Description copied from interface:SequentialCombinatorialTestManager
Generates all initial test inputs for execution. This should generate at least one test input if dynamic generation viaSequentialCombinatorialTestManager.generateAdditionalTestInputsWithResult(int[], TestResult)
should be used, as most front-ends won't callSequentialCombinatorialTestManager.generateAdditionalTestInputsWithResult(int[], TestResult)
if this returned no test input.- Specified by:
generateInitialTests
in interfaceSequentialCombinatorialTestManager
- Returns:
- a list of all initial test inputs. It is not guaranteed that these test inputs don't contain duplicates
-
generateAdditionalTestInputsWithResult
public List<int[]> generateAdditionalTestInputsWithResult(int[] testInput, TestResult testResult)
Description copied from interface:SequentialCombinatorialTestManager
Generates additional test inputs based on results of previous test inputs normally generated by eitherSequentialCombinatorialTestManager.generateInitialTests()
or this method in a previous iteration. For example, this functionality can be used to implement dynamic test input generation or fault characterization (or a combination of both).- Specified by:
generateAdditionalTestInputsWithResult
in interfaceSequentialCombinatorialTestManager
- Parameters:
testInput
- the test input for which's result further test inputs should be generatedtestResult
- the result of the test input- Returns:
- a list of additional test inputs generated based on the result of the given test inputs. This does not necessarily have to return any test inputs for each call
-
getGenerator
public SequentialCombinatorialTestManager getGenerator()
-
-