[论文解读] A Systematic and Semi-Automatic Safety-Based Test Case Generation Approach Based on Systems-Theoretic Process Analysis
本文提出了一种系统化、半自动化的测试用例生成方法,基于STPA(系统理论过程分析)安全分析结果,采用LTL形式化规格说明与SMV模型检测技术。核心贡献是开发了一款开源工具STPA TCGenerator,可自动根据STPA软件安全需求生成测试用例,提升安全关键软件测试中的可追溯性与覆盖率。
Software safety is a crucial aspect during the development of modern safety-critical systems. Software is becoming responsible for most of the critical functions of systems. Therefore, the software components in the systems need to be tested extensively against their safety requirements to ensure a high level of system safety. However, performing testing exhaustively to test all software behaviours is impossible. Numerous testing approaches exist. However, they do not directly concern the information derived during the safety analysis. STPA (Systems-Theoretic Process Analysis) is a unique safety analysis approach based on system and control theory, and was developed to identify unsafe scenarios of a complex system including software. In this paper, we present a systematic and semi-automatic testing approach based on STPA to generate test cases from the STPA safety analysis results to help software and safety engineers to recognize and reduce the associated software risks. We also provide an open-source safety-based testing tool called STPA TCGenerator to support the proposed approach. We illustrate the proposed approach with a prototype of a software of the Adaptive Cruise Control System (ACC) with a stop-and-go function with a Lego-Mindstorms EV3 robot.
研究动机与目标
- 填补现有测试方法中未整合安全分析信息的空白,特别是来自系统理论方法(如STPA)的安全分析信息。
- 通过直接利用STPA导出的非安全场景和安全需求,提升软件密集型系统的安全测试水平。
- 开发一种半自动、可追溯且形式化的测试用例生成方法,确保覆盖所有STPA软件安全需求。
- 开发一款开源工具STPA TCGenerator,实现测试用例的自动化生成,并支持与基于模型的开发环境集成。
- 通过基于安全需求与测试模型之间词元相似度的可追溯性矩阵,提升测试用例质量并减少冗余。
提出的方法
- 应用STPA分析安全关键软件,通过流程模型与安全需求识别非安全控制行为及其约束。
- 将识别出的非安全场景转化为带时间约束的形式化LTL规格说明,以表示时序安全属性。
- 从STPA的安全需求与流程模型构建安全行为模型,确保与系统级约束一致。
- 从安全行为模型推导出安全测试模型,并通过符号模型检测(SMV)验证其正确性。
- 从安全测试模型自动生成功能测试用例,并利用基于相似度的矩阵实现与STPA软件安全需求的可追溯性。
- 在STPA TCGenerator工具中实现该方法,支持与Simulink Stateflow及基于Eclipse的环境集成。
实验结果
研究问题
- RQ1如何系统化地将STPA安全分析结果映射到软件密集型系统的测试用例生成?
- RQ2从STPA导出的非安全场景在多大程度上可形式化表示为LTL,以指导测试用例生成?
- RQ3如何确保并自动化STPA安全需求与生成测试用例之间的可追溯性?
- RQ4自动化测试用例生成对安全关键软件测试中的测试覆盖率与冗余性有何影响?
- RQ5在测试生成过程中,如何保持STPA流程模型与Simulink Stateflow模型之间的一致性?
主要发现
- 所提方法成功生成了系统化源自STPA安全需求的测试用例,确保与识别出的安全风险保持一致。
- STPA TCGenerator工具支持测试用例的自动化生成,并实现与每个STPA软件安全需求的可追溯性,提升了可审计性与覆盖率。
- 基于词元相似度的可追溯性矩阵能够识别与每个安全需求相关的测试转换,有效减少冗余。
- 通过在所有安全需求均被匹配后停止测试生成,该方法实现了对STPA软件安全需求的100%覆盖率。
- 使用SMV的模型检测确认了安全测试模型的正确性,但模型转换过程本身缺乏形式化正确性证明。
- 通过在具备停走功能的自适应巡航控制系统上使用Lego-Mindstorms EV3机器人进行原型实现,验证了该方法的实际适用性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。