1、 International Telecommunication Union ITU-T Z.143TELECOMMUNICATION STANDARDIZATION SECTOR OF ITU (03/2006) SERIES Z: LANGUAGES AND GENERAL SOFTWARE ASPECTS FOR TELECOMMUNICATION SYSTEMS Formal description techniques (FDT) Testing and Test Control Notation (TTCN) Testing and Test Control Notation ve
2、rsion 3 (TTCN-3): Operational semantics ITU-T Recommendation Z.143 ITU-T Z-SERIES RECOMMENDATIONS LANGUAGES AND GENERAL SOFTWARE ASPECTS FOR TELECOMMUNICATION SYSTEMS FORMAL DESCRIPTION TECHNIQUES (FDT) Specification and Description Language (SDL) Z.100Z.109 Application of formal description techniq
3、ues Z.110Z.119 Message Sequence Chart (MSC) Z.120Z.129 Extended Object Definition Language (eODL) Z.130Z.139 Testing and Test Control Notation (TTCN) Z.140Z.149 User Requirements Notation (URN) Z.150Z.159 PROGRAMMING LANGUAGES CHILL: The ITU-T high level language Z.200Z.209 MAN-MACHINE LANGUAGE Gene
4、ral principles Z.300Z.309 Basic syntax and dialogue procedures Z.310Z.319 Extended MML for visual display terminals Z.320Z.329 Specification of the man-machine interface Z.330Z.349 Data-oriented human-machine interfaces Z.350Z.359 Human-machine interfaces for the management of telecommunications net
5、works Z.360Z.379 QUALITY Quality of telecommunication software Z.400Z.409 Quality aspects of protocol-related Recommendations Z.450Z.459 METHODS Methods for validation and testing Z.500Z.519 MIDDLEWARE Distributed processing environment Z.600Z.609 For further details, please refer to the list of ITU
6、-T Recommendations. ITU-T Rec. Z.143 (03/2006) i ITU-T Recommendation Z.143 Testing and Test Control Notation version 3 (TTCN-3): Operational semantics Summary This Recommendation defines the operational semantics of TTCN-3 (Testing and Test Control Notation 3). The operational semantics are necessa
7、ry to unambiguously interpret the specifications made with TTCN-3. This Recommendation is based on the TTCN-3 core language defined in ITU-T Rec. Z.140. Source ITU-T Recommendation Z.143 was approved on 16 March 2006 by ITU-T Study Group 17 (2005-2008) under the ITU-T Recommendation A.8 procedure. i
8、i ITU-T Rec. Z.143 (03/2006) FOREWORD The International Telecommunication Union (ITU) is the United Nations specialized agency in the field of telecommunications. The ITU Telecommunication Standardization Sector (ITU-T) is a permanent organ of ITU. ITU-T is responsible for studying technical, operat
9、ing and tariff questions and issuing Recommendations on them with a view to standardizing telecommunications on a worldwide basis. The World Telecommunication Standardization Assembly (WTSA), which meets every four years, establishes the topics for study by the ITU-T study groups which, in turn, pro
10、duce Recommendations on these topics. The approval of ITU-T Recommendations is covered by the procedure laid down in WTSA Resolution 1. In some areas of information technology which fall within ITU-Ts purview, the necessary standards are prepared on a collaborative basis with ISO and IEC. NOTE In th
11、is Recommendation, the expression “Administration“ is used for conciseness to indicate both a telecommunication administration and a recognized operating agency. Compliance with this Recommendation is voluntary. However, the Recommendation may contain certain mandatory provisions (to ensure e.g. int
12、eroperability or applicability) and compliance with the Recommendation is achieved when all of these mandatory provisions are met. The words “shall“ or some other obligatory language such as “must“ and the negative equivalents are used to express requirements. The use of such words does not suggest
13、that compliance with the Recommendation is required of any party. INTELLECTUAL PROPERTY RIGHTS ITU draws attention to the possibility that the practice or implementation of this Recommendation may involve the use of a claimed Intellectual Property Right. ITU takes no position concerning the evidence
14、, validity or applicability of claimed Intellectual Property Rights, whether asserted by ITU members or others outside of the Recommendation development process. As of the date of approval of this Recommendation, ITU had not received notice of intellectual property, protected by patents, which may b
15、e required to implement this Recommendation. However, implementors are cautioned that this may not represent the latest information and are therefore strongly urged to consult the TSB patent database. ITU 2006 All rights reserved. No part of this publication may be reproduced, by any means whatsoeve
16、r, without the prior written permission of ITU. ITU-T Rec. Z.143 (03/2006) iii CONTENTS Page 1 Scope . 1 2 References 1 3 Definitions and abbreviations 1 3.1 Definitions. 1 3.2 Abbreviations. 1 4 Introduction. 1 5 Structure of this Recommendation . 2 6 Restrictions . 2 7 Replacement of short forms 2
17、 7.1 Order of replacement steps 3 7.2 Replacement of global constants and module parameters 3 7.3 Embedding single receiving operations into alt statements. 3 7.4 Embedding stand-alone altstep calls into alt statements. 4 7.5 Replacement of interleave statements 4 7.6 Replacement of trigger operatio
18、ns 16 8 Flow graph semantics of TTCN-3 17 8.1 Flow graphs . 17 8.2 Flow graph representation of TTCN-3 behaviour. 22 8.3 State definitions for TTCN-3 modules. 27 8.4 Messages, procedure calls, replies and exceptions 35 8.5 Call records for functions, altsteps and test cases. 37 8.6 The evaluation pr
19、ocedure for a TTCN-3 module . 38 9 Flow graph segments for TTCN-3 constructs . 40 9.1 Action statement . 40 9.2 Activate statement. 40 9.3 Alt statement 41 9.4 Altstep call 47 9.5 Assignment statement 47 9.6 Call operation. 47 9.7 Catch operation. 53 9.8 Check operation 54 9.9 Clear port operation.
20、57 9.10 Connect operation . 57 9.11 Constant definition 58 9.12 Create operation 59 9.13 Deactivate statement 59 9.14 Disconnect operation . 61 9.15 Do-while statement 62 9.16 Done component operation . 63 9.17 Execute statement . 64 9.18 Expression. 67 9.18b Flow graph segment . 69 9.19 Flow graph
21、segment 70 9.20 Flow graph segment . 70 9.21 Flow graph segment 71 9.22 Flow graph segment . 71 9.23 For statement . 72 9.24 Function call 73 9.25 Getcall operation. 77 9.26 Getreply operation. 78 9.27 Getverdict operation 78 9.28 Goto statement . 79 iv ITU-T Rec. Z.143 (03/2006) Page 9.29 If-else s
22、tatement 79 9.30 Label statement. 80 9.31 Log statement. 80 9.32 Map operation 81 9.33 Mtc operation. 81 9.34 Port declaration. 82 9.35 Raise operation. 82 9.36 Read timer operation 84 9.37 Receive operation 85 9.38 Repeat statement. 88 9.39 Reply operation 88 9.40 Return statement . 90 9.41 Running
23、 component operation . 93 9.42 Running timer operation. 96 9.43 Self operation. 97 9.44 Send operation 97 9.45 Setverdict operation. 100 9.46 Start component operation 100 9.47 Start port operation 102 9.48 Start timer operation 102 9.49 Stop component operation. 104 9.50 Stop execution statement 10
24、8 9.51 Stop port operation 110 9.52 Stop timer operation 110 9.53 System operation 111 9.54 Timer declaration 111 9.55 Timeout timer operation . 113 9.56 Unmap operation 113 9.57 Variable declaration. 114 9.58 While statement 116 10 Lists of operational semantic components 116 10.1 Functions and sta
25、tes. 116 10.2 Special keywords 118 10.3 Flow graphs of TTCN-3 behaviour descriptions 119 10.4 Flow graph segments . 119 ITU-T Rec. Z.143 (03/2006) 1 ITU-T Recommendation Z.143 Testing and Test Control Notation version 3 (TTCN-3): Operational semantics 1 Scope This Recommendation defines the operatio
26、nal semantics of TTCN-3. This Recommendation is based on the TTCN-3 core language defined in ITU-T Rec. Z.140 1. 2 References The following ITU-T Recommendations and other references contain provisions which, through reference in this text, constitute provisions of this Recommendation. At the time o
27、f publication, the editions indicated were valid. All Recommendations and other references are subject to revision; users of this Recommendation are therefore encouraged to investigate the possibility of applying the most recent edition of the Recommendations and other references listed below. A lis
28、t of the currently valid ITU-T Recommendations is regularly published. The reference to a document within this Recommendation does not give it, as a stand-alone document, the status of a Recommendation. 1 ITU-T Recommendation Z.140 (2006), Testing and Test Control Notation version 3 (TTCN-3): Core l
29、anguage. 3 Definitions and abbreviations 3.1 Definitions For the purposes of this Recommendation, the terms and definitions given in ITU-T Rec. Z.140 1 apply. 3.2 Abbreviations This Recommendation uses the following abbreviations: ASN.1 Abstract Syntax Notation One BNF Backus-Nauer Form IDL Interfac
30、e Description Language MTC Master Test Component SUT System Under Test TTCN Testing and Test Control Notation 4 Introduction This clause defines the meaning of TTCN-3 behaviour in an intuitive and unambiguous manner. The operational semantics is not meant to be formal and therefore the ability to pe
31、rform mathematical proofs based on this semantics is very limited. This operational semantics provides a state-oriented view on the execution of a TTCN module. Different kinds of states are introduced and the meaning of the different TTCN-3 constructs is described by: 1) using state information to d
32、efine the preconditions for the execution of a construct; and 2) defining how the execution of a construct will change a state. The operational semantics is restricted to the meaning of behaviour in TTCN-3, i.e., functions, altsteps, test cases, module control and language constructs for defining te
33、st behaviour, e.g., send and receive operations, if-else-, or while- statements. The meaning of some TTCN-3 constructs is explained by replacing them with other language constructs. For example, interleave statements are short forms for series of nested alt statements and the meaning of each interle
34、ave statement is explained by its replacement with a corresponding series of nested alt statements. In most cases, the definition of the semantics of a language is based on an abstract syntax tree of the code that shall be described. This semantics does not work on an abstract syntax tree but requir
35、es a graphical representation of TTCN-3 2 ITU-T Rec. Z.143 (03/2006) behaviour descriptions in form of flow graphs. A flow graph describes the flow of control in a function, altstep, test case or the module control. The mapping of TTCN-3 behaviour descriptions onto flow graphs is straightforward. NO
36、TE The mapping of TTCN-3 statements onto flow graphs is an informal step and is not defined by using the BNF rules in ITU-T Rec. Z.140 1. The reason for this is that the BNF rules are not optimal for an intuitive mapping because several static semantic rules are coded into BNF rules in order to allo
37、w static semantic checks during the syntax check. 5 Structure of this Recommendation This Recommendation is structured into four parts: 1) The first part (see clause 6) describes restrictions of the operational semantics, i.e., issues related to the semantics, which are not covered by this Recommend
38、ation. 2) The second part (see clause 7) defines the meaning of TTCN-3 short cut and macro notations by their replacement with other TTCN-3 language constructs. These replacements in a TTCN-3 module can be seen as pre-processing step before the module can be interpreted according to the following op
39、erational semantics description. 3) The third part (see clause 8) describes the operational semantics of TTCN-3 by means of flow graph interpretation and state modification. 4) The fourth part (see clause 9) specifies the mapping of the different TTCN-3 statements onto flow graph segments, which pro
40、vide the building blocks for flow graphs representing functions, altsteps, test cases and module control. 6 Restrictions The operational semantics only covers behavioural aspects of TTCN-3, i.e., it describes the meaning of statements and operations. It does not provide: a) A semantics for the data
41、aspects of TTCN-3. This includes aspects like encoding, decoding and the usage of data imported from non-TTCN-3 specifications. b) A semantics for the grouping mechanism. Grouping is related to the definitions part of a TTCN-3 module and has no behavioural aspects. c) A semantics for the import stat
42、ement. The import of definitions has to be done in the definitions part of a TTCN-3 module. The operational semantics handles imported definitions as if they are defined in the importing module. d) A semantics for the parameterization of ports. 7 Replacement of short forms Short forms have to be exp
43、anded by the corresponding complete definitions on a textual level before this operational semantics can be used for the explanation of TTCN-3 behaviour. TTCN-3 short forms are: lists of module parameter, constant and variable declarations of the same type and lists of timer declarations; stand-alon
44、e receiving operations; stand-alone altsteps calls; trigger operations; missing return and stop statements at the end of function and test case definitions; missing stop execution statements; and interleave statements. In addition to the handling of short forms, the operational semantics requires a
45、special handling for module parameters and global constants, i.e., constants that are defined in the module definitions part. All references to module parameters and global constants shall be replaced by concrete values. This means, it is assumed that the value of module parameters and global consta
46、nts can be determined before the operational semantics becomes relevant. ITU-T Rec. Z.143 (03/2006) 3 NOTE 1 The handling of module parameters and global constants in the operational semantics will be different from their handling in a TTCN-3 compiler. The operational semantics describes the meaning
47、 of TTCN-3 behaviour and is not a guideline for the implementation of a TTCN-3 compiler. NOTE 2 The operational semantics handles parameters and local constants in test components, test cases, functions and module control like variables. The wrong usage of local constants or in, out and inout parame
48、ters has to be checked statically. 7.1 Order of replacement steps The textual replacements of short forms, global constants and module parameters have to be done in the following order: 1) replacement of lists of module parameter, constant, variable and timer declarations with individual declaration
49、s; 2) replacement of global constants and module parameters by concrete values; 3) embedding stand-alone receiving operations into alt statements; 4) embedding stand-alone altstep calls into alt statements; 5) expansion of interleave statements; 6) replacement of all trigger operations by equivalent receive operations and repeat statements; 7) adding return at the end of functions without return statement, adding self.stop operations at the end of testcase definitions without a stop statement; 8) adding stop at the end a module control part wi