Class TestCaseGenerator
public class TestCaseGenerator
- Inheritance
-
TestCaseGenerator
- Inherited Members
Methods
ConstructDescriptionForConcurrentTestCase(IList<TestCaseSegment>)
public static string ConstructDescriptionForConcurrentTestCase(IList<TestCaseSegment> segments)
Parameters
segmentsIList<TestCaseSegment>
Returns
ConstructDescriptionForSequentialTestCase(IList<OperationCall>)
public static string ConstructDescriptionForSequentialTestCase(IList<OperationCall> operationCalls)
Parameters
operationCallsIList<OperationCall>
Returns
CreateManualConcurrentTestCase(TestingContext, InputSet, IList<string>, IList<string>)
public static ConcurrentTestCase CreateManualConcurrentTestCase(TestingContext context, InputSet inputSet, IList<string> sequentialPrefixOperationNames, IList<string> concurrentOperationNames)
Parameters
contextTestingContextinputSetInputSetsequentialPrefixOperationNamesIList<string>concurrentOperationNamesIList<string>
Returns
CreateManualSequentialTestCase(TestingContext, InputSet, params string[])
public static SequentialTestCase CreateManualSequentialTestCase(TestingContext context, InputSet inputSet, params string[] operationNames)
Parameters
contextTestingContextinputSetInputSetoperationNamesstring[]
Returns
DeserializeConcurrentTestCases(TestingContext, string)
public static IList<ConcurrentTestCase> DeserializeConcurrentTestCases(TestingContext context, string serializedTestCases)
Parameters
contextTestingContextserializedTestCasesstring
Returns
DeserializeConcurrentTestCases<T>(TestingContext, string)
public static (T, IList<ConcurrentTestCase>) DeserializeConcurrentTestCases<T>(TestingContext context, string serializedTestCases) where T : ITestingMetadata
Parameters
contextTestingContextserializedTestCasesstring
Returns
- (T, IList<ConcurrentTestCase>)
Type Parameters
T
DeserializeSequentialTestCases(TestingContext, string)
public static IList<SequentialTestCase> DeserializeSequentialTestCases(TestingContext context, string serializedTestCases)
Parameters
contextTestingContextserializedTestCasesstring
Returns
DeserializeSequentialTestCases<T>(TestingContext, string)
public static (T, IList<SequentialTestCase>) DeserializeSequentialTestCases<T>(TestingContext context, string serializedTestCases) where T : ITestingMetadata
Parameters
contextTestingContextserializedTestCasesstring
Returns
- (T, IList<SequentialTestCase>)
Type Parameters
T
ExploreStateSpace(TestingContext, IState, InputSet, TestGenerationOptions)
This methods explores the state graph in the same way as its explored during test case generation. One difference is that it currently also fully explores the interleaving of step functions spawned the behavior (say, to model background asynchrony) with the rest of the operations, so its exploration is more exhaustive. It returns the root node of the resulting state graph to the caller.
public static StateGraphNode ExploreStateSpace(TestingContext context, IState startingState, InputSet inputSet, TestGenerationOptions options = null)
Parameters
contextTestingContextstartingStateIStateinputSetInputSetoptionsTestGenerationOptions
Returns
GenerateConcurrentTestCases(TestingContext, IState, InputSet, TestGenerationOptions)
This method generates test cases by gathering all test sequences starting from the rootNode, where each test case is a (sequentialPrefix, concurrentSteps) pair. The step functions in "sequentialPrefix" are meant to be run one after another. The step functions in "concurrentSteps" are all meant to be run concurrently. A test case here contains the labels of the step functions in consideration. This method returns a dictionary whose key is the
public static IList<ConcurrentTestCase> GenerateConcurrentTestCases(TestingContext context, IState startingState, InputSet inputSet, TestGenerationOptions options = null)
Parameters
contextTestingContextstartingStateIStateinputSetInputSetoptionsTestGenerationOptions
Returns
GenerateSequentialTestCases(TestingContext, IState, InputSet, TestGenerationOptions)
This method generates test cases by gathering all distinct paths starting from rootNode, where each path consists of the step function labels for the transitions in that path. If a path loop backs into itself, this method stops generating that path and doesn't follow the cycles. This method returns a dictionary whose key is the unique identifier for the test case and whose value is the list of operations comprising a test case.
public static IList<SequentialTestCase> GenerateSequentialTestCases(TestingContext context, IState startingState, InputSet inputSet, TestGenerationOptions options = null)
Parameters
contextTestingContextstartingStateIStateinputSetInputSetoptionsTestGenerationOptions
Returns
LoadConcurrentTestCases(TestingContext, string)
public static IList<ConcurrentTestCase> LoadConcurrentTestCases(TestingContext context, string filePath)
Parameters
contextTestingContextfilePathstring
Returns
LoadConcurrentTestCases<T>(TestingContext, string)
public static (T, IList<ConcurrentTestCase>) LoadConcurrentTestCases<T>(TestingContext context, string filePath) where T : ITestingMetadata
Parameters
contextTestingContextfilePathstring
Returns
- (T, IList<ConcurrentTestCase>)
Type Parameters
T
LoadSequentialTestCases(TestingContext, string)
public static IList<SequentialTestCase> LoadSequentialTestCases(TestingContext context, string filePath)
Parameters
contextTestingContextfilePathstring
Returns
LoadSequentialTestCases<T>(TestingContext, string)
public static (T, IList<SequentialTestCase>) LoadSequentialTestCases<T>(TestingContext context, string filePath) where T : ITestingMetadata
Parameters
contextTestingContextfilePathstring
Returns
- (T, IList<SequentialTestCase>)
Type Parameters
T
SaveConcurrentTestCases(TestingContext, string, IList<ConcurrentTestCase>)
public static void SaveConcurrentTestCases(TestingContext context, string filePath, IList<ConcurrentTestCase> testCases)
Parameters
contextTestingContextfilePathstringtestCasesIList<ConcurrentTestCase>
SaveConcurrentTestCases<T>(TestingContext, T, string, IList<ConcurrentTestCase>)
public static void SaveConcurrentTestCases<T>(TestingContext context, T testingMetadata, string filePath, IList<ConcurrentTestCase> testCases) where T : ITestingMetadata
Parameters
contextTestingContexttestingMetadataTfilePathstringtestCasesIList<ConcurrentTestCase>
Type Parameters
T
SaveSequentialTestCases(TestingContext, string, IList<SequentialTestCase>)
public static void SaveSequentialTestCases(TestingContext context, string filePath, IList<SequentialTestCase> testCases)
Parameters
contextTestingContextfilePathstringtestCasesIList<SequentialTestCase>
SaveSequentialTestCases<T>(TestingContext, T, string, IList<SequentialTestCase>)
public static void SaveSequentialTestCases<T>(TestingContext context, T testingMetadata, string filePath, IList<SequentialTestCase> testCases) where T : ITestingMetadata
Parameters
contextTestingContexttestingMetadataTfilePathstringtestCasesIList<SequentialTestCase>
Type Parameters
T
SerializeConcurrentTestCases(TestingContext, IList<ConcurrentTestCase>)
public static string SerializeConcurrentTestCases(TestingContext context, IList<ConcurrentTestCase> testCases)
Parameters
contextTestingContexttestCasesIList<ConcurrentTestCase>
Returns
SerializeConcurrentTestCases<T>(TestingContext, T, IList<ConcurrentTestCase>)
public static string SerializeConcurrentTestCases<T>(TestingContext context, T testingMetadata, IList<ConcurrentTestCase> testCases) where T : ITestingMetadata
Parameters
contextTestingContexttestingMetadataTtestCasesIList<ConcurrentTestCase>
Returns
Type Parameters
T
SerializeSequentialTestCases(TestingContext, IList<SequentialTestCase>)
public static string SerializeSequentialTestCases(TestingContext context, IList<SequentialTestCase> testCases)
Parameters
contextTestingContexttestCasesIList<SequentialTestCase>
Returns
SerializeSequentialTestCases<T>(TestingContext, T, IList<SequentialTestCase>)
public static string SerializeSequentialTestCases<T>(TestingContext context, T testingMetadata, IList<SequentialTestCase> testCases) where T : ITestingMetadata
Parameters
contextTestingContexttestingMetadataTtestCasesIList<SequentialTestCase>
Returns
Type Parameters
T
VisualizeStateSpace(TestingContext, IState, InputSet, TestGenerationOptions, VisualizationOptions)
This methods explores the state graph in the exact same way as it is explored during test case generation. It returns a GraphViz visualization of the state graph to the caller.
public static string VisualizeStateSpace(TestingContext context, IState startingState, InputSet inputSet, TestGenerationOptions options = null, VisualizationOptions visualizationOptions = null)
Parameters
contextTestingContextstartingStateIStateinputSetInputSetoptionsTestGenerationOptionsvisualizationOptionsVisualizationOptions