Modeling the IUT
Model of the IUT (implementation under test) for TestCast Generator consists of EFSM (extended finite state machine), context variables, and port definitions.
EFSM is used to model the behaviour of the IUT. With TestCast Generator the third party UML CASE tools are used for drawing EFSMs. Currently TestCast Generator can import state-machines from Poseidon for UML CASE tool and Artisan Studio. In the future TestCast Generator will export state-machines from any UML CASE tools that support export in XMI 2.1 format. EFSMs for TestCast Generator are drawn as flat UML state-machines without parallel and hierarchical states. UML state machines do not have formally specified action language for presenting guard conditions, input events and actions on the transitions. It is possible to generate tests only from the formal system model. Therefore a formal action language for EFSM transitions is developed for TestCast Generator purposes.
Context variables are the variables used in EFSM for storing state information in addition to the control states of the EFSM.
Port definitions define the input/output ports used in the model. Ports define the IUT interface towards its environment (the data type of the events that the ports accept). The context variables and ports are defined in TTCN-3.
Preparing test data
Tests control part (or test sequences) is generated by TestCast Generator automatically from the IUT model. Test data used by the test sequences should be prepared manually before the tests generation. Like context variables and port definitions the test data are defined and instantiated in TTCN-3 also.
Importing model and test data to TestCast Generator
TestCast Generator generates tests from the model and data resources prepared in previous steps. For different test generation purposes the different models and different test data is needed. A term resource set is used in TestCast Generator to call such collection of data. The concept of resource set corresponds to project or solution in software development environments like Borland Delphi and Microsoft Visual Studio.
User has to create a new resource set or open an existing one before the tests generation. In creating a new resource set the user has to import EFSM model file that was created with Poseidon, TTCN-3 files with context variables, port definitions, and test data.
Defining test coverage
The structural coverage items of the state model are used to define coverage criteria in TestCast Generator. The following options are possible: selected states/transitions, all transitions, all states, all k-switches.
Test generation engines
TestCast Generator includes two test generation engines: (1) model checking engine and (2) reactive planning tester engine.
The model checking engine is used for generating test cases for the deterministic IUT. The engine utilises the Uppaal Cora model checker for finding abstract test sequences over the EFSM.
The reactive planning tester engine does not generate test cases but it generates a reactive planning tester that in test execution time generates tests on-the-fly. The reactive planning tester is targeted for generating tests for nondeterministic IUT but it can be used for generating tests for deterministic IUT also. Reactive planning tester engine uses reachability analysis in synthesizing the reactive planning tester. The reactive planning tester is generated in form of TTCN-3 script. The intelligence of the reactive planning tester is encoded as gain functions. In on-the-fly testing phase the reactive planning tester has to decide which move from the possible ones to take. For each possible move it calculates the gain function and takes the move with maximal gains. The gain function gives higher value if the next move leads faster to bigger amount of next coverage items.
Tests generation and execution
After the previous steps are completed the user has to press the “G” button and the test generator does the rest. The TTCN-3 test cases or reactive planning tester are generated under the current resource set. The generated TTCN-3 files can be imported to any TTCN-3 test tool and to run them against the IUT.
Read about TestCast different editions to see how you can execute TTCN-3 tests that have been generated with TestCast Generator.