DFS-KeyLevel: A Two-Layer Test Scenario Generation Approach for UML Activity Diagram
Xiaozhi Du,Jinjin Zhang,Kai Chen,Yanrong Zhou
DOI: https://doi.org/10.1007/s10836-023-06045-y
2023-01-01
Journal of Electronic Testing
Abstract:For automatic generation of test scenarios from UML (Unified Modeling Language) activity diagrams (ADs) are very important for improving test efficiency. However, state-of-the-art approaches mainly focus on simple approaches, without specifically considering the case of concurrent activity, which may result in the path explosion problem during the generation of test scenarios. In this paper, we put forward DFS-KeyLevel, a two-layer test scenario generation approach for UML Activity Diagram. First, the ADs of the software under test are modeled and preprocessed, and each concurrent module in each AD is simplified to a composite node. Then, primary test scenarios are generated from the concurrent activity modules using our proposed KeyLevel method. Next, the high-layer test scenarios are generated from the simplified AD with our improved Depth-First Search (DFS) algorithm. Finally, the primary and high-layer test scenarios are combined to generate the final test scenarios for the AD. The experimental results show that this DFS-KeyLevel is superior to the previous approaches. The DFS-KeyLevel can generate more test scenarios under constraints. Compared with DFS-LevelPermutes, the number of test scenarios generated by our DFS-KeyLevel is 1.13 times higher. Compared with Depth-First Search and Breadth-First Search (DFS-BFS) and Improved-DFS (IDFS), the DFS-KeyLevel produced 2.37 times test scenarios. The average coverage rates of staggered activities and total activity logical path coverage (TALPC) of the DFS-KeyLevel are 83.67% and 84% respectively, which is significantly higher than the above three approaches. In addition, when our method is applied to a real embedded system, it significantly reduces test scenarios generated to avoid path explosion while ensuring enough test scenarios.