TTCN-3基本结构
TTCN-3脚本由测试套(test suite)组成。一个test suite就是一个Module。Module包括定义(define)和控制(control)(可选)。
定义部分可能包括以下内容:
- 基本数据定义。 只能定义常量,包括integer, float, bitstring,charstring,hexstring ,etc 。基本数据对于module来说是全局的,即module中任何element都可以使用
- 采用extern引入的常量
- 从其他Module引入数据
- 自定义数据结构,包括定义record, record of , set ,set of
- 定义template,template 用于构造test data
- 定义测试配置,包括定义component .port
- 定义behavior,包括定义function, altsetps,testcase
控制部分可能包含以下内容:
- local declaration,比如变量定义和定时器
- 执行test case
- 可能包含if,while等基本的程序表达式
TTCN-3基本数据类型
- 简单基本类型:integer, float,char,boolean,verdicttype
- 串类型:bitstring,octstring,hexstring,charstring
- 结构类型:record,record of ,set,set of ,union,enumerated
- 特殊数据类型:anytype
- 特殊配置类型:component,port,address
TTCN-3测试配置
- TTC