[Previous] [Next] [Contents] [Index]


    Tutorial: The Autolink

This tutorial is intended to guide you through some of the features of Autolink. There are some aspects of Autolink which are not covered by this tutorial. For a complete description of all Autolink facilities, please see Using Autolink.

To be able to follow the tutorial, some experience of the SDT Validator is needed. Therefore you should have read and practised Tutorial: The SDT Validator. You also need to have basic knowledge of ITEX.

The example protocol used in this tutorial is the inres system, the same as the one used in the TTCN Link tutorial.

Table of Contents 

Purpose of This Tutorial

The purpose of this tutorial is to make you familiar with Autolink. The tutorial is split into three parts. You are strongly recommended to read the tutorial sequentially as each exercise is founded on the previous one.

In the first exercise, you will start by creating a simple MSC. Based on this MSC, you will generate a TTCN test case and save it in a test suite. You will also learn how to manipulate constraints.

In the second session, you will develop a structured MSC. Once again a TTCN test case is generated, but this time by a direct MSC into TTCN translation. Additionally, so-called translation rules are introduced as a simple example for an Autolink configuration.

In the third part, you will use the Power Walk algorithm to create a large number of MSC test cases automatically. You will also learn how to save and load generated test cases in Autolink. This facility will allow you to compute test cases separately and distribute test generation over several computers (provided that you have more than one license).

It is assumed that you know how to generate an SDT Validator. In addition, you should be familiar with the basic functionality of the SDT Validator, the MSC Editor and ITEX. You may also find it useful to have knowledge of MSC diagrams.

Note:  Platform differences

This tutorial is possible to run on both the UNIX and Windows platform, and is described in a way common to both platforms. In case there are differences between the platforms, this is indicated by texts like "on UNIX", "Windows only", etc.

When such platform indicators are found, please pay attention only to the instructions for the platform you are running on.

Basics of Autolink

Autolink assists you in the automatic generation of TTCN test suites based on an SDL specification. In a simple approach, a TTCN test suite is generated in three steps:

  1. One or more system level Message Sequence Charts have to be defined. System level MSCs contain the externally visible events of a path. These events describe the correct test sequences of a TTCN test case.
  2. The MSCs defined in step 1 are used to generate internal test case representations.
  3. All internal test case representations are saved as a test suite in a file in TTCN-MP format.

Constraints can be added, modified and deleted between any of the above steps.

Getting Ready to Use Autolink

In order to use Autolink, an SDT Validator application has to be generated and started. In this exercise, you will use the inres system, which is found in $telelogic/sdt/examples/inres.

"Inres" is short for Initiator-Responder. The inres system is an example of a simplified communication protocol intended to give a secure transfer of information over an unsafe communication medium. It provides a one-way, connection-oriented communication service that uses sequence numbers and retransmission to ensure that messages sent to the initiator side, are correctly received at the responder side.

Note: 

In order to generate a validator application that behaves as stated in the exercises, you should copy all files of the inres protocol from the SDT distribution to your working directory.

You also have to create two directories where MSC test steps and test cases will be stored.

  1. In your current working directory, create two subdirectories called TC (used for test cases) and TS (used for test steps).
  2. Start Telelogic Tau and open the inres system in the Organizer.
  3. Generate an inres validator and open it in the Validator UI.

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

  1. Select Autolink: Test Cases Directory in the Options2 menu.

  2. The Directory name dialog is displayed.
  3. Double-click the TC directory.
  4. Click the OK button.
  5. Select Autolink: Test Steps Directory in the Options2 menu.

  6. Once again, the Directory name dialog is displayed.
  7. Choose the TS directory by first clicking the Current button and then double-clicking the TS directory.
  8. Click the OK button.

Note: 

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

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.

  2. A number of new command buttons appears.
  3. Click the Clear Value button in the TEST VALUES module to clear all integer test values.

  4. A Select dialog is displayed.
  5. Choose integer.
  6. Click the OK button.

  7. A Prompt dialog is displayed.
  8. Click the OK button, without typing anything in the text field.
  9. Click the Def Value button in the TEST VALUES group to define a new test value for integers.

  10. Another Select dialog is displayed.
  11. Choose integer.
  12. Click the OK button.

  13. A Prompt dialog is displayed.
  14. Type 55 as the new test value in the Value field.
  15. 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.

  2. The Navigator window is displayed.
  3. Navigate through the system by double-clicking in turn on the following nodes:

  4. 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)
  5. Select MSC: Save Test Case in the Autolink1 menu to save the current path as a system level MSC.

  6. A Prompt dialog is displayed.
  7. Type Example1 in the Test case name field.

  8. The test case name is identical to the name of the generated MSC.
  9. Click the OK button.

  10. 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

Extracted pic [3]

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.

  2. A Select dialog is displayed.
  3. Select Example1.mpr.
  4. Click the OK button.

  5. Autolink performs a bit state exploration, which produces the following output in the text area of the Validator 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: 1.
      MSCVerification  : 1 report
    Generated states: 1614.
    Truncated paths: 0.
    Unique system states: 605.
    Size of hash table: 8000000 (1000000 bytes)
    No of bits set in hash table: 1210
    Collision risk: 0 %
    
    Max depth: 48
    Current depth: -1
    Min state size: 432
    Max state size: 580
    Exploration started at: Tue Feb 16 22:42:08 1999
    Exploration ended at:   Tue Feb 16 22:42:08 1999
    Exploration time: 000 h, 00 m, 00 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.

  2. A Select dialog is displayed.
  3. Choose Example1.
  4. Click the OK button.

  5. The resulting output is:

    Example1
    
      0 P: ISAP1 ! ICONreq - cExample1_010
      1  P: MSAP2 ? MDATind - cExample1_009
      2   P: MSAP2 ! MDATreq - cExample1_008
      3    P: ISAP1 ? ICONconf - cExample1_007
      4     P: ISAP1 ! IDATreq - cExample1_006
      5      P: ISAP1 ! IDISreq - cExample1_005
      6       P: MSAP2 ? MDATind - cExample1_004
      7        P: MSAP2 ! MDATreq - cExample1_003
      8         P: ISAP1 ? IDISind - cExample1_001
      9          P: MSAP2 ? MDATind - cExample1_002
      8         P: 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.

  2. A Prompt dialog is displayed.
  3. Type RequestCon in the Constraint name field.
  4. Click the OK button.

  5. A Select dialog is displayed, listing all signals in the system.
  6. Select ICONreq.
  7. Click the OK button.

  8. In the text area of the Validator 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.

  2. A Select dialog is displayed, listing all constraints currently defined.
  3. Choose cExample1_007.
  4. Click the OK button.

  5. A Prompt dialog is displayed.
  6. Enter ConfirmCon in the New constraint name field.
  7. 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.

  2. A Select dialog is displayed.
  3. Select cExample1_006.
  4. Click the OK button.

  5. A Select dialog is displayed.
  6. Select 1 for the first signal parameter.
  7. Click the OK button.

  8. A Prompt dialog is displayed.
  9. Enter Data in the Formal parameter field.
  10. Click the OK button.

  11. The Select dialog is displayed again.
  12. This time, select 0 in order to finish parameterization.
  13. 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.

  2. A Select dialog is displayed, listing all currently defined constraints.
  3. Choose cExample1_002 as the first constraint.
  4. Click the OK button.

  5. Another Select dialog is displayed.
  6. Choose cExample1_004 as the second constraint.

  7. A Prompt dialog is displayed.
  8. Enter ProtDataUnit in the Formal parameter name field.
  9. 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.

  2. 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.

  2. A Select dialog is displayed.
  3. Select Example1.
  4. Click the OK button.

  5. The output is:

    Example1
    
      0 P: ISAP1 ! ICONreq - cExample1_010
      1  P: MSAP2 ? MDATind - cExample1_009
      2   P: MSAP2 ! MDATreq - cExample1_008
      3    P: ISAP1 ? ICONconf - ConfirmCon
      4     P: ISAP1 ! IDATreq - cExample1_006(55)
      5      P: ISAP1 ! IDISreq - cExample1_005
      6       P: MSAP2 ? MDATind - cExample1_004
                ({ id DT, num one, data 55 })
      7        P: MSAP2 ! MDATreq - cExample1_003
      8         P: ISAP1 ? IDISind - cExample1_001
      9          P: MSAP2 ? MDATind - cExample1_004
                ({ id DR, num one, data 55 })
      8         P: 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 Validator, they can be saved in a file:

  1. Select Constraint: Save in the Autolink2 menu.

  2. A Select dialog is displayed.
  3. Click the OK button.

  4. The File name dialog is displayed.
  5. Type Example1.con in the File field.
  6. Click the OK button.

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

  2. A Select dialog is displayed.
  3. Select cExample1_003.
  4. Click the OK button.

  5. 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.


  6. Once again, select Constraint: Clear in the Autolink2 menu.

  7. The same Select dialog as above is displayed.
  8. Select RequestCon.
  9. Click the OK button.

  10. 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.

  2. A Prompt dialog is displayed.
  3. Type inres in the Test suite name field.
  4. Click the OK button.

  5. A File name dialog is displayed.
  6. Type inres.mp in the File field.
  7. Click the OK button.

  8. Autolink saves the test suite in file inres.mp.

    If you get any messages about test steps, you can ignore them, since your test case does not have any test steps at all.

You can exit the Validator now:

  1. Select Exit in the File menu.

  2. A Select dialog is displayed.
  3. Select Yes.
  4. Click the OK button.

  5. 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 have to convert the test suite to GR (graphical notation) before you include it in the Organizer and open it in ITEX.

  1. In the Organizer, select Convert to GR in the Generate menu.

  2. The Convert to GR dialog is displayed.
  3. Click the Convert TTCN MP to TTCN GR radio button.
  4. Select inres.mp as the source MP file.
  5. Optionally, you may change the destination directory for the generated TTCN-GR file.
  6. Click the Convert button.

  7. A file called inres.itex is created in the destination directory.
  8. Select the TTCN Test Specification chapter in the Organizer.
  9. Select Add Existing in the Edit menu.

  10. The Add Existing dialog is displayed.
  11. Select the file inres.itex in the Files section. If necessary change the file filter to *.itex.
  12. Click the OK button.

  13. The file is added to the Organizer and ITEX 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.

  2. A dialog windows appears.
  3. Click the Generate button.

  4. The test case index is generated.

Exercise 2: Advanced Concepts

What You Will Learn

Preparations

If you have left SDT or the Validator UI temporarily, perform the following steps:

  1. Open the inres system in the Organizer.
  2. Start the Validator UI.
  3. Open the inres validator again.

If you have not quit the inres validator, bring the application to its initial state now:

Creating a Structured MSC Test Case

For a better understanding, a test case can be structured into different test steps. Typically, a test case consists of three parts:

In this section, you will create a test case with a preamble, a test body and a postamble. This test case will be identical to the one developed in Exercise 1: Basic Concepts except for its structural information.

Creating the Preamble

You can define structured MSC test cases in a similar way as you did in Exercise 1: Basic Concepts.

  1. Click the Navigator button in the EXPLORE module to start the Navigator.

  2. The Navigator window is displayed.
  3. Navigate through the system by double-clicking in turn on the following nodes:

  4. 1, 1, 1, 1, 1, 1, 1, 1 (i.e. 8 times transition #1),
    3,
    1, 1, 1 (i.e. 3 times transition #1)

    Do not close the Navigator yet.
  5. Select MSC: Save Test Step in the Autolink1 menu to save the current path as an MSC test step.

  6. A prompt dialog is displayed.
  7. Type Preamble in the Test step name field.
  8. Click the OK button.

  9. Autolink saves a file called Preamble.mpr in the MSC test steps directory.

The preamble which you have just created is shown in Figure 73.

Creating the Test Body

You should also create the body of the MSC test case:

  1. Type define-root current in the input line to set the current root.

  2. The following message appears in the text area:

    Root of behaviour tree set to current system state


  3. Double-click the following transitions in the Navigator window:

  4. 1, 1, 1, 1 (i.e. 4 times transition #1),
    10,
    1, 1, 1 (i.e. 3 times transition #1).

    Again, do not close the Navigator.
  5. Select MSC: Save Test Case in the Autolink1 menu to save the path as an MSC test case.

  6. Make sure that you save the path as a test case, not as test step!

    A Prompt dialog is displayed.
  7. Type Example2 in the Test case name field.
  8. Click the OK button.

  9. Autolink saves a file called Example2.mpr in the MSC test cases directory.

Now you have defined the body of the test case. See Figure 72.

Figure 72  : The MSC Example2 -- test body

Extracted pic [4]

Creating the Postamble

Finally, you create the postamble of the MSC.

  1. Again, type define-root current in the input line to set the root.

  2. The following message appears in the text area:

    Root of behaviour tree set to current system state
    
    
  3. Navigate through the system by double-clicking in turn on the following nodes:

  4. 2,
    1, 1, 1.
  5. Select MSC: Save Test Step in the Autolink1 menu.

  6. A Prompt dialog is displayed.
  7. Type Postamble in the Test step name field.
  8. Click the OK button.

  9. Autolink saves a file called Postamble.mpr in the MSC test steps directory.

You have now created the postamble of the test case, see Figure 73.

Figure 73  : Preamble and Postamble MSCs

Extracted pic [1]

Extracted pic [2]

Inserting MSC References

Before you can use MSC Example2 to generate a TTCN test case, you have to insert two global MSC references for the preamble and the postamble. To do this:

  1. Select Toggle MSC Trace in the Commands menu.

  2. The MSC Editor will start, showing a complete Validator Trace.
  3. Open MSC Example2.mpr stored in directory TC.
  4. Make the MSC look like Figure 74, that is:

Figure 74  : Example2

Extracted pic [5]

  1. Save the MSC diagram as Example2.msc.

  2. You have now created a complete structured MSC test case with a pre- and a postamble and you are ready to generate a TTCN test case from it.

In the previous steps, you have changed the root of the behavior tree to the beginning of the postamble. Even though it is not necessary for a direct translation, you should better reset it before continuing.

  1. Switch back to the Validator UI window.
  2. Type Define-Root Original at the command line.

  3. The MSC Editor is started, but you do not have to bother about that. Select Toggle MSC Trace in the Commands menu to quit it.

You can list all MSC test cases and test steps currently stored on disk:

  1. Select MSC: List in the Autolink1 menu.

  2. The following output should appear in the text area:

    MSC test cases:
    Example1.mpr                  Example2.msc
    Example2.mpr
    
    MSC test steps:
    Postamble.mpr                    Preamble.mpr
    
    

It is also possible to remove test cases and test steps from disk. Since you do not need the temporary MSC Example2.mpr any more, you can delete it:

  1. Select MSC: Clear Test Case in the Autolink1 menu.

  2. A Select dialog is displayed.
  3. Select Example2.mpr.
  4. Click the OK button.

  5. Another Select dialog is displayed, asking you whether you really want to delete this MSC.
  6. Choose Yes.
  7. Click the OK button.

Defining an Autolink Configuration

Autolink allows to define a configuration which guides the naming and parameterization of constraints, the introduction of test suite parameters and constants and the grouping of test cases and test steps into a hierarchy of test groups. An Autolink configuration consists of a set of rules which have to be written by the user.

In this tutorial you will not learn how to write configuration rules. Instead you will use a pre-defined configuration that covers some aspects of an Autolink configuration. For a detailed descriptions of configuration rules and corresponding examples see Translation Rules and Test Suite Structure Rules.

In a first step you have to create a new command file which contains the Autolink configuration:

  1. Open a text editor.

  2. The choice of text editor depends on the operating system of your computer.

    Create a new file called config.com.
  3. Type in the following text:

  4. # -------------------------------
    #   Autolink configuration file
    #     for the inres protocol
    # -------------------------------
    
    Define-Autolink-Configuration
    
    TRANSLATE "ICONreq"
      CONSTRAINT NAME   "Connection_Request"
    END
    
    TRANSLATE "ICONconf"
      CONSTRAINT NAME   "Connection_Confirmation"
    END
    
    TRANSLATE "IDATreq"
      CONSTRAINT NAME   "Data_Request"
                 PARS   $1="Data"
      TESTSUITE  PARS   $1="DataValue"
    END
    
    
    TRANSLATE "IDISreq"
      CONSTRAINT NAME   "Disconnection_Request"
    
    END
    
    TRANSLATE "IDISind"
      CONSTRAINT NAME   "Disconnection_Indication"
    END
    
    TRANSLATE "MDATind" | "MDATreq"
      IF $1 == "{ id CC, *, * }" THEN
        CONSTRAINT NAME "Medium_Connection_Confirmation"
      END
      IF $1 == "{ id AK, *, * }" THEN
        CONSTRAINT NAME   "Medium_Acknowledge"
      END
      CONSTRAINT NAME   "c_" + $0
    END
    
    End
    
    
  5. Save the file in your current working directory.

Next, you have to load this configuration into the Validator:

  1. Select Configuration: Load in the Autolink2 menu.

  2. A File name dialog is displayed.
  3. Select config.com in the Files section.
  4. Click the OK button.

If an error message is displayed, you have probably made a spelling mistake in the command file. In this case, correct your file and try to reload the configuration.

Translating the MSC into TTCN

In Generating the Test Case, you have learned how to generate an internal test case representation based on an MSC. For that purpose, a state space exploration has been started.

However, in some cases it is not possible to simulate the MSC, e.g. if the internal processes of the SDL system are not fully specified. In these cases, you have to translate an MSC test case directly into an internal test case representation (without performing a state space exploration).

Even though it should be possible to simulate the MSC Example2.msc, you will apply a direct translation in this exercise:

  1. Select Test Case: Translate in the Autolink1 menu.

  2. A Select dialog is displayed.
  3. Select Example2.msc.
  4. Click the OK button.

  5. Autolink analyses the preamble, the test body and the postamble and generates a complete, structured test case. The following output should appear in the text area:

    Current state is reset to root.
    
    MSC 'Example2' loaded.
    
    Constraints are checked for naming conflicts...
    
    Constraint 'c_MDATind' is renamed to 'c_MDATind_001'.
    Constraint 'c_MDATind' is renamed to 'c_MDATind_002'.
    Constraint 'c_MDATind' is renamed to 'c_MDATind_003'.
    
    Constraints with identical signal definitions are merged automatically...
    
    ... done.
    
    

Take a look at the internal test case representation to see the difference with respect to test case Example1:

  1. Select Test Case: Print in the Autolink1 menu.

  2. A Select dialog is displayed.
  3. Choose Example2.
  4. Click the OK button.
  5. The output is:

  6. Example2
    
      0 P: IN Preamble
      1  P: ISAP1 ! ICONreq - Connection_Request
      2   P: MSAP2 ? MDATind - c_MDATind_003
      3    P: MSAP2 ! MDATreq -
                Medium_Connection_Confirmation
      4     P: ISAP1 ? ICONconf - 
                Connection_Confirmation
      5      P: OUT Preamble
      6       P: ISAP1 ! IDATreq - 
                Data_Request(DataValue)
      7        P: MSAP2 ? MDATind - c_MDATind_002
      8         P: MSAP2 ! MDATreq - Medium_Acknowledge
      9          P: IN Postamble
     10           P: ISAP1 ! IDISreq - 
                      Disconnection_Request
     11            P: ISAP1 ? IDISind - 
                      Disconnection_Indication
     12             P: MSAP2 ? MDATind - c_MDATind_001
     13              P: OUT Postamble
     11            P: MSAP2 ? MDATind - c_MDATind_001
     12             P: ISAP1 ? IDISind - 
                      Disconnection_Indication
     13              P: OUT Postamble
    
    Also take a look at the constraints to see what the translation rules in your configuration file have affected:
  7. Select Constraint: List in the Autolink2 menu.

  8. The following output will appear in the text area:

    Connection_Confirmation :
      ICONconf {  }
    Connection_Request :
      ICONreq {  }
    Data_Request(Data) :
      IDATreq { iSDUType1 Data }
    Disconnection_Indication :
      IDISind {  }
    Disconnection_Request :
      IDISreq {  }
    Medium_Acknowledge :
      MDATreq { mSDUType1 { id AK, num one, data 55 } }
    Medium_Connection_Confirmation :
      MDATreq { mSDUType1 { id CC, num zero, data 55 } }
    c_MDATind_001 :
      MDATind { mSDUType1 { id DR, num one, data 55 } }
    c_MDATind_002 :
      MDATind { mSDUType1 { id DT, num one, data 55 } }
    c_MDATind_003 :
      MDATind { mSDUType1 { id CR, num zero, data 0 } }
    

Saving the TTCN Test Suite

When a TTCN test suite is created, test steps can be stored in different formats. By default, test steps are put into the test step library. However, you might want to save them locally, i.e. attached to their test cases:

  1. Select Autolink: Test Steps Format in the Options2 menu.

  2. A Select dialog is displayed.
  3. Select Local.
  4. Click the OK button.

Now, you are ready to save the test suite:

  1. Select Test Suite: Save in the Autolink1 menu.

  2. A Prompt dialog is displayed.
  3. Type inres2_local in the Test suite name field.
  4. Click the OK button.

  5. A File name dialog is displayed.
  6. Type inres2_local.mp in the File field.
  7. Click the OK button.

  8. Autolink saves the test suite in file inres2local.mp.

You may want to save the test suite in different formats. To do this:

  1. Select Autolink: Test Steps Format in the Options2 menu.

  2. A Select dialog is displayed.
  3. Select Global or Inline.
  4. Click the OK button.
  5. Save the test suite as above. You can save the current test suite as often as you like.

Merging With the Old Test Suite

It is possible to merge the new TTCN test case (with its constraints) with an existing test suite.

  1. Make sure that the inres test suite you created in the first part of this tutorial is opened in ITEX. This test suite contains test case Example1.
  2. On UNIX, select Autolink Merge from the SDT Link menu in the Browser.

  3. In Windows, select Autolink Merge from the File menu.
  4. In the dialog that is opened, select inres2_local.mp.
  5. Click Merge (UNIX) or OK (Windows).

  6. The test case and the constraints from the inres2_local.mp file will now be merged into the old test suite.

There are more possibilities to merge test cases: Autolink also provides commands to combine separately generated test cases within the Validator. For a detailed description see Computing Test Cases.

Exercise 3: Test Generation with Power Walk

What You Will Learn

Preparations

If you have left SDT or the Validator UI temporarily, perform the following steps:

  1. Open the inres system in the Organizer.
  2. Start the Validator UI.
  3. Open the inres validator again.

If you have not quit the inres validator, bring the application to its initial state now:

  1. Select Reset in the Options1 menu.

Creating MSC Test Cases Automatically

In the previous exercises, you had to specify your MSC test cases manually. Creating test cases by hand gives you full control over what is tested.

However, you might not be interested in defining tests for particular aspects of your SDL system. Instead, you only wish to create a large number of test cases randomly which cover most symbols of the SDL system.

In this case, you can use the Power Walk algorithm provided by Autolink to generate test cases automatically.

In the first step, a number of PowerWalk reports have to be computed:

The number of reports generated by the Validator may vary, since to a certain extent, Power Walk is based on a random search. Do not worry if you get different results, as you can a still perform the following steps.

The output above states that five reports have been generated. When traversing their corresponding paths, a total symbol coverage of 85.53 percent is reached. The Power Walk command stopped when it failed to create another report which increases coverage.

Since Autolink requires MSC test cases as input, you have to convert the PowerWalk reports into MSCs:

  1. Select MSC: Save Reports in the Autolink1 menu.

  2. A Select dialog is displayed.
  3. Select PowerWalk in order to save all PowerWalk reports.
  4. Click the OK button.

  5. Autolink saves all PowerWalk reports as system level MSCs in distinct files in the test cases directory:

    MSC test case is saved in file '/home/tutorial/inres/TC/PowerWalk_00001.mpr'.
    MSC test case is saved in file '/home/tutorial/inres/TC/PowerWalk_00002.mpr'.
    MSC test case is saved in file '/home/tutorial/inres/TC/PowerWalk_00003.mpr'.
    MSC test case is saved in file '/home/tutorial/inres/TC/PowerWalk_00004.mpr'.
    MSC test case is saved in file '/home/tutorial/inres/TC/PowerWalk_00005.mpr'.
    

Generating the Test Cases

In the previous exercises you have learned how to generate internal test case representations from MSCs. If you want more than one test case, you can either compute all test cases in the test cases directory at once -- by a single command -- or compute one test case after another.

For large SDL systems, test generation may take some time. In this case, it is advantageous not to compute all test cases in a single validator session. Instead, each test case (or a small number of test cases) should be computed separately, preferably in parallel on different machines.

To enable distributed test generation, Autolink allows to store internal test case representations on disk. After all test cases have been computed, their internal representations can be reloaded from disk and saved in a single test suite. While loading the test cases, Autolink checks them for consistency and merges identical constraints.

Generating and Saving a Single Test Case

  1. Select Reset in the Options1 menu.

  2. All options are reset and all generated test cases and reports are cleared.
  3. Select Test case: Generate in the Autolink1 menu.
  4. A Select dialog is displayed.
  5. Select PowerWalk00001.mpr.
  6. Click the OK button.
  7. Select Test case: Save in the Autolink1 menu.

  8. A Select dialog is displayed.
  9. Select PowerWalk_00001.
  10. Click the OK button.

  11. A File name dialog is displayed.
  12. Select the TC directory by double-clicking.
  13. Type PowerWalk_00001.gen in the File field.
  14. Click the OK button.

  15. The generated test case is stored on disk.

Repeat steps 1 to 11 for all other PowerWalk test cases.

Saving the Test Suite

Once you have created all test cases and saved them in files, you can combine them and create a test suite.

  1. Select Reset in the Options1 menu.
  2. Select Test case: Load in the Autolink1 menu.

  3. A File name dialog is displayed.
  4. Select file PowerWalk_00001.gen in the Files section.
  5. Click the OK button.

  6. The generated test case is loaded and identical constraints are merged (if there are identical constraints).
  7. Repeat steps 2 to 4 for all other test cases.
  8. Select Test suite: Save in the Autolink1 menu.

  9. A Prompt dialog is displayed.
  10. Type Power in the Test suite name field.
  11. Click the OK button.

  12. A File name dialog is displayed.
  13. Type power.mp the File field.
  14. Click the OK button.

  15. Autolink saves the test suite file power.mp.

    Now you may exit the Validator:
  16. Select Exit in the File menu.

In order to take a look at the TTCN test suite, you have to convert the MP file into TTCN-GR just the same way you did in the first and second example above.

So Far ...

You should have learned how to create structured system level MSCs, and how to generate TTCN test cases from those MSCs. Especially you have become acquainted with two ways of producing TTCN test cases: Test generation by state space search and test generation by a direct translation. While doing this, you have discovered many of the commands in the Autolink menus of the Validator. In addition, you should also know how to view the test suite in ITEX, how to generate the test suite overview and how to merge new test cases and constraints into an existing test suite in ITEX.


[Previous] [Next] [Contents] [Index]