[Paper Review] A Systematic and Semi-Automatic Safety-Based Test Case Generation Approach Based on Systems-Theoretic Process Analysis
This paper presents a systematic, semi-automatic approach to generate safety-based test cases from STPA (Systems-Theoretic Process Analysis) safety analysis results, using formal specification in LTL and model checking via SMV. The key contribution is an open-source tool, STPA TCGenerator, which automates test case generation aligned with STPA software safety requirements, improving traceability and coverage in safety-critical software testing.
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.
Motivation & Objective
- Address the gap in existing testing approaches that do not integrate safety analysis information, particularly from systems-theoretic methods like STPA.
- Improve safety testing of software-intensive systems by directly leveraging STPA-derived unsafe scenarios and safety requirements.
- Develop a semi-automatic, traceable, and formal method to generate test cases that cover all STPA software safety requirements.
- Create an open-source tool, STPA TCGenerator, to automate test case generation and support integration with model-based development environments.
- Enhance test case quality and reduce redundancy by introducing a traceability matrix based on token similarity between safety requirements and test models.
Proposed method
- Apply STPA to analyze safety-critical software, identifying unsafe control actions and constraints through process models and safety requirements.
- Transform identified unsafe scenarios into formal LTL specifications with timing constraints to represent temporal safety properties.
- Construct a safe behavioral model from STPA’s safety requirements and process model, ensuring consistency with system-level constraints.
- Derive a safe test model from the safe behavioral model and validate its correctness using symbolic model checking (SMV).
- Automatically generate test cases from the safe test model, with traceability to STPA software safety requirements using a similarity-based matrix.
- Implement the approach in the STPA TCGenerator tool, supporting integration with Simulink Stateflow and Eclipse-based environments.
Experimental results
Research questions
- RQ1How can STPA safety analysis results be systematically mapped to test case generation for software-intensive systems?
- RQ2To what extent can unsafe scenarios derived from STPA be formally specified in LTL to guide test case generation?
- RQ3How can traceability between STPA safety requirements and generated test cases be ensured and automated?
- RQ4What is the impact of automated test case generation on test coverage and redundancy in safety-critical software testing?
- RQ5How can model consistency between STPA process models and Simulink Stateflow models be maintained during test generation?
Key findings
- The proposed approach successfully generates test cases that are systematically derived from STPA safety requirements, ensuring alignment with identified safety risks.
- The STPA TCGenerator tool supports automated test case generation with traceability to each STPA software safety requirement, improving auditability and coverage.
- The traceability matrix based on token similarity enables identification of relevant test transitions for each safety requirement, reducing redundancy.
- The method achieves 100% coverage of STPA software safety requirements by stopping test generation once all requirements are matched.
- Model checking with SMV confirms the correctness of the safe test model, although the model transformation process itself lacks formal proof of correctness.
- The approach demonstrates practical applicability through a prototype implementation on an Adaptive Cruise Control system with stop-and-go functionality using a Lego-Mindstorms EV3 robot.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.