IBM
Contents Index Previous Next



Using Test Values


In this final exercise we will explore the test value feature in the Explorer. This feature is used to control the way the environment interacts with the system during state space exploration. In practise, the test values define what signals will be sent from the environment to the system, including the exact values of their parameters.

In this part of the Explorer tutorial we will use another SDL system, the Inres system.

  1. Copy the Inres system from the installation to a working directory of your own. Copy all files from the directory $telelogic/sdt/examples/inres (on UNIX), or
    C:\IBM\Rational\SDL_TTCN_Suite6.3\sdt\examples\inres
    (in Windows).

What You Will Learn

Using the Automatic Test Value Generation

When the Explorer is started, test values for a number of SDL sorts are automatically generated. For example, all integer parameters will have the test values -55, 0 or 55. We will now take a look at the automatically generated test values for the Inres system.

  1. Open the Inres system file from the Organizer's File menu. If any part of the existing DemonGame system needs saving, you are first prompted to do so before the Open file dialog appears. Locate the file inres.sdt that you have copied and open it.
  2. Generate and start an Explorer for the system by clicking on the Explore quick button; see Quick Start of an SDL Explorer for more information. If you are asked in a dialog whether to start a new Explorer UI or use an existing one, select the existing explorer in the list and click OK.
  3. Expand the Test Values button module in the Explorer UI and make the window bigger so you can see all the buttons.
    The button module contains four rows of buttons. The top three buttons List Value, Def Value And Clear Value make it possible to define test values for each sort (data type) in the SDL system. The middle row with the buttons List Par, Def Par and Clear Par handles test values for specific signal parameters. The bottom rows handles test values for entire signals.
  4. Click on the List Value button to see what default test values have been generated. The following values should be listed:
    Sort integer:
    
    0
    
    -55
    
    55
    
    
    
    Sort Sequencenumber:
    
    zero
    
    one
    
    
    
    Sort IPDUType:
    
    CR
    
    CC
    
    DR
    
    DT
    
    AK
    
    
    
    As you can see, there were test values defined for the predefined sort integer and for two system specific enumerated sorts Sequencenumber and IPDUType. For enumerated types, all the values will by default be used as test values if there are 10 or less values. Note that only sorts that appear on parameters to signals to or from the environment are listed.
  5. Click on the List Signal button to see what signals will be sent to the system based on the test values for the sorts.
    You should now see a list of signals similar to the following. Note that there might be differences in the parameters to the MDATreq signal since this is computed using a random function that is depending on the compiler used.
    ICONreq
    
    IDATreq(0)
    
    IDATreq(-55)
    
    IDATreq(55)
    
    IDISreq
    
    MDATreq((. CR, zero, -55 .))
    
    MDATreq((. CR, zero, -55 .))
    
    MDATreq((. CC, one, 55 .))
    
    MDATreq((. AK, one, 55 .))
    
    MDATreq((. CR, one, 55 .))
    
    MDATreq((. DT, one, -55 .))
    
    MDATreq((. CC, one, 0 .))
    
    MDATreq((. CC, one, -55 .))
    
    MDATreq((. AK, one, 55 .))
    
    MDATreq((. DR, one, 0 .))
    
    
    
    The signals ICONreq and IDISreq have no parameters so there will only be one signal definition for each of these signals. The IDATreq signal has one integer parameter, and as you can see there will be three test values for this signal, one for each of the test values for the integer sort.
    The MDATreq signal takes a parameter that is a structure with three fields: one IPDUType, one Sequencenumber and one integer. Whenever the Explorer finds a structure, it tries to generate test values for the sort based on all combination of test values for each field. However, if the number of test values is larger than a maximum value, a randomly chosen subset is used instead. The maximum number is by default 10, but can be changed with the Define-Max-Test-Values command.
    The consequence of this is that for the MDATreq signal, 10 different randomly chosen parameter values are generated.
    Now, let us check how the test values influence the behavior of the system during state space exploration.
  6. Start the Navigator by clicking on the Navigator button in the Explore button module.
  7. Double-click on the down node 4 times (until there is more than one alternative down node).
    You should now have a choice between 11 different down nodes that each one represents an input from the environment to the SDL system. If you check the inputs more carefully, you will see that these 11 inputs correspond to the test values defined for the signals ICONreq and MDATreq.
    This is the way the test values have an impact on the state space exploration. Whenever a signal can be sent from the environment to the system, the Explorer uses the test values defined for the signal to determine what parameters to use when sending the signal.

Changing the Test Values Manually

Now, we will use the other commands in the Test Values button module to manually change the test values.

  1. Click on the Top button in the Explore module to return to the start state in the state space.
    First we will change the test values for integer to only test the values 1 and 99.
  2. Click on the Clear Value button, select the integer type in the dialog and give the value `-' (a dash) in the value dialog. Dash indicates that we would like to remove all test values currently defined for the sort.
    Note that the Explorer tries to recompute test values for various sorts and signals when you have changed the test values for integer. Since integer is used in a number of other sorts and signals, the Explorer is now unable to compute test values for these sorts and signals.
  3. Check the signal definitions that now is used by clicking on the List Signal button. The current signal definitions should now be:
    ICONreq
    
    IDISreq
    
    Since there are no test values for integer, only the signals that does not contain integer parameters are listed. In this case this means that only ICONreq and IDISreq would have been sent to the system from the environment if you would start an exploration.
  4. Click on the Def Value button, select integer in the sort dialog and give the value 1 in the value dialog.
  5. Click on the Def Value button once more. Select integer in the sort dialog again, but this time give the value 99 in the value dialog.
  6. Click on the List Signal button to check the signal definitions and make sure that the signals with integer parameters are once again on the list. This time with the test values 1 and 99.
    ICONreq
    
    IDATreq(1)
    
    IDATreq(99)
    
    IDISreq
    
    MDATreq((. AK, zero, 1 .))
    
    MDATreq((. DR, zero, 99 .))
    
    MDATreq((. AK, one, 1 .))
    
    MDATreq((. DR, one, 1 .))
    
    MDATreq((. DR, zero, 99 .))
    
    MDATreq((. AK, zero, 1 .))
    
    MDATreq((. AK, one, 99 .))
    
    MDATreq((. AK, zero, 99 .))
    
    MDATreq((. AK, one, 1 .))
    
    MDATreq((. CR, one, 1 .))
    

You have now explored some on the most frequently used test value features in the Explorer. There are also possibilities to set test values for specific parameters and to enumerate all signal definitions manually. You can find more information about this in the section Defining Signals from the Environment.

Exiting the SDL Explorer

To exit the Explorer follow the same steps as before:

  1. Select Exit from the File menu.
  2. Choose Yes when asked whether you want to save the new options or not. To select Yes in this dialog implies that commands that recreates your new test value definitions will be saved in the file .valinit (on UNIX) or valinit.com (in Windows).

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