电子学报 ›› 2020, Vol. 48 ›› Issue (7): 1303-1310.DOI: 10.3969/j.issn.0372-2112.2020.07.008

• 学术论文 • 上一篇    下一篇

基于均衡优化理论的路径覆盖测试数据进化生成

范书平1, 张岩1, 马宝英2, 万里3, 姚念民4, 宋妍1   

  1. 1. 牡丹江师范学院计算机与信息技术学院, 黑龙江牡丹江 157011;
    2. 牡丹江医学院卫生管理学院, 黑龙江牡丹江 157011;
    3. 天津大学智能与计算学部, 天津 300350;
    4. 大连理工大学计算机科学与技术学院, 辽宁大连 116024
  • 收稿日期:2019-05-08 修回日期:2019-12-06 出版日期:2020-07-25
    • 通讯作者:
    • 马宝英
    • 作者简介:
    • 范书平 男,1977年出生,黑龙江牡丹江人.副教授,CCF会员,主要从事复杂软件的测试数据生成和进化计算研究.E-mail:f8259@163.com;张岩 女,1972年出生,辽宁本溪人.教授,CCF会员,主要研究方向为基于搜索的软件工程、进化计算.E-mail:zhangyancumt@126.com;万里 男,1994年出生,湖北荆州人.天津大学在读研究生,主要研究软件测试、语音信号处理;姚念民 男,1974年出生,黑龙江大庆人.教授,主要从事基于搜索的软件工程的研究;宋妍 女,1977年出生,黑龙江牡丹江人.副教授,主要研究方向为复杂软件的测试数据生成.
    • 基金资助:
    • 黑龙江省省属高等学校基本科研业务费 (No.1353ZD003,No.2018-KYYWFMY-0104); 黑龙江省自然科学基金 (No.F2016039); 牡丹江市科学技术计划项目 (No.Z2018g023); 牡丹江师范学院科学技术研究项目 (No.YB2019003); 大连市科技创新项目 (No.2018J12GX045)

Evolutionary Generation of Test Data for Paths Coverage Based on Balance Optimization Theory

FAN Shu-ping1, ZHANG Yan1, MA Bao-ying2, WAN li3, YAO Nian-min4, SONG Yan1   

  1. 1. School of Computer and Information Technology, Mudanjiang Normal University, Mudanjiang, Heilongjiang 157011, China;
    2. School of Health Management, Mudanjiang Medical University, Mudanjiang, Heilongjiang 157011, China;
    3. Department of Intelligence and Computing, Tianjin University, Tianjin 300350, China;
    4. School of Computer Science and Technology, Dalian University of Technology, Dalian, Liaoning 116024, China
  • Received:2019-05-08 Revised:2019-12-06 Online:2020-07-25 Published:2020-07-25

摘要: 为了快速生成覆盖目标路径的测试数据,提出在测试数据进化生成中,利用种群中个体穿越程序各分支的均衡程度调整进化过程.首先,在个体运行被测程序后,统计个体穿越各分支节点真假分支的情况;然后,设计并计算个体穿越程序的均衡度;最后,计算个体对程序均衡度的影响,使对程序均衡度影响大的个体具有较高的适应值,有更多机会参与到后续进化中,有效地提高了测试数据的生成效率.基准程序和工业用例的实验结果表明,与同类方法比较,所提出的方法在生成测试数据的运行时间与成功率方面具有优越性.

关键词: 软件测试, 路径覆盖, 遗传算法, 测试数据, 程序均衡度

Abstract: In order to speed up the generation of test data that covers the target path,the paper makes good use of the balance of individual traversing program to adjust the evolutionary process of generating test data.First,after the individuals run the program,the number of individuals crossing the true and false branches of each branch node is counted.Then,the program balance is designed and calculated.Finally,the influence on the program balance of each individual is calculated.The individual with high influence has a bigger fitness value to have greater chance to participate in subsequent evolution.The proposed method effectively improves the efficiency of test data generation.The experiment results of benchmark programs and industrial cases show that our methods have superiority in running time and success rate of test data generation when compared with similar methods.

Key words: software testing, path coverage, genetic algorithm, test data, program balance

中图分类号: