1、 ETSI ES 203 022 V1.2.1 (2018-05) Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; TTCN-3 extension: Advanced Matching ETSI STANDARD ETSI ETSI ES 203 022 V1.2.1 (2018-05) 2 Reference RES/MTS-203022ed121 Keywords conformance, testing, TTCN-3 ETSI 650 Route
2、 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 enregistre la Sous-Prfecture de Grasse (06) N 7803/88 Important notice The present document can be downloaded from: http:/www.etsi.o
3、rg/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
4、 contents between such versions and/or in print, the only prevailing document is the print of the Portable Document Format (PDF) version kept on a specific network drive within ETSI Secretariat. Users of the present document should be aware that the document may be subject to revision or change of s
5、tatus. 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.asp
6、x 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 ETS
7、I. The copyright and the foregoing restriction extend to reproduction in all media. ETSI 2018. All rights reserved. DECTTM, PLUGTESTSTM, UMTSTMand the ETSI logo are trademarks of ETSI registered for the benefit of its Members. 3GPPTM and LTETMare trademarks of ETSI registered for the benefit of its
8、Members and of the 3GPP Organizational Partners. oneM2M logo is protected for the benefit of its Members. GSMand the GSM logo are trademarks registered and owned by the GSM Association. ETSI ETSI ES 203 022 V1.2.1 (2018-05) 3 Contents Intellectual Property Rights 4g3Foreword . 4g3Modal verbs termino
9、logy 4g31 Scope 5g32 References 5g32.1 Normative references . 5g32.2 Informative references 5g33 Definitions and abbreviations . 6g33.1 Definitions 6g33.2 Abbreviations . 6g34 Package conformance and compatibility 6g35 Package Concepts for the Core Language 7g35.0 General . 7g35.1 Dynamic Matching .
10、 7g35.2 Templates with variable bindings . 8g35.2.0 General 8g35.2.1 Value retrieval from matching 8g35.2.2 Declaring out parameters for template definitions 9g35.3 Additional logical operators for combining matching mechanisms . 11g35.3.0 General 11g35.3.1 Conjunction. 11g35.3.2 Implication 12g35.3
11、.3 Exclusion 13g35.3.4 Disjunction 13g35.4 Repetition . 14g35.4.1 General 14g35.4.2 Repetition in record of and array 14g35.4.3 Repetition in string . 16g35.4.4 Modifications to ETSI ES 201 873-1 1, clause 15.11 (Concatenating templates of string and list types) 17g35.4.4.0 General 17g35.4.4.1 Step
12、1 of modifications to ETSI ES 201 873-1 1, clause 15.11 17g35.4.4.2 Step 2 of modifications to ETSI ES 201 873-1 1, clause 15.11 17g35.5 Equality operator for the omit symbol and templates with restriction omit . 18g35.5.0 General 18g35.5.1 Modifications to ETSI ES 201 873-1 1, clause 7 (Expressions
13、) 18g36 TCI Extensions for the Package . 19g36.1 Extensions to clause 7.2.2.2.0 of ETSI ES 201 873-6, Basic rules 19g36.2 Extensions to clause 7.2.2.3.1 of ETSI ES 201 873-6, The abstract data type MatchingMechanism 20g36.3 Extensions to clause 7.2.2.3.2 of ETSI ES 201 873-6, The abstract data type
14、MatchingList . 20g36.4 Extensions to clause 7.2.2.3 of ETSI ES 201 873-6, The abstract data type MatchingMechanism . 20g36.5 Extensions to clause 8 of ETSI ES 201 873-6, JavaTMlanguage mapping . 21g36.6 Extensions to clause 9 of ETSI ES 201 873-6, ANSI C language mapping . 23g36.7 Extensions to clau
15、se 10 of ETSI ES 201 873-6, C+ language mapping. 24g36.8 Extensions to clause 12 of ETSI ES 201 873-6, C# language mapping . 26g3Annex A (normative): BNF and static semantics 28g3A.1 Modified TTCN-3 syntax BNF productions 28g3A.2 Deleted TTCN-3 syntax BNF productions . 28g3A.3 Additional TTCN-3 synt
16、ax BNF productions 28g3History 30g3ETSI ETSI ES 203 022 V1.2.1 (2018-05) 4 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 availabl
17、e 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 (
18、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, e
19、ssential 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 reproduc
20、e 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 ETSI Standard (ES) has been produced by ETSI Technical Committee Methods for Testing
21、 and Specification (MTS). The present document relates to the multi-part deliverable ETSI ES 201 873 covering the Testing and Test Control Notation version 3, as identified below: Part 1: “TTCN-3 Core Language“; Part 4: “TTCN-3 Operational Semantics“; Part 5: “TTCN-3 Runtime Interface (TRI)“; Part 6
22、: “TTCN-3 Control Interface (TCI)“; Part 7: “Using ASN.1 with TTCN-3“; Part 8: “The IDL to TTCN-3 Mapping“; Part 9: “Using XML schema with TTCN-3“; Part 10: “TTCN-3 Documentation Comment Specification“; Part 11: “Using JSON with TTCN-3“. NOTE: Part 2 is in status “historical“ and part 3 is no longer
23、 maintained. 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
24、 “must not“ are NOT allowed in ETSI deliverables except when used in direct citation. ETSI ETSI ES 203 022 V1.2.1 (2018-05) 5 1 Scope The present document defines the support of advance matching of TTCN-3. TTCN-3 can be used for the specification of all types of reactive system tests over a variety
25、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 fo
26、r 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 n
27、ot 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 pa
28、ckages, 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-spec
29、ific. 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
30、.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 Speci
31、fication (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 Spe
32、cification (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 Referenc
33、es 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 h
34、yperlinks 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
35、 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 ETSI ES 203 022 V1.2.1 (2018-05) 6 i.2 ETSI ES 201 873-8: “Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part
36、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 vers
37、ion 3; Part 10: TTCN-3 Documentation Comment Specification“. 3 Definitions and abbreviations 3.1 Definitions For the purposes of the present document, the terms and definitions 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 Abbreviations For
38、 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:2017 Advanced
39、 Matching“ - 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
40、 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.9.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.
41、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 ETSI ES 203 022 V1.2.1 (2018-05) 7 5 Package Concepts for the Core Language 5.0 General This p
42、ackage defines advanced matching mechanisms for TTCN-3, i.e. new matching mechanisms which go beyond the matching mechanisms defined in ETSI ES 201 873-1 1. This package realizes the following concepts: Dynamic matching: allows to specify matching in a function-like fashion, i.e. statement blocks an
43、d functions can be used to define matching. Templates with variable bindings: ease the retrieval field values of received messages and signatures. For this the “-“ symbol is used to denote a value assignment to a variable or an out parameter in the scope of a template definition in case of a success
44、ful template matching. Additional logical operators: conjunction, implication, exclusion and disjunction allow the combination matching mechanisms for advanced matching. Repetition: allows to match repetitions of a sub-sequence templates inside values of a certain type. Restrictions for the omit sym
45、bol and templates with restriction omit are relieved allowing omit symbols and templates with restriction omit as operands for the equality operator. 5.1 Dynamic Matching A dynamic matching is a special matching mechanism. Similar to other matching mechanisms, it can be considered as a Boolean funct
46、ion that indicates successful matching for the value to be matched by returning the value true and unsuccessful matching by returning the value false. Syntactical Structure dynamic (StatementBlock | FunctionRef) Semantic Description The StatementBlock shall return a value of type boolean. The value
47、to be matched is referenced by the special keyword value. When applying this matching mechanism to a value, the StatementBlock is executed and if and only if the execution returns true, the dynamic matching function matches. Unsuccessful matching shall return false. A dynamic matching function can o
48、nly be used in the context of a template, the value expression inside the StatementBlock shall have the same type as the whole template. The notation dynamic FunctionRef denotes a shorthand for the special case dynamic return FunctionRef(value) where FunctionRef is a reference to a Boolean function
49、with a single parameter compatible with the templates type. Here, the type of the parameter of the referenced function determines the type context, if this templates place of usage does not provide a type context. Restrictions a) The dynamic matching syntax shall only be used in a typed context. b) The StatementBlock shall compute a value of type boolean. c) The StatementBlock shall be deterministic and side-effect free and follow the restrictions of clause 16.1.4 of ETSI ES 201 8