HSTCG: State-Aware Simulink Model Test Case Generation With Heuristic Strategy
- 15 July 2024
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 50 (12) , 3088-3103
Abstract
Simulink has gained widespread recognition as a valuable tool for system design. It supports efficient modeling and synthesis of embedded controllers. Test cases can also be automatically generated to simulate and verify the correctness of the Simulink model. Nevertheless, as systems grow increasingly complex, particularly in terms of their internal states, this complexity poses new challenges for existing model testing methodologies. Traditional techniques such as constraint solving and random search encounter difficulties when attempting to explore the intricate logic embedded within these models. In this paper, we introduce HSTCG, a state-aware test case generation method for Simulink models with heuristic strategy. HSTCG solves only one iteration of the model each time to get the test input that can cover a target branch, then executes the model once to obtain and update the new model state based on the solved input dynamically. Then, it solves the remaining branches based on the new model state iteratively until all the coverage requirements are satisfied. To improve the efficiency of test case generation, we also designed a heuristic strategy containing heuristic branch searching, repeated state filter and unreached branch filter to minimize the times of constraint solving. We implemented HSTCG and evaluated it on several benchmark Simulink models. Compared to the built-in Simulink Design Verifier and state-of-the-art academic work SimCoTest, HSTCG achieves an average improvement of 55% and 103% on Decision Coverage, 53% and 62% on Condition Coverage and 192% and 201% on Modified Condition Decision Coverage, respectively. We also validated the significant improvement of the heuristic strategy, which can improve the efficiency of test case generation by 62.2% on average.Keywords
Funding Information
- National Key Research and Development Project (2022YFB3104000)
- China Postdocoral Science Foundation (BX20230183, 2023M731954)
- NSFC Program (92167101, 62021002, 62372263)
This publication has 39 references indexed in Scilit:
- CPSDebug: Automatic failure explanation in CPS modelsInternational Journal on Software Tools for Technology Transfer, 2021
- A Survey on Model-Based Testing Tools for Test Case Generation2017
- Automatic test case generation from Simulink/Stateflow models using model checkingSoftware Testing, Verification and Reliability, 2013
- CVC42011
- Automated Test Case Generation with SMT-Solving and Abstract Interpretation2011
- An Instrumentation-Based Approach to Controller Model ValidationLecture Notes in Computer Science, 2008
- Z3: An Efficient SMT Solver2008
- SCADE: Synchronous Design and Validation of Embedded Control Software2007
- 14 Tools for Test Case GenerationLecture Notes in Computer Science, 2005
- Symbolic Model Checking1993