[Previous]
[Next]
[Contents]
[Index]
Tutorial: The Basics of ITEX in Windows
This tutorial is intended as an easy introduction to ITEX for the newcomer. It is assumed that you have some basic knowledge about Windows. In addition, to find ITEX meaningful to use, you have to understand TTCN.
Note: Windows version
This is the Windows version of the tutorial. The UNIX version can be found in Tutorial: The Basics of ITEX on UNIX. |
Note:
This document is an ITEX primer and is not intended to provide a tutorial on TTCN. The volume ITEX Methodology Guidelines introduces some basic TTCN features presented with the aid of a simple example. |
Table of Contents
Purpose of This Tutorial
The purpose of this tutorial is to make you familiar with the basic functions of ITEX. You will start by creating a test suite and you will learn various ways of editing tables.
It is assumed that you know how to use Windows but that you have no or little previous knowledge about ITEX. However, to understand the full use of ITEX, you must have knowledge of TTCN. ITEX Methodology Guidelines introduces some essential TTCN features, presented with the aid of a simple example.
Starting ITEX
It is assumed that ITEX (or Telelogic Tau) has been installed correctly and that the installation directory is C:\tau35
.
To start Telelogic Tau:
- Select the Telelogic Tau icon from the Start menu.
- You can also double-click the executable file
sdt.exe
, which should be located in C:\tau35\bin\wini386
.
After a few seconds, the Organizer is started. The Organizer is the main window from which you have access to the tools in the Telelogic Tau environment.
A welcome window, where you may read the license agreement for Telelogic Tau, will also be displayed. The window disappears as soon as you click the Continue button or perform any action in the Organizer.
Figure 9 : The Organizer main window
The Organizer consists of a main window and a log window. In the main window, five areas -- known as chapters -- are displayed by default:
- Analysis Model
- Used Files
- SDL System Structure
- TTCN Test Specifications
- Other Documents
You may freely use these chapters to hold a number of documents and chapters may also be renamed, deleted and created -- the actual use is a matter of personal taste.
More information about customizing the chapters can be found in Customizing the Organizer Chapters.
Creating a TTCN Test Suite Document
What You Will learn
- To set the source and target directory
- To create a TTCN test suite
Setting the Source and Target Directory
You will begin by setting the source and target directory in the Organizer. The source directory is where your new documents will be saved by default. The target directory is where generated files are put. Both of these directories must already exist -- you cannot create them in the Organizer.
|
- Double-click the source directory icon in the Organizer window.
- You may also select the source directory icon and then select Edit from the Edit menu in the Organizer or you may select Set Directories from the File menu.
|
The Set Directories dialog is opened, and you may change the source and target directories.
Figure 10 : The Set Directories dialog
- Select the source directory by writing the path in the text field or by browsing in the dialog that is opened when you click the folder button. Make sure that you have write access to the directory.
- In the same way, you can change the target directory.
- Click OK in the Set Directories dialog.
Creating a New Test Suite
When you have set the source and target directories, you should create a new TTCN document.
- Select the chapter TTCN Test Specification in the Organizer.
- Select Add New from the Edit menu in the Organizer.
The Add New dialog is opened. In the dialog you should set the document type and name.
Figure 11 : Add New dialog
- Select TTCN and Test Suite or Modular Test Suite in the New document type list.
- Type
Tutorial
in the New document name field.
- Make sure that the option Show in editor is selected.
- Click OK.
A new TTCN document is created in the source directory. At the same time, a TTCN icon is created in the Organizer. After that, ITEX is started. The ITEX Browser will show the new test suite in collapsed format.
Figure 12
: ITEX is started and the Browser displays the test suite
Using the Browser
What You Will Learn
- To expand and collapse nodes
- To build a test suite
Expanding and Collapsing Nodes
The Browser displays the test suite in a collapsed format, which is indicated by plus signs in front of the nodes. You expand and collapse the nodes the same way that you expand and collapse directory levels in the Windows Explorer.
Figure 13
: The Dynamic Part has been expanded
Some nodes are not marked with plus or minus signs. Those node are tree nodes without children. The node Test Cases in Figure 13 is an example of this. Such nodes represent the static (structural) parts of the test suite that cannot be opened or edited.
Building a Test Suite
You are now going to add a TTCN table to your test suite.
To add a PCO type:
- Expand the Declarations Part.
To be able to see the entire test suite, you may also have to enlarge the Browser window.
- Select the PCO Type Declarations node.
- Select Add in from the Edit menu.
A PCO Type with the temporary name NoName is added in the PCO Type Declarations list. The table icon looks like a small graphical table, which means that it can be opened and edited.
- Rename the PCO type NoName by clicking on it when it is selected, that is, it becomes highlighted. Name the PCO type
LOWER_PCO
.
Figure 14
: The test suite when a PCO Type has been added
Note that the new table is marked with a question mark to indicate that it has not yet been analyzed.
- You should also add the following items:
- A TTCN PCO called
L
(Declarations Part > PCO Declarations)
- A TTCN PDU called
SEND
(Declarations Part > PDU Type Definitions > TTCN PDU Type Definitions)
- A TTCN PDU called
RECEIVE
(Declarations Part > PDU Type Definitions > TTCN PDU Type Definitions)
You can also copy and paste SEND and change the name to RECEIVE.
- A TTCN PDU constraint on the SEND PDU called
S1
(Constraints Part > PDU Constraint Declarations > TTCN PDU Constraint Declarations)
- A TTCN PDU constraint on the RECEIVE PDU called
R1
(Constraints Part > PDU Constraint Declarations > TTCN PDU Constraint Declarations)
You can also copy and paste S1 and change the name to R1.
- A test case called
TEST_CASE_1
(Dynamic Part > Test Cases)
- A test step called
TEST_STEP_1
Dynamic Part > Test Step Library)
Figure 15 : The test suite when the tables have been added
The next step is to edit the tables that you just added.
Using the Table Editor
What You Will Learn
- To open the Table Editor
- To resize the window parts
- To edit the contents of a table
Opening the Table Editor
The Table Editor is opened when you double-click a table icon in the Browser:
- Double-click the test case table TEST_CASE_1.
The test case table is opened in the Table Editor.
Figure 16 : The test case TEST_CASE_1 which has not yet been edited
Resizing the Table
As you can see, the Table Editor window is divided into three parts: the header, the body and the footer. These parts can be resized and hidden.
- Drag the horizontal bars that separates the table parts to change the relative size.
- Drag a row separator in the leftmost column to change the height of a row.
- Drag a column separator in a header of the body part of the table to change the column width.
Editing the Test Case Table
As you can see, TEST_CASE_1, or any other table, consists of fields where text may be inserted and edited. This is what you are going to do now:
- Click in the Purpose field and type some text, for example:
This is an example test case for the ITEX tutorial
.
- Type some text in the Description field:
Example test case
.
- Instead of clicking the mouse to set the input focus, you can press
<down arrow>
until the cursor has reached the Description field.
It is also possible to type text in the other fields but you do not have to do that in this tutorial. Note that the Group field is not editable. The contents of this field is always kept updated from the Browser structure.
- Select Insert New Row After from the Edit menu.
- You can also press
<Ins>
or <Insert>
.
A new empty line is added to the body of the table. Note that the line is automatically numbered.
- Type
L! SENT
in the Behaviour description field of the new line.
Note:
The misspelling of "SEND" is intentional! |
- Type
S1
in the Constraints Ref field.
- Press
<Ins>
or <Insert>
to add another new line.
- Type
+TEST_STEP_1
in the Behaviour Description field of row 2
Note that the text is automatically indented.
Figure 17
: The test case TEST_CASE_1 when it has been edited.
The misspelling of "SEND" is intentional.
When you have edited TEST_CASE_1, you should close the table.
Completing the Test Suite
You should now edit the other tables that you have already added to the test suite. Use the tables in the following figures as models.
- Edit the tables in the Declarations Part of the test suite, that is the PCO type LOWER_PCO, the PCO called L and the PDUs called SEND and RECEIVE:
Figure 18 : The PCO type LOWER_PCO
Figure 19 : The PCO L
Figure 20 : The PDU SEND
Since the contents of SEND and RECEIVE are identical, you can copy the text and rows from SEND and paste them in RECEIVE:
- Select text in the usual way with the mouse.
- Select an entire row in the body of a table by clicking the leftmost field.
When you are going to paste, note the following:
- Text can only be pasted in text edit mode, that is, when a field contains a text pointer.
- A body row can only be pasted when a body row is selected or when a body field is highlighted.
Note:
This means that there are two paste buffers: one for plain text and one for body rows. |
Figure 21 : The PDU RECEIVE
- Edit the tables in the Constraints Part, that is the PDU constraints called S1 and R1:
Figure 22 : The PDU constraint S1
Figure 23 : The PDU constraint R1
- Edit the test step called TEST_STEP_1 in the Dynamic Part:
Figure 24 : The test step TEST_STEP_1
When you add row 2 it is automatically indented, however, in this case it should not be. To decrease the indention, put the cursor in row 2 and then either:
- Press
<Alt+->
(<Alt>
and the minus key).
- Click the minus indention quick-button.
- Select Edit > Decrease Indention Level.
- Close all tables when you have finished editing.
- Save the test suite by selecting Save in the File menu.
Analyzing the Test Suite
What You Will Learn
- To analyze a test suite
- To find errors
Analyzing the Test Suite
You are now going to analyze the test suite:
- Select Analyze Suite from the Build menu.
- You can also select the top node in the Browser and then select Analyze. Analyze only works on selected parts of a test suite (including sub-trees) so in this case it will have the same effect as Analyze Suite.)
The Analyzer/CCG Settings dialog is opened. You do not have to change the settings in this tutorial.
Figure 25 : The Analyzer/CCG Settings dialog
Note that if you analyze the test suite again by using a quick-button or a shortcut, the same options will be used but the dialog will not be displayed.
- Click OK.
If you have edited the test suite as described, the ITEX Log Manager is opened with a textual log that should show a single error message:
Figure 26 : The ITEX Log Manager window showing one error
The log text means that there is an error in line 1 of the behaviour description of the test case dynamic behaviour table called TEST_CASE_1.
Also note that the parent nodes to the erroneous table are marked with a red arrow and the table is marked with a red cross in the Browser.
Finding and Correcting the Error
To find the erroneous table, you use the popup menu:
- In the Log Manager, click the table identifier, that is, the name of the table: TEST_CASE_1.
<Ctrl>
-right-click the name of the table again.
A popup menu is opened.
- Select the top command in the popup menu: Test Case Name: TEST_CASE_1.
Figure 27 : Finding a table by using the popup menu in the Log Manager
The Table Editor window is opened, displaying the TEST_CASE_1 table. Note that the error is marked in red, in this case L! SENT in the Behaviour Description column.
You should now correct the error and analyze again:
- Correct the error, i.e. change SENT to SEND.
- Analyze the test suite again. You can do this while having the Table Editor window still opened since the Analyzer works on any level of the test suite.
You will now have a small test suite that is syntactically correct. This means that the red markings will disappear.
Creating TTCN Tables in Other Ways
The methods described below make it faster and more efficient to create TTCN tables. They also avoid annoying spelling errors and reduces the amount of text that needs to be typed.
What You Will Learn
- To create a table by copying and pasting.
- To create a table by using the Data Dictionary.
- To delete a table.
Copying and Pasting
You are now going to practice another way of creating a TTCN table, namely by copying and pasting it.
- Copy the PDU called SEND in the Browser.
- Select S1 and then paste the table you have copied.
The SEND table is pasted before S1.
Editing the New Table
- Open the new SEND table.
The Table Editor window is opened displaying the table. As you can see, the PDU Type field and the Field names are filled in. Now you just have to change the name and insert values in Field_1 and Field_2.
- Type a new name in the Constraint Name field:
S2
.
- Give Field_1 the value
3
and Field_2 the value TRUE
in the Field Value column.
- Analyze the entire test suite as described in Analyzing the Test Suite.
Using the Data Dictionary
You can use the Data Dictionary to interactively build behaviour lines in behaviour tables. In the Data Dictionary dialog, you can compose sends, receives, timeouts and attachments, and at the same time see how it turns out in the dialog.
In this simple example, you will use the Data Dictionary to create a new test case with the same contents as TEST_CASE_1, and as a comparison you may have that table opened too:
- Create a new test case and open it.
- Name the test case
TEST_CASE_2
.
- Open the Data Dictionary from the View menu.
Figure 28 : The Data Dictionary dialog
- In the Send/Receive tab in the dialog, make the following settings:
- Select the PCO L.
- Select the ! (exclamation mark) radio button, which means that you will add a send statement.
- Select the type SEND.
- Select the constraint S1.
- No verdict should be selected.
The Behaviour Line, the Constraint and the Verdict fields show the contents of the behaviour line that is inserted in the table.
- Click Apply.
The behaviour line you have composed is inserted in the table.
- In the Attachment tab, select TEST_STEP_1.
The Behavior Line will read +TEST_STEP_1
.
- Click the Apply button.
The behaviour line is inserted and TEST_CASE_2 should now be identical to TEST_CASE_1.
- Close the Data Dictionary dialog.
Deleting the Tables
You will not need the newly created tables in the rest of this tutorial. You should therefore delete them:
- Select S2 and TEST_CASE_2 in the Browser.
- Select Delete from the Edit menu or press the
<Delete> key.
The tables are deleted.
Exporting a Test Suite
What You Will Learn
- To export the test suite to TTCN-MP format
- To generate the test suite overview
- To export the test suite to HTML
Exporting a Test Suite to MP Format and Generating the Overview
You should now convert the test suite to TTCN-MP format. However, before the actual conversion, the test suite overview has to be generated. How to do this will also be described below.
- Select the top node of the test suite in the Browser.
- Select Export from the File menu.
Since the test suite overview has not been generated before, it has to be done now. A dialog is opened where you can confirm this operation.
- Click Yes in the confirmation dialog.
Since the test suite you have created is small, the generation will not take long. Also, once it has been generated, it will be updated automatically.
A file dialog is opened.
- Specify where the file is to be saved, ensure that you save as type TTCN-MP and give the file a name (
example
).
The TTCN-MP file for the test suite can now be found in the file example.mp
. The Log Manager also informs you that the export is completed.
A TTCN-MP file can be opened like an ordinary .itex
file.
Exporting a Test Suite to HTML Format
To export the entire test suite, or selected parts of it, to HTML, you proceed as described above. But instead of TTCN-MP, select HTML as the file type to export to.
It is also possible to only export an opened table. To do this:
- Open a table.
- Select Generate HTML from the pop-up menu in the table.
- Select a name of the file and where it should be saved.
A HTML document cannot be opened in ITEX again, but you can view it in an HTML browser.
Printing the Test Suite
You should by now have a test suite that is syntactically correct.
If you have exported the test suite, as described earlier, the test suite overview should also have been generated and it does not have to be done again. The overview will be automatically updated as soon as you make any changes in the test suite after the generation.
If you did not export the test suite, you will have to confirm the updating of the overview before printing is possible.
You can print a test suite both from ITEX and the Organizer. The main differences are that in ITEX there is a print preview, and in the Organizer, you can print several test suites at the same time.
Printing from ITEX
To print from ITEX:
- Ensure that the Browser window is active.
- Select Print from the File menu.
The Print dialog is opened.
- If necessary, change some settings.
- Click OK.
The test suite is printed.
Printing from the Organizer
To print from the Organizer:
- Select the TTCN document icon in the Organizer.
- Select Print from the File menu.
The Print TTCN dialog is opened.
- If necessary, change some settings.
- Click Print.
The test suite is printed.
So Far ...
You should now have learned how to create a test suite and how to edit it in the Browser. You have also learned how to create and edit tables and how to work with the Table Editor. Other things you should have learned is how to analyze the test suite, how to find errors and how to export to MP and HTML.
By practicing this tutorial you have probably not achieved any knowledge about TTCN. If you want to know more about the basics of TTCN you may read the ITEX Methodology Guidelines. That volume is, however, not a tutorial on TTCN.
The following tutorial is Tutorial: The ITEX Simulator in Windows. Before you start practising that, you should know how to use the SDT Simulator. A tutorial on that can be found in Tutorial: The SDT Simulator.
[Previous]
[Next]
[Contents]
[Index]