IBM
Contents Index Previous Next



Constants and Variables


TTCN supports both constants and variables. There are two types of constants:

and two types of variables:

The tables used are:

Test Suite Constants and Test Suite Parameters

Test suite constants are declared globally and may be used anywhere in the test suite, including the constraints part. The value of the constant is specified at its point of declaration and may not be changed.

Case study 17: Declaration of test suite constants.

Figure 61 : Test suite constant declarations

Test Suite Parameters

Test suite parameters are also constants, but their actual values are not known to the abstract test suite specifier. These values will depend on which IUT is being tested, and possibly on the test system itself. In this sense the values of test suite parameters will be different from IUT to IUT, but during the testing of any given IUT they will remain constant.

Case study 18: Declaration of test suite parameters.

Figure 62 : Test suite parameter declarations

The test suite parameter values are derived from the Protocol Implementation Conformance Statement (PICS) and the Protocol Implementation eXtra Information for Testing (PIXIT). These documents are like checklists that are filled-in according to the characteristics of the IUT.

Prior to executing the tests the PICS and PIXIT are used to bind values to the test suite parameters. This process is called test suite parameterization.

Test Suite and Test Case Variables

Both test suite variables and test case variables are declared globally i.e. they may be used by test cases, test steps and defaults throughout the test suite. A default value may be specified for each variable, if wished. If no default value is specified, then the variable is said to be unbound.

Variables should be bound before use, unless they appear on the l.h.s. of an assignment.

Case study 19: Declaration of test case variables.

Figure 63 : Test case variable declaration

Resetting Default Values

The difference between the two kinds of variable is when they are reset to their default values (if no default value is specified for a variable, then resetting means that the variable becomes unbound):

Variables in Concurrent TTCN

When more than one test component exists, as does with concurrent TTCN, then each test component is supplied with its own copy of each test case variable.

Test suite variables behave the same way in concurrent TTCN as they do in the non-concurrent version.


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