IBM
Contents Index Previous Next



Exercise 1: Basic Concepts


What You Will Learn

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:

  1. Select Autolink: Test Cases Directory in the Options2 menu.
    The Directory name dialog is displayed.
  2. Double-click the TC directory.
  3. Click the Select button.
  4. Select Autolink: Test Steps Directory in the Options2 menu.
    Once again, the Directory name dialog is displayed.
  5. Choose the TS directory by first clicking the Current button and then double-clicking the TS directory.
  6. Click the OK button.

Note:

The directory settings can be saved when you leave the explorer.

You should also set up proper test value definitions for the inres system:

  1. Open the TEST VALUES module by clicking on the box beside.
    A number of new command buttons appear.
  2. Click the Clear Value button in the TEST VALUES module to clear all integer test values.
    A Select dialog is displayed.
  3. Choose integer.
  4. Click the OK button.
    A Prompt dialog is displayed.
  5. Click the OK button, without typing anything in the text field.
  6. Click the Def Value button in the TEST VALUES group to define a new test value for integers.
    Another Select dialog is displayed.
  7. Choose integer.
  8. Click the OK button.
    A Prompt dialog is displayed.
  9. Type 55 as the new test value in the Value field.
  10. 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.

  1. Click the Navigator button in the EXPLORE module to start the Navigator.
    The Navigator window is displayed.
  2. Navigate through the system by double-clicking in turn on the following nodes:
    1, 1, 1, 1, 1, 1, 1, 1 (i.e. 8 times transition #1),
    3,
    1, 1, 1, 1, 1, 1, 1 (i.e. 7 times transition #1),
    10,
    1, 1, 1 (i.e. 3 times transition #1),
    2,
    1, 1, 1 (i.e. 3 times transition #1)
  3. Select MSC: Save Test Case in the Autolink1 menu to save the current path as a system level MSC.
    A Prompt dialog is displayed.
  4. Type Example1 in the Test case name field.
    The test case name is identical to the name of the generated MSC.
  5. Click the OK button.
    Autolink saves a file called Example1.mpr in the MSC test cases directory.

You have now created your first MSC test case (see Figure 71). You may start the MSC Editor and take a look at it.

Note:

You can create as many MSC test cases as you like, provided that they share the same root node.

Figure 71 : MSC Example1

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.

  1. Select Test Case: Generate in the Autolink1 menu.
    A Select dialog is displayed.
  2. Select Example1.mpr.
  3. 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 All
    
    Define-Transition Symbol-Sequence
    
    Define-Symbol-Time Zero
    
    Define-Priorities 2 1 3 2 2
    
    Define-Channel-Queue ISAP1 On
    
    Define-Channel-Queue MSAP2 On
    
    Define-Max-Input-Port-Length 10
    
    
    
    Current state is reset to root.
    
    
    
    MSC 'Example1' loaded.
    
    
    
    ** Test case generation statistics **
    
    No of reports: 2.
    
      Deadlock         : 1 report
    
      MSCVerification  : 1 report
    
    Generated states: 2089.
    
    Truncated paths: 0.
    
    Unique system states: 790.
    
    Size of hash table: 8000000 (1000000 bytes)
    
    No of bits set in hash table: 1411
    
    Collision risk: 0 %
    
    Max depth: 49
    
    Current depth: -1
    
    Min state size: 388
    
    Max state size: 524
    
    Exploration started at: Sat Jan 29 13:39:14 2000
    
    Exploration ended at:   Sat Jan 29 13:39:15 2000
    
    Exploration time: 000 h, 00 m, 01 s
    
    
    
    Constraints 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.

  1. Select Test Case: Print in the Autolink1 menu.
    A Select dialog is displayed.
  2. Choose Example1.
  3. Click the OK button.
    The resulting output is:
    Example1
    
    
    
      0     ISAP1 ! ICONreq - cExample1_010
    
      1      MSAP2 ? MDATind - cExample1_009
    
      2       MSAP2 ! MDATreq - cExample1_008
    
      3        ISAP1 ? ICONconf - cExample1_007
    
      4         ISAP1 ! IDATreq - cExample1_006
    
      5          ISAP1 ! IDISreq - cExample1_005
    
      6           MSAP2 ? MDATind - cExample1_004
    
      7            MSAP2 ! MDATreq - cExample1_003
    
      8             ISAP1 ? IDISind - cExample1_001
    
      9  P           MSAP2 ? MDATind - cExample1_002
    
      8             MSAP2 ? MDATind - cExample1_002
    
      9  P           ISAP1 ? IDISind - cExample1_001
    

Modifying 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:

Adding a Constraint

Next, you can add a new constraint:

  1. Select Constraint: Define in the Autolink2 menu.
    A Prompt dialog is displayed.
  2. Type RequestCon in the Constraint name field.
  3. Click the OK button.
    A Select dialog is displayed, listing all signals in the system.
  4. Select ICONreq.
  5. Click the OK button.
    In the text area of the Explorer user interface, the following message appears:
    Constraints are checked for naming conflicts...
    
    
    
    Of course, there is no naming conflict, since there does not exist another constraint with the same name.

Renaming a Constraint

You might want to assign a more reasonable name to constraint cExample1_007 containing the signal ICONconf:

  1. Select Constraint: Rename in the Autolink2 menu.
    A Select dialog is displayed, listing all constraints currently defined.
  2. Choose cExample1_007.
  3. Click the OK button.
    A Prompt dialog is displayed.
  4. Enter ConfirmCon in the New constraint name field.
  5. 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.

  1. Select Constraint: Parameterize in the Autolink2 menu.
    A Select dialog is displayed.
  2. Select cExample1_006.
  3. Click the OK button.
    A Select dialog is displayed.
  4. Select 1 for the first signal parameter.
  5. Click the OK button.
    A Prompt dialog is displayed.
  6. Enter Data in the Formal parameter field.
  7. Click the OK button.
    The Select dialog is displayed again.
  8. This time, select 0 in order to finish parameterization.
  9. 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.

  1. Select Constraint: Merge in the Autolink2 menu.
    A Select dialog is displayed, listing all currently defined constraints.
  2. Choose cExample1_002 as the first constraint.
  3. Click the OK button.
    Another Select dialog is displayed.
  4. Choose cExample1_004 as the second constraint.
    A Prompt dialog is displayed.
  5. Enter ProtDataUnit in the Formal parameter name field.
  6. Click the OK button.

Listing the Constraints - A Second Time

To see the effect of all your operations, you can list the constraints again:

  1. 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:

  1. Select Test Case: Print in the Autolink1 menu.
    A Select dialog is displayed.
  2. Select Example1.
  3. Click the OK button.
    The output is:
    Example1
    
    
    
      0     ISAP1 ! ICONreq - cExample1_010
    
      1      MSAP2 ? MDATind - cExample1_009
    
      2       MSAP2 ! MDATreq - cExample1_008
    
      3        ISAP1 ? ICONconf - ConfirmCon
    
      4         ISAP1 ! IDATreq - cExample1_006(55)
    
      5          ISAP1 ! IDISreq - cExample1_005
    
      6           MSAP2 ? MDATind - cExample1_004
    
                      ({ id DT, num one, data 55 })
    
      7            MSAP2 ! MDATreq - cExample1_003
    
      8             ISAP1 ? IDISind - cExample1_001
    
      9  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_001
    

Saving 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:

  1. Select Constraint: Save in the Autolink2 menu.
    A Select dialog is displayed.
  2. Click the OK button without entering any text before.
    By this you indicate that you want to store all constraints.
    The File name dialog is displayed.
  3. Type Example1.con in the File field.
  4. Click the OK button.
    The constraint definitions are saved. They can be restored by the Constraint: Load command in the Autolink2 menu but you should not do that at the moment.

Removing a Constraint

A constraint can be removed:

  1. Select Constraint: Clear in the Autolink2 menu.
    A Select dialog is displayed.
  2. Select cExample1_003.
  3. Click the OK button.
    Since this constraint is currently used in a test case, an error message is displayed in the text area:
    Error clearing constraint 'cExample1_003'.
    The constraint is currently used in a test case.
  4. Once again, select Constraint: Clear in the Autolink2 menu.
    The same Select dialog as above is displayed.
  5. Select RequestCon.
  6. Click the OK button.
    This time the specified constraint is removed, since it is not referred to in any test case.

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.

  1. Select Test Suite: Save in the Autolink1 menu.
    A Prompt dialog is displayed.
  2. Type inres in the Test suite name field.
  3. Click the OK button.
    A File name dialog is displayed.
  4. Type inres.mp in the File field.
  5. Click the OK button.
    Autolink saves the test suite in file inres.mp.
    During saving, Autolink performs a few checks to ensure the consistent use of various test suite elements. You can ignore the message about test steps, since your test case does not have any test steps at all.

You can exit the Explorer now:

  1. Select Exit in the File menu.
    A Select dialog is displayed.
  2. Select Yes.
  3. Click the OK button.
    The current options are saved. You will need them in the next exercise.

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.

  1. In the Organizer, select the TTCN Test Specification chapter.
  2. Select Add Existing in the Edit menu.
    A corresponding dialog is displayed.
  3. Change the filter from "*.txt" to "*.mp" (UNIX) or "*.*" (Windows) and click the Filter button.
    Provided that you are in the right directory, the file inres.mp is shown in the Files box.
  4. Select the file inres.mp in the Files section.
  5. Click the OK button.
    The file is added to the Organizer and the TTCN Suite is opened with the test suite.

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:

  1. Select Generate Overview in the Tools menu in the Browser.
    A dialog windows appears.
  2. Click the Generate button.
    The test case index is generated.

http://www.ibm.com/rational
Contents Index Previous Next