![]() |
![]() |
![]() |
![]() |
![]() |
Exercise 1: Basic Concepts
What You Will Learn
- To set up value definitions
- To create an MSC test case definition
- To generate a test case
- To work with constraints
Preparations
First, you should define the location of the test cases and test steps directories which you have created prior to opening the SDL Explorer:
- Select Autolink: Test Cases Directory in the Options2 menu.
- Double-click the TC directory.
- Click the Select button.
- Select Autolink: Test Steps Directory in the Options2 menu.
- Choose the TS directory by first clicking the Current button and then double-clicking the TS directory.
- Click the OK button.
The directory settings can be saved when you leave the explorer.
You should also set up proper test value definitions for the inres system:
- Open the TEST VALUES module by clicking on the box beside.
- Click the Clear Value button in the TEST VALUES module to clear all integer test values.
- Choose integer.
- Click the OK button.
- Click the OK button, without typing anything in the text field.
- Click the Def Value button in the TEST VALUES group to define a new test value for integers.
- Choose integer.
- Click the OK button.
- Type 55 as the new test value in the Value field.
- Click the OK button.
Creating an MSC Test Case
The first step in the test case generation process is the choice of a path. A path describes a trace through the SDL system. This trace consists of internal and external events. External events are signals sent to or from the environment.
Autolink uses system level MSCs to abstract from a path by only considering the external events. System level MSCs consist of exactly one instance axis for the SDL system and one or more instance axes for the system environment. Figure 71 shows the MSC which you are going to create in this exercise.
- Click the Navigator button in the EXPLORE module to start the Navigator.
- Navigate through the system by double-clicking in turn on the following nodes:
- Select MSC: Save Test Case in the Autolink1 menu to save the current path as a system level MSC.
- Type Example1 in the Test case name field.
- Click the OK button.
You have now created your first MSC test case (see Figure 71). You may start the MSC Editor and take a look at it.
You can create as many MSC test cases as you like, provided that they share the same root node.
It is possible to get a list of all MSC test cases (and test steps) which are currently defined:
Generating the Test Case
In the next step, an internal test case representation has to be created which is based on the MSC test case defined above.
- Select Test Case: Generate in the Autolink1 menu.
- Select Example1.mpr.
- Click the OK button.
- Autolink performs a bit state exploration, which produces the following output in the text area of the Explorer UI:
Autolink state space options are set.Define-Scheduling AllDefine-Transition Symbol-SequenceDefine-Symbol-Time ZeroDefine-Priorities 2 1 3 2 2Define-Channel-Queue ISAP1 OnDefine-Channel-Queue MSAP2 OnDefine-Max-Input-Port-Length 10Current state is reset to root.MSC 'Example1' loaded.** Test case generation statistics **No of reports: 2.Deadlock : 1 reportMSCVerification : 1 reportGenerated states: 2089.Truncated paths: 0.Unique system states: 790.Size of hash table: 8000000 (1000000 bytes)No of bits set in hash table: 1411Collision risk: 0 %Max depth: 49Current depth: -1Min state size: 388Max state size: 524Exploration started at: Sat Jan 29 13:39:14 2000Exploration ended at: Sat Jan 29 13:39:15 2000Exploration time: 000 h, 00 m, 01 sConstraints are checked for naming conflicts...Constraint 'cExample1' is renamed to 'cExample1_001'.Constraint 'cExample1' is renamed to 'cExample1_002'.Constraint 'cExample1' is renamed to and merged with 'cExample1_002'.Constraint 'cExample1' is renamed to and merged with 'cExample1_001'.Constraint 'cExample1' is renamed to 'cExample1_003'.Constraint 'cExample1' is renamed to 'cExample1_004'.Constraint 'cExample1' is renamed to 'cExample1_005'.Constraint 'cExample1' is renamed to 'cExample1_006'.Constraint 'cExample1' is renamed to 'cExample1_007'.Constraint 'cExample1' is renamed to 'cExample1_008'.Constraint 'cExample1' is renamed to 'cExample1_009'.Constraint 'cExample1' is renamed to 'cExample1_010'.Constraints with identical signal definitions are merged automatically...... done.State space options are restored.You have now generated your first test case. This test case is kept in memory. You will save it in a TTCN test suite soon.
It is possible to get a list of all test cases which have been generated so far.
You might also want to take a look at the internal test case representation before you create the TTCN test suite.
- Select Test Case: Print in the Autolink1 menu.
- Choose Example1.
- Click the OK button.
- The resulting output is:
Example10 ISAP1 ! ICONreq - cExample1_0101 MSAP2 ? MDATind - cExample1_0092 MSAP2 ! MDATreq - cExample1_0083 ISAP1 ? ICONconf - cExample1_0074 ISAP1 ! IDATreq - cExample1_0065 ISAP1 ! IDISreq - cExample1_0056 MSAP2 ? MDATind - cExample1_0047 MSAP2 ! MDATreq - cExample1_0038 ISAP1 ? IDISind - cExample1_0019 P MSAP2 ? MDATind - cExample1_0028 MSAP2 ? MDATind - cExample1_0029 P ISAP1 ? IDISind - cExample1_001Modifying the Constraints
During test case generation, a number of constraints have been created. These constraints are also stored in memory and can be manipulated in several ways.
Listing the Constraints
First of all, it is possible to print the list of all constraints:
- Select Constraint: List in the Autolink2 menu.
- This should be the output in the text area:
cExample1_001 :IDISind { }cExample1_002 :MDATind { mSDUType1 { id DR, num one, data 55 } }cExample1_003 :MDATreq { mSDUType1 { id AK, num one, data 55 } }cExample1_004 :MDATind { mSDUType1 { id DT, num one, data 55 } }cExample1_005 :IDISreq { }cExample1_006 :IDATreq { iSDUType1 55 }cExample1_007 :ICONconf { }cExample1_008 :MDATreq { mSDUType1 { id CC, num zero, data 55 } }cExample1_009 :MDATind { mSDUType1 { id CR, num zero, data 0 } }cExample1_010 :ICONreq { }- As you can see, 10 constraints have been created during test generation.
Adding a Constraint
Next, you can add a new constraint:
- Select Constraint: Define in the Autolink2 menu.
- Type RequestCon in the Constraint name field.
- Click the OK button.
- Select ICONreq.
- Click the OK button.
Renaming a Constraint
You might want to assign a more reasonable name to constraint cExample1_007 containing the signal ICONconf:
- Select Constraint: Rename in the Autolink2 menu.
- Choose cExample1_007.
- Click the OK button.
- Enter ConfirmCon in the New constraint name field.
- Click the OK button.
Parameterize a Constraint
Constraint cExample1_006 contains a signal parameter (value 55). You can define this signal parameter to be a parameter of the constraint.
- Select Constraint: Parameterize in the Autolink2 menu.
- Select cExample1_006.
- Click the OK button.
- Select 1 for the first signal parameter.
- Click the OK button.
- Enter Data in the Formal parameter field.
- Click the OK button.
- This time, select 0 in order to finish parameterization.
- Click the OK button.
Merging Constraints
The constraints cExample1_002 and cExample1_004 only differ in the first signal parameter (which is a struct). Therefore, you might want to merge them.
- Select Constraint: Merge in the Autolink2 menu.
- Choose cExample1_002 as the first constraint.
- Click the OK button.
- Choose cExample1_004 as the second constraint.
- Enter ProtDataUnit in the Formal parameter name field.
- Click the OK button.
Listing the Constraints - A Second Time
To see the effect of all your operations, you can list the constraints again:
- Select Constraint: List in the Autolink2 menu.
- This time, the following output should be displayed in the text area:
ConfirmCon :ICONconf { }RequestCon :ICONreq { }cExample1_001 :IDISind { }cExample1_003 :MDATreq { mSDUType1 { id AK, num one, data 55 } }cExample1_004(ProtDataUnit) :MDATind { mSDUType1 ProtDataUnit }cExample1_005 :IDISreq { }cExample1_006(Data) :IDATreq { iSDUType1 Data }cExample1_008 :MDATreq { mSDUType1 { id CC, num zero, data 55 } }cExample1_009 :MDATind { mSDUType1 { id CR, num zero, data 0 } }cExample1_010 :ICONreq { }In the test case, all references to the constraints have been updated appropriately:
- Select Test Case: Print in the Autolink1 menu.
- Select Example1.
- Click the OK button.
- The output is:
Example10 ISAP1 ! ICONreq - cExample1_0101 MSAP2 ? MDATind - cExample1_0092 MSAP2 ! MDATreq - cExample1_0083 ISAP1 ? ICONconf - ConfirmCon4 ISAP1 ! IDATreq - cExample1_006(55)5 ISAP1 ! IDISreq - cExample1_0056 MSAP2 ? MDATind - cExample1_004({ id DT, num one, data 55 })7 MSAP2 ! MDATreq - cExample1_0038 ISAP1 ? IDISind - cExample1_0019 P MSAP2 ? MDATind - cExample1_004({ id DR, num one, data 55 })8 MSAP2 ? MDATind - cExample1_004({ id DR, num one, data 55 })9 P ISAP1 ? IDISind - cExample1_001Saving the Constraints
Since all constraints are deleted if they are no longer referred to by any generated test case or if you leave the Explorer, they can be saved in a file:
- Select Constraint: Save in the Autolink2 menu.
- Click the OK button without entering any text before.
- Type Example1.con in the File field.
- Click the OK button.
Removing a Constraint
- Select Constraint: Clear in the Autolink2 menu.
- Select cExample1_003.
- Click the OK button.
- Once again, select Constraint: Clear in the Autolink2 menu.
- Select RequestCon.
- Click the OK button.
Saving the TTCN Test Suite
In a final step, all generated test cases can be saved in a TTCN test suite. In this tutorial there is only one test case, but it is also possible to put several test cases into one test suite.
- Select Test Suite: Save in the Autolink1 menu.
- Type inres in the Test suite name field.
- Click the OK button.
- Type inres.mp in the File field.
- Click the OK button.
You can exit the Explorer now:
Viewing the TTCN Test Suite
Up to now, you have created a TTCN test suite. This test suite is stored in MP format (machine processable) which is somewhat hard to read. Therefore you should add it to the Organizer and open it in the TTCN Suite.
- In the Organizer, select the TTCN Test Specification chapter.
- Select Add Existing in the Edit menu.
- Change the filter from "*.txt" to "*.mp" (UNIX) or "*.*" (Windows) and click the Filter button.
- Select the file inres.mp in the Files section.
- Click the OK button.
Completing the Test Suite
The TTCN test suite you have created so far contains information in three parts: the declarations part, the constraints part and the dynamic part.
In Windows, the test suite overview part will be generated automatically for example when you open one of the overview tables or before you print the test suite. After that, it will be kept updated.
On UNIX, you have to generate and update the overview explicitly:
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |