1.1 List
1.1 Module
模块定义,类似于class,模块不能包含子模块,但是可以从其他模块引入定义。
定义部分:定义测试成分、通信端口、数据类型、常数、测试数据模板、函数、测试端口上调用的过程特征(signatures)、测试例等等。
控制部分:分调用测试例并控制它们的执行。控制部分也可以声明(局部)变量等,程序语句(如ifelse 和do-while)可以用于各个测试例的选择和执行顺序 。TTCN-3不支持全局变量的概念。
module MyModule { const integer A := 1; function MyBehaviourA { } } 1.2 Type
用户自定义数据类型
type float pi (3.1415926); type set MySetType {
integer field1, charstring field2 }
1.3 Template
模板(Templates)用于传送一个特定值的集合或是测试接收的值的集合是否与模板说明匹配。 a) 模板提供了一种组织和重复使用测试数据的方法 b) 模板能够被参数化; c) 模板允许匹配机制;
d) 模板既能够用于基于消息的通信,也能用于基于过程的通信
1.4 Component
The component type defines which ports are associated with a component. • •
It is also possible to declare constants, variables and timers local to a particular component type.
These declarations are visible to all testcases, functions and altsteps that run on an instance of the given component type. This shall be explicitly stated using the runs on keyword (see clause 16) in the testcase, function or altstep header.
1.5 Port && message
Port:端口可以基于消息(message标识),和基于过程(procedure)的,甚至是二者混合(mixed)的。
端口类型定义中可以声明进出的数据类型
type port MyMessagePortType message{//message说明基于消息的 in MsgType1,MsgType2; out MsgType3;
inout integer;//该端口允许接受MsgType1和MsgType2类型,发送MsgType3类型,并且可发送和接收任何整形值 }
消息通信方法有:
send()The send operation is used to place a message on an outgoing message port.
Receive()The receive operation is used to receive a message from an incoming message port queue.
1.6 Record
TTCN-3支持有序的结构化类型,即记录类型(record)。一个record类型元素可以是基本类型或用户定义数据类型(如其它记录、集合或数组类型)的任一种. type record MyRecordType {
integer field1,
MyOtherRecordType field2 optional, charstring field3 }
1.7 Function
用于函数定义,当函数使用了component中的port或者参数时,需要用runs on指定 function MyFunction() runs on MyComponent return integer { return 7; }
1.8 Verdict
• •
MTC collect local verdicts from the PTC:s and gives the final verdict The verdict can have five different values: pass, fail, inconc, none and error
1.9 Altsteps
TTCN-3使用可选步(Altsteps)来描述默认行为,或构造一个alt语句的选择对象
(Alternatives).它是与函数相似的范围单位,可以对一些对象进行操作,当操作的对象涉及到component时,需要用runs on指定
可选步的调用分显示和隐式。隐式调用之前必须通过activate()激活。
var default MyDefVarTwo := activate(MySecondAltStep()); // 一个可选步激活为默认。 显示操作是在alt语句中进行。
1.10 Repeat
1.11 Any&&all
1. 定时器中使用
2. Import语句使用 all
• Abbreviations and Definitions
ASN.1 Abstract Syntax Notation 1 ASP(s) Abstract Service Primitive(s) ATS IE(s) IUT
Abstract Test Suite Information Element(s) Implementation Under Test
MTC Main Test Component
PDU(s) Protocol Data Unit(s) PICS PIXIT PTC SDL SUT TCI TSI
Protocol Implementation Conformance Statement Protocol Implementation eXtra Information for Testing Parallel Test Component System Description Language System Under Test TTCN-3 Control Interface Test System Interface
TTCN-2 Tree and Tabular Combined Notation, version 2 TTCN-3 Testing and Test Control Notation, version 3
• References
[3GPP SG]
3rd Generation Partnership Project; Technical Specification Group Terminal; User Equipment (UE) conformance specification; Part 3: Abstract Test Suites (Release 1999). Annex E (informative): TTCN style guide for 3GPP ATS.
K. Eriksson, M. Williams, and J. Armstrong.
Program Development Using Erlang – Programming Rules and Conventions. Ericsson, Doc. No EPK/NP 95:035,
http://www.erlang.se/doc/programming_rules.pdf.1996. Nokia Network Element TTCN tester;
Implementation Principles, V1.0. Teemu Rekinen & Work Group. LN: FSG System Design Documents. 2001.
TTCN STYLE GUIDE, Nokia Network Element TTCN Testing, V0.4.0, Z. Babik, 2001.
TTCN Style Guide, WST group. WST TTCN Style Committee, R&D WST /. DTS01123-EN. 1999. Systems Engineering Using SDL-92, Anders Olsen, Ove Faergemand, Birger Moller-Pedersen, Rick Reed, J.R.W. Smith. Elsevier, 1994
RNC Protocol Testing, Methodologies Style Guide, V1.0.0. INT09. Paul James. 2000.
[ErWiAr96]
[NET Impl]
[NET SG] [NMP SG] [OlFaMo94]
[Ja00]
[SIP/OSP]
Study on the use of TTCN-3 for SIP and OSP test specifications. Technical Report. ETSI DTR/TIPHON-06019, V1.1.0, 2001.
Methods for Testing and Specification (MTS); The Tree and Tabular Combined Notation version 3; TTCN-3: TTCN-2 to TTCN-3 Mapping; Technical Report. ETSI. DTR/MTS-00069 V1.0.2. 2000.
Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 1: TTCN-3 Core Language. ETSI Standard. ETSI ES 201 873-1, V2.1.0, October 2001.
Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 3: TTCN-3 Graphical Presentation Format (GFT). ETSI Standard. ETSI ES 201 873-3, October 2001. Methods for Testing and Specification (MTS); The Testing and Test Control Notation version 3; Part 2: TTCN-3 Tabular Presentation Format (TFT). ETSI Standard. ETSI ES 201 873-2, October 2001. Methods for Testing and Specification (MTS; The Testing and
Test Control Notation version 3; Part 4: TTCN-3 Operational Semantics. ETSI ES 201 873-4, V2.1.0, October 2001.
[TTCN-2 Map]
[TTCN-3 CL]
[TTCN-3 GFT]
[TTCN-3 TFT]
[TTCN-3 OS]
表 15: TTCN-3 配置操作一览表 配 置 操 作 语句 操作名
创建并行测试成分 create
连接一个测试成分到另一个 connect 断开两个测试成分的连接 disconnect 映射成分端口到测试接口端口 Map 去除端口到测试系统接口的映射 unmap 获得MTC地址 Mtc
获得测试系统接口地址 system
获得自身地址 Self 启动测试成分的执行 Start 停止测试成分的执行 Stop 检查一个PTC的终止 running 等待一个PTC的终止 Done action address all alt fail for from noblock not no 4b no self set activate altstep and and4b any anytype bitstring
boolean call catch char charstring check clear complement component connect const control create
deactivate default disconnect display do done else encode enumerated error except exception
execute extension external false float function
getverdict getcall getreply goto group hexstring if ifpresent import in inconc infinity inout integer interleave label language length
log map match message mixed mod modifies module mtc none t wait null objid octetstring of omit on optional or or4b out override param
Modulepar pass pattern port procedure raise read receive record recursive rem repeat reply return running runs send sender setverdict signature start stop subset superset system
template testcase timeout timer to trigger true type union universal unmap value valueof var variant verdicttype while with xor xor4b
因篇幅问题不能全部显示,请点此查看更多更全内容