论文标题

PTSG:基于扩展有限状态机的测试生成工具

PTSG: a test generation tool based on extended finite state machine

论文作者

Pan, Zhijie, Shu, Ting, Ding, Zuohua

论文摘要

扩展有限状态机(EFSM)是基于模型测试的最流行的建模方法之一。但是,基于EFSM的测试案例生成易受不可行的(不可迫见)路径问题,这源于路径过渡之间的谓词(守卫)的冲突。因此,为了得出可行的测试用例,测试生成算法需要动态获取有关模型的信息,并通过模型的仿真执行来验证生成的测试路径的可行性。使用硬编码为正在测试的不同EFSM模型进行硬编码构建可执行模型的传统方法具有限制,例如僵化,耗时和容易出错。为了解决此问题,本文开发了用于测试EFSM指定系统PTSG的开源测试生成工具,以支持自动生成可执行的测试用例。它从测试生成算法中解除了EFSM模型描述,解析和模拟执行函数,这些算法可以有效地提高测试生成的效率和质量。特别是,PTSG首先使用精心设计的JSON语法来描述正在测试的特定EFSM。然后,基于模型描述文件,它使用词汇和句法解析器动态提取模型信息,以在内存中构建各种模型对象,例如状态配置,过渡等。最后,该工具提供了一系列的服务接口,以支持模型信息获取,过渡可行性评估和模型模拟执行。 SCP协议模型的测试序列生成的案例研究证明了PTSG提供可执行测试用例的能力和希望。

The Extended Finite State Machine (EFSM) is one of the most popular modeling approaches for model-based testing. However, EFSM-based test case generation is susceptible to the infeasible (inexecutable) path problem, which stems from the conflict of predicates (guards) between transitions in the path. Therefore, in order to derive feasible test cases, a test generation algorithm needs to dynamically acquire information about the model and verify the feasibility of the generated test path through the simulation execution of the model. The traditional method of constructing executable models using hard-coding for different EFSM models under test has limitations such as inflexibility, time-consuming and error-prone. To address this issue, this paper develops an open source test generation tool for testing EFSM-specified systems, PTSG, to support the automatic generation of executable test cases. It decouples the EFSM model description, parsing and simulation execution functions from the test generation algorithm, which can effectively improve the efficiency and quality of test generation. In particular, PTSG first uses a well-designed JSON syntax to describe the specific EFSM under test. Then, based on the model description file, it uses lexical and syntactic parsers to dynamically extract model information to construct various model objects in memory such as state configurations, transitions, etc. Finally, the tool provide a series of service interfaces to support model information acquisition, transition feasibility evaluation, and model simulation execution. A case study of test sequence generation for the SCP protocol model demonstrates the capability and promise of the PTSG to serve executable test cases.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源