| 摘要: |
| 路径测试是一种非常重要且应用广泛的结构测试方法, 已有路径生成方法的测试效率不高、测试开销较大, 且易生成冗余测试路径. 针对以上问题, 主要研究路径选择问题的优化模型及其进化求解方法, 目的在于: 在不降低测试覆盖率的前提下, 减少冗余路径的数量, 降低测试消耗. 首先, 以多条路径作为决策变量, 基于该决策变量包含的边数和路径数, 建立多目标优化模型; 然后, 采用多目标进化算法求解该模型, 得到目标路径集. 将所提方法应用于7个基准测试程序, 并与其他算法比较. 实验结果表明, 相比其他算法, 所提方法能够在保证测试充分性的条件下, 降低测试消耗, 从而提高测试效率. |
| 关键词: 路径测试 路径选择 多目标优化 带精英策略的非支配排序遗传算法 Pareto最优解集 |
| DOI:10.13328/j.cnki.jos.006387 |
| 分类号:TP311 |
| 基金项目:国家自然科学基金(61773384, 61763026, 61673404); 国家重点研发计划(2018YFB1003802-01); 山东省自然科学基金(ZR2020MF084) |
|
| Optimization Model of Path Selection for Software Testing and Its Evolution-based Solution |
|
DU Ying1, SUN Bai-Cai1, GONG Dun-Wei1, TIAN Tian2, YAO Xiang-Juan3
|
|
1.School of Information and Control Engineering, China University of Mining and Technology, Xuzhou 221116, China;2.School of Computer Science and Technology, Shandong Jianzhu University, Jinan 251100, China;3.School of Mathematics, China University of Mining and Technology, Xuzhou 221116, China
|
| Abstract: |
| Path testing is a very important and widely used structural testing method. Existing path generation methods are either time-consuming or labor-intensive, or they can generate a large number of redundant paths. To solve the above problem, this work mainly studies the optimization model of path selection problem and its evolutionary solution method. The purpose is to reduce the number of redundant paths and reduce test consumption without reducing test coverage. First, a number of paths are selected as the decision variable, and the number of edges and paths included in these paths are taken as the objective to formulate a multi-objective optimization model. Then, the multi-objective evolutionary algorithm is employed to solve the formulated model with the purpose of obtaining the target path set. The proposed method is applied to test 7 benchmark programs and it is compared with the existing method and greedy algorithm. Experimental results show that, compared with other algorithms, the proposed method can reduce the test consumption under the condition of ensuring test sufficiency, thereby improving the test efficiency. |
| Key words: path testing path selection multi-objective optimization non-dominated sorting genetic algorithm with elitism Pareto-optimal solution set |