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


    Tutorial: The ITEX Simulator on UNIX

This is an introductory tutorial to the ITEX Simulator on UNIX and an example of a complete test session with Cbasic. The tutorial is divided into sections that describes steps that are performed during a typical test session.

Note:  UNIX version

This is the UNIX version of the tutorial. The Windows version is Tutorial: The ITEX Simulator in Windows.

Table of Contents 

Purpose of This Tutorial

The purpose of this tutorial is to make you familiar with the ITEX Simulator. When you have read and practised this tutorial you will know the actions required to execute a simulated test.

In this tutorial it is assumed that you know how to use the SDT Simulator. More information can be found in Tutorial: The SDT Simulator and in The SDT Simulator.

The Steps in a Test Session

When an ITEX test suite and an SDT system already exists, this is what you do in a typical test session:

  1. Generate and start the ITEX simulator.
  2. Generate and start the SDT simulator.
  3. Set up the communication between the ITEX and SDT simulators.
  4. Start the SDT simulation.
  5. Start the ITEX simulation.
  6. Perform the simulation.

The Test System

This section describes the system that is going to be tested and what roles the ITEX and SDT simulators play in the test.

An SDT system called ABP will be used in this tutorial. The ABP system implements a small OSI stack containing a network layer, a data-link layer and a physical layer. The network component on one side is handled by ITEX and on the other side by an SDT process.

The data-link layer implements a very simple protocol known as the Alternating Bit Protocol (ABP).

The network protocol is very simple protocol, where all messages are echoed back as an acknowledgment that they have been received.

This setup gives us the ability to send messages from ITEX to the network peer simulated by SDT, and to receive acknowledgments in return. If the answer is identical to the message, we have managed to communicate successfully.

What we want to test is the ability of the Data-Link layer's protocol to deliver, even when messages are lost on the way. To enable this, we have introduced an extra channel between the ITEX simulator and the SDT simulator, on which commands can be sent to make the physical layer lose messages.

The ABP system is stored in the Telelogic Tau installation, in the sub-directory examples/bitprotocol. If you have set up the $telelogic environment variable, the complete path is $telelogic/examples/bitprotocol.

Setting Up a Simulation

What You Will Learn

When you have finished with this section, the simulators should be ready to run an ITEX test on a simulated SDT system.

Generating and Starting the ITEX Simulator

The first thing you should do is to generate and start the ITEX simulator:

  1. Start Telelogic Tau.
  2. In the Organizer, load the SDT system ABP from the file abp.sdt.

  3. You can find this file in $telelogic/examples/bitprotocol (where $telelogic points to the installation directory).
  4. Double-click the abp icon in the TTCN Test Specification chapter.

  5. This will start ITEX with the abp.itex test suite opened.
  6. Select the node named abp in the ITEX Browser.
  7. Select Make from the Tools menu.

  8. The TTCN Make dialog is opened.
  9. Make sure that the Use standard kernel option is checked.

Note: 

The dialog will show up the first time you build your simulator. In later builds it will remember the settings.

  1. Select the Directory for generated files to point to a location where you have write permission and sufficient space for the generated files.
  2. Click the Full Make button to start the generation and compilation of the ITEX simulator executable.

  3. ITEX will now generate and build the ITEX simulator executable.

.


Extracted pic [2]
  1. Click the Start Simulator button on the ITEX tool bar.

  2. This will start the ITEX simulator and open the simulator window. ITEX is now ready to simulate.

Generating and Starting the SDT Simulator

Now you have to set up the SDT simulator as well:

  1. In the Organizer, select the system diagram ABP from the SDL System Structure chapter.
  2. Click the Simulate button in the tool bar.
  3. SDT will now generate and build a simulator executable. It will also display the SDT simulator window with the simulator started. SDT is now ready to simulate.

Getting the Simulators to Communicate

The next step you should perform is to initialize the communication between the simulators.

  1. Enter the command start-itex in the SDT simulator window.

  2. This instructs the SDT simulator to communicate with the ITEX simulator.
  3. Enter the command go-forever in the SDT simulator window.

  4. The SDT simulator is now executing and it is possible to perform a simulation.

Performing the Simulation

What You Will Learn

Single Stepping Test Cases

  1. In the ITEX simulator window, select the test case TC_01 and then click the right arrow that appears.

  2. This selects the test case that we will execute by adding it to the Selected box:

Figure 64 : Selecting a test case to execute

Extracted pic [7]



Extracted pic [1]
  1. Click the Step Simulation button

  2. Each time you click this button, the ITEX simulator executes one step of TTCN code.

Note: 

This bar indicates which line will be executed the next time you click the Step Simulation button.

  1. Click the Step Simulation button repeatedly until you reach the end of the test case.

Running Test Cases at Full Speed

  1. In the ITEX simulator window, make sure that the test case TC_01 is still in the Selected box. If it is not, select the test case again and click the right arrow.

Note: 

If the test case already is in the Selected box, you do not have to select it again. If you select it again, you are actually telling the ITEX simulator that you want to execute the test case twice.


Extracted pic [3]
  1. Click the Run Simulation button.

  2. The simulator now starts executing lines of TTCN code without pausing. This will continue until the end of the test case is reached or until you click the Pause Simulation button.
    As you can see, the colored bar in the Table Editor will change rapidly.

At this point the SDT simulator is running at full speed. This is normal and you can safely ignore the SDT simulator. The cause of this is a timer in the simulated SDT system that fires repeatedly while waiting for input from the ITEX simulator.

Running Test Batches

It is also possible to execute more than one test case or test group.

  1. In the ITEX simulator window, deselect the test case TC_01 in the Available box. You do this by clicking on the test case.
  2. Select the test case TC_02 and click the right arrow. The test case is added to the Selected box after TC_01.

  3. You can perform this operation with as many test cases as you wish. You can add them in any order. The Selected box tells you in what order the test cases will be executed.
  4. Press the Run Simulation button.

  5. This will cause the ITEX simulator to execute all the selected test cases in turn without pausing anywhere. Another Table Editor is opened for the second test case.

Note: 

This requires a SDT system that always ends in a state from where you can execute a new test case. The SDT system may not require any manual resetting between test cases.

Toggling Breakpoints

  1. Make sure that the ITEX simulator window is active and press <Ctrl+B>.

  2. This will open the Breakpoints window. In this window you can add and delete breakpoints.
  3. Select Add from the Edit menu.

  4. This adds an empty breakpoint definition to the breakpoint editor.
  5. Click in the edit field at the bottom of the Breakpoints window and type in TC_01 3 followed by <Return>.

Figure 65 : A breakpoint in the Breakpoints window

Extracted pic [6]

  1. Select Save from the File menu.
  2. Type in a filename with the extension .ttb and select OK.

  3. This will set a breakpoint on line 3.
  4. In the simulator window, make sure that only the test case TC_01 is selected.
  5. Press the Run Simulation button.

  6. The ITEX simulator will run without pausing between lines of TTCN code. When it reaches the line where the breakpoint was set, it will stop, as you can see in the Table Editor.
  7. Select the breakpoint line we just added in the Breakpoints window.
  8. Select Delete from the Edit menu.

  9. This will remove the breakpoint from line 3.
  10. Select Save from the File menu.
  11. Select Close from the File menu.
  12. Click the Run Simulation button.

  13. The simulator now continues to run until it reaches the end of the test case.

Ending a Simulation

It is possible to end a simulation in the middle of an execution

  1. Click the Step Simulation button twice.

  2. This will place the current line on line 2 in the test case.

    You now realize that the execution was a mistake and you want to abort it.


Extracted pic [8]
  1. Click the Abort Simulation button.

  2. This aborts the execution of the test case for the ITEX simulator.

  1. In the SDT simulator window, select Restart in the File menu.

  2. This restarts the SDT simulator. This step is necessary because otherwise the SDT and ITEX simulators would be out of sync.

    This step requires that you enter the commands start-itex followed by go-forever in the SDT simulator window again.

The Execution Trace

Every execution of the ITEX simulator produces a trace. This trace is output in the trace window. Every line in the test case that is executed will be present in the trace window.

This makes it possible to examine a trace of the execution after it has finished. This is valuable when running the test cases in a batch.

The trace contains the test component, table name, line within the table, behaviour, constraint and verdict.

Figure 66 : An execution trace

Extracted pic [5]

The Conformance Log

Every test case produces a conformance log. This log contains detailed information about the tests performed. It is very useful when determining why a test case failed or succeeded.

Figure 67 : A conformance log

Extracted pic [4]


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