Intellectual Property Rights
Foreword
1 Scope
2 References
3 Definitions and abbreviations
3.1 Definitions
3.2 Abbreviations
4 Introduction
4.0 General
4.1 The core language and presentation formats
4.2 Unanimity of the specification
4.3 Conformance
5 Basic language elements
5.0 General
5.1 Ordering of language elements
5.2 Parameterization
5.2.0 Static and dynamic parameterization
5.2.1 Parameter passing by reference and by value
5.2.1.0 General
5.2.1.1 Parameters passed by reference
5.2.1.2 Parameters passed by value
5.2.2 Formal and actual parameter lists
5.2.3 Empty formal parameter list
5.2.4 Nested parameter lists
5.2.5 Template-type formal parameters
5.2.5.1 Parameterization with templates and matching attributes
5.2.5.2 Language elements using template-type parameters
5.3 Scope rules
5.3.0 General
5.3.1 Scope of formal parameters
5.3.2 Uniqueness of identifiers
5.4 Identifiers and keywords
6 Types and values
6.0 General
6.1 Basic types and values
6.1.0 Simple basic types and values
6.1.1 Basic string types and values
6.1.2 Accessing individual string elements
6.2 Sub-typing of basic types
6.2.0 General
6.2.1 Lists of values
6.2.2 Ranges
6.2.2.0 General
6.2.2.1 Infinite ranges
6.2.2.2 Mixing lists and ranges
6.2.3 String length restrictions
6.2.4 Pattern sub-typing of character string types
6.2.5 Mixing sub-typing mechanisms
6.2.5.1 Mixing patterns, lists and ranges
6.2.5.2 Using length restriction with other constraints
6.3 Structured types and values
6.3.0 General
6.3.1 Record type and values
6.3.1.0 General
6.3.1.1 Referencing fields of a record type
6.3.1.2 Optional elements in a record
6.3.1.3 Nested type definitions for field types
6.3.2 Set type and values
6.3.2.0 General
6.3.2.1 Referencing fields of a set type
6.3.2.2 Optional elements in a set
6.3.2.3 Nested type definition for field types
6.3.3 Records and sets of single types
6.3.3.0 General
6.3.3.1 Nested type definitions
6.3.4 Enumerated type and values
6.3.5 Unions
6.3.5.0 General
6.3.5.1 Referencing fields of a union type
6.3.5.2 Optionality and union
6.3.5.3 Nested type definition for field types
6.4 The anytype
6.5 Arrays
6.6 Recursive types
6.7 Type compatibility
6.7.0 General
6.7.1 Type compatibility of non-structured types
6.7.2 Type compatibility of structured types
6.7.2.0 General
6.7.2.1 Type compatibility of enumerated types
6.7.2.2 Type compatibility of record and record of types
6.7.2.3 Type compatibility of set and set of types
6.7.2.4 Compatibility between sub-structures
6.7.3 Type compatibility of component types
6.7.4 Type compatibility of communication operations
6.7.5 Type conversion
7 Modules
7.0 General
7.1 Naming of modules
7.2 Module parameters
7.2.0 General
7.2.1 Default values for module parameters
7.3 Module definitions part
7.3.0 General
7.3.1 Groups of definitions
7.4 Module control part
7.5 Importing from modules
7.5.0 General
7.5.1 Structure of importable definitions
7.5.2 Rules on using import
7.5.3 Void
7.5.4 Importing single definitions
7.5.5 Importing all definitions of a module
7.5.6 Importing groups
7.5.7 Importing definitions of the same kind
7.5.8 Handling name clashes on import
7.5.9 Handling multiple references to the same definition
7.5.10 Import definitions from non-TTCN-3 modules
8 Test configurations
8.0 General
8.1 Port communication model
8.2 Restrictions on connections
8.3 Abstract test system interface
8.4 Defining communication port types
8.4.0 General
8.4.1 Mixed ports
8.5 Defining component types
8.5.0 General
8.5.1 Declaring local variables, constants and timers in a component
8.5.2 Defining components with arrays of ports
8.5.3 Extension of component types
8.6 Addressing entities inside the SUT
8.7 Component references
8.8 Defining the test system interface
9 Declaring constants
10 Declaring variables
10.0 General
10.1 Value variables
10.2 Template variables
11 Declaring timers
11.0 General
11.1 Timers as parameters
12 Declaring messages
13 Declaring procedure signatures
13.0 General
13.1 Signatures for blocking and non-blocking communication
13.2 Parameters of procedure signatures
13.3 Value returning remote procedures
13.4 Specifying exceptions
14 Declaring templates
14.0 General
14.1 Declaring message templates
14.1.0 General
14.1.1 Templates for sending messages
14.1.2 Templates for receiving messages
14.2 Declaring signature templates
14.2.0 General
14.2.1 Templates for invoking procedures
14.2.2 Templates for accepting procedure invocations
14.3 Template matching mechanisms
14.3.0 General
14.3.1 Referencing elements of templates or template fields
14.3.1.1 Referencing individual string elements
14.3.1.2 Referencing record and set fields
14.3.1.3 Referencing record of and set of elements
14.4 Parameterization of templates
14.4.0 General
14.5 Void
14.6 Modified templates
14.6.0 General
14.6.1 Parameterization of modified templates
14.6.2 In-line modified templates
14.7 Changing template fields
14.8 Match Operation
14.9 Value of Operation
15 Operators
15.0 General
15.1 Arithmetic operators
15.2 String operators
15.3 Relational operators
15.4 Logical operators
15.5 Bitwise operators
15.6 Shift operators
15.7 Rotate operators
16 Functions and altsteps
16.1 Functions
16.1.0 General
16.1.1 Parameterization of functions
16.1.2 Invoking functions
16.1.3 Predefined functions
16.1.4 Restrictions for functions called from specific places
16.2 Altsteps
16.2.0 General
16.2.1 Parameterization of altsteps
16.2.2 Local definitions in altsteps
16.2.2.0 General
16.2.2.1 Restrictions for the initialization of local definitions in altsteps
16.2.3 Invocation of altsteps
16.3 Functions and altsteps for different component types
17 Test cases
17.0 General
17.1 Parameterization of test cases
18 Overview of program statements and operations
19 Expressions and basic program statements
19.0 General
19.1 Expressions
19.1.0 General
19.1.1 Boolean expressions
19.2 Assignments
19.3 The Log statement
19.4 The Label statement
19.5 The Goto statement
19.6 The If-else statement
19.7 The For statement
19.8 The While statement
19.9 The Do-while statement
19.10 The Stop execution statement
19.11 The Select Case statement
20 Behavioural program statements
20.0 General
20.1 Alternative behaviour
20.1.0 General
20.1.1 Execution of alternative behaviour
20.1.2 Selecting/deselecting an alternative
20.1.3 Else branch in alternatives
20.1.4 Void
20.1.5 Re-evaluation of alt statements
20.1.6 Invocation of altsteps as alternatives
20.2 The Repeat statement
20.3 Interleaved behaviour
20.4 The Return statement
21 Default Handling
21.0 General
21.1 The default mechanism
21.2 Default references
21.3 The activate operation
21.3.0 General
21.3.1 Activation of parameterized altsteps
21.4 The deactivate operation
22 Configuration operations
22.0 General
22.1 The Create operation
22.2 The Connect and Map operations
22.2.0 General
22.2.1 Consistent connections and mappings
22.3 The Disconnect and Unmap operations
22.4 The MTC, System and Self operations
22.5 The Start test component operation
22.6 The Stop test behaviour operation
22.7 The Running operation
22.8 The Done operation
22.9 The Kill test component operation
22.10 The Alive operation
22.11 The Killed operation
22.12 Using component arrays
22.13 Summary of the use of any and all with components
23 Communication operations
23.0 General
23.1 General format of communication operations
23.1.0 General
23.1.1 General format of the sending operations
23.1.2 General format of the receiving operations
23.2 Message-based communication
23.2.0 General
23.2.1 The Send operation
23.2.1.0 General
23.2.1.1 Sending unicast, multicast or broadcast
23.2.2 The Receive operation
23.2.2.0 General
23.2.2.1 Receive any message
23.2.2.2 Receive on any port
23.2.3 The Trigger operation
23.2.3.0 General
23.2.3.1 Trigger on any message
23.2.3.2 Trigger on any port
23.3 Procedure-based communication
23.3.0 General
23.3.1 The Call operation
23.3.1.0 General
23.3.1.1 Handling responses and exceptions to a Call
23.3.1.2 Handling timeout exceptions to the Call
23.3.1.3 Calling blocking procedures without return value, out parameters, inout parameters and exceptions
23.3.1.4 Calling non-blocking procedures
23.3.1.5 Unicast, multicast and broadcast calls of procedures
23.3.2 The Getcall operation
23.3.2.0 General
23.3.2.1 Accepting any call
23.3.2.2 Getcall on any port
23.3.3 The Reply operation
23.3.4 The Getreply operation
23.3.4.0 General
23.3.4.1 Get any reply
23.3.4.2 Get a reply on any port
23.3.5 The Raise operation
23.3.6 The Catch operation
23.3.6.0 General
23.3.6.1 The Timeout exception
23.3.6.2 Catch any exception
23.3.6.3 Catch on any port
23.4 The Check operation
23.4.0 General
23.4.1 The Check any operation
23.4.2 Check on any port
23.5 Controlling communication ports
23.5.0 General
23.5.1 The Clear port operation
23.5.2 The Start port operation
23.5.3 The Stop port operation
23.5.4 The halt port operation
23.6 Use of any and all with ports
24 Timer operations
24.0 General
24.1 The Start timer operation
24.2 The Stop timer operation
24.3 The Read timer operation
24.4 The Running timer operation
24.5 The Timeout operation
24.6 Summary of use of any and all with timers
25 Test verdict operations
25.0 General
25.1 Test case verdict
25.2 Verdict values and overwriting rules
25.2.0 General
25.2.1 Error verdict
26 External actions
27 Module control part
27.0 General
27.1 Execution of test cases
27.2 Termination of test cases
27.3 Controlling execution of test cases
27.4 Selection of Test cases
27.5 Use of timers in control
28 Specifying attributes
28.0 General
28.1 Display attributes
28.2 Encoding of values
28.2.0 General
28.2.1 Encode attributes
28.2.2 Variant attributes
28.2.3 Special strings
28.2.4 Invalid encodings
28.3 Extension attributes
28.4 Scope of attributes
28.5 Overwriting rules for attributes
28.5.1 Additional overwriting rules for variant attributes
28.6 Changing attributes of imported language elements
Annex A (normative): BNF and static semantics
A.1 TTCN-3 BNF
A.1.0 General
A.1.1 Conventions for the syntax description
A.1.2 Statement terminator symbols
A.1.3 Identifiers
A.1.4 Comments
A.1.5 TTCN-3 terminals
A.1.6 TTCN-3 syntax BNF productions
A.1.6.0 TTCN-3 module
A.1.6.1 Module definitions part
A.1.6.1.0 General
A.1.6.1.1 Typedef definitions
A.1.6.1.2 Constant definitions
A.1.6.1.3 Template definitions
A.1.6.1.4 Function definitions
A.1.6.1.5 Signature definitions
A.1.6.1.6 Testcase definitions
A.1.6.1.7 Altstep definitions
A.1.6.1.8 Import definitions
A.1.6.1.9 Group definitions
A.1.6.1.10 External function definitions
A.1.6.1.11 External constant definitions
A.1.6.1.12 Module parameter definitions
A.1.6.2 Control part
A.1.6.2.0 General
A.1.6.2.1 Variable instantiation
A.1.6.2.2 Timer instantiation
A.1.6.2.3 Component operations
A.1.6.2.4 Port operations
A.1.6.2.5 Timer operations
A.1.6.3 Type
A.1.6.4 Value
A.1.6.5 Parameterization
A.1.6.6 With statement
A.1.6.7 Behaviour statements
A.1.6.8 Basic statements
A.1.6.9 Miscellaneous productions
Annex B (normative): Matching incoming values
B.1 Template matching mechanisms
B.1.0 General
B.1.1 Matching specific values
B.1.1.1 Omitting values
B.1.2 Matching mechanisms instead of values
B.1.2.0 General
B.1.2.1 Value list
B.1.2.2 Complemented value list
B.1.2.3 Any value
B.1.2.4 Any value or none
B.1.2.5 Value range
B.1.2.6 SuperSet
B.1.2.7 SubSet
B.1.3 Matching mechanisms inside values
B.1.3.0 General
B.1.3.1 Any element
B.1.3.1.1 Using single character wildcards
B.1.3.2 Any number of elements or no element
B.1.3.2.1 Using multiple character wildcards
B.1.3.3 Permutation
B.1.4 Matching attributes of values
B.1.4.0 General
B.1.4.1 Length restrictions
B.1.4.2 The IfPresent indicator
B.1.5 Matching character pattern
B.1.5.0 General
B.1.5.1 Set expression
B.1.5.2 Reference expression
B.1.5.3 Match expression n times
B.1.5.4 Match a referenced character set
B.1.5.5 Type compatibility rules for patterns
Annex C (normative): Pre-defined TTCN-3 functions
C.0 General exception handling procedures
C.1 Integer to character
C.2 Character to integer
C.3 Integer to universal character
C.4 Universal character to integer
C.5 Bitstring to integer
C.6 Hexstring to integer
C.7 Octetstring to integer
C.8 Charstring to integer
C.9 Integer to bitstring
C.10 Integer to hexstring
C.11 Integer to octetstring
C.12 Integer to charstring
C.13 Length of string type
C.14 Number of elements in a structured value
C.15 The IsPresent function
C.16 The IsChosen function
C.17 The Regexp function
C.18 Bitstring to charstring
C.19 Hexstring to charstring
C.20 Octetstring to character string
C.21 Character string to octetstring
C.22 Bitstring to hexstring
C.23 Hexstring to octetstring
C.24 Bitstring to octetstring
C.25 Hexstring to bitstring
C.26 Octetstring to hexstring
C.27 Octetstring to bitstring
C.28 Integer to float
C.29 Float to integer
C.30 The random number generator function
C.31 The Substring function
C.32 Number of elements in a structured type
C.33 Character string to float
C.34 The Replace function
C.35 Octetstring to character string
C.36 Character string to octetstring
Annex D: Void
Annex E (informative): Library of Useful Types
E.1 Limitations
E.2 Useful TTCN-3 types
E.2.1 Useful simple basic types
E.2.1.0 Signed and unsigned single byte integers
E.2.1.1 Signed and unsigned short integers
E.2.1.2 Signed and unsigned long integers
E.2.1.3 Signed and unsigned longlong integers
E.2.1.4 IEEE 754 floats
E.2.2 Useful character string types
E.2.2.0 UTF-8 character string "utf8string"
E.2.2.1 BMP character string "bmpstring"
E.2.2.2 UTF-16 character string "utf16string"
E.2.2.3 ISO/IEC 8859 character string "iso8859string"
E.2.3 Useful structured types
E.2.3.0 Fixed-point decimal literal
E.2.4 Useful atomic string types
E.2.4.1 Single ISO 646 character type
E.2.4.2 Single universal character type
E.2.4.3 Single bit type
E.2.4.4 Single hex type
E.2.4.5 Single octet type
Annex F (informative): Operations on TTCN-3 active objects
F.1 General
F.2 Test components
F.2.1 Test component references
F.2.2 Dynamic behaviour of PTCs
F.2.3 Dynamic behaviour of the MTC
F.3 Timers
F.4 Ports
F.4.1 Configuration Operations
F.4.2 Port Controlling Operations
F.4.3 Communication Operations
Annex G (informative): Deprecated language features
G.1 Group style definition of module parameters
G.2 Recursive import
G.3 Using all in port type definitions
Annex H (informative): Bibliography
History