光学 精密工程, 2016, 24 (5): 1185, 网络出版: 2016-06-15
基于需求模型的航天软件测试用例生成方法
Test case generation of aerospace software based on modeling requirements
软件测试 航天软件 测试用例生成 用例约简 测试需求 模型 software test aerospace software test case generation optimization of test case test requirement model
摘要
为了提高航天软件测试的效率和覆盖率, 增加航天软件测试的有效性, 提出了一种基于需求模型的软件测试用例设计方法。针对航天软件测试的特点, 该方法采用从用例层深入至步骤层的测试优化策略。首先, 基于元建模方法定义了一种测试需求模型; 通过建立模型, 将测试需求加以拆分, 获取了测试需求之间的先后依赖关系以及测试需求与测试步骤之间的对应关系。然后, 基于测试需求模型, 构建了测试需求的路径图, 进而通过对图的遍历获得了测试用例。最后, 将该方法用于工程实践进行了实验验证。验证结果表明, 该方法有效保证了测试活动的充分性和有效性, 降低了测试用例约简的风险。与不约简的测试方法相比, 该方法减少测试工作量达18%, 减少测试用例数量为40%以上, 软件测试的执行时间也减少了40%以上, 在满足需求覆盖率的同时, 有效提高了测试效率。
Abstract
A model-driven software test case generation approach was researched to improve the efficiency and coverage rate of aerospace soft test and to increase the validity of test. According to the characteristics of aerospace software test, the strategy of step-layer test case optimization was put forward instead of case-layer optimization. Firstly, a model for testing requirements was presented based on meta-modeling method. Then, the test requirements were split by model building to obtain the relationship between the test requirements and the dependence of the test requirements on the test steps. With the constructed path graph of test requirements, test cases were gotten based on traversing for the graph. Finally, the approach was applied to the test of aerospace software test. The results of application show that this approach reduces the risk of test case optimization and is effective to ensuring the adequacy and validity of testing activities. The number of test cases are reduced more than 40%, and the whole workload of test is saved more than 18%. It meets the coverage rate of software test and improves the efficiency of test.
哈清华, 刘大有, 沈湘衡, 刘逻. 基于需求模型的航天软件测试用例生成方法[J]. 光学 精密工程, 2016, 24(5): 1185. HA Qing-hua, LIU Da-you, SHEN Xiang-heng, LIU Luo. Test case generation of aerospace software based on modeling requirements[J]. Optics and Precision Engineering, 2016, 24(5): 1185.