IBM
Contents Index Previous Next



TTCN Types and Values


We shall now discuss TTCN data types and their values. These are used to specify the data types, including ASPs and PDUs that are used in the behaviour descriptions.

TTCN has been tailored to interface with the Abstract Syntax Notation One (ASN.1, ISO/IEC 8824:1990). There is no clear boundary between TTCN types and ASN.1 types; the distinction is an artificial one. It is there, however, to allow test suite specifiers to build the types, ASPs, PDUs, etc. they need without using ASN.1 if they do not wish to do so. This is relevant, for example, in lower-layer protocols, where ASN.1 is not normally used in the protocol specifications.

TTCN contains a number of predefined types. It also allows the user to construct his own types from the predefined types. This may be done using the following tables:

Predefined Types

TTCN supports a rich set of predefined (built-in) types. The predefined TTCN types, with the exception of HEXSTRING, are a subset of the ASN.1 built-in types and are compatible with their ASN.1 counterparts. The HEXSTRING type does not exist in ASN.1. The remaining ASN.1 built-in types may also be used without being explicitly defined.

Figure 9 : List of predefined types that may be used in TTCN Test Suites

Value Denotation

The value denotation for the predefined types is the same in both TTCN and ASN.1, see ASN.1 Types and Values.

Simple User Defined Types

The TTCN user can construct other types based on the simple predefined types, without the need to resort to ASN.1 syntax. These subtypes are defined in the Simple Type Definitions table, and they may be used anywhere in the test suite. They are constructed by restricting the predefined types (and possibly previously declared subtypes) by specifying:

Note:

The TTCN syntax does allow the use of ASN.1 in the Simple Type Definitions table if wished. We recommend, however, that the special tables for ASN.1 types be used instead.

Figure 10 : Some miscellaneous simple type definitions

Case study 4: Definition of a user type for test case results.

Figure 11 : Simple Type Definitions

Structured Types

TTCN has tables for the declaration of structured (i.e., complex) types. These types, like the predefined types and the simple types may be used anywhere (that is why they are defined early on in the test suite). However, their main use is to substructure ASPs and PDUs and we shall therefore discuss them in Specifying ASP, PDU and CM Values.


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