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

RES/MTS-201873-1v4.11.1_Core

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. 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 CORBA®, programski vmesniki (API) itd. TTCN-3 ni omejen na preskušanje skladnosti in se lahko uporabi 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 v 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
29-Apr-2019
Current Stage
12 - Completion
Due Date
03-May-2019
Completion Date
30-Apr-2019
Standard
ETSI ES 201 873-1 V4.11.1 (2019-02) - Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 1: TTCN-3 Core Language
English language
368 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
ETSI ES 201 873-1 V4.11.1 (2019-04) - Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 1: TTCN-3 Core Language
English language
367 pages
sale 15% off
Preview
sale 15% off
Preview
Standardization document
ES 201 873-1 V4.11.1:2019
English language
367 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.11.1 (2019-02)

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.11.1 (2019-02)

Reference
RES/MTS-201873-1v4.11.1_Core
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 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88

Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
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 at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
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 2019.
All rights reserved.
TM TM TM
DECT , PLUGTESTS , UMTS and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.
TM TM
3GPP and LTE are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners. ®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI
3 Final draft ETSI ES 201 873-1 V4.11.1 (2019-02)
Contents
Intellectual Property Rights . 13
Foreword . 13
Modal verbs terminology . 13
1 Scope . 14
2 References . 14
2.1 Normative references . 14
2.2 Informative references . 15
3 Definition of terms, symbols and abbreviations . 16
3.1 Terms . 16
3.2 Symbols . 21
3.3 Abbreviations . 22
4 Introduction . 23
4.0 General . 23
4.1 The core language and presentation formats . 23
4.2 Unanimity of the specification . 25
4.3 Conformance . 25
5 Basic language elements . 25
5.0 General . 25
5.1 Identifiers and keywords . 26
5.2 Scope rules . 26
5.2.0 General . 26
5.2.1 Scope of formal parameters . 29
5.2.2 Uniqueness of identifiers . 29
5.3 Ordering of language elements . 30
5.4 Parameterization . 30
5.4.0 General . 30
5.4.1 Formal parameters . 31
5.4.1.0 General . 31
5.4.1.1 Formal parameters of kind value . 31
5.4.1.2 Formal parameters of kind template . 34
5.4.2 Actual parameters . 36
5.5 Cyclic Definitions. 41
6 Types and values . 42
6.0 General . 42
6.1 Basic types and values . 43
6.1.0 Simple basic types and values. 43
6.1.1 Basic string types and values . 44
6.1.1.0 General . 44
6.1.1.1 Accessing individual string elements . 46
6.1.2 Subtyping of basic types . 47
6.1.2.0 General . 47
6.1.2.1 Lists of templates . 47
6.1.2.2 Lists of types . 47
6.1.2.3 Ranges . 48
6.1.2.4 String length restrictions . 48
6.1.2.5 Pattern subtyping of character string types . 49
6.1.2.6 Mixing subtyping mechanisms . 49
6.1.2.6.1 Mixing patterns, lists and ranges . 49
6.1.2.6.2 Using length restriction with other constraints . 50
6.2 Structured types and values . 50
6.2.0 General . 50
6.2.1 Record type and values . 52
6.2.1.0 General . 52
ETSI
4 Final draft ETSI ES 201 873-1 V4.11.1 (2019-02)
6.2.1.1 Referencing fields of a record type . 54
6.2.1.2 Optional elements in a record. 56
6.2.1.3 Nested type definitions for field types . 56
6.2.2 Set type and values . 56
6.2.2.0 General . 56
6.2.2.1 Referencing fields of a set type . 57
6.2.2.2 Optional elements in a set . 57
6.2.2.3 Nested type definition for field types . 57
6.2.3 Records and sets of single types . 57
6.2.3.0 General . 57
6.2.3.1 Nested type definitions . 60
6.2.3.2 Referencing elements of record of and set of types . 60
6.2.4 Enumerated type and values . 61
6.2.5 Unions . 63
6.2.5.0 General . 63
6.2.5.1 Referencing fields of a union type . 64
6.2.5.2 Option and union . 65
6.2.5.3 Nested type definition for field types . 65
6.2.6 The anytype . 65
6.2.7 Arrays . 66
6.2.8 The default type . 67
6.2.9 Communication port types . 68
6.2.10 Component types . 70
6.2.10.1 Component type definition . 70
6.2.10.2 Reuse of component types . 71
6.2.11 Component references . 73
6.2.12 Addressing entities inside the SUT . 75
6.2.13 Subtyping of structured types . 77
6.2.13.0 General . 77
6.2.13.1 Length subtyping of record ofs and set ofs . 77
6.2.13.2 List subtyping of structured types and anytype . 78
6.2.13.3 Subtyping of the iterated type of record ofs and set ofs . 80
6.2.13.4 Mixing subtyping mechanisms . 82
6.2.14 The timer type . 82
6.3 Type compatibility . 82
6.3.0 General . 82
6.3.1 Compatibility of non-structured types . 82
6.3.2 Compatibility of structured types . 84
6.3.2.0 General . 84
6.3.2.1 Compatibility of enumerated types . 84
6.3.2.2 Compatibility of record and record of types . 85
6.3.2.3 Compatibility of set and set of types . 86
6.3.2.4 Compatibility of union types . 87
6.3.2.5 Compatibility of anytype types . 87
6.3.2.6 Compatibility between sub-structures . 88
6.3.3 Compatibility of component types . 89
6.3.4 Type compatibility of communication and connection operations . 89
6.3.5 Type conversion . 90
6.3.6 Type compatibility of port types . 90
6.3.7 Type compatibility of timer types . 90
6.4 Type synonym . 90
7 Expressions . 90
7.0 General . 90
7.1 Operators . 91
7.1.0 General . 91
7.1.1 Arithmetic operators . 92
7.1.2 List operator . 93
7.1.3 Relational operators . 93
7.1.4 Logical operators . 96
7.1.5 Bitwise operators . 96
7.1.6 Shift operators . 97
ETSI
5 Final draft ETSI ES 201 873-1 V4.11.1 (2019-02)
7.1.7 Rotate operators . 98
7.2 Field references and list ele me nts . 99
7.3 Decoded field reference . 99
8 Modules . 100
8.0 General . 100
8.1 Definition of a module . 100
8.2 Module definitions part . 101
8.2.0 General . 101
8.2.1 Module parameters . 102
8.2.2 Groups of definitions . 103
8.2.3 Importing from modules . 104
8.2.3.0 General . 104
8.2.3.1 General format of import . 104
8.2.3.2 Importing single definitions . 111
8.2.3.3 Importing groups . 112
8.2.3.4 Importing definitions of the same kind . 113
8.2.3.5 Importing all definitions of a module . 114
8.2.3.6 Import definitions from other TTCN-3 editions and from non-TTCN-3 modules . 114
8.2.3.7 Importing of import statements from TTCN-3 modules . 116
8.2.3.8 Compatibility of language specifications in imports . 117
8.2.4 Definition of friend modules . 118
8.2.5 Visibility of definitions . 118
8.3 Module control part . 120
9 Port types, component types and test configurations . 121
9.0 General . 121
9.1 Communication ports . 121
9.2 Test system interface . 124
10 Declaring constants . 126
11 Declaring variables . 126
11.0 General . 126
11.1 Value variables . 127
11.2 Template variables . 128
12 Declaring timers . 129
13 Declaring messages . 130
14 Declaring procedure signatures . 131
15 Declaring templates . 132
15.0 General . 132
15.1 Declaring message templates . 133
15.2 Declaring signature templates . 135
15.3 Global and local templates . 136
15.4 In-line Templates . 137
15.5 Modified templates . 138
15.6 Referencing elements of templates or template fields . 142
15.6.0 General . 142
15.6.1 Referencing individual string elements. 142
15.6.2 Referencing record and set fields . 142
15.6.3 Referencing record of and set of elements . 143
15.6.4 Referencing signature parameters . 146
15.6.5 Referencing union alternatives . 147
15.7 Template matching mechanisms . 148
15.7.0 General . 148
15.7.1 Specific values . 149
15.7.2 Special symbols that can be used instead of values . 150
15.7.3 Special symbols that can be used inside values . 151
15.7.4 Special symbols which describe attributes of values . 151
15.8 Template Restrictions . 152
ETSI
6 Final draft ETSI ES 201 873-1 V4.11.1 (2019-02)
15.9 Match Operation . 154
15.10 Valueof Operation . 156
15.11 Concatenating templates of string and list types . 156
16 Functions, altsteps and testcases . 159
16.0 General . 159
16.1 Functions . 159
16.1.0 General . 159
16.1.1 Invoking functions . 162
16.1.2 Predefined functions . 163
16.1.3 External functions . 165
16.1.4 Invoking functions from specific places . 166
16.1.5 Explicit control functions . 167
16.2 Altsteps . 167
16.2.0 General . 167
16.2.1 Invoking altsteps . 169
16.3 Test cases. 171
17 Void . 172
18 Overview of program statements and operations . 172
19 Basic program statements . 174
19.0 General . 174
19.1 Assignments . 175
19.2 The If-else statement . 176
19.3 The Select statements . 177
19.3.1 The Select case statement . 177
19.3.2 The Select union statement . 178
19.4 The For statement . 179
19.5 The While statement . 180
19.6 The Do-while statement . 180
19.7 The Label statement . 180
19.8 The Goto statement . 181
19.9 The Stop execution statement . 182
19.10 The Return statement . 183
19.11 The Log statement . 184
19.12 The Break statement . 185
19.13 The Continue statement . 186
19.14 Statement block . 187
20 Statement and operations for alternative behaviours . 187
20.0 General . 187
20.1 The snapshot mechanism . 188
20.2 The Alt statement . 188
20.3 The Repeat statement . 192
20.4 The Interleave statement . 193
20.5 Default Handling . 195
20.5.0 General . 195
20.5.1 The default mechanism . 196
20.5.2 The Activate operation . 196
20.5.3 The Deactivate operation . 197
21 Configuration Operations . 198
21.0 General . 198
21.1 Connection Operations . 199
21.1.0 General . 199
21.1.1 The Connect and Map operations . 200
21.1.2 The Disconnect and Unmap operations . 202
21.2 Test case operations. 203
21.2.0 General . 203
21.2.1 Test case stop operation . 204
21.3 Test Component Operations . 204
21.3.0 General . 204
ETSI
7 Final draft ETSI ES 201 873-1 V4.11.1 (2019-02)
21.3.1 The Create operation . 204
21.3.2 The Start test component operation . 205
21.3.3 The Stop test behaviour operation . 207
21.3.4 The Kill test component operation . 208
21.3.5 The Alive operation . 208
21.3.6 The Running operation . 209
21.3.7 The Done operation . 211
21.3.8 The Killed operation . 213
21.3.9 Summary of the use of any and all with components . 215
21.3.10 The Call test component behaviour operation . 215
22 Communication operations. 217
22.0 General . 217
22.1 The communication mechanisms . 217
22.1.0 General . 217
22.1.1 Principles of message-based communication. 217
22.1.2 Principles of procedure-based communication . 218
22.1.3 Principles of unicast, multicast and broadcast communication . 218
22.1.4 General format of communication operations . 219
22.1.4.0 General . 219
22.1.4.1 General format of the sending operations . 219
22.1.4.2 General format of the receiving operations . 220
22.2 Message-based communication . 221
22.2.0 General . 221
22.2.1 The Send operation . 221
22.2.2 The Receive operation . 222
22.2.3 The Trigger operation . 226
22.3 Procedure-based communication . 229
22.3.0 General . 229
22.3.1 The Call operation . 229
22.3.2 The Getcall operation. 233
22.3.3 The Reply operation. 236
22.3.4 The Getreply operation . 237
22.3.5 The Raise operation . 240
22.3.6 The Catch operation . 241
22.4 The Check operation . 245
22.5 Controlling communication ports . 247
22.5.0 General . 247
22.5.1 The Clear port operation . 247
22.5.2 The Start port operation . 248
22.5.3 The Stop port operation . 248
22.5.4 The Halt port operation . 249
22.5.5 The Checkstate port operation . 250
22.6 Use of any and all with ports . 251
23 Timer operations . 252
23.0 General . 252
23.1 The timer mechanism . 252
23.2 The Start timer operation . 252
23.3 The Stop timer operation . 253
23.4 The Read timer 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.11.1 (2019-04)

Reference
RES/MTS-201873-1v4.11.1_Core
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 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88

Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
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 at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
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 2019.
All rights reserved.
TM TM TM
DECT , PLUGTESTS , UMTS and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.
TM TM
3GPP and LTE are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners. ®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI
3 ETSI ES 201 873-1 V4.11.1 (2019-04)
Contents
Intellectual Property Rights . 13
Foreword . 13
Modal verbs terminology . 13
1 Scope . 14
2 References . 14
2.1 Normative references . 14
2.2 Informative references . 15
3 Definition of terms, symbols and abbreviations . 16
3.1 Terms . 16
3.2 Symbols . 21
3.3 Abbreviations . 22
4 Introduction . 23
4.0 General . 23
4.1 The core language and presentation formats . 23
4.2 Unanimity of the specification . 25
4.3 Conformance . 25
5 Basic language elements . 25
5.0 General . 25
5.1 Identifiers and keywords . 26
5.2 Scope rules . 26
5.2.0 General . 26
5.2.1 Scope of formal parameters . 29
5.2.2 Uniqueness of identifiers . 29
5.3 Ordering of language elements . 30
5.4 Parameterization . 30
5.4.0 General . 30
5.4.1 Formal parameters . 31
5.4.1.0 General . 31
5.4.1.1 Formal parameters of kind value . 31
5.4.1.2 Formal parameters of kind template . 34
5.4.2 Actual parameters . 36
5.5 Cyclic Definitions. 41
6 Types and values . 42
6.0 General . 42
6.1 Basic types and values . 43
6.1.0 Simple basic types and values. 43
6.1.1 Basic string types and values . 44
6.1.1.0 General . 44
6.1.1.1 Accessing individual string elements . 46
6.1.2 Subtyping of basic types . 47
6.1.2.0 General . 47
6.1.2.1 Lists of templates . 47
6.1.2.2 Lists of types . 47
6.1.2.3 Ranges . 48
6.1.2.4 String length restrictions . 48
6.1.2.5 Pattern subtyping of character string types . 49
6.1.2.6 Mixing subtyping mechanisms . 49
6.1.2.6.1 Mixing patterns, lists and ranges . 49
6.1.2.6.2 Using length restriction with other constraints . 50
6.2 Structured types and values . 50
6.2.0 General . 50
6.2.1 Record type and values . 52
6.2.1.0 General . 52
ETSI
4 ETSI ES 201 873-1 V4.11.1 (2019-04)
6.2.1.1 Referencing fields of a record type . 54
6.2.1.2 Optional elements in a record. 56
6.2.1.3 Nested type definitions for field types . 56
6.2.2 Set type and values . 56
6.2.2.0 General . 56
6.2.2.1 Referencing fields of a set type . 57
6.2.2.2 Optional elements in a set . 57
6.2.2.3 Nested type definition for field types . 57
6.2.3 Records and sets of single types . 57
6.2.3.0 General . 57
6.2.3.1 Nested type definitions . 60
6.2.3.2 Referencing elements of record of and set of types . 60
6.2.4 Enumerated type and values . 61
6.2.5 Unions . 63
6.2.5.0 General . 63
6.2.5.1 Referencing fields of a union type . 64
6.2.5.2 Option and union . 65
6.2.5.3 Nested type definition for field types . 65
6.2.6 The anytype . 65
6.2.7 Arrays . 66
6.2.8 The default type . 67
6.2.9 Communication port types . 68
6.2.10 Component types . 70
6.2.10.1 Component type definition . 70
6.2.10.2 Reuse of component types . 71
6.2.11 Component references . 73
6.2.12 Addressing entities inside the SUT . 75
6.2.13 Subtyping of structured types . 77
6.2.13.0 General . 77
6.2.13.1 Length subtyping of record ofs and set ofs . 77
6.2.13.2 List subtyping of structured types and anytype . 78
6.2.13.3 Subtyping of the iterated type of record ofs and set ofs . 80
6.2.13.4 Mixing subtyping mechanisms . 82
6.2.14 The timer type . 82
6.3 Type compatibility . 82
6.3.0 General . 82
6.3.1 Compatibility of non-structured types . 82
6.3.2 Compatibility of structured types . 84
6.3.2.0 General . 84
6.3.2.1 Compatibility of enumerated types . 84
6.3.2.2 Compatibility of record and record of types . 85
6.3.2.3 Compatibility of set and set of types . 86
6.3.2.4 Compatibility of union types . 87
6.3.2.5 Compatibility of anytype types . 87
6.3.2.6 Compatibility between sub-structures . 88
6.3.3 Compatibility of component types . 88
6.3.4 Type compatibility of communication and connection operations . 89
6.3.5 Type conversion . 90
6.3.6 Type compatibility of port types . 90
6.3.7 Type compatibility of timer types . 90
6.4 Type synonym . 90
7 Expressions . 90
7.0 General . 90
7.1 Operators . 91
7.1.0 General . 91
7.1.1 Arithmetic operators . 92
7.1.2 List operator . 93
7.1.3 Relational operators . 93
7.1.4 Logical operators . 96
7.1.5 Bitwise operators . 96
7.1.6 Shift operators . 97
ETSI
5 ETSI ES 201 873-1 V4.11.1 (2019-04)
7.1.7 Rotate operators . 98
7.2 Field references and list ele me nts . 99
7.3 Decoded field reference . 99
8 Modules . 100
8.0 General . 100
8.1 Definition of a module . 100
8.2 Module definitions part . 101
8.2.0 General . 101
8.2.1 Module parameters . 102
8.2.2 Groups of definitions . 103
8.2.3 Importing from modules . 104
8.2.3.0 General . 104
8.2.3.1 General format of import . 104
8.2.3.2 Importing single definitions . 111
8.2.3.3 Importing groups . 112
8.2.3.4 Importing definitions of the same kind . 113
8.2.3.5 Importing all definitions of a module . 113
8.2.3.6 Import definitions from other TTCN-3 editions and from non-TTCN-3 modules . 114
8.2.3.7 Importing of import statements from TTCN-3 modules . 116
8.2.3.8 Compatibility of language specifications in imports . 117
8.2.4 Definition of friend modules . 118
8.2.5 Visibility of definitions . 118
8.3 Module control part . 120
9 Port types, component types and test configurations . 121
9.0 General . 121
9.1 Communication ports . 121
9.2 Test system interface . 124
10 Declaring constants . 126
11 Declaring variables . 126
11.0 General . 126
11.1 Value variables . 127
11.2 Template variables . 128
12 Declaring timers . 129
13 Declaring messages . 130
14 Declaring procedure signatures . 131
15 Declaring templates . 132
15.0 General . 132
15.1 Declaring message templates . 133
15.2 Declaring signature templates . 135
15.3 Global and local templates . 136
15.4 In-line Templates . 137
15.5 Modified templates . 138
15.6 Referencing elements of templates or template fields . 142
15.6.0 General . 142
15.6.1 Referencing individual string elements. 142
15.6.2 Referencing record and set fields . 142
15.6.3 Referencing record of and set of elements . 143
15.6.4 Referencing signature parameters . 146
15.6.5 Referencing union alternatives . 147
15.7 Template matching mechanisms . 148
15.7.0 General . 148
15.7.1 Specific values . 149
15.7.2 Special symbols that can be used instead of values . 150
15.7.3 Special symbols that can be used inside values . 151
15.7.4 Special symbols which describe attributes of values . 151
15.8 Template Restrictions . 152
ETSI
6 ETSI ES 201 873-1 V4.11.1 (2019-04)
15.9 Match Operation . 154
15.10 Valueof Operation . 156
15.11 Concatenating templates of string and list types . 156
16 Functions, altsteps and testcases . 159
16.0 General . 159
16.1 Functions . 159
16.1.0 General . 159
16.1.1 Invoking functions . 162
16.1.2 Predefined functions . 162
16.1.3 External functions . 165
16.1.4 Invoking functions from specific places . 166
16.1.5 Explicit control functions . 167
16.2 Altsteps . 167
16.2.0 General . 167
16.2.1 Invoking altsteps . 169
16.3 Test cases. 170
17 Void . 171
18 Overview of program statements and operations . 171
19 Basic program statements . 174
19.0 General . 174
19.1 Assignments . 174
19.2 The If-else statement . 176
19.3 The Select statements . 176
19.3.1 The Select case statement . 176
19.3.2 The Select union statement . 177
19.4 The For statement . 178
19.5 The While statement . 179
19.6 The Do-while statement . 179
19.7 The Label statement . 180
19.8 The Goto statement . 180
19.9 The Stop execution statement . 181
19.10 The Return statement . 182
19.11 The Log statement . 183
19.12 The Break statement . 184
19.13 The Continue statement . 185
19.14 Statement block . 186
20 Statement and operations for alternative behaviours . 186
20.0 General . 186
20.1 The snapshot mechanism . 187
20.2 The Alt statement . 187
20.3 The Repeat statement . 191
20.4 The Interleave statement . 192
20.5 Default Handling . 194
20.5.0 General . 194
20.5.1 The default mechanism . 194
20.5.2 The Activate operation . 195
20.5.3 The Deactivate operation . 196
21 Configuration Operations . 197
21.0 General . 197
21.1 Connection Operations . 198
21.1.0 General . 198
21.1.1 The Connect and Map operations . 198
21.1.2 The Disconnect and Unmap operations . 201
21.2 Test case operations. 202
21.2.0 General . 202
21.2.1 Test case stop operation . 202
21.3 Test Component Operations . 203
21.3.0 General . 203
ETSI
7 ETSI ES 201 873-1 V4.11.1 (2019-04)
21.3.1 The Create operation . 203
21.3.2 The Start test component operation . 204
21.3.3 The Stop test behaviour operation . 205
21.3.4 The Kill test component operation . 207
21.3.5 The Alive operation . 207
21.3.6 The Running operation . 208
21.3.7 The Done operation . 210
21.3.8 The Killed operation . 212
21.3.9 Summary of the use of any and all with components . 214
21.3.10 The Call test component behaviour operation . 214
22 Communication operations. 216
22.0 General . 216
22.1 The communication mechanisms . 216
22.1.0 General . 216
22.1.1 Principles of message-based communication. 216
22.1.2 Principles of procedure-based communication . 217
22.1.3 Principles of unicast, multicast and broadcast communication . 217
22.1.4 General format of communication operations . 218
22.1.4.0 General . 218
22.1.4.1 General format of the sending operations . 218
22.1.4.2 General format of the receiving operations . 219
22.2 Message-based communication . 220
22.2.0 General . 220
22.2.1 The Send operation . 220
22.2.2 The Receive operation . 221
22.2.3 The Trigger operation . 225
22.3 Procedure-based communication . 228
22.3.0 General . 228
22.3.1 The Call operation . 228
22.3.2 The Getcall operation. 232
22.3.3 The Reply operation. 235
22.3.4 The Getreply operation . 236
22.3.5 The Raise operation . 239
22.3.6 The Catch operation . 240
22.4 The Check operation . 244
22.5 Controlling communication ports . 246
22.5.0 General . 246
22.5.1 The Clear port operation . 246
22.5.2 The Start port operation . 247
22.5.3 The Stop port operation . 247
22.5.4 The Halt port operation . 248
22.5.5 The Checkstate port operation . 248
22.6 Use of any and all with ports . 250
23 Timer operations . 250
23.0 General . 250
23.1 The timer mechanism . 251
23.2 The Start timer operation . 251
23.3 The Stop timer operation . 252
23.4 The Read timer operation . 252
23.5
...


SLOVENSKI STANDARD
01-julij-2019
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.11.1 (2019-04)
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.11.1 (2019-04)

Reference
RES/MTS-201873-1v4.11.1_Core
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 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88

Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
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 at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
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 2019.
All rights reserved.
TM TM TM
DECT , PLUGTESTS , UMTS and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.
TM TM
3GPP and LTE are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners. ®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI
3 ETSI ES 201 873-1 V4.11.1 (2019-04)
Contents
Intellectual Property Rights . 13
Foreword . 13
Modal verbs terminology . 13
1 Scope . 14
2 References . 14
2.1 Normative references . 14
2.2 Informative references . 15
3 Definition of terms, symbols and abbreviations . 16
3.1 Terms . 16
3.2 Symbols . 21
3.3 Abbreviations . 22
4 Introduction . 23
4.0 General . 23
4.1 The core language and presentation formats . 23
4.2 Unanimity of the specification . 25
4.3 Conformance . 25
5 Basic language elements . 25
5.0 General . 25
5.1 Identifiers and keywords . 26
5.2 Scope rules . 26
5.2.0 General . 26
5.2.1 Scope of formal parameters . 29
5.2.2 Uniqueness of identifiers . 29
5.3 Ordering of language elements . 30
5.4 Parameterization . 30
5.4.0 General . 30
5.4.1 Formal parameters . 31
5.4.1.0 General . 31
5.4.1.1 Formal parameters of kind value . 31
5.4.1.2 Formal parameters of kind template . 34
5.4.2 Actual parameters . 36
5.5 Cyclic Definitions. 41
6 Types and values . 42
6.0 General . 42
6.1 Basic types and values . 43
6.1.0 Simple basic types and values. 43
6.1.1 Basic string types and values . 44
6.1.1.0 General . 44
6.1.1.1 Accessing individual string elements . 46
6.1.2 Subtyping of basic types . 47
6.1.2.0 General . 47
6.1.2.1 Lists of templates . 47
6.1.2.2 Lists of types . 47
6.1.2.3 Ranges . 48
6.1.2.4 String length restrictions . 48
6.1.2.5 Pattern subtyping of character string types . 49
6.1.2.6 Mixing subtyping mechanisms . 49
6.1.2.6.1 Mixing patterns, lists and ranges . 49
6.1.2.6.2 Using length restriction with other constraints . 50
6.2 Structured types and values . 50
6.2.0 General . 50
6.2.1 Record type and values . 52
6.2.1.0 General . 52
ETSI
4 ETSI ES 201 873-1 V4.11.1 (2019-04)
6.2.1.1 Referencing fields of a record type . 54
6.2.1.2 Optional elements in a record. 56
6.2.1.3 Nested type definitions for field types . 56
6.2.2 Set type and values . 56
6.2.2.0 General . 56
6.2.2.1 Referencing fields of a set type . 57
6.2.2.2 Optional elements in a set . 57
6.2.2.3 Nested type definition for field types . 57
6.2.3 Records and sets of single types . 57
6.2.3.0 General . 57
6.2.3.1 Nested type definitions . 60
6.2.3.2 Referencing elements of record of and set of types . 60
6.2.4 Enumerated type and values . 61
6.2.5 Unions . 63
6.2.5.0 General . 63
6.2.5.1 Referencing fields of a union type . 64
6.2.5.2 Option and union . 65
6.2.5.3 Nested type definition for field types . 65
6.2.6 The anytype . 65
6.2.7 Arrays . 66
6.2.8 The default type . 67
6.2.9 Communication port types . 68
6.2.10 Component types . 70
6.2.10.1 Component type definition . 70
6.2.10.2 Reuse of component types . 71
6.2.11 Component references . 73
6.2.12 Addressing entities inside the SUT . 75
6.2.13 Subtyping of structured types . 77
6.2.13.0 General . 77
6.2.13.1 Length subtyping of record ofs and set ofs . 77
6.2.13.2 List subtyping of structured types and anytype . 78
6.2.13.3 Subtyping of the iterated type of record ofs and set ofs . 80
6.2.13.4 Mixing subtyping mechanisms . 82
6.2.14 The timer type . 82
6.3 Type compatibility . 82
6.3.0 General . 82
6.3.1 Compatibility of non-structured types . 82
6.3.2 Compatibility of structured types . 84
6.3.2.0 General . 84
6.3.2.1 Compatibility of enumerated types . 84
6.3.2.2 Compatibility of record and record of types . 85
6.3.2.3 Compatibility of set and set of types . 86
6.3.2.4 Compatibility of union types . 87
6.3.2.5 Compatibility of anytype types . 87
6.3.2.6 Compatibility between sub-structures . 88
6.3.3 Compatibility of component types . 88
6.3.4 Type compatibility of communication and connection operations . 89
6.3.5 Type conversion . 90
6.3.6 Type compatibility of port types . 90
6.3.7 Type compatibility of timer types . 90
6.4 Type synonym . 90
7 Expressions . 90
7.0 General . 90
7.1 Operators . 91
7.1.0 General . 91
7.1.1 Arithmetic operators . 92
7.1.2 List operator . 93
7.1.3 Relational operators . 93
7.1.4 Logical operators . 96
7.1.5 Bitwise operators . 96
7.1.6 Shift operators . 97
ETSI
5 ETSI ES 201 873-1 V4.11.1 (2019-04)
7.1.7 Rotate operators . 98
7.2 Field references and list ele me nts . 99
7.3 Decoded field reference . 99
8 Modules . 100
8.0 General . 100
8.1 Definition of a module . 100
8.2 Module definitions part . 101
8.2.0 General . 101
8.2.1 Module parameters . 102
8.2.2 Groups of definitions . 103
8.2.3 Importing from modules . 104
8.2.3.0 General . 104
8.2.3.1 General format of import . 104
8.2.3.2 Importing single definitions . 111
8.2.3.3 Importing groups . 112
8.2.3.4 Importing definitions of the same kind . 113
8.2.3.5 Importing all definitions of a module . 113
8.2.3.6 Import definitions from other TTCN-3 editions and from non-TTCN-3 modules . 114
8.2.3.7 Importing of import statements from TTCN-3 modules . 116
8.2.3.8 Compatibility of language specifications in imports . 117
8.2.4 Definition of friend modules . 118
8.2.5 Visibility of definitions . 118
8.3 Module control part . 120
9 Port types, component types and test configurations . 121
9.0 General . 121
9.1 Communication ports . 121
9.2 Test system interface . 124
10 Declaring constants . 126
11 Declaring variables . 126
11.0 General . 126
11.1 Value variables . 127
11.2 Template variables . 128
12 Declaring timers . 129
13 Declaring messages . 130
14 Declaring procedure signatures . 131
15 Declaring templates . 132
15.0 General . 132
15.1 Declaring message templates . 133
15.2 Declaring signature templates . 135
15.3 Global and local templates . 136
15.4 In-line Templates . 137
15.5 Modified templates . 138
15.6 Referencing elements of templates or template fields . 142
15.6.0 General . 142
15.6.1 Referencing individual string elements. 142
15.6.2 Referencing record and set fields . 142
15.6.3 Referencing record of and set of elements . 143
15.6.4 Referencing signature parameters . 146
15.6.5 Referencing union alternatives . 147
15.7 Template matching mechanisms . 148
15.7.0 General . 148
15.7.1 Specific values . 149
15.7.2 Special symbols that can be used instead of values . 150
15.7.3 Special symbols that can be used inside values . 151
15.7.4 Special symbols which describe attributes of values . 151
15.8 Template Restrictions . 152
ETSI
6 ETSI ES 201 873-1 V4.11.1 (2019-04)
15.9 Match Operation . 154
15.10 Valueof Operation . 156
15.11 Concatenating templates of string and list types . 156
16 Functions, altsteps and testcases . 159
16.0 General . 159
16.1 Functions . 159
16.1.0 General . 159
16.1.1 Invoking functions . 162
16.1.2 Predefined functions . 162
16.1.3 External functions . 165
16.1.4 Invoking functions from specific places . 166
16.1.5 Explicit control functions . 167
16.2 Altsteps . 167
16.2.0 General . 167
16.2.1 Invoking altsteps . 169
16.3 Test cases. 170
17 Void . 171
18 Overview of program statements and operations . 171
19 Basic program statements . 174
19.0 General . 174
19.1 Assignments . 174
19.2 The If-else statement . 176
19.3 The Select statements . 176
19.3.1 The Select case statement . 176
19.3.2 The Select union statement . 177
19.4 The For statement . 178
19.5 The While statement . 179
19.6 The Do-while statement . 179
19.7 The Label statement . 180
19.8 The Goto statement . 180
19.9 The Stop execution statement . 181
19.10 The Return statement . 182
19.11 The Log statement . 183
19.12 The Break statement . 184
19.13 The Continue statement . 185
19.14 Statement block . 186
20 Statement and operations for alternative behaviours . 186
20.0 General . 186
20.1 The snapshot mechanism . 187
20.2 The Alt statement . 187
20.3 The Repeat statement . 191
20.4 The Interleave statement . 192
20.5 Default Handling . 194
20.5.0 General . 194
20.5.1 The default mechanism . 194
20.5.2 The Activate operation . 195
20.5.3 The Deactivate operation . 196
21 Configuration Operations . 197
21.0 General . 197
21.1 Connection Operations . 198
21.1.0 General . 198
21.1.1 The Connect and Map operations . 198
21.1.2 The Disconnect and Unmap operations . 201
21.2 Test case operations. 202
21.2.0 General . 202
21.2.1 Test case stop operation . 202
21.3 Test Component Operations . 203
21.3.0 General . 203
ETSI
7 ETSI ES 201 873-1 V4.11.1 (2019-04)
21.3.1 The Create operation . 203
21.3.2 The Start test component operation . 204
21.3.3 The Stop test behaviour operation . 205
21.3.4 The Kill test component operation . 207
21.3.5 The Alive operation . 207
21.3.6 The Running operation . 208
21.3.7 The Done operation . 210
21.3.8 The Killed operation . 212
21.3.9 Summary of the use of any and all with components . 214
21.3.10 The Call test component behaviour operation . 214
22 Communication operations. 216
22.0 General . 216
22.1 The communication mechanisms . 216
22.1.0 General . 216
22.1.1 Principles of message-based communication. 216
22.1.2 Principles of procedure-based communication . 217
22.1.3 Principles of unicast, multicast and broadcast communication . 217
22.1.4 General format of communication operations . 218
22.1.4.0 General . 218
22.1.4.1 General format of the sending operations . 218
22.1.4.2 General format of the receiving operations . 219
22.2 Message-based communication . 220
22.2.0 General . 220
22.2.1 The Send operation . 220
22.2.2 The Receive operation . 221
22.2.3 The Trigger operation . 225
22.3 Procedure-based communication . 228
22.3.0 General . 228
22.3.1 The Call operation . 228
22.3.2 The Getcall operation. 232
22.3.3 The Reply operation. 235
22.3.4 The Getreply operation . 236
22.3.5 The Raise operation . 239
22.3.6 The Catch operation . 240
22.4 The Check operation . 244
22.5 Controlling communication ports . 246
22.5.0 General . 246
22.5.1 The Clear port operation . 246
22.5.2 The Start port operation . 247
22.5.3 The Stop port operation . 247
22.5.4 The Halt port operation . 248
22.5.5 The Checkstate port operation .
...

Questions, Comments and Discussion

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

Loading comments...