为解决现有协议建模方法验证困难及测试序列生成算法复杂度高和测试序列长的问题,提出了一种基于行为树(BT)的协议描述新方法。采用行为树模型对协议的控制流程进行建模,提出了基于行为树描述的协议验证方法,并给出了基于行为树的测试序列生成方法。以某监控协议为例给出了基于行为树的建模过程,将所建模型转换为通信顺序进程(CSP)后采用过程分析工具(PAT)完成了协议验证,并完成了测试序列的计算与对比分析,结果表明提出的方法能方便地完成对协议的描述与验证,能降低测试序列计算复杂度并减少生成的测试序列长度。
To solve the problem that the existing protocol modelling method is difficult to validate and test sequence generation algorithm has high complexity and long test sequence, this paper put forward a new protocol modelling method based on beha- viour trees (BT). Sequence and selection were taken as two basic control structures to model the control flow of protocol, this paper proposed a protocol verifying method based on BT, then gave the test sequence generation method based on behavior tree. A monitoring protocol was taken as an example for modeling and verifying. Firstly, it modelled the protocol by BT. Sec- ondly, it translated the BT model into communication sequential processes (CSP) model. Thirdly, it used a process analysis toolkit (PAT) to verify the deadlock and reachability of the model. It finishied contrast analysis of test sequences at last. The results show that protocol modelling and verification can be conveniently completed by the method of this paper, and it can re- duce the computation complexity and the length of the test sequence.