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


    Tutorial: The ITEX Simulator in Windows

This is an introductory tutorial to the ITEX Simulator in Windows 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:  Windows version

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

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.

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. Switch to simulation mode in ITEX.
  4. Set up the communication between the ITEX and SDT Simulators.
  5. Start the SDT simulation.
  6. Start the ITEX simulation.
  7. 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 a default installation, the complete path is C:\tau35\examples\bitprotocol.

Setting Up a Simulation

What You Will Learn

When you are 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 C:\tau35\examples\bitprotocol (where C:\tau35 is the default installation directory).

    You may also find it useful to copy the bitprotocol directory and the files included, to another directory. In any case, you have to make sure the bitprotocol directories and files are not read-only.
  4. Double-click the abp icon in the TTCN Test Specification chapter.

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

  8. The Analyzer/CCG Settings dialog is opened:

Figure 59 : The C Code Generator options

Extracted pic [9]

  1. Make sure that the Generate Simulation Kernel and Ignore bodies of test suite operations options are checked, in the C Code Generator Options.
  2. Select an output directory that has sufficient space and where you have write permission.
  3. In the Build Options, ensure that the Run Make option is selected.
  4. You may also have to change the Makefile Type.
  5. Click OK to start the generation and compilation of the ITEX simulator executable.

  6. ITEX will now generate and build the ITEX simulator executable. In the Log Manager window, you can see the what is happening.

.


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

  2. This is a toggle button, which means that if it is depressed, the simulator is in simulation mode. If the button is released, simulation is ended.
    The Simulator Toolbar is available whenever this button is depressed.

  1. Select abp.exe in the dialog.

  2. The ITEX simulation executable has the same name as the test suite that you are simulating.

    This step will put ITEX in simulation mode, and 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 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 Browser, select the test case TC_01.

Figure 60 : The test case TC_01 is selected in the Browser

Extracted pic [8]


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.

When you have reached the end of the test case, the bar that indicates the current line will change color. The color indicates the result of the execution of the test case. The colors are as follows:

Color Verdict

Green

PASS

Yellow

INCONC

Red

FAIL

At this point the SDT Simulator is running at full speed. This is normal and you can safely ignore it. 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 Cases at Full Speed

  1. In the ITEX Browser, select the test case TC_01 again.

  2. This time, you are going to execute the test case at full speed.


Extracted pic [3]

  1. Click the Run Simulation button.

  2. The Table Editor is opened. The lines of TTCN code in the table will execute without pausing until the end of the test case is reached.


Extracted pic [7]
    • It is possible to stop the execution by clicking the Pause Simulation button

Running Test Batches

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

  1. In the ITEX Browser, select the test case TC_01 and TC_02.

Figure 61 : Selecting multiple test cases

Extracted pic [4]

  1. Press the Run Simulation button.

  2. This will cause the ITEX simulator to execute all the selected test cases in turn without pausing anywhere.

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. Set the cursor on line 3 in the test case TC_01.


Extracted pic [5]

  1. Press the Toggle Breakpoint button.

  2. This will set a breakpoint on line 3.
    The button will toggle the breakpoint status on the line that the cursor is placed on. If there is a breakpoint set on the line, it will be removed. If there is not a breakpoint there, one will be set.

  1. Select test case TC_01 in the Browser.
  2. Press the Run Simulation button.

  3. 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.
  4. Set the cursor on line 3 in the test case TC_01.
  5. Press the Toggle Breakpoint button.

  6. This will remove the breakpoint from line 3.
  7. Press the Run Simulation button.

  8. 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. Select test case TC_01 in the browser.
  2. Click the Step Simulation button twice.

  3. 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.
  4. Click the Abort Simulation button.

  5. This aborts the execution of the test case for the ITEX simulator.
  6. In the SDT simulator window, select Restart in the File menu.

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

Taking a Look at the Log Window

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

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 log contains the test component, table name, line within the table, behaviour, constraint and verdict.

Figure 62 : An execution log

Extracted pic [6]

Every test case also 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 63 : A conformance log

Extracted pic [10]


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