Methods for Testing and Specification (MTS) - The Testing and Test Control Notation version 3 - TTCN-3 Language Extensions: Object-Oriented Features

The present document defines the support for object-oriented features in 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 OMG 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 packages are intended to define additional TTCN-3 concepts, which are not mandatory as concepts in the
TTCN-3 core language, but which are optional as part of a package which is suited for dedicated applications and/or
usages of TTCN-3.
While the design of TTCN-3 package has taken into account the consistency of a combined usage of the core language
with a number of packages, the concrete usages of and guidelines for this package in combination with other packages
is outside the scope of the present document.

Metode za preskušanje in specificiranje (MTS) - 3. različica zapisa preskušanja in krmiljenja preskusov - Razširitev nabora jezikov TTCN-3: objektno orientirane lastnosti

General Information

Status
Published
Publication Date
25-May-2021
Current Stage
6060 - National Implementation/Publication (Adopted Project)
Start Date
25-May-2021
Due Date
30-Jul-2021
Completion Date
26-May-2021

Buy Standard

Standard
ETSI ES 203 790 V1.3.1 (2021-05) - Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: Object-Oriented Features
English language
68 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
ETSI ES 203 790 V1.3.1 (2021-03) - Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 Language Extensions: Object-Oriented Features
English language
68 pages
sale 15% off
Preview
sale 15% off
Preview
Standardization document
SIST ES 203 790 V1.3.1:2021
English language
68 pages
sale 10% off
Preview
sale 10% off
Preview

e-Library read for
1 day

Standards Content (sample)

ETSI ES 203 790 V1.3.1 (2021-05)
ETSI STANDARD
Methods for Testing and Specification (MTS);
The Testing and Test Control Notation version 3;
TTCN-3 Language Extensions: Object-Oriented Features
---------------------- Page: 1 ----------------------
2 ETSI ES 203 790 V1.3.1 (2021-05)
Reference
RES/MTS-203790v131
Keywords
language, 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:
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
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 2021.
All rights reserved.
ETSI
---------------------- Page: 2 ----------------------
3 ETSI ES 203 790 V1.3.1 (2021-05)
Contents

Intellectual Property Rights ................................................................................................................................ 5

Foreword ............................................................................................................................................................. 5

Modal verbs terminology .................................................................................................................................... 5

1 Scope ........................................................................................................................................................ 6

2 References ................................................................................................................................................ 6

2.1 Normative references ......................................................................................................................................... 6

2.2 Informative references ........................................................................................................................................ 6

3 Definition of terms, symbols and abbreviations ....................................................................................... 7

3.1 Terms .................................................................................................................................................................. 7

3.2 Symbols .............................................................................................................................................................. 7

3.3 Abbreviations ..................................................................................................................................................... 7

4 Package conformance and compatibility .................................................................................................. 7

5 Package Concepts for the Core Language ................................................................................................ 8

5.0 General ............................................................................................................................................................... 8

5.1 Classes and Objects ............................................................................................................................................ 8

5.1.0 General .......................................................................................................................................................... 8

5.1.1 Classes .......................................................................................................................................................... 8

5.1.1.0 General .................................................................................................................................................... 8

5.1.1.1 Scope rules ............................................................................................................................................ 10

5.1.1.2 Abstract classes ..................................................................................................................................... 11

5.1.1.3 External classes ..................................................................................................................................... 11

5.1.1.4 Final Classes ......................................................................................................................................... 12

5.1.1.5 Constructors .......................................................................................................................................... 12

5.1.1.6 Constructor invocation .......................................................................................................................... 14

5.1.1.7 Destructors ............................................................................................................................................ 14

5.1.1.8 Methods ................................................................................................................................................. 15

5.1.1.9 Method invocation ................................................................................................................................ 15

5.1.1.10 Visibility ............................................................................................................................................... 15

5.1.1.11 Built-in classes ...................................................................................................................................... 16

5.1.1.12 Properties .............................................................................................................................................. 16

5.1.2 Objects ........................................................................................................................................................ 18

5.1.2.0 General .................................................................................................................................................. 18

5.1.2.1 Ownership ............................................................................................................................................. 19

5.1.2.2 Object References ................................................................................................................................. 19

5.1.2.3 Null reference ........................................................................................................................................ 19

5.1.2.4 Select class-statement............................................................................................................................ 19

5.1.2.5 Of-operator (Dynamic Class Discrimination) ....................................................................................... 20

5.1.2.6 Casting .................................................................................................................................................. 20

5.1.2.7 Comparison ........................................................................................................................................... 20

5.1.2.8 Object Templates .................................................................................................................................. 21

5.1.3 Extension to ETSI ES 201 873-1, clause 7.1.8 (Presence checking operators) .......................................... 22

5.2 Exception handling ........................................................................................................................................... 23

5.2.0 General ........................................................................................................................................................ 23

5.2.1 Extension to ETSI ES 201 873-1, clause 16.1.0 (Functions) ...................................................................... 23

5.2.2 Extension to ETSI ES 201 873-1, clause 16.1.3 (External Functions) ....................................................... 24

5.2.3 Extension to ETSI ES 201 873-1, clause 16.1.4 (Invoking functions from specific places)....................... 24

5.2.4 Extension to ETSI ES 201 873-1, clause 16.2 (Altsteps)............................................................................ 24

5.2.5 Extension to ETSI ES 201 873-1, clause 16.3 (Test cases) ........................................................................ 25

5.2.6 Extension to ETSI ES 201 873-1, clause 18 (Overview of program statements and operations) ............... 25

5.2.7 Extension to ETSI ES 201 873-1, clause 19 (Basic program statements) .................................................. 27

6 TRI Extensions for the Package ............................................................................................................. 30

6.1 Extensions to clause 5.3 of ETSI ES 201 873-5 Data interface........................................................................ 30

6.2 Extensions to clause 5.6.3 of ETSI ES 201 873-5 Miscellaneous operations .................................................. 31

ETSI
---------------------- Page: 3 ----------------------
4 ETSI ES 203 790 V1.3.1 (2021-05)

6.3 Extensions to clause 6 of ETSI ES 201 873-5 Java language mapping ........................................................ 33

6.4 Extensions to clause 7 of ETSI ES 201 873-5 ANSI C language mapping ...................................................... 34

6.5 Extensions to clause 8 of ETSI ES 201 873-5 C++ language mapping............................................................ 35

6.6 Extensions to clause 9 of ETSI ES 201 873-5 C# language mapping .............................................................. 36

7 TCI Extensions for the Package ............................................................................................................. 37

7.1 Extensions to clause 7.2.2.1 of ETSI ES 201 873-6 Abstract TTCN-3 data types and values ......................... 37

7.2 Extensions to clause 7.2.2 of ETSI ES 201 873-6 Abstract TTCN-3 data types and values ............................ 37

7.3 Extensions to clause 7.2.2.2.0 of ETSI ES 201 873-6 Basic rules ................................................................... 38

7.4 Extensions to clause 7.2.2.2 of ETSI ES 201 873-6 Abstract TTCN-3 values ................................................. 39

7.5 Extensions to clause 7.3.4.1 of ETSI ES 201 873-6 Abstract TCI-TL provided .............................................. 40

7.6 Extensions to clause 8 of ETSI ES 201 873-6 Java language mapping ........................................................ 44

7.7 Extensions to clause 9 of ETSI ES 201 873-6 ANSI C language mapping ...................................................... 46

7.8 Extensions to clause 10 of ETSI ES 201 873-6 C++ language mapping .......................................................... 48

7.9 Extensions to clause 11 of ETSI ES 201 873-6 W3C XML mapping .............................................................. 50

7.10 Extensions to clause 12 of ETSI ES 201 873-6 C# language mapping ............................................................ 52

8 XTRI Extensions for the Package (optional) .......................................................................................... 54

8.1 Changes to clause 5.6.3 of ETSI ES 201 873-5 Miscellaneous operations ...................................................... 54

8.2 Extensions to clause 6 of ETSI ES 201 873-5 Java language mapping ........................................................ 56

8.3 Extensions to clause 7 of ETSI ES 201 873-5 ANSI C language mapping ...................................................... 56

8.4 Extensions to clause 8 of ETSI ES 201 873-5 C++ language mapping............................................................ 57

8.5 Extensions to clause 9 of ETSI ES 201 873-5 C# language mapping .............................................................. 57

Annex A (normative): BNF and static semantics .............................................................................. 58

A.1 Extensions to TTCN-3 terminals ............................................................................................................ 58

A.2 Modified TTCN-3 syntax BNF productions .......................................................................................... 59

A.3 Additional TTCN-3 syntax BNF productions ........................................................................................ 60

Annex B (normative): Standard Collections...................................................................................... 62

B.1 The TTCN3_standard_collections module............................................................................................. 62

B.1.0 General ............................................................................................................................................................. 62

B.1.1 The Collection class ......................................................................................................................................... 63

B.1.2 The List class .................................................................................................................................................... 63

B.1.3 The LinkedList class ........................................................................................................................................ 63

B.1.4 The Queue class ............................................................................................................................................... 64

B.1.5 The PriorityQueue class ................................................................................................................................... 64

B.1.6 The Stack class ................................................................................................................................................. 65

B.1.7 The RingBuffer class ........................................................................................................................................ 65

B.1.8 The HashMap class .......................................................................................................................................... 66

B.1.9 The Set class ..................................................................................................................................................... 67

B.1.10 The Exception class .......................................................................................................................................... 67

B.1.11 The Iterator class .............................................................................................................................................. 67

History .............................................................................................................................................................. 68

ETSI
---------------------- Page: 4 ----------------------
5 ETSI ES 203 790 V1.3.1 (2021-05)
Intellectual Property Rights
Essential patents

IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The declarations

pertaining to these essential IPRs, if any, are publicly available for ETSI members and non-members, and can be

found in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to

ETSI in respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the

ETSI Web server (https://ipr.etsi.org/).

Pursuant to the ETSI Directives including the ETSI IPR Policy, no investigation regarding the essentiality of IPRs,

including IPR searches, has been carried out by ETSI. No guarantee can be given as to the existence of other IPRs not

referenced in ETSI SR 000 314 (or the updates on the ETSI Web server) which are, or may be, or may become,

essential to the present document.
Trademarks

The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.

ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no

right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does

not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.

DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its

Members. 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.

Foreword

This ETSI Standard (ES) has been produced by ETSI Technical Committee Methods for Testing and Specification

(MTS).

The use of underline (additional text) and strike through (deleted text) highlights the differences between base

document and extended documents.

The present document relates to the multi-part standard ETSI ES 201 873 covering the Testing and Test Control

Notation version 3, as identified in ETSI ES 201 873-1 [1].
Modal verbs terminology

In the present document "shall", "shall not", "should", "should not", "may", "need not", "will", "will not", "can" and

"cannot" are to be interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of

provisions).

"must" and "must not" are NOT allowed in ETSI deliverables except when used in direct citation.

ETSI
---------------------- Page: 5 ----------------------
6 ETSI ES 203 790 V1.3.1 (2021-05)
1 Scope

The present document defines the support for object-oriented features in 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 OMG 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 packages are intended to define additional TTCN-3 concepts, which are not mandatory as concepts in the

TTCN-3 core language, but which are optional as part of a package which is suited for dedicated applications and/or

usages of TTCN-3.

While the design of TTCN-3 package has taken into account the consistency of a combined usage of the core language

with a number of packages, the concrete usages of and guidelines for this package in combination with other packages

is outside the scope of the present document.
2 References
2.1 Normative references

References are either specific (identified by date of publication and/or edition number or version number) or

non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the

referenced document (including any amendments) applies.

Referenced documents which are not found to be publicly available in the expected location might be found at

https://docbox.etsi.org/Reference/.

NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee

their long term validity.

The following referenced documents are necessary for the application of the present document.

[1] ETSI ES 201 873-1: "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-4: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 4: TTCN-3 Operational Semantics".

[3] ETSI ES 201 873-5: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 5: TTCN-3 Runtime Interface (TRI)".

[4] ETSI ES 201 873-6: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 6: TTCN-3 Control Interface (TCI)".
2.2 Informative references

References are either specific (identified by date of publication and/or edition number or version number) or

non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the

referenced document (including any amendments) applies.

NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee

their long term validity.

The following referenced documents are not necessary for the application of the present document but they assist the

user with regard to a particular subject area.

[i.1] ETSI ES 201 873-7: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 7: Using ASN.1 with TTCN-3".
ETSI
---------------------- Page: 6 ----------------------
7 ETSI ES 203 790 V1.3.1 (2021-05)

[i.2] ETSI ES 201 873-8: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 8: The IDL to TTCN-3 Mapping".

[i.3] ETSI ES 201 873-9: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 9: Using XML schema with TTCN-3".

[i.4] ETSI ES 201 873-10: "Methods for Testing and Specification (MTS); The Testing and Test

Control Notation version 3; Part 10: TTCN-3 Documentation Comment Specification".

3 Definition of terms, symbols and abbreviations
3.1 Terms

For the purposes of the present document, the terms given in ETSI ES 201 873-1 [1], ETSI ES 201 873-4 [2], ETSI

ES 201 873-5 [3] and ETSI ES 201 873-6 [4] apply.
3.2 Symbols
Void.
3.3 Abbreviations

For the purposes of the present document, the abbreviations given in ETSI ES 201 873-1 [1], ETSI ES 201 873-4 [2],

ETSI ES 201 873-5 [3] and ETSI ES 201 873-6 [4] apply.
4 Package conformance and compatibility
The package presented in the present document is identified by the package tag:

"TTCN-3:2018 Object-Oriented features" - to be used with modules complying with the present document.

For an implementation claiming to conform to this package version, all features specified in the present document shall

be implemented consistently with the requirements given in the present document and in ETSI ES 201 873-1 [1] and

ETSI ES 201 873-4 [2].
The package presented in the present document is compatible to:
• ETSI ES 201 873-1 [1], version 4.10.1;
• ETSI ES 201 873-4 [2], version 4.6.1;
• ETSI ES 201 873-5 [3], version 4.8.1;
• ETSI ES 201 873-6 [4], version 4.9.1;
• ETSI ES 201 873-7 [i.1];
• ETSI ES 201 873-8 [i.2];
• ETSI ES 201 873-9 [i.3];
• ETSI ES 201 873-10 [i.4].

If later versions of those parts are available and should be used instead, the compatibility to the package presented in the

present document has to be checked individually.
ETSI
---------------------- Page: 7 ----------------------
8 ETSI ES 203 790 V1.3.1 (2021-05)
5 Package Concepts for the Core Language
5.0 General

This package defines object-oriented features for TTCN-3, i.e. it extends the TTCN-3 core language (ETSI

ES 201 873-1 [1]) with well-known concepts from object-oriented programming and modelling languages. This

package realizes the following concepts:

• classes (i.e. class definition, scope rules, abstract and external classes, refinement, constructors, destructors,

methods, visibility, and built-in classes);

• objects (i.e. ownership, object references, select class-statement, dynamic class discrimination and casting);

and

• exception handling (i.e. ability to define exception handling for functions, external functions, altsteps and test

cases).
5.1 Classes and Objects
5.1.0 General

This clause introduces the concepts of class types and their values, called objects as well as the operations allowed to be

applied to these objects.
5.1.1 Classes
5.1.1.0 General
Syntactical Structure
[public | private]
type [external] class [@final |@abstract | @trait]
Identifier [extends ClassType {"," Identifier}]
[runsOnSpec] [systemSpec] [mtcSpec]
"{" {ClassMember} "}"
[finally StatementBlock]
Semantic Description

A class is a type where the values are called objects. A class can declare fields (variables, constants, templates, timers,

classes), methods and properties as its members. Each member name inside the class shall be unique, there is no

overloading. The private and protected fields and methods are only accessible by the methods of the class, while the

public members of the class can be accessed also from behaviour not defined in the class. The private members of the

class can be accessed directly only by members of the class itself. All members which are neither private nor public are

protected and can also be accessed by members of subclasses.
All fields may be declared without initializer, even const and template fields.

A class can be declared with the @trait modifier. Such a class is called a trait class. Other classes are called normal

classes. A trait class is an abstract class and can not be instantiated. It also shall only declare methods without function

bodies as members and no constructor.

A normal class can extend at most one other normal class and also any number of trait classes. The extended normal

class is called the superclass, the extended trait classes are called the supertraits, while the extending class is called the

subclass of all the classes it extends. Trait classes can only extend trait classes but not normal classes. The resulting type

of a class definition is the set of object instances of the class itself and all instances of its direct or indirect subclasses. A

subclass is a subtype of its direct and indirect superclasses and supertraits and its object instances are type compatible

with them. If a class does not explicitly extend another class type, it implicitly extends the root class type object.

Thus, all classes are directly or indirectly extensions of the object class.
ETSI
---------------------- Page: 8 ----------------------
9 ETSI ES 203 790 V1.3.1 (2021-05)

A class inherits all members of its superclass and its supertraits that it does not override in its own class body. A non-

private non-abstract member from the superclass can always be accessed inside the class body by using the dotted

notation on the keyword super. Non overridden non-private members can be accessed without any dotted notation

before the member name.

A class can have optional runs on, mtc and system clauses. This restricts the type of component context that can create

objects of that class and all methods of this class. If a class does not have one of these clauses, it inherits it from its

superclass, if the superclass ha
...

Final draft ETSI ES 203 790 V1.3.1 (2021-03)
ETSI STANDARD
Methods for Testing and Specification (MTS);
The Testing and Test Control Notation version 3;
TTCN-3 Language Extensions: Object-Oriented Features
---------------------- Page: 1 ----------------------
2 Final draft ETSI ES 203 790 V1.3.1 (2021-03)
Reference
RES/MTS-203790v131
Keywords
language, 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 2021.
All rights reserved.

DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.

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
---------------------- Page: 2 ----------------------
3 Final draft ETSI ES 203 790 V1.3.1 (2021-03)
Contents

Intellectual Property Rights ................................................................................................................................ 5

Foreword ............................................................................................................................................................. 5

Modal verbs terminology .................................................................................................................................... 5

1 Scope ........................................................................................................................................................ 6

2 References ................................................................................................................................................ 6

2.1 Normative references ......................................................................................................................................... 6

2.2 Informative references ........................................................................................................................................ 6

3 Definition of terms, symbols and abbreviations ....................................................................................... 7

3.1 Terms .................................................................................................................................................................. 7

3.2 Symbols .............................................................................................................................................................. 7

3.3 Abbreviations ..................................................................................................................................................... 7

4 Package conformance and compatibility .................................................................................................. 7

5 Package Concepts for the Core Language ................................................................................................ 8

5.0 General ............................................................................................................................................................... 8

5.1 Classes and Objects ............................................................................................................................................ 8

5.1.0 General .......................................................................................................................................................... 8

5.1.1 Classes .......................................................................................................................................................... 8

5.1.1.0 General .................................................................................................................................................... 8

5.1.1.1 Scope rules ............................................................................................................................................ 10

5.1.1.2 Abstract classes ..................................................................................................................................... 11

5.1.1.3 External classes ..................................................................................................................................... 11

5.1.1.4 Final Classes ......................................................................................................................................... 12

5.1.1.5 Constructors .......................................................................................................................................... 12

5.1.1.6 Constructor invocation .......................................................................................................................... 14

5.1.1.7 Destructors ............................................................................................................................................ 14

5.1.1.8 Methods ................................................................................................................................................. 15

5.1.1.9 Method invocation ................................................................................................................................ 15

5.1.1.10 Visibility ............................................................................................................................................... 15

5.1.1.11 Built-in classes ...................................................................................................................................... 16

5.1.1.12 Properties .............................................................................................................................................. 16

5.1.2 Objects ........................................................................................................................................................ 18

5.1.2.0 General .................................................................................................................................................. 18

5.1.2.1 Ownership ............................................................................................................................................. 19

5.1.2.2 Object References ................................................................................................................................. 19

5.1.2.3 Null reference ........................................................................................................................................ 19

5.1.2.4 Select class-statement............................................................................................................................ 19

5.1.2.5 Of-operator (Dynamic Class Discrimination) ....................................................................................... 20

5.1.2.6 Casting .................................................................................................................................................. 20

5.1.2.7 Comparison ........................................................................................................................................... 20

5.1.2.8 Object Templates .................................................................................................................................. 21

5.1.3 Extension to ETSI ES 201 873-1, clause 7.1.8 (Presence checking operators) .......................................... 22

5.2 Exception handling ........................................................................................................................................... 23

5.2.0 General ........................................................................................................................................................ 23

5.2.1 Extension to ETSI ES 201 873-1, clause 16.1.0 (Functions) ...................................................................... 23

5.2.2 Extension to ETSI ES 201 873-1, clause 16.1.3 (External Functions) ....................................................... 24

5.2.3 Extension to ETSI ES 201 873-1, clause 16.1.4 (Invoking functions from specific places)....................... 24

5.2.4 Extension to ETSI ES 201 873-1, clause 16.2 (Altsteps)............................................................................ 24

5.2.5 Extension to ETSI ES 201 873-1, clause 16.3 (Test cases) ........................................................................ 25

5.2.6 Extension to ETSI ES 201 873-1, clause 18 (Overview of program statements and operations) ............... 25

5.2.7 Extension to ETSI ES 201 873-1, clause 19 (Basic program statements) .................................................. 27

6 TRI Extensions for the Package ............................................................................................................. 30

6.1 Extensions to clause 5.3 of ETSI ES 201 873-5 Data interface........................................................................ 30

6.2 Extensions to clause 5.6.3 of ETSI ES 201 873-5 Miscellaneous operations .................................................. 31

ETSI
---------------------- Page: 3 ----------------------
4 Final draft ETSI ES 203 790 V1.3.1 (2021-03)

6.3 Extensions to clause 6 of ETSI ES 201 873-5 Java language mapping ........................................................ 33

6.4 Extensions to clause 7 of ETSI ES 201 873-5 ANSI C language mapping ...................................................... 34

6.5 Extensions to clause 8 of ETSI ES 201 873-5 C++ language mapping............................................................ 35

6.6 Extensions to clause 9 of ETSI ES 201 873-5 C# language mapping .............................................................. 36

7 TCI Extensions for the Package ............................................................................................................. 37

7.1 Extensions to clause 7.2.2.1 of ETSI ES 201 873-6 Abstract TTCN-3 data types and values ......................... 37

7.2 Extensions to clause 7.2.2 of ETSI ES 201 873-6 Abstract TTCN-3 data types and values ............................ 37

7.3 Extensions to clause 7.2.2.2.0 of ETSI ES 201 873-6 Basic rules ................................................................... 38

7.4 Extensions to clause 7.2.2.2 of ETSI ES 201 873-6 Abstract TTCN-3 values ................................................. 39

7.5 Extensions to clause 7.3.4.1 of ETSI ES 201 873-6 Abstract TCI-TL provided .............................................. 40

7.6 Extensions to clause 8 of ETSI ES 201 873-6 Java language mapping ........................................................ 44

7.7 Extensions to clause 9 of ETSI ES 201 873-6 ANSI C language mapping ...................................................... 46

7.8 Extensions to clause 10 of ETSI ES 201 873-6 C++ language mapping .......................................................... 48

7.9 Extensions to clause 11 of ETSI ES 201 873-6 W3C XML mapping .............................................................. 50

7.10 Extensions to clause 12 of ETSI ES 201 873-6 C# language mapping ............................................................ 52

8 XTRI Extensions for the Package (optional) .......................................................................................... 54

8.1 Changes to clause 5.6.3 of ETSI ES 201 873-5 Miscellaneous operations ...................................................... 54

8.2 Extensions to clause 6 of ETSI ES 201 873-5 Java language mapping ........................................................ 56

8.3 Extensions to clause 7 of ETSI ES 201 873-5 ANSI C language mapping ...................................................... 56

8.4 Extensions to clause 8 of ETSI ES 201 873-5 C++ language mapping............................................................ 57

8.5 Extensions to clause 9 of ETSI ES 201 873-5 C# language mapping .............................................................. 57

Annex A (normative): BNF and static semantics .............................................................................. 58

A.1 Extensions to TTCN-3 terminals ............................................................................................................ 58

A.2 Modified TTCN-3 syntax BNF productions .......................................................................................... 59

A.3 Additional TTCN-3 syntax BNF productions ........................................................................................ 60

Annex B (normative): Standard Collections...................................................................................... 62

B.1 The TTCN3_standard_collections module............................................................................................. 62

B.1.0 General ............................................................................................................................................................. 62

B.1.1 The Collection class ......................................................................................................................................... 63

B.1.2 The List class .................................................................................................................................................... 63

B.1.3 The LinkedList class ........................................................................................................................................ 63

B.1.4 The Queue class ............................................................................................................................................... 64

B.1.5 The PriorityQueue class ................................................................................................................................... 64

B.1.6 The Stack class ................................................................................................................................................. 65

B.1.7 The RingBuffer class ........................................................................................................................................ 65

B.1.8 The HashMap class .......................................................................................................................................... 66

B.1.9 The Set class ..................................................................................................................................................... 67

B.1.10 The Exception class .......................................................................................................................................... 67

B.1.11 The Iterator class .............................................................................................................................................. 67

History .............................................................................................................................................................. 68

ETSI
---------------------- Page: 4 ----------------------
5 Final draft ETSI ES 203 790 V1.3.1 (2021-03)
Intellectual Property Rights
Essential patents

IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The information

pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found

in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in

respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web

server (https://ipr.etsi.org/).

Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee

can be given as to the existence of other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web

server) which are, or may be, or may become, essential to the present document.
Trademarks

The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.

ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no

right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does

not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.

Foreword

This final draft ETSI Standard (ES) has been produced by ETSI Technical Committee Methods for Testing and

Specification (MTS), and is now submitted for the ETSI standards Membership Approval Procedure.

The use of underline (additional text) and strike through (deleted text) highlights the differences between base

document and extended documents.

The present document relates to the multi-part standard ETSI ES 201 873 covering the Testing and Test Control

Notation version 3, as identified in ETSI ES 201 873-1 [1].
Modal verbs terminology

In the present document "shall", "shall not", "should", "should not", "may", "need not", "will", "will not", "can" and

"cannot" are to be interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of

provisions).

"must" and "must not" are NOT allowed in ETSI deliverables except when used in direct citation.

ETSI
---------------------- Page: 5 ----------------------
6 Final draft ETSI ES 203 790 V1.3.1 (2021-03)
1 Scope

The present document defines the support for object-oriented features in 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 OMG 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 packages are intended to define additional TTCN-3 concepts, which are not mandatory as concepts in the

TTCN-3 core language, but which are optional as part of a package which is suited for dedicated applications and/or

usages of TTCN-3.

While the design of TTCN-3 package has taken into account the consistency of a combined usage of the core language

with a number of packages, the concrete usages of and guidelines for this package in combination with other packages

is outside the scope of the present document.
2 References
2.1 Normative references

References are either specific (identified by date of publication and/or edition number or version number) or

non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the

referenced document (including any amendments) applies.

Referenced documents which are not found to be publicly available in the expected location might be found at

https://docbox.etsi.org/Reference/.

NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee

their long term validity.

The following referenced documents are necessary for the application of the present document.

[1] ETSI ES 201 873-1: "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-4: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 4: TTCN-3 Operational Semantics".

[3] ETSI ES 201 873-5: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 5: TTCN-3 Runtime Interface (TRI)".

[4] ETSI ES 201 873-6: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 6: TTCN-3 Control Interface (TCI)".
2.2 Informative references

References are either specific (identified by date of publication and/or edition number or version number) or

non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the

referenced document (including any amendments) applies.

NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee

their long term validity.

The following referenced documents are not necessary for the application of the present document but they assist the

user with regard to a particular subject area.

[i.1] ETSI ES 201 873-7: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 7: Using ASN.1 with TTCN-3".
ETSI
---------------------- Page: 6 ----------------------
7 Final draft ETSI ES 203 790 V1.3.1 (2021-03)

[i.2] ETSI ES 201 873-8: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 8: The IDL to TTCN-3 Mapping".

[i.3] ETSI ES 201 873-9: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 9: Using XML schema with TTCN-3".

[i.4] ETSI ES 201 873-10: "Methods for Testing and Specification (MTS); The Testing and Test

Control Notation version 3; Part 10: TTCN-3 Documentation Comment Specification".

3 Definition of terms, symbols and abbreviations
3.1 Terms

For the purposes of the present document, the terms given in ETSI ES 201 873-1 [1], ETSI ES 201 873-4 [2], ETSI

ES 201 873-5 [3] and ETSI ES 201 873-6 [4] apply.
3.2 Symbols
Void.
3.3 Abbreviations

For the purposes of the present document, the abbreviations given in ETSI ES 201 873-1 [1], ETSI ES 201 873-4 [2],

ETSI ES 201 873-5 [3] and ETSI ES 201 873-6 [4] apply.
4 Package conformance and compatibility
The package presented in the present document is identified by the package tag:

"TTCN-3:2018 Object-Oriented features" - to be used with modules complying with the present document.

For an implementation claiming to conform to this package version, all features specified in the present document shall

be implemented consistently with the requirements given in the present document and in ETSI ES 201 873-1 [1] and

ETSI ES 201 873-4 [2].
The package presented in the present document is compatible to:
• ETSI ES 201 873-1 [1], version 4.10.1;
• ETSI ES 201 873-4 [2], version 4.6.1;
• ETSI ES 201 873-5 [3], version 4.8.1;
• ETSI ES 201 873-6 [4], version 4.9.1;
• ETSI ES 201 873-7 [i.1];
• ETSI ES 201 873-8 [i.2];
• ETSI ES 201 873-9 [i.3];
• ETSI ES 201 873-10 [i.4].

If later versions of those parts are available and should be used instead, the compatibility to the package presented in the

present document has to be checked individually.
ETSI
---------------------- Page: 7 ----------------------
8 Final draft ETSI ES 203 790 V1.3.1 (2021-03)
5 Package Concepts for the Core Language
5.0 General

This package defines object-oriented features for TTCN-3, i.e. it extends the TTCN-3 core language (ETSI

ES 201 873-1 [1]) with well-known concepts from object-oriented programming and modelling languages. This

package realizes the following concepts:

• classes (i.e. class definition, scope rules, abstract and external classes, refinement, constructors, destructors,

methods, visibility, and built-in classes);

• objects (i.e. ownership, object references, select class-statement, dynamic class discrimination and casting);

and

• exception handling (i.e. ability to define exception handling for functions, external functions, altsteps and test

cases).
5.1 Classes and Objects
5.1.0 General

This clause introduces the concepts of class types and their values, called objects as well as the operations allowed to be

applied to these objects.
5.1.1 Classes
5.1.1.0 General
Syntactical Structure
[public | private]
type [external] class [@final |@abstract | @trait]
Identifier [extends ClassType {"," Identifier}]
[runsOnSpec] [systemSpec] [mtcSpec]
"{" {ClassMember} "}"
[finally StatementBlock]
Semantic Description

A class is a type where the values are called objects. A class can declare fields (variables, constants, templates, timers,

classes), methods and properties as its members. Each member name inside the class shall be unique, there is no

overloading. The private and protected fields and methods are only accessible by the methods of the class, while the

public members of the class can be accessed also from behaviour not defined in the class. The private members of the

class can be accessed directly only by members of the class itself. All members which are neither private nor public are

protected and can also be accessed by members of subclasses.
All fields may be declared without initializer, even const and template fields.

A class can be declared with the @trait modifier. Such a class is called a trait class. Other classes are called normal

classes. A trait class is an abstract class and can not be instantiated. It also shall only declare methods without function

bodies as members and no constructor.

A normal class can extend at most one other normal class and also any number of trait classes. The extended normal

class is called the superclass, the extended trait classes are called the supertraits, while the extending class is called the

subclass of all the classes it extends. Trait classes can only extend trait classes but not normal classes. The resulting type

of a class definition is the set of object instances of the class itself and all instances of its direct or indirect subclasses. A

subclass is a subtype of its direct and indirect superclasses and supertraits and its object instances are type compatible

with them. If a class does not explicitly extend another class type, it implicitly extends the root class type object.

Thus, all classes are directly or indirectly extensions of the object class.
ETSI
---------------------- Page: 8 ----------------------
9 Final draft ETSI ES 203 790 V1.3.1 (2021-03)

A class inherits all members of its superclass and its supertraits that it does not override in its own class body. A non-

private non-abstract member from the superclass can always be accessed inside the class body by using the dotted

notation on the keyword super. Non overridden non-private members can be accessed without any dotted notation

before the member name.

A class can have optional runs on, mtc and system clauses. This restricts the type of component context that can create

objects of that class and all methods of this class. If a class does not have one of these clauses, it inherits it from its

superclass, if the superclass has one. If the superclass has or inherits a runs on, mtc or system clause, the subclass may

declare each of these clauses with a more specific component type than the one inherited. The function members of

classes shall not have runs on, system or mtc classes but inherit them from their surrounding class or its superclasses.

Classes can be used as field or element types of structured types.
Restrictions
a) Void.

b) Passing of object references and structured types containing fields or elements of class type to the create

operation of a component type or a function started on another component is not allowed.

c) No subtyping definition is allowed for class types via the normal subtype definition.

d) No local/global constants or module parameters of class type or structured types containing fields or elements

of class type are allowed.
e) Class type cannot be the contained value of an any type value.
f) The functions of a class shall not have a runs on, mtc or system clause.

g) The runs on type of a class shall be runs on compatible with the runs on type of the behaviour creating a class.

h) The runs on type of a class shall be runs on compatible with the runs on type of the superclass and the

supertraits.
i) The mtc and system type of a class shall be
...

SLOVENSKI STANDARD
SIST ES 203 790 V1.3.1:2021
01-julij-2021

Metode za preskušanje in specificiranje (MTS) - 3. različica zapisa preskušanja in

krmiljenja preskusov - Razširitev nabora jezikov TTCN-3: objektno orientirane
lastnosti

Methods for Testing and Specification (MTS) - The Testing and Test Control Notation

version 3 - TTCN-3 Language Extensions: Object-Oriented Features
Ta slovenski standard je istoveten z: ETSI ES 203 790 V1.3.1 (2021-05)
ICS:
35.060 Jeziki, ki se uporabljajo v Languages used in
informacijski tehniki in information technology
tehnologiji
SIST ES 203 790 V1.3.1:2021 en

2003-01.Slovenski inštitut za standardizacijo. Razmnoževanje celote ali delov tega standarda ni dovoljeno.

---------------------- Page: 1 ----------------------
SIST ES 203 790 V1.3.1:2021
---------------------- Page: 2 ----------------------
SIST ES 203 790 V1.3.1:2021
ETSI ES 203 790 V1.3.1 (2021-05)
ETSI STANDARD
Methods for Testing and Specification (MTS);
The Testing and Test Control Notation version 3;
TTCN-3 Language Extensions: Object-Oriented Features
---------------------- Page: 3 ----------------------
SIST ES 203 790 V1.3.1:2021
2 ETSI ES 203 790 V1.3.1 (2021-05)
Reference
RES/MTS-203790v131
Keywords
language, 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:
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
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 2021.
All rights reserved.
ETSI
---------------------- Page: 4 ----------------------
SIST ES 203 790 V1.3.1:2021
3 ETSI ES 203 790 V1.3.1 (2021-05)
Contents

Intellectual Property Rights ................................................................................................................................ 5

Foreword ............................................................................................................................................................. 5

Modal verbs terminology .................................................................................................................................... 5

1 Scope ........................................................................................................................................................ 6

2 References ................................................................................................................................................ 6

2.1 Normative references ......................................................................................................................................... 6

2.2 Informative references ........................................................................................................................................ 6

3 Definition of terms, symbols and abbreviations ....................................................................................... 7

3.1 Terms .................................................................................................................................................................. 7

3.2 Symbols .............................................................................................................................................................. 7

3.3 Abbreviations ..................................................................................................................................................... 7

4 Package conformance and compatibility .................................................................................................. 7

5 Package Concepts for the Core Language ................................................................................................ 8

5.0 General ............................................................................................................................................................... 8

5.1 Classes and Objects ............................................................................................................................................ 8

5.1.0 General .......................................................................................................................................................... 8

5.1.1 Classes .......................................................................................................................................................... 8

5.1.1.0 General .................................................................................................................................................... 8

5.1.1.1 Scope rules ............................................................................................................................................ 10

5.1.1.2 Abstract classes ..................................................................................................................................... 11

5.1.1.3 External classes ..................................................................................................................................... 11

5.1.1.4 Final Classes ......................................................................................................................................... 12

5.1.1.5 Constructors .......................................................................................................................................... 12

5.1.1.6 Constructor invocation .......................................................................................................................... 14

5.1.1.7 Destructors ............................................................................................................................................ 14

5.1.1.8 Methods ................................................................................................................................................. 15

5.1.1.9 Method invocation ................................................................................................................................ 15

5.1.1.10 Visibility ............................................................................................................................................... 15

5.1.1.11 Built-in classes ...................................................................................................................................... 16

5.1.1.12 Properties .............................................................................................................................................. 16

5.1.2 Objects ........................................................................................................................................................ 18

5.1.2.0 General .................................................................................................................................................. 18

5.1.2.1 Ownership ............................................................................................................................................. 19

5.1.2.2 Object References ................................................................................................................................. 19

5.1.2.3 Null reference ........................................................................................................................................ 19

5.1.2.4 Select class-statement............................................................................................................................ 19

5.1.2.5 Of-operator (Dynamic Class Discrimination) ....................................................................................... 20

5.1.2.6 Casting .................................................................................................................................................. 20

5.1.2.7 Comparison ........................................................................................................................................... 20

5.1.2.8 Object Templates .................................................................................................................................. 21

5.1.3 Extension to ETSI ES 201 873-1, clause 7.1.8 (Presence checking operators) .......................................... 22

5.2 Exception handling ........................................................................................................................................... 23

5.2.0 General ........................................................................................................................................................ 23

5.2.1 Extension to ETSI ES 201 873-1, clause 16.1.0 (Functions) ...................................................................... 23

5.2.2 Extension to ETSI ES 201 873-1, clause 16.1.3 (External Functions) ....................................................... 24

5.2.3 Extension to ETSI ES 201 873-1, clause 16.1.4 (Invoking functions from specific places)....................... 24

5.2.4 Extension to ETSI ES 201 873-1, clause 16.2 (Altsteps)............................................................................ 24

5.2.5 Extension to ETSI ES 201 873-1, clause 16.3 (Test cases) ........................................................................ 25

5.2.6 Extension to ETSI ES 201 873-1, clause 18 (Overview of program statements and operations) ............... 25

5.2.7 Extension to ETSI ES 201 873-1, clause 19 (Basic program statements) .................................................. 27

6 TRI Extensions for the Package ............................................................................................................. 30

6.1 Extensions to clause 5.3 of ETSI ES 201 873-5 Data interface........................................................................ 30

6.2 Extensions to clause 5.6.3 of ETSI ES 201 873-5 Miscellaneous operations .................................................. 31

ETSI
---------------------- Page: 5 ----------------------
SIST ES 203 790 V1.3.1:2021
4 ETSI ES 203 790 V1.3.1 (2021-05)

6.3 Extensions to clause 6 of ETSI ES 201 873-5 Java language mapping ........................................................ 33

6.4 Extensions to clause 7 of ETSI ES 201 873-5 ANSI C language mapping ...................................................... 34

6.5 Extensions to clause 8 of ETSI ES 201 873-5 C++ language mapping............................................................ 35

6.6 Extensions to clause 9 of ETSI ES 201 873-5 C# language mapping .............................................................. 36

7 TCI Extensions for the Package ............................................................................................................. 37

7.1 Extensions to clause 7.2.2.1 of ETSI ES 201 873-6 Abstract TTCN-3 data types and values ......................... 37

7.2 Extensions to clause 7.2.2 of ETSI ES 201 873-6 Abstract TTCN-3 data types and values ............................ 37

7.3 Extensions to clause 7.2.2.2.0 of ETSI ES 201 873-6 Basic rules ................................................................... 38

7.4 Extensions to clause 7.2.2.2 of ETSI ES 201 873-6 Abstract TTCN-3 values ................................................. 39

7.5 Extensions to clause 7.3.4.1 of ETSI ES 201 873-6 Abstract TCI-TL provided .............................................. 40

7.6 Extensions to clause 8 of ETSI ES 201 873-6 Java language mapping ........................................................ 44

7.7 Extensions to clause 9 of ETSI ES 201 873-6 ANSI C language mapping ...................................................... 46

7.8 Extensions to clause 10 of ETSI ES 201 873-6 C++ language mapping .......................................................... 48

7.9 Extensions to clause 11 of ETSI ES 201 873-6 W3C XML mapping .............................................................. 50

7.10 Extensions to clause 12 of ETSI ES 201 873-6 C# language mapping ............................................................ 52

8 XTRI Extensions for the Package (optional) .......................................................................................... 54

8.1 Changes to clause 5.6.3 of ETSI ES 201 873-5 Miscellaneous operations ...................................................... 54

8.2 Extensions to clause 6 of ETSI ES 201 873-5 Java language mapping ........................................................ 56

8.3 Extensions to clause 7 of ETSI ES 201 873-5 ANSI C language mapping ...................................................... 56

8.4 Extensions to clause 8 of ETSI ES 201 873-5 C++ language mapping............................................................ 57

8.5 Extensions to clause 9 of ETSI ES 201 873-5 C# language mapping .............................................................. 57

Annex A (normative): BNF and static semantics .............................................................................. 58

A.1 Extensions to TTCN-3 terminals ............................................................................................................ 58

A.2 Modified TTCN-3 syntax BNF productions .......................................................................................... 59

A.3 Additional TTCN-3 syntax BNF productions ........................................................................................ 60

Annex B (normative): Standard Collections...................................................................................... 62

B.1 The TTCN3_standard_collections module............................................................................................. 62

B.1.0 General ............................................................................................................................................................. 62

B.1.1 The Collection class ......................................................................................................................................... 63

B.1.2 The List class .................................................................................................................................................... 63

B.1.3 The LinkedList class ........................................................................................................................................ 63

B.1.4 The Queue class ............................................................................................................................................... 64

B.1.5 The PriorityQueue class ................................................................................................................................... 64

B.1.6 The Stack class ................................................................................................................................................. 65

B.1.7 The RingBuffer class ........................................................................................................................................ 65

B.1.8 The HashMap class .......................................................................................................................................... 66

B.1.9 The Set class ..................................................................................................................................................... 67

B.1.10 The Exception class .......................................................................................................................................... 67

B.1.11 The Iterator class .............................................................................................................................................. 67

History .............................................................................................................................................................. 68

ETSI
---------------------- Page: 6 ----------------------
SIST ES 203 790 V1.3.1:2021
5 ETSI ES 203 790 V1.3.1 (2021-05)
Intellectual Property Rights
Essential patents

IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The declarations

pertaining to these essential IPRs, if any, are publicly available for ETSI members and non-members, and can be

found in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to

ETSI in respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the

ETSI Web server (https://ipr.etsi.org/).

Pursuant to the ETSI Directives including the ETSI IPR Policy, no investigation regarding the essentiality of IPRs,

including IPR searches, has been carried out by ETSI. No guarantee can be given as to the existence of other IPRs not

referenced in ETSI SR 000 314 (or the updates on the ETSI Web server) which are, or may be, or may become,

essential to the present document.
Trademarks

The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.

ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no

right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does

not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.

DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its

Members. 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.

Foreword

This ETSI Standard (ES) has been produced by ETSI Technical Committee Methods for Testing and Specification

(MTS).

The use of underline (additional text) and strike through (deleted text) highlights the differences between base

document and extended documents.

The present document relates to the multi-part standard ETSI ES 201 873 covering the Testing and Test Control

Notation version 3, as identified in ETSI ES 201 873-1 [1].
Modal verbs terminology

In the present document "shall", "shall not", "should", "should not", "may", "need not", "will", "will not", "can" and

"cannot" are to be interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of

provisions).

"must" and "must not" are NOT allowed in ETSI deliverables except when used in direct citation.

ETSI
---------------------- Page: 7 ----------------------
SIST ES 203 790 V1.3.1:2021
6 ETSI ES 203 790 V1.3.1 (2021-05)
1 Scope

The present document defines the support for object-oriented features in 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 OMG 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 packages are intended to define additional TTCN-3 concepts, which are not mandatory as concepts in the

TTCN-3 core language, but which are optional as part of a package which is suited for dedicated applications and/or

usages of TTCN-3.

While the design of TTCN-3 package has taken into account the consistency of a combined usage of the core language

with a number of packages, the concrete usages of and guidelines for this package in combination with other packages

is outside the scope of the present document.
2 References
2.1 Normative references

References are either specific (identified by date of publication and/or edition number or version number) or

non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the

referenced document (including any amendments) applies.

Referenced documents which are not found to be publicly available in the expected location might be found at

https://docbox.etsi.org/Reference/.

NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee

their long term validity.

The following referenced documents are necessary for the application of the present document.

[1] ETSI ES 201 873-1: "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-4: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 4: TTCN-3 Operational Semantics".

[3] ETSI ES 201 873-5: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 5: TTCN-3 Runtime Interface (TRI)".

[4] ETSI ES 201 873-6: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 6: TTCN-3 Control Interface (TCI)".
2.2 Informative references

References are either specific (identified by date of publication and/or edition number or version number) or

non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the

referenced document (including any amendments) applies.

NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee

their long term validity.

The following referenced documents are not necessary for the application of the present document but they assist the

user with regard to a particular subject area.

[i.1] ETSI ES 201 873-7: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 7: Using ASN.1 with TTCN-3".
ETSI
---------------------- Page: 8 ----------------------
SIST ES 203 790 V1.3.1:2021
7 ETSI ES 203 790 V1.3.1 (2021-05)

[i.2] ETSI ES 201 873-8: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 8: The IDL to TTCN-3 Mapping".

[i.3] ETSI ES 201 873-9: "Methods for Testing and Specification (MTS); The Testing and Test Control

Notation version 3; Part 9: Using XML schema with TTCN-3".

[i.4] ETSI ES 201 873-10: "Methods for Testing and Specification (MTS); The Testing and Test

Control Notation version 3; Part 10: TTCN-3 Documentation Comment Specification".

3 Definition of terms, symbols and abbreviations
3.1 Terms

For the purposes of the present document, the terms given in ETSI ES 201 873-1 [1], ETSI ES 201 873-4 [2], ETSI

ES 201 873-5 [3] and ETSI ES 201 873-6 [4] apply.
3.2 Symbols
Void.
3.3 Abbreviations

For the purposes of the present document, the abbreviations given in ETSI ES 201 873-1 [1], ETSI ES 201 873-4 [2],

ETSI ES 201 873-5 [3] and ETSI ES 201 873-6 [4] apply.
4 Package conformance and compatibility
The package presented in the present document is identified by the package tag:

"TTCN-3:2018 Object-Oriented features" - to be used with modules complying with the present document.

For an implementation claiming to conform to this package version, all features specified in the present document shall

be implemented consistently with the requirements given in the present document and in ETSI ES 201 873-1 [1] and

ETSI ES 201 873-4 [2].
The package presented in the present document is compatible to:
• ETSI ES 201 873-1 [1], version 4.10.1;
• ETSI ES 201 873-4 [2], version 4.6.1;
• ETSI ES 201 873-5 [3], version 4.8.1;
• ETSI ES 201 873-6 [4], version 4.9.1;
• ETSI ES 201 873-7 [i.1];
• ETSI ES 201 873-8 [i.2];
• ETSI ES 201 873-9 [i.3];
• ETSI ES 201 873-10 [i.4].

If later versions of those parts are available and should be used instead, the compatibility to the package presented in the

present document has to be checked individually.
ETSI
---------------------- Page: 9 ----------------------
SIST ES 203 790 V1.3.1:2021
8 ETSI ES 203 790 V1.3.1 (2021-05)
5 Package Concepts for the Core Language
5.0 General

This package defines object-oriented features for TTCN-3, i.e. it extends the TTCN-3 core language (ETSI

ES 201 873-1 [1]) with well-known concepts from object-oriented programming and modelling languages. This

package realizes the following concepts:

• classes (i.e. class definition, scope rules, abstract and external classes, refinement, constructors, destructors,

methods, visibility, and built-in classes);

• objects (i.e. ownership, object references, select class-statement, dynamic class discrimination and casting);

and

• exception handling (i.e. ability to define exception handling for functions, external functions, altsteps and test

cases).
5.1 Classes and Objects
5.1.0 General

This clause introduces the concepts of class types and their values, called objects as well as the operations allowed to be

applied to these objects.
5.1.1 Classes
5.1.1.0 General
Syntactical Structure
[public | private]
type [external] class [@final |@abstract | @trait]
Identifier [extends ClassType {"," Identifier}]
[runsOnSpec] [systemSpec] [mtcSpec]
"{" {ClassMember} "}"
[finally StatementBlock]
Semantic Description

A class is a type where the values are called objects. A class can declare fields (variables, constants, templates, timers,

classes), methods and properties as its members. Each member name inside the class shall be unique, there is no

overloading. The private and protected fields and methods are only accessible by the methods of the class, while the

public members of the class can be accessed also from behaviour not defined in the class. The private members of the

class can be accessed directly only by members of the class itself. All members which are neither private nor public are

protected and can also be accessed by members of subclasses.
All fields may be declared without initializer, even const and template fields.

A class can be declared with the @trait modifier. Such a class is called a trait class. Other classes are called normal

classes. A trait class is an abstract class and can not be instantiated. It also shall only declare methods without function

bodies as members and no constructor.

A normal class can extend at most one other normal class and also any number of trait classes. The extended normal

class is called the superclass, the extended trait classes are called the supertraits, while the extending class is called the

subclass of all the classes it extends. Trait classes can only extend trait classes but not normal classes. The resulting type

of a class definition is the set of object instances of the class itself and all instances of its direct or

...

Questions, Comments and Discussion

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