Testing Modeling Method for Engineering Testing of High-Speed Railway Signaling System
-
摘要:
高铁信号系统工程测试关注系统中各设备间的复杂行为关系和状态同步,工程测试的测试建模方法缺少复杂行为交互和同步机制,针对此问题,提出基于扩展有限状态机的高铁信号系统工程测试建模方法和测试用例生成方法. 首先,分析高铁信号系统工程测试的特点,提出复杂事件交互和状态同步的测试建模需求,以有限状态机理论为基础,扩展出状态事件和层次性,满足信号系统工程测试中复杂行为关系和状态同步的建模需求,采用
Z 规格说明语言给出扩展有限状态机的形式化定义,定义扩展有限状态机的格局和同步机制;然后,提出将扩展有限状态机转化为时间自动机的算法,利用时间自动机的测试用例生成算法自动生成高铁信号系统工程测试的测试用例;最后,以高铁信号系统工程测试中的进路控制为例,建立扩展有限状态机模型并生成测试用例,通过变异分析对生成的测试用例进行评估. 结果表明:测试用例在检测状态变异和事件表达式变异时的变异评分均为1,具有良好的覆盖度,能够满足高铁信号系统工程测试的需求.Abstract:The engineering testing of a high-speed railway signaling system (HSRSS) focuses on the complex behavior relationship and state synchronization among various equipment in the system. Since the testing modeling method for engineering testing lacks complex behavior interaction and synchronization mechanism, the engineering testing modeling method and test case generation method of HSRSS based on an extended finite state machine (EFSM) were proposed. First, the engineering testing characteristics of HSRSS were analyzed, and the testing modeling requirements for complex event interaction and state synchronization were proposed. Based on the theory of finite state machine, the state events and hierarchy were extended to meet the modeling requirements for complex behavior relationships and state synchronization in engineering testing of HSRSS. The formal definition of EFSM was given by using
Z specification language. The pattern and synchronization mechanism of EFSM were defined. Then, the algorithm of transforming the EFSM into a timed automata (TA) was put forward, and the test case generation algorithm of TA was used to automatically generate test cases for engineering testing of HSRSS. Finally, with the route control in engineering testing of HSRSS as an example, an EFSM model was established, and test cases were generated. In addition, the generated test cases were evaluated through mutation analysis. The result shows that the test cases have a mutation score of 1 when testing state mutation and signal expression mutation, and they have good coverage, which can meet the requirements of engineering testing of HSRSS. -
表 1 Droute事件含义
Table 1. Meaning of events in Droute
事件 含义 事件 含义 e10 进路占用 e11 进路空闲 e12 进路红光带 e13 进路检查通过 e20 道岔正确 e21 超限绝缘相邻区段空闲 e30 敌对进路满足 e31 灯丝正常 e41 向 TCC 发送进路 e42 向 RBC 发送 SA e43 取消进路 e44 延迟解锁 e45 分段解锁 表 2 Droute状态含义
Table 2. Meaning of states in Droute
状态 含义 状态 含义 s11 进路处于占用状态 s12 进路处于空闲状态 s13 进路处于红光带状态 s21 道岔位置处于非法状态 s22 道岔位置处于合法状态 s24 超限绝缘相邻区段处于占用状态 s25 超限绝缘相邻区段处于空闲状态 s31 敌对进路处于建立状态 s32 敌对进路处于未建立状态 s34 灯丝处于故障状态 s35 灯丝处于正常状态 s41 进路处于建立状态 s42 进路处于取消状态 表 3 Droute与Droute_TA 对比
Table 3. Comparison between Droute and Droute
个 模型 构件数 状态数 变迁数 事件/变量数 Droute 1 19 29 13 DTA 7 25 47 22 表 4 Droute测试用例(部分)
Table 4. Test cases of Droute (part)
测试用例 主要内容 1 a) 进路区段空闲,道岔位置正确,超限绝缘相邻区段占用;b) 超限绝缘相邻区段空闲,进路上区段红光带,进路不能锁闭 2 进路空闲、超限绝缘相邻区段空闲、道岔位置正确、敌对进路未建立,进路锁闭,信号机开放 3 a) 进路空闲,超限绝缘相邻区段空闲,道岔位置正确,进路锁闭,信号尚未开放;b) 敌对进路未建立,灯丝正常,但进路占用,信号不能开放 4 a) 进路锁闭后,向 TCC 发送联锁进路;b) 进路锁闭后,向 RBC 发送 SA 信息 5 进路锁闭后,灯丝断丝,信号不能开放 6 列车在进路内正常运行,进路分段解锁 7 接近区段占用,接车进路解锁时需延时 3 min 表 5 测试用例评估
Table 5. Test case evaluation
变异算子 变异描述 变异体数量/个 发现变异体数量/个 变异评分 迁移变异 增加或减少迁移 20 12 0.6 状态变异 增加或减少状态 10 10 1.0 事件表达式变异 改变事件表达式内容 15 15 1.0 -
[1] 上官伟,胡福威,袁敏,等. 基于弹复力效应的列控车载设备可靠性分析方法[J]. 铁道学报,2018,40(6): 75-82. doi: 10.3969/j.issn.1001-8360.2018.06.010SHANGGUAN Wei, HU Fuwei, YUAN Min, et al. Reliability analysis method for on-board equipment of train control system based on resilience effect[J]. Journal of the China Railway Society, 2018, 40(6): 75-82. doi: 10.3969/j.issn.1001-8360.2018.06.010 [2] 齐凡瑞,李强. 列控系统RBC测试序列优化生成方法[J]. 北京交通大学学报,2022,46(2): 11-19,28. doi: 10.11860/j.issn.1673-0291.20210139QI Fanrui, LI Qiang. Optimal generation method of RBC test sequence for train control system[J]. Journal of Beijing Jiaotong University, 2022, 46(2): 11-19,28. doi: 10.11860/j.issn.1673-0291.20210139 [3] 梁茨,郑伟,李开成,等. 基于路径优化算法的测试序列自动生成及验证[J]. 铁道学报,2013,35(6): 53-58. doi: 10.3969/j.issn.1001-8360.2013.06.009LIANG Ci, ZHENG Wei, LI Kaicheng, et al. Automated generation of test cases and sequences based on path optimization algorithm[J]. Journal of the China Railway Society, 2013, 35(6): 53-58. doi: 10.3969/j.issn.1001-8360.2013.06.009 [4] 赵显琼,郑伟,唐涛. 一种基于模型的形式化测试序列自动生成方法及在ETCS-2中的应用[J]. 铁道学报,2012,34(5): 70-80. doi: 10.3969/j.issn.1001-8360.2012.05.012ZHAO Xianqiong, ZHENG Wei, TANG Tao. Model-based formal approach for generating test cases and test sequences automatically by example of the ETCS-2[J]. Journal of the China Railway Society, 2012, 34(5): 70-80. doi: 10.3969/j.issn.1001-8360.2012.05.012 [5] 赵晓宇,杨志杰,吕旌阳. 基于有色Petri网的车载设备模式转换测试序列生成方法[J]. 中国铁道科学,2017,38(4): 115-123. doi: 10.3969/j.issn.1001-4632.2017.04.16ZHAO Xiaoyu, YANG Zhijie, LÜ Jingyang. Test sequence generation method of mode transition for on-board equipment based on colored petri net[J]. China Railway Science, 2017, 38(4): 115-123. doi: 10.3969/j.issn.1001-4632.2017.04.16 [6] 王硕,张亚东,郭进,等. 列控中心自动化测试测试用例生成方法[J]. 北京交通大学学报,2020,44(5): 49-54. doi: 10.11860/j.issn.1673-0291.20200052WANG Shuo, ZHANG Yadong, GUO Jin, et al. Generation method of test cases for automated testing of TCC[J]. Journal of Beijing Jiaotong University, 2020, 44(5): 49-54. doi: 10.11860/j.issn.1673-0291.20200052 [7] LV J D, AHMAD E, TANG T. Non-deterministic delay behavior testing of Chinese train control system using UPPAAL-TRON[J]. IEEE Intelligent Transportation Systems Magazine, 2021, 13(3): 58-82. doi: 10.1109/MITS.2019.2953536 [8] 魏柏全,吕继东,陈柯行,等. 基于TAIO变异的CTCS-3列控系统测试案例生成方法[J]. 西南交通大学学报,2020,55(5): 937-945,962. doi: 10.3969/j.issn.0258-2724.20180078WEI Baiquan, LÜ Jidong, CHEN Kexing, et al. Mutation timed automata with input and output-based method of generating test suites for Chinese train control system level 3[J]. Journal of Southwest Jiaotong University, 2020, 55(5): 937-945,962. doi: 10.3969/j.issn.0258-2724.20180078 [9] LI C L, LI K C, TANG T, et al. Model-based generation of safety test-cases for Onboard systems[C]//2013 IEEE International Conference on Intelligent Rail Transportation Proceedings. Beijing: IEEE, 2013: 191-196. [10] 吕继东,朱晓琳,王海峰,等. 基于UPPAAL-TRON的高速铁路列控系统非确定性时延一致性测试研究[J]. 铁道学报,2016,38(1): 54-64. doi: 10.3969/j.issn.1001-8360.2016.01.009LV Jidong, ZHU Xiaolin, WANG Haifeng, et al. Online conformance testing of non-determinism time delay in high-speed train control system using UPPAAL-TRON[J]. Journal of the China Railway Society, 2016, 38(1): 54-64. doi: 10.3969/j.issn.1001-8360.2016.01.009 [11] 曹雅鑫. 基于UML状态图的列控中心轨道电路编码功能测试用例生成方法研究[D]. 成都:西南交通大学,2017. [12] 郑伟,唐涛,吕继东,等. 基于IECP的CTCS-3列控车载TSM曲线完备性测试用例集生成方法研究[J]. 铁道学报,2020,42(5): 72-83. doi: 10.3969/j.issn.1001-8360.2020.05.010ZHENG Wei, TANG Tao, LÜ Jidong, et al. Method of generating completeness test suit based on IECP for CTCS-3 train control TSM profile[J]. Journal of the China Railway Society, 2020, 42(5): 72-83. doi: 10.3969/j.issn.1001-8360.2020.05.010 [13] LV J D, LU W L, WANG T, et al. The search-based mutation testing of the Chinese train control system level 3 on board a train control system[J]. IEEE Intelligent Transportation Systems Magazine, 2022, 14(5): 41-58. doi: 10.1109/MITS.2021.3069900 [14] SUN Y J, LI K C, YUAN L, et al. Safety test case generation of train-ground transmission function for CTCS based on fault models[C]//2019 IEEE Intelligent Transportation Systems Conference (ITSC). Auckland: IEEE, 2019: 3355-3360. [15] 李耀,张晓霞,郭进,等. 高铁信号系统安全关键功能测试建模方法[J]. 西南交通大学学报,2022,57(1): 28-35,45. doi: 10.3969/j.issn.0258-2724.20200378LI Yao, ZHANG Xiaoxia, GUO Jin, et al. Testing modeling method for safety critical function of high-speed railway signal system[J]. Journal of Southwest Jiaotong University, 2022, 57(1): 28-35,45. doi: 10.3969/j.issn.0258-2724.20200378 [16] 李耀,张晓霞,郭进,等. 铁路信号系统软件测试建模方法[J]. 西南交通大学学报,2022,57(2): 392-400,424. doi: 10.3969/j.issn.0258-2724.20200530LI Yao, ZHANG Xiaoxia, GUO Jin, et al. Modeling method for testing railway signal system software[J]. Journal of Southwest Jiaotong University, 2022, 57(2): 392-400,424. doi: 10.3969/j.issn.0258-2724.20200530 [17] AMMANN P, OFFUTT J. Introduction to Software Testing[M]. New York: Cambridge University Press, 2017. [18] 吴彪. 基于EFSM的测试用例自动生成方法的研究[D]. 杭州:浙江理工大学,2016. [19] MIKK E, LAKHNECH Y, PETERSOHN C, et al. On formal semantics of statecharts as supported by STATEMATE[C]//Proceedings of the 2nd BCS-FACS conference on Northern Formal Methods. Ilkley: [s. n.], 1997: 1 -12. [20] 朱雪阳,唐稚松. Statecharts的组合语义与求精[J]. 软件学报,2006,17(4): 670-681. doi: 10.1360/jos170670ZHU Xueyang, TANG Zhisong. Compositional semantics and refinement of statecharts[J]. Journal of Software, 2006, 17(4): 670-681. doi: 10.1360/jos170670 [21] SOLIMAN D, THRAMBOULIDIS K, FREY G. Transformation of Function Block Diagrams to UPPAAL timed automata for the verification of safety applications[J]. Annual Reviews in Control, 2012, 36: 338-345. doi: 10.1016/j.arcontrol.2012.09.015 [22] LI Y, ZHANG X X, ZHANG Y D, et al. Towards A test paths generation method for CTCS level transition[J]. MATEC Web of Conferences, 2020, 325: 1001-1005. doi: 10.1051/matecconf/202032501001 [23] 李兰心,王海峰,齐志华,等. 基于SCADE模型的车载ATP测试用例生成方法[J]. 铁道学报,2020,42(9): 102-110. doi: 10.3969/j.issn.1001-8360.2020.09.013LI Lanxin, WANG Haifeng, QI Zhihua, et al. SCADE model-based method of test cases generation for onboard ATP system[J]. Journal of the China Railway Society, 2020, 42(9): 102-110. doi: 10.3969/j.issn.1001-8360.2020.09.013 [24] 魏柏全. 基于TAIO变异分析的新型列控系统安全功能测试评价研究[D]. 北京:北京交通大学,2018.