TL;DR
This paper introduces a SysML-based methodology and a SysML-Simulink co-simulation framework to enable early-stage model testing of Cyber-Physical Systems (CPS). By allowing executable models of software, hardware, and environment to be tested together, it addresses the challenges of traditional testing for complex, intertwined CPS.
What Problem Does This Paper Address?
Testing Cyber-Physical Systems (CPS) is notoriously difficult. These systems involve a deep integration of software, hardware, and physical processes, leading to complex and continuous interactions. Traditional testing methods struggle with this complexity, especially in early design phases. This makes it hard to automate testing, explore a wide range of scenarios, and detect faults before systems are built, which can be costly and time-consuming. The paper aims to bridge this gap by enabling robust testing of CPS designs using executable models, specifically at the Software-in-the-Loop (SiL) stage.
Methods
The core contribution is a SysML-based modeling methodology coupled with an efficient SysML-Simulink co-simulation framework.
The methodology involves:
- SysML for modeling: Using SysML for structural and behavioral modeling of the CPS, including its software architecture and behavior.
- Simulink for function models: Leveraging Simulink for modeling control algorithms and physical environments.
- A dedicated SysML profile: This profile extends standard SysML to capture aspects crucial for testable models, such as task scheduling, data types (like matrices, which SysML doesn't natively support), and configuration details.
- Information Model: A structured way to represent the System Under Test (SUT) and its environment, detailing blocks, tasks, and data exchanges.
- Modeling Steps: A three-step process for specifying the SUT environment, architecture, and behavior, emphasizing the use of SysML diagrams (BDDs, iBDs, ADs, SMs).
- Integration Points: Defined using opaque actions in SysML's Activity Diagrams to specify how SysML models interact with Simulink models.
The co-simulation framework is built upon this methodology:
- Code Generator: Automatically generates C++ code for a CPS simulator from the SysML models.
- SysML-Simulink Integration: The generated simulator invokes Simulink models via the MATLAB runtime, enabling synchronized execution.
- Static Cyclic Scheduler (SCS): The simulator employs an SCS for task scheduling, derived from SysML stereotypes.
- Controllability and Observability: The framework supports precise simulation of task scheduling and data flows (controllability) and generates detailed, timestamped execution traces (observability).
- External Event Handling: The simulator can process predefined external events at specific simulated times.
Datasets
Not discussed in the paper. The evaluation was performed on a case study from the satellite domain (Attitude Determination and Control System - ADCS) developed by LuxSpace Sàrl.
Key Insights and Ideas
- Early-stage testing is crucial for CPS: The paper strongly advocates for shifting testing to earlier design phases (SiL) using executable models to catch faults before costly hardware development.
- SysML and Simulink are a powerful combination: By integrating these industry-standard tools, the approach leverages existing expertise and toolchains, making it more practical for industrial adoption.
- SysML's limitations require extensions: The need for a dedicated SysML profile highlights that standard SysML alone is insufficient for capturing all necessary details for testable CPS models, especially regarding execution and scheduling.
- Co-simulation requires careful orchestration: The framework's ability to synchronize SysML and Simulink execution, manage data flows, and handle events is key to achieving realistic simulation results.
- Execution traces are vital for analysis: The generated traces provide the necessary "observability" to understand system behavior and verify properties, which is a significant challenge in complex systems.
Key Results
- Efficiency: The co-simulation framework is demonstrated to be efficient enough for practical model testing. For a realistic satellite case study, executing 100,000 seconds of simulated time took between 8.2 to 9.7 hours, with a ratio of execution time to simulated time of approximately 0.3-0.4.
- Overhead of Test Cases: Running a large number of test cases (1000) with shorter simulation spans incurred more overhead (approx. 1.5 hours extra) compared to fewer test cases (20) with longer spans, primarily due to Simulink model initialization. This suggests that optimizing initialization or parallelizing test execution could further improve efficiency.
- Modeling Effort: Building the SysML model for the case study (40 blocks, 30 ADs, 1 SM) took approximately 2 man-months, plus an additional week for training engineers. The most laborious parts were integrating Simulink models and specifying software behavioral aspects.
- Requirements Fulfillment: The proposed methodology and framework successfully address the key requirements for model testing of CPSs: Efficiency (EFF), SysML-Simulink Co-simulation (CO-S), No User Intervention (NO-U), Controllability (CONT), and Observability (OBS).
Limitations and Future Work
- Limitations:
- The paper acknowledges that performance bottlenecks are primarily due to the execution of Simulink models.
- The current methodology does not decompose SUT subsystems into sub-subsystems, limiting the depth of architectural modeling.
- The analysis of existing co-simulation frameworks revealed that none fully met all requirements, necessitating the proposed solution.
- Future Work:
- The authors plan to combine their approach with more sophisticated techniques for automatic test case generation and test oracle generation to conduct more effective testing.
- Further research could explore parallelizing the co-simulation process on multiple cores to improve efficiency.
- Investigating more advanced modeling techniques for deeper architectural decomposition could be beneficial.
Summary updated