Methods for Testing and Specification (MTS) - The Testing and Test Control Notation version 3 - Part 1: TTCN-3 Core Language

The present document defines the Core Language of TTCN-3. TTCN-3 can be used for the specification of all types of reactive system tests over a variety of communication ports. Typical areas of application are protocol testing (including mobile and Internet protocols), service testing (including supplementary services), module testing, testing of CORBA ® based platforms, APIs, etc.  TTCN-3 is not restricted to conformance testing and can be used for many other kinds of testing including interoperability, robustness, regression, system and integration testing. The specification of test suites for physical layer protocols is outside the scope of the present document.
TTCN-3 is intended to be used for the specification of test suites which are independent of test methods, layers and protocols. In addition to the textual format defined in the present document, while GFT (ETSI ES 201 873-3 [i.2]) defines a graphical presentation format for TTCN-3. The specification of these formats is outside the scope of the present document.
While the design of TTCN-3 has taken the eventual implementation of TTCN-3 translators and compilers into consideration the means of realization of Executable Test Suites (ETS) from Abstract Test Suites (ATS) is outside the scope of the present document.

Metode za preskušanje in specificiranje (MTS) - 3. različica zapisa preskušanja in krmiljenja preskusov - 1. del: Jedrni jezik TTCN-3

Ta dokument določa jedrni jezik TTCN-3. Jezik TTCN-3 je mogoče uporabiti za specificiranje vseh vrst reaktivnih sistemskih preskusov v okviru različnih komunikacijskih vrat. Običajna področja uporabe so preskušanje protokolov (vključno z mobilnimi in internetnimi protokoli), preskušanje storitev (vključno z dopolnilnimi storitvami), preskušanje modulov, preskušanje platform na osnovi sistema CORBA, programskih vmesnikov (API) itd. TTCN-3 ni omejen na preskušanje skladnosti in ga je mogoče uporabljati za številne druge vrste preskušanja, vključno s preskušanjem interoperabilnosti, robustnosti, regresije, sistema in integracije. Specificiranje preskuševalnih nizov za protokole fizične plasti ne spada na področje uporabe tega dokumenta.  TTCN-3 je namenjen uporabi za specificiranje preskuševalnih nizov, ki so neodvisni od preskusnih metod, plasti in protokolov. Poleg besedilnega formata, ki je opredeljen v tem dokumentu, standard GFT (ETSI ES 201 873-3 [i.2]) določa format grafične predstavitve jezika TTCN-3. Specificiranje teh formatov ne spada na področje uporabe tega dokumenta.  Zasnova jezika TTCN-3 upošteva postopno uvedbo prevajalnikov TTCN-3, vendar pa realizacija izvršljivih preskuševalnih nizov (ETS) iz abstraktnih preskuševalnih nizov (ATS) ne spada na področje uporabe tega dokumenta.

General Information

Status
Published
Publication Date
12-Oct-2025
Current Stage
6060 - National Implementation/Publication (Adopted Project)
Start Date
13-Oct-2025
Due Date
18-Dec-2025
Completion Date
13-Oct-2025
Standard
ETSI ES 201 873-1 V4.17.1 (2025-07) - Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 1: TTCN-3 Core Language
English language
396 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
ETSI ES 201 873-1 V4.17.1 (2025-09) - Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 1: TTCN-3 Core Language
English language
396 pages
sale 15% off
Preview
sale 15% off
Preview
Standardization document
SIST ES 201 873-1 V4.17.1:2025
English language
396 pages
sale 10% off
Preview
sale 10% off
Preview
e-Library read for
1 day

Standards Content (Sample)


Final draft ETSI ES 201 873-1 V4.17.1 (2025-07)

ETSI STANDARD
Methods for Testing and Specification (MTS);
The Testing and Test Control Notation version 3;
Part 1: TTCN-3 Core Language
2 Final draft ETSI ES 201 873-1 V4.17.1 (2025-07)

Reference
RES/MTS-201873-1v4.17.1
Keywords
language, methodology, testing, TTCN-3

ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE

Tel.: +33 4 92 94 42 00  Fax: +33 4 93 65 47 16

Siret N° 348 623 562 00017 - APE 7112B
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° w061004871

Important notice
The present document can be downloaded from the
ETSI Search & Browse Standards application.
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format on ETSI deliver repository.
Users should be aware that the present document may be revised or have its status changed,
this information is available in the Milestones listing.
If you find errors in the present document, please send your comments to
the relevant service listed under Committee Support Staff.
If you find a security vulnerability in the present document, please report it through our
Coordinated Vulnerability Disclosure (CVD) program.
Notice of disclaimer & limitation of liability
The information provided in the present deliverable is directed solely to professionals who have the appropriate degree of
experience to understand and interpret its content in accordance with generally accepted engineering or
other professional standard and applicable regulations.
No recommendation as to products and services or vendors is made or should be implied.
No representation or warranty is made that this deliverable is technically accurate or sufficient or conforms to any law
and/or governmental rule and/or regulation and further, no representation or warranty is made of merchantability or fitness
for any particular purpose or against infringement of intellectual property rights.
In no event shall ETSI be held liable for loss of profits or any other incidental or consequential damages.

Any software contained in this deliverable is provided "AS IS" with no warranties, express or implied, including but not
limited to, the warranties of merchantability, fitness for a particular purpose and non-infringement of intellectual property
rights and ETSI shall not be held liable in any event for any damages whatsoever (including, without limitation, damages
for loss of profits, business interruption, loss of information, or any other pecuniary loss) arising out of or related to the use
of or inability to use the software.
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and
microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.

© ETSI 2025.
All rights reserved.
ETSI
3 Final draft ETSI ES 201 873-1 V4.17.1 (2025-07)
Contents
Intellectual Property Rights . 13
Foreword . 13
Modal verbs terminology . 14
1 Scope . 15
2 References . 15
2.1 Normative references . 15
2.2 Informative references . 15
3 Definition of terms, symbols and abbreviations . 18
3.1 Terms . 18
3.2 Symbols . 24
3.3 Abbreviations . 24
4 Introduction . 25
4.0 General . 25
4.1 The core language and presentation formats . 26
4.2 Unanimity of the specification . 27
4.3 Conformance . 27
5 Basic language elements . 27
5.0 General . 27
5.1 Identifiers and keywords . 28
5.2 Scope rules . 29
5.2.0 General . 29
5.2.1 Scope of formal parameters . 31
5.2.2 Uniqueness of identifiers . 31
5.3 Ordering of language elements . 32
5.4 Parameterization . 32
5.4.0 General . 32
5.4.1 Formal parameters . 33
5.4.1.0 General . 33
5.4.1.1 Formal parameters of kind value . 34
5.4.1.2 Formal parameters of kind template . 37
5.4.2 Actual parameters . 39
5.4.3 Variadic Parameters . 44
5.5 Cyclic Definitions. 45
6 Types and values . 45
6.0 General . 45
6.1 Basic types and values . 46
6.1.0 Simple basic types and values. 46
6.1.1 Basic string types and values . 47
6.1.1.0 General . 47
6.1.1.1 Accessing individual string elements . 49
6.1.2 Subtyping of basic types . 50
6.1.2.0 General . 50
6.1.2.1 Lists of templates . 50
6.1.2.2 Lists of types . 50
6.1.2.3 Ranges . 51
6.1.2.4 String length restrictions . 52
6.1.2.5 Pattern subtyping of character string types . 52
6.1.2.6 Mixing subtyping mechanisms . 52
6.1.2.6.1 Mixing patterns, lists and ranges . 52
6.1.2.6.2 Using length restriction with other constraints . 53
6.2 Structured types and values . 53
6.2.0 General . 53
6.2.1 Record type and values . 55
ETSI
4 Final draft ETSI ES 201 873-1 V4.17.1 (2025-07)
6.2.1.0 General . 55
6.2.1.1 Referencing fields of a record type . 58
6.2.1.2 Optional elements in a record. 59
6.2.1.3 Nested type definitions for field types . 59
6.2.1.4 Embedded fields . 60
6.2.2 Set type and values . 60
6.2.2.0 General . 60
6.2.2.1 Referencing fields of a set type . 61
6.2.2.2 Optional elements in a set . 61
6.2.2.3 Nested type definition for field types . 61
6.2.2.4 Embedded Fields . 61
6.2.3 Records and sets of single types . 61
6.2.3.0 General . 61
6.2.3.1 Nested type definitions . 64
6.2.3.2 Referencing elements of record of and set of types . 64
6.2.4 Enumerated type and values . 65
6.2.5 Unions . 67
6.2.5.0 General . 67
6.2.5.1 Referencing fields of a union type . 68
6.2.5.2 Option and union . 69
6.2.5.3 Nested type definition for field types . 69
6.2.5.4 Embedded Fields . 69
6.2.6 The anytype . 70
6.2.7 Arrays . 70
6.2.8 The default type . 72
6.2.9 Communication port types . 72
6.2.10 Component types . 74
6.2.10.1 Component type definition . 74
6.2.10.2 Reuse of component types . 75
6.2.11 Component references . 77
6.2.12 Addressing entities inside the SUT . 79
6.2.13 Subtyping of structured types . 81
6.2.13.0 General . 81
6.2.13.1 Length subtyping of record ofs and set ofs . 81
6.2.13.2 List subtyping of structured types and anytype . 82
6.2.13.3 Subtyping of the iterated type of record ofs and set ofs . 85
6.2.13.4 Mixing subtyping mechanisms . 86
6.2.14 The timer type . 86
6.2.15 Map types . 87
6.2.15.0 General . 87
6.2.15.1 Map Type Definition . 87
6.2.15.2 Indexed Assignment Notation . 87
6.2.15.3 Unmapping Keys . 88
6.2.15.4 Index Notation . 88
6.2.15.5 Accessing the Keys of a Map . 89
6.2.15.6 Accessing the Values of a Map . 90
6.2.15.7 Referencing of Elements of a Map . 90
6.2.15.8 Nested type definitions . 91
6.2.15.9 Optionality of map element values . 91
6.2.16 The open type . 91
6.3 Type compatibility . 92
6.3.0 General . 92
6.3.1 Compatibility of non-structured types . 92
6.3.2 Compatibility of structured types . 94
6.3.2.0 General . 94
6.3.2.1 Compatibility of enumerated types . 94
6.3.2.2 Compatibility of record and record of types . 94
6.3.2.3 Compatibility of set and set of types . 96
6.3.2.4 Compatibility of union types . 96
6.3.2.5 Compatibility of anytype types . 97
6.3.2.6 Compatibility between sub-structures . 98
6.3.2.7 Compatibility of the open type . 98
ETSI
5 Final draft ETSI ES 201 873-1 V4.17.1 (2025-07)
6.3.3 Compatibility of component types . 99
6.3.4 Type compatibility of communication and connection operations . 99
6.3.5 Type conversion . 100
6.3.6 Type compatibility of port types . 100
6.3.7 Type compatibility of timer types . 100
6.3.8 Type Compatibility of Map Types . 100
6.4 Type synonym . 100
6.5 Automatic type . 100
7 Expressions . 102
7.0 General . 102
7.1 Operators . 102
7.1.0 General . 102
7.1.1 Arithmetic operators . 104
7.1.2 List operator . 105
7.1.3 Relational operators . 105
7.1.4 Logical operators . 108
7.1.5 Bitwise operators . 108
7.1.6 Shift operators . 109
7.1.7 Rotate operators . 110
7.1.8 Presence checking operators . 111
7.1.8.0 General . 111
7.1.8.1 The ispresent operator . 111
7.1.8.2 The ischosen operator . 112
7.1.8.3 The isvalue operator . 114
7.1.8.4 The isbound operator. 115
7.2 Field references and list ele me nts . 116
7.3 Decoded field reference . 116
8 Modules . 117
8.0 General . 117
8.1 Definition of a module . 117
8.2 Module definitions part . 119
8.2.0 General . 119
8.2.1 Module parameters . 120
8.2.2 Groups of definitions . 121
8.2.3 Importing from modules . 122
8.2.3.0 General . 122
8.2.3.1 General format of import . 122
8.2.3.2 Importing single definitions . 129
8.2.3.3 Importing groups . 129
8.2.3.4 Importing definitions of the same kind . 130
8.2.3.5 Importing all definitions of a module . 131
8.2.3.6 Import definitions from other TTCN-3 editions and from non-TTCN-3 modules . 132
8.2.3.7 Importing of import statements from TTCN-3 modules . 134
8.2.3.8 Compatibility of language specifications in imports . 135
8.2.4 Definition of friend modules . 135
8.2.5 Visibility of definitions . 136
8.3 Module control part . 137
9 Port types, component types and test configurations . 138
9.0 General . 138
9.1 Communication ports . 139
9.2 Test system interface . 141
10 Declaring constants . 143
11 Declaring variables . 144
11.0 General . 144
11.1 Value variables . 144
11.2 Template variables . 145
12 Declaring timers . 147
ETSI
6 Final draft ETSI ES 201 873-1 V4.17.1 (2025-07)
13 Declaring messages . 148
14 Declaring procedure signatures . 148
15 Declaring templates . 150
15.0 General . 150
15.1 Declaring message templates . 151
15.2 Declaring signature templates . 152
15.3 Global and local templates . 154
15.4 In-line Templates . 155
15.5 Modified templates . 156
15.6 Referencing elements of templates or template fields . 160
15.6.0 General . 160
15.6.1 Referencing individual string elements. 160
15.6.2 Referencing record and set fields . 163
15.6.3 Referencing record of and set of elements . 164
15.6.4 Referencing signature parameters . 167
15.6.5 Referencing union alternatives . 168
15.6.6 Referencing map elements. 169
15.7 Template matching mechanisms . 170
15.7.0 General . 170
15.7.1 Specific values . 171
15.7.2 Special symbols that can be used instead of values . 172
15.7.3 Special symbols that can be used inside values . 173
15.7.4 Special symbols which describe attributes of values . 173
15.8 Template Restrictions . 174
15.8.1 Explicit restrictions . 174
15.8.2 Implicit restrictions for template fields, alternatives and elements . 176
15.9 Match Operation . 177
15.10 Valueof Operation . 178
15.11 Concatenating templates of string and list types . 178
15.12 The omit operation . 181
15.13 The present operation . 182
15.14 Presentness conversion . 182
15.15 The Value Extraction . 183
16 Functions, altsteps and testcases . 184
16.0 General . 184
16.1 Functions . 184
16.1.0 General . 184
16.1.1 Invoking functions . 186
16.1.2 Predefined functions . 187
16.1.3 External functions . 190
16.1.4 Invoking functions from specific places . 190
16.1.5 Explicit control functions . 192
16.1.6 The not-implemented function . 192
16.2 Altsteps . 193
16.2.0 General . 193
16.2.1 Invoking altsteps . 195
16.3 Test cases. 196
17 Void . 197
18 Overview of program statements and operations . 197
19 Basic program statements . 199
19.0 General . 199
19.1 Assignments . 200
19.1.1 Basic assignments . 200
19.1.2 Shorthand assignments . 202
19.2 The If-else statement . 202
19.3 The Select statements . 203
19.3.1 The Select case statement . 203
19.3.2 The Select union statement . 204
ETSI
7 Final draft ETSI ES 201 873-1 V4.17.1 (2025-07)
19.4 The For statements . 205
19.4.1 The counter loop . 205
19.4.2 The range-based loop . 206
19.5 The While statement . 208
19.6 The Do-while statement . 208
19.7 The Label statement . 208
19.8 The Goto statement . 209
19.9 The Stop execution statement . 210
19.10 The Return statement . 211
19.11 The Log statement . 212
19.12 The Break statement . 213
19.13 The Continue statement . 214
19.14 Statement block . 215
20 Statement and operations for alternative behaviours . 215
20.0 General . 215
20.1 The snapshot mechanism . 216
20.2 The Alt statement . 216
20.3 The Repeat statement . 220
20.4 The Interleave statement . 221
20.5 Default Handling . 224
20.5.0 General . 224
20.5.1 The default mechanism . 224
20.5.2 The Activate operation . 225
20.5.3 The Deactivate operation . 226
21 Configuration Operations . 227
21.0 General . 227
21.1 Connection Operations . 228
21.1.0 General . 228
21.1.1 The Connect and Map operations . 229
21.1.2 The Disconnect and Unmap operations . 231
21.2 Test case operations. 232
21.2.0 General . 232
21.2.1 Test case stop operation . 233
21.3 Test Component Operations . 233
21.3.0 General . 233
21.3.1 The Create operation . 233
21.3.2 The Start test component operation . 234
21.3.3 The Stop test behaviour operation . 236
21.3.4 The Kill test component operation . 237
21.3.5 The Alive operation .
...


ETSI STANDARD
Methods for Testing and Specification (MTS);
The Testing and Test Control Notation version 3;
Part 1: TTCN-3 Core Language
2 ETSI ES 201 873-1 V4.17.1 (2025-09)

Reference
RES/MTS-201873-1v4.17.1
Keywords
language, methodology, testing, TTCN-3

ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE

Tel.: +33 4 92 94 42 00  Fax: +33 4 93 65 47 16

Siret N° 348 623 562 00017 - APE 7112B
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° w061004871

Important notice
The present document can be downloaded from the
ETSI Search & Browse Standards application.
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format on ETSI deliver repository.
Users should be aware that the present document may be revised or have its status changed,
this information is available in the Milestones listing.
If you find errors in the present document, please send your comments to
the relevant service listed under Committee Support Staff.
If you find a security vulnerability in the present document, please report it through our
Coordinated Vulnerability Disclosure (CVD) program.
Notice of disclaimer & limitation of liability
The information provided in the present deliverable is directed solely to professionals who have the appropriate degree of
experience to understand and interpret its content in accordance with generally accepted engineering or
other professional standard and applicable regulations.
No recommendation as to products and services or vendors is made or should be implied.
No representation or warranty is made that this deliverable is technically accurate or sufficient or conforms to any law
and/or governmental rule and/or regulation and further, no representation or warranty is made of merchantability or fitness
for any particular purpose or against infringement of intellectual property rights.
In no event shall ETSI be held liable for loss of profits or any other incidental or consequential damages.

Any software contained in this deliverable is provided "AS IS" with no warranties, express or implied, including but not
limited to, the warranties of merchantability, fitness for a particular purpose and non-infringement of intellectual property
rights and ETSI shall not be held liable in any event for any damages whatsoever (including, without limitation, damages
for loss of profits, business interruption, loss of information, or any other pecuniary loss) arising out of or related to the use
of or inability to use the software.
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and
microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.

© ETSI 2025.
All rights reserved.
ETSI
3 ETSI ES 201 873-1 V4.17.1 (2025-09)
Contents
Intellectual Property Rights . 13
Foreword . 13
Modal verbs terminology . 14
1 Scope . 15
2 References . 15
2.1 Normative references . 15
2.2 Informative references . 15
3 Definition of terms, symbols and abbreviations . 18
3.1 Terms . 18
3.2 Symbols . 24
3.3 Abbreviations . 24
4 Introduction . 25
4.0 General . 25
4.1 The core language and presentation formats . 26
4.2 Unanimity of the specification . 27
4.3 Conformance . 27
5 Basic language elements . 27
5.0 General . 27
5.1 Identifiers and keywords . 28
5.2 Scope rules . 29
5.2.0 General . 29
5.2.1 Scope of formal parameters . 31
5.2.2 Uniqueness of identifiers . 31
5.3 Ordering of language elements . 32
5.4 Parameterization . 32
5.4.0 General . 32
5.4.1 Formal parameters . 33
5.4.1.0 General . 33
5.4.1.1 Formal parameters of kind value . 34
5.4.1.2 Formal parameters of kind template . 37
5.4.2 Actual parameters . 39
5.4.3 Variadic Parameters . 44
5.5 Cyclic Definitions. 45
6 Types and values . 45
6.0 General . 45
6.1 Basic types and values . 46
6.1.0 Simple basic types and values. 46
6.1.1 Basic string types and values . 47
6.1.1.0 General . 47
6.1.1.1 Accessing individual string elements . 49
6.1.2 Subtyping of basic types . 50
6.1.2.0 General . 50
6.1.2.1 Lists of templates . 50
6.1.2.2 Lists of types . 50
6.1.2.3 Ranges . 51
6.1.2.4 String length restrictions . 52
6.1.2.5 Pattern subtyping of character string types . 52
6.1.2.6 Mixing subtyping mechanisms . 52
6.1.2.6.1 Mixing patterns, lists and ranges . 52
6.1.2.6.2 Using length restriction with other constraints . 53
6.2 Structured types and values . 53
6.2.0 General . 53
6.2.1 Record type and values . 55
ETSI
4 ETSI ES 201 873-1 V4.17.1 (2025-09)
6.2.1.0 General . 55
6.2.1.1 Referencing fields of a record type . 58
6.2.1.2 Optional elements in a record. 59
6.2.1.3 Nested type definitions for field types . 59
6.2.1.4 Embedded fields . 60
6.2.2 Set type and values . 60
6.2.2.0 General . 60
6.2.2.1 Referencing fields of a set type . 61
6.2.2.2 Optional elements in a set . 61
6.2.2.3 Nested type definition for field types . 61
6.2.2.4 Embedded Fields . 61
6.2.3 Records and sets of single types . 61
6.2.3.0 General . 61
6.2.3.1 Nested type definitions . 64
6.2.3.2 Referencing elements of record of and set of types . 64
6.2.4 Enumerated type and values . 65
6.2.5 Unions . 67
6.2.5.0 General . 67
6.2.5.1 Referencing fields of a union type . 68
6.2.5.2 Option and union . 69
6.2.5.3 Nested type definition for field types . 69
6.2.5.4 Embedded Fields . 69
6.2.6 The anytype . 70
6.2.7 Arrays . 70
6.2.8 The default type . 72
6.2.9 Communication port types . 72
6.2.10 Component types . 74
6.2.10.1 Component type definition . 74
6.2.10.2 Reuse of component types . 75
6.2.11 Component references . 77
6.2.12 Addressing entities inside the SUT . 79
6.2.13 Subtyping of structured types . 81
6.2.13.0 General . 81
6.2.13.1 Length subtyping of record ofs and set ofs . 81
6.2.13.2 List subtyping of structured types and anytype . 82
6.2.13.3 Subtyping of the iterated type of record ofs and set ofs . 85
6.2.13.4 Mixing subtyping mechanisms . 86
6.2.14 The timer type . 86
6.2.15 Map types . 87
6.2.15.0 General . 87
6.2.15.1 Map Type Definition . 87
6.2.15.2 Indexed Assignment Notation . 87
6.2.15.3 Unmapping Keys . 88
6.2.15.4 Index Notation . 88
6.2.15.5 Accessing the Keys of a Map . 89
6.2.15.6 Accessing the Values of a Map . 90
6.2.15.7 Referencing of Elements of a Map . 90
6.2.15.8 Nested type definitions . 91
6.2.15.9 Optionality of map element values . 91
6.2.16 The open type . 91
6.3 Type compatibility . 92
6.3.0 General . 92
6.3.1 Compatibility of non-structured types . 92
6.3.2 Compatibility of structured types . 94
6.3.2.0 General . 94
6.3.2.1 Compatibility of enumerated types . 94
6.3.2.2 Compatibility of record and record of types . 94
6.3.2.3 Compatibility of set and set of types . 96
6.3.2.4 Compatibility of union types . 96
6.3.2.5 Compatibility of anytype types . 97
6.3.2.6 Compatibility between sub-structures . 98
6.3.2.7 Compatibility of the open type . 98
ETSI
5 ETSI ES 201 873-1 V4.17.1 (2025-09)
6.3.3 Compatibility of component types . 99
6.3.4 Type compatibility of communication and connection operations . 99
6.3.5 Type conversion . 100
6.3.6 Type compatibility of port types . 100
6.3.7 Type compatibility of timer types . 100
6.3.8 Type Compatibility of Map Types . 100
6.4 Type synonym . 100
6.5 Automatic type . 100
7 Expressions . 102
7.0 General . 102
7.1 Operators . 102
7.1.0 General . 102
7.1.1 Arithmetic operators . 104
7.1.2 List operator . 105
7.1.3 Relational operators . 105
7.1.4 Logical operators . 108
7.1.5 Bitwise operators . 108
7.1.6 Shift operators . 109
7.1.7 Rotate operators . 110
7.1.8 Presence checking operators . 111
7.1.8.0 General . 111
7.1.8.1 The ispresent operator . 111
7.1.8.2 The ischosen operator . 112
7.1.8.3 The isvalue operator . 114
7.1.8.4 The isbound operator. 115
7.2 Field references and list ele me nts . 116
7.3 Decoded field reference . 116
8 Modules . 117
8.0 General . 117
8.1 Definition of a module . 117
8.2 Module definitions part . 119
8.2.0 General . 119
8.2.1 Module parameters . 120
8.2.2 Groups of definitions . 121
8.2.3 Importing from modules . 122
8.2.3.0 General . 122
8.2.3.1 General format of import . 122
8.2.3.2 Importing single definitions . 129
8.2.3.3 Importing groups . 129
8.2.3.4 Importing definitions of the same kind . 130
8.2.3.5 Importing all definitions of a module . 131
8.2.3.6 Import definitions from other TTCN-3 editions and from non-TTCN-3 modules . 132
8.2.3.7 Importing of import statements from TTCN-3 modules . 134
8.2.3.8 Compatibility of language specifications in imports . 135
8.2.4 Definition of friend modules . 135
8.2.5 Visibility of definitions . 136
8.3 Module control part . 137
9 Port types, component types and test configurations . 138
9.0 General . 138
9.1 Communication ports . 139
9.2 Test system interface . 141
10 Declaring constants . 143
11 Declaring variables . 144
11.0 General . 144
11.1 Value variables . 144
11.2 Template variables . 145
12 Declaring timers . 147
ETSI
6 ETSI ES 201 873-1 V4.17.1 (2025-09)
13 Declaring messages . 148
14 Declaring procedure signatures . 148
15 Declaring templates . 150
15.0 General . 150
15.1 Declaring message templates . 151
15.2 Declaring signature templates . 152
15.3 Global and local templates . 154
15.4 In-line Templates . 155
15.5 Modified templates . 156
15.6 Referencing elements of templates or template fields . 160
15.6.0 General . 160
15.6.1 Referencing individual string elements. 160
15.6.2 Referencing record and set fields . 163
15.6.3 Referencing record of and set of elements . 164
15.6.4 Referencing signature parameters . 167
15.6.5 Referencing union alternatives . 168
15.6.6 Referencing map elements. 169
15.7 Template matching mechanisms . 170
15.7.0 General . 170
15.7.1 Specific values . 171
15.7.2 Special symbols that can be used instead of values . 172
15.7.3 Special symbols that can be used inside values . 173
15.7.4 Special symbols which describe attributes of values . 173
15.8 Template Restrictions . 174
15.8.1 Explicit restrictions . 174
15.8.2 Implicit restrictions for template fields, alternatives and elements . 176
15.9 Match Operation . 177
15.10 Valueof Operation . 178
15.11 Concatenating templates of string and list types . 178
15.12 The omit operation . 181
15.13 The present operation . 182
15.14 Presentness conversion . 182
15.15 The Value Extraction . 183
16 Functions, altsteps and testcases . 184
16.0 General . 184
16.1 Functions . 184
16.1.0 General . 184
16.1.1 Invoking functions . 186
16.1.2 Predefined functions . 187
16.1.3 External functions . 190
16.1.4 Invoking functions from specific places . 190
16.1.5 Explicit control functions . 192
16.1.6 The not-implemented function . 192
16.2 Altsteps . 193
16.2.0 General . 193
16.2.1 Invoking altsteps . 195
16.3 Test cases. 196
17 Void . 197
18 Overview of program statements and operations . 197
19 Basic program statements . 199
19.0 General . 199
19.1 Assignments . 200
19.1.1 Basic assignments . 200
19.1.2 Shorthand assignments . 202
19.2 The If-else statement . 202
19.3 The Select statements . 203
19.3.1 The Select case statement . 203
19.3.2 The Select union statement . 204
ETSI
7 ETSI ES 201 873-1 V4.17.1 (2025-09)
19.4 The For statements . 205
19.4.1 The counter loop . 205
19.4.2 The range-based loop . 206
19.5 The While statement . 208
19.6 The Do-while statement . 208
19.7 The Label statement . 208
19.8 The Goto statement . 209
19.9 The Stop execution statement . 210
19.10 The Return statement . 211
19.11 The Log statement . 212
19.12 The Break statement . 213
19.13 The Continue statement . 214
19.14 Statement block . 215
20 Statement and operations for alternative behaviours . 215
20.0 General . 215
20.1 The snapshot mechanism . 216
20.2 The Alt statement . 216
20.3 The Repeat statement . 220
20.4 The Interleave statement . 221
20.5 Default Handling . 224
20.5.0 General . 224
20.5.1 The default mechanism . 224
20.5.2 The Activate operation . 225
20.5.3 The Deactivate operation . 226
21 Configuration Operations . 227
21.0 General . 227
21.1 Connection Operations . 228
21.1.0 General . 228
21.1.1 The Connect and Map operations . 229
21.1.2 The Disconnect and Unmap operations . 231
21.2 Test case operations. 232
21.2.0 General . 232
21.2.1 Test case stop operation . 233
21.3 Test Component Operations . 233
21.3.0 General . 233
21.3.1 The Create operation . 233
21.3.2 The Start test component operation . 234
21.3.3 The Stop test behaviour operation . 236
21.3.4 The Kill test component operation . 237
21.3.5 The Alive operation . 237
21.3.6 The Running operation .
...


SLOVENSKI STANDARD
01-november-2025
Metode za preskušanje in specificiranje (MTS) - 3. različica zapisa preskušanja in
krmiljenja preskusov - 1. del: Jedrni jezik TTCN-3
Methods for Testing and Specification (MTS) - The Testing and Test Control Notation
version 3 - Part 1: TTCN-3 Core Language
Ta slovenski standard je istoveten z: ETSI ES 201 873-1 V4.17.1 (2025-09)
ICS:
33.040.01 Telekomunikacijski sistemi Telecommunication systems
na splošno in general
35.060 Jeziki, ki se uporabljajo v Languages used in
informacijski tehniki in information technology
tehnologiji
2003-01.Slovenski inštitut za standardizacijo. Razmnoževanje celote ali delov tega standarda ni dovoljeno.

ETSI STANDARD
Methods for Testing and Specification (MTS);
The Testing and Test Control Notation version 3;
Part 1: TTCN-3 Core Language
2 ETSI ES 201 873-1 V4.17.1 (2025-09)

Reference
RES/MTS-201873-1v4.17.1
Keywords
language, methodology, testing, TTCN-3

ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE

Tel.: +33 4 92 94 42 00  Fax: +33 4 93 65 47 16

Siret N° 348 623 562 00017 - APE 7112B
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° w061004871

Important notice
The present document can be downloaded from the
ETSI Search & Browse Standards application.
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format on ETSI deliver repository.
Users should be aware that the present document may be revised or have its status changed,
this information is available in the Milestones listing.
If you find errors in the present document, please send your comments to
the relevant service listed under Committee Support Staff.
If you find a security vulnerability in the present document, please report it through our
Coordinated Vulnerability Disclosure (CVD) program.
Notice of disclaimer & limitation of liability
The information provided in the present deliverable is directed solely to professionals who have the appropriate degree of
experience to understand and interpret its content in accordance with generally accepted engineering or
other professional standard and applicable regulations.
No recommendation as to products and services or vendors is made or should be implied.
No representation or warranty is made that this deliverable is technically accurate or sufficient or conforms to any law
and/or governmental rule and/or regulation and further, no representation or warranty is made of merchantability or fitness
for any particular purpose or against infringement of intellectual property rights.
In no event shall ETSI be held liable for loss of profits or any other incidental or consequential damages.

Any software contained in this deliverable is provided "AS IS" with no warranties, express or implied, including but not
limited to, the warranties of merchantability, fitness for a particular purpose and non-infringement of intellectual property
rights and ETSI shall not be held liable in any event for any damages whatsoever (including, without limitation, damages
for loss of profits, business interruption, loss of information, or any other pecuniary loss) arising out of or related to the use
of or inability to use the software.
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and
microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.

© ETSI 2025.
All rights reserved.
ETSI
3 ETSI ES 201 873-1 V4.17.1 (2025-09)
Contents
Intellectual Property Rights . 13
Foreword . 13
Modal verbs terminology . 14
1 Scope . 15
2 References . 15
2.1 Normative references . 15
2.2 Informative references . 15
3 Definition of terms, symbols and abbreviations . 18
3.1 Terms . 18
3.2 Symbols . 24
3.3 Abbreviations . 24
4 Introduction . 25
4.0 General . 25
4.1 The core language and presentation formats . 26
4.2 Unanimity of the specification . 27
4.3 Conformance . 27
5 Basic language elements . 27
5.0 General . 27
5.1 Identifiers and keywords . 28
5.2 Scope rules . 29
5.2.0 General . 29
5.2.1 Scope of formal parameters . 31
5.2.2 Uniqueness of identifiers . 31
5.3 Ordering of language elements . 32
5.4 Parameterization . 32
5.4.0 General . 32
5.4.1 Formal parameters . 33
5.4.1.0 General . 33
5.4.1.1 Formal parameters of kind value . 34
5.4.1.2 Formal parameters of kind template . 37
5.4.2 Actual parameters . 39
5.4.3 Variadic Parameters . 44
5.5 Cyclic Definitions. 45
6 Types and values . 45
6.0 General . 45
6.1 Basic types and values . 46
6.1.0 Simple basic types and values. 46
6.1.1 Basic string types and values . 47
6.1.1.0 General . 47
6.1.1.1 Accessing individual string elements . 49
6.1.2 Subtyping of basic types . 50
6.1.2.0 General . 50
6.1.2.1 Lists of templates . 50
6.1.2.2 Lists of types . 50
6.1.2.3 Ranges . 51
6.1.2.4 String length restrictions . 52
6.1.2.5 Pattern subtyping of character string types . 52
6.1.2.6 Mixing subtyping mechanisms . 52
6.1.2.6.1 Mixing patterns, lists and ranges . 52
6.1.2.6.2 Using length restriction with other constraints . 53
6.2 Structured types and values . 53
6.2.0 General . 53
6.2.1 Record type and values . 55
ETSI
4 ETSI ES 201 873-1 V4.17.1 (2025-09)
6.2.1.0 General . 55
6.2.1.1 Referencing fields of a record type . 58
6.2.1.2 Optional elements in a record. 59
6.2.1.3 Nested type definitions for field types . 59
6.2.1.4 Embedded fields . 60
6.2.2 Set type and values . 60
6.2.2.0 General . 60
6.2.2.1 Referencing fields of a set type . 61
6.2.2.2 Optional elements in a set . 61
6.2.2.3 Nested type definition for field types . 61
6.2.2.4 Embedded Fields . 61
6.2.3 Records and sets of single types . 61
6.2.3.0 General . 61
6.2.3.1 Nested type definitions . 64
6.2.3.2 Referencing elements of record of and set of types . 64
6.2.4 Enumerated type and values . 65
6.2.5 Unions . 67
6.2.5.0 General . 67
6.2.5.1 Referencing fields of a union type . 68
6.2.5.2 Option and union . 69
6.2.5.3 Nested type definition for field types . 69
6.2.5.4 Embedded Fields . 69
6.2.6 The anytype . 70
6.2.7 Arrays . 70
6.2.8 The default type . 72
6.2.9 Communication port types . 72
6.2.10 Component types . 74
6.2.10.1 Component type definition . 74
6.2.10.2 Reuse of component types . 75
6.2.11 Component references . 77
6.2.12 Addressing entities inside the SUT . 79
6.2.13 Subtyping of structured types . 81
6.2.13.0 General . 81
6.2.13.1 Length subtyping of record ofs and set ofs . 81
6.2.13.2 List subtyping of structured types and anytype . 82
6.2.13.3 Subtyping of the iterated type of record ofs and set ofs . 85
6.2.13.4 Mixing subtyping mechanisms . 86
6.2.14 The timer type . 86
6.2.15 Map types . 87
6.2.15.0 General . 87
6.2.15.1 Map Type Definition . 87
6.2.15.2 Indexed Assignment Notation . 87
6.2.15.3 Unmapping Keys . 88
6.2.15.4 Index Notation . 88
6.2.15.5 Accessing the Keys of a Map . 89
6.2.15.6 Accessing the Values of a Map . 90
6.2.15.7 Referencing of Elements of a Map . 90
6.2.15.8 Nested type definitions . 91
6.2.15.9 Optionality of map element values . 91
6.2.16 The open type . 91
6.3 Type compatibility . 92
6.3.0 General . 92
6.3.1 Compatibility of non-structured types . 92
6.3.2 Compatibility of structured types . 94
6.3.2.0 General . 94
6.3.2.1 Compatibility of enumerated types . 94
6.3.2.2 Compatibility of record and record of types . 94
6.3.2.3 Compatibility of set and set of types . 96
6.3.2.4 Compatibility of union types . 96
6.3.2.5 Compatibility of anytype types . 97
6.3.2.6 Compatibility between sub-structures . 98
6.3.2.7 Compatibility of the open type . 98
ETSI
5 ETSI ES 201 873-1 V4.17.1 (2025-09)
6.3.3 Compatibility of component types . 99
6.3.4 Type compatibility of communication and connection operations . 99
6.3.5 Type conversion . 100
6.3.6 Type compatibility of port types . 100
6.3.7 Type compatibility of timer types . 100
6.3.8 Type Compatibility of Map Types . 100
6.4 Type synonym . 100
6.5 Automatic type . 100
7 Expressions . 102
7.0 General . 102
7.1 Operators . 102
7.1.0 General . 102
7.1.1 Arithmetic operators . 104
7.1.2 List operator . 105
7.1.3 Relational operators . 105
7.1.4 Logical operators . 108
7.1.5 Bitwise operators . 108
7.1.6 Shift operators . 109
7.1.7 Rotate operators . 110
7.1.8 Presence checking operators . 111
7.1.8.0 General . 111
7.1.8.1 The ispresent operator . 111
7.1.8.2 The ischosen operator . 112
7.1.8.3 The isvalue operator . 114
7.1.8.4 The isbound operator. 115
7.2 Field references and list ele me nts . 116
7.3 Decoded field reference . 116
8 Modules . 117
8.0 General . 117
8.1 Definition of a module . 117
8.2 Module definitions part . 119
8.2.0 General . 119
8.2.1 Module parameters . 120
8.2.2 Groups of definitions . 121
8.2.3 Importing from modules . 122
8.2.3.0 General . 122
8.2.3.1 General format of import . 122
8.2.3.2 Importing single definitions . 129
8.2.3.3 Importing groups . 129
8.2.3.4 Importing definitions of the same kind . 130
8.2.3.5 Importing all definitions of a module . 131
8.2.3.6 Import definitions from other TTCN-3 editions and from non-TTCN-3 modules . 132
8.2.3.7 Importing of import statements from TTCN-3 modules . 134
8.2.3.8 Compatibility of language specifications in imports . 135
8.2.4 Definition of friend modules . 135
8.2.5 Visibility of definitions . 136
8.3 Module control part . 137
9 Port types, component types and test configurations . 138
9.0 General . 138
9.1 Communication ports . 139
9.2 Test system interface . 141
10 Declaring constants . 143
11 Declaring variables . 144
11.0 General . 144
11.1 Value variables . 144
11.2 Template variables . 145
12 Declaring timers . 147
ETSI
6 ETSI ES 201 873-1 V4.17.1 (2025-09)
13 Declaring messages . 148
14 Declaring procedure signatures . 148
15 Declaring templates . 150
15.0 General . 150
15.1 Declaring message templates . 151
15.2 Declaring signature templates . 152
15.3 Global and local templates . 154
15.4 In-line Templates . 155
15.5 Modified templates . 156
15.6 Referencing elements of templates or template fields . 160
15.6.0 General . 160
15.6.1 Referencing individual string elements. 160
15.6.2 Referencing record and set fields . 163
15.6.3 Referencing record of and set of elements . 164
15.6.4 Referencing signature parameters . 167
15.6.5 Referencing union alternatives . 168
15.6.6 Referencing map elements. 169
15.7 Template matching mechanisms . 170
15.7.0 General . 170
15.7.1 Specific values . 171
15.7.2 Special symbols that can be used instead of values . 172
15.7.3 Special symbols that can be used inside values . 173
15.7.4 Special symbols which describe attributes of values . 173
15.8 Template Restrictions . 174
15.8.1 Explicit restrictions . 174
15.8.2 Implicit restrictions for template fields, alternatives and elements . 176
15.9 Match Operation . 177
15.10 Valueof Operation . 178
15.11 Concatenating templates of string and list types . 178
15.12 The omit operation . 181
15.13 The present operation . 182
15.14 Presentness conversion . 182
15.15 The Value Extraction . 183
16 Functions, altsteps and testcases . 184
16.0 General . 184
16.1 Functions . 184
16.1.0 General . 184
16.1.1 Invoking functions . 186
16.1.2 Predefined functions . 187
16.1.3 External functions . 190
16.1.4 Invoking functions from specific places . 190
16.1.5 Explicit control functions . 192
16.1.6 The not-implemented function . 192
16.2 Altsteps . 193
16.2.0 General . 193
16.2.1 Invoking altsteps . 195
16.3 Test cases. 196
17 Void . 197
18 Overview of program statements and operations . 197
19 Basic program statements . 199
19.0 General . 199
19.1 Assignments . 200
19.1.1 Basic assignments . 200
19.1.2 Shorthand assignments . 202
19.2 The If-else statement . 202
19.3 The Select statements . 203
19.3.1 The Select case statement . 203
19.3.2 The Select union statement . 204
ETSI
7 ETSI ES 201 873-1 V4.17.1 (2025-09)
19.4 The For statements . 205
19.4.1 The counter loop . 205
19.4.2 The range-based loop . 206
19.5 The While statement . 208
19.6 The Do-while statement . 208
19.7 The Label statement . 208
19.8 The Goto statement . 209
19.9 The Stop execution statement . 210
19.10 The Return statement . 211
19.11 The Log statement . 212
19.12 The Break statement . 213
19.13 The Continue statement . 214
19.14 Statement block . 215
20 Statement and operations for alternative behaviours . 215
20.0 General . 215
20.1 The snapshot mechanism . 216
20.2 The Alt statement . 216
20.3 The Repeat statement . 220
20.4 The Interleave statement . 221
20.5 Default Handling . 224
20.5.0 General . 224
20.5.1 The default mechanism . 224
20.5.2 The Activate operation . 225
20.5.3 The Deactivate operation . 226
21 Configuration Operations . 227
21.0 General . 227
21.1 Connection Operations . 228
21.1.0 General . 228
21.1.1 The Connect and Map operations . 229
21.1.2 The Disconnect and Unmap operations . 231
21.2 Test case operations. 232
21.2.0 General . 232
21.2.1 Test case stop operation . 23
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.