电子学报 ›› 2019, Vol. 47 ›› Issue (12): 2630-2638.DOI: 10.3969/j.issn.0372-2112.2019.12.024

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

基于否定选择遗传算法的路径覆盖测试数据生成

夏春艳1, 张岩1, 万里2, 宋妍1, 肖楠1, 郭冰1   

  1. 1. 牡丹江师范学院计算机与信息技术学院, 黑龙江牡丹江 157012;
    2. 天津大学智能与计算学部, 天津 300350
  • 收稿日期:2018-08-20 修回日期:2018-10-18 出版日期:2019-12-25
    • 通讯作者:
    • 张岩
    • 作者简介:
    • 夏春艳 女,1980年3月出生,黑龙江桦川人.副教授,CCF会员.2007年毕业于长春理工大学计算机应用技术专业,获得硕士学位.现为牡丹江师范学院教师,主要从事软件工程、数据挖掘等方面的研究工作.E-mail:xia-chun-yan@163.com;万里 男,1994年4月出生,湖北松滋人.2018年进入天津大学智能与计算学部.现为硕士研究生,主要从事人工智能、软件工程等方面的有关研究.E-mail:1151843852@qq.com;宋妍 女,1977年出生,黑龙江牡丹江人.现为牡丹江师范学院教师,硕士,研究方向为软件工程、大数据技术.;肖楠 女,1983年出生,黑龙江牡丹江人.现为牡丹江师范学院教师,硕士,研究方向为基于搜索的软件工程.;郭冰 女,2000年出生,河北省唐山市人.现为牡丹江师范学院学生,本科.研究方向为基于搜索的软件工程.
    • 基金资助:
    • 黑龙江省教育厅基本科研业务费 (No.1353MSYYB005); 牡丹江师范学院科学技术研究 (No.YB2018004,No.GP201602); 黑龙江省自然科学基金 (No.F2016039); 黑龙江省教育厅 (No.1353ZD003,No.1353MSYYB007,No.1353MSYQN006); 牡丹江市科技计划 (No.Z2016s0027,No.Z2018s073); 牡丹江师范学院大学生创新训练项目 (No.201910233006)

Test Data Generation of Path Coverage Based on Negative Selection Genetic Algorithm

XIA Chun-yan1, ZHANG Yan1, WAN Li2, SONG Yan1, XIAO Nan1, GUO Bing1   

  1. 1. School of Computer and Information Technology, Mudanjiang Normal University, Mudanjiang, Heilongjiang 157012, China;
    2. Tianjin University Division of Intelligence and Computing, Tianjin University, Tianjin 300350, China
  • Received:2018-08-20 Revised:2018-10-18 Online:2019-12-25 Published:2019-12-25
    • Corresponding author:
    • ZHANG Ya
    • Supported by:
    • Fundamental Research Funds of Education Department of Heilongjiang Province (No.1353MSYYB005); Science and Technology Research Program of Mudanjiang Normal University (No.YB2018004, No.GP201602); Natural Science Foundation of Heilongjiang Province,  China (No.F2016039); Education Department of Heilongjiang Province (No.1353ZD003, No.1353MSYYB007, No.1353MSYQN006); Project of Science and Technology Plan of Mudanjiang (No.Z2016s0027, No.Z2018s073); Innovative Training Program for College Students in Mudanjiang Normal University (No.201910233006)

摘要: 路径覆盖是软件测试领域重要的测试方法之一.在搜索空间中,找到一组测试数据满足路径覆盖是一个具有挑战性的问题.因此,自动生成测试数据是软件测试的关键问题.文中提出一种基于否定选择遗传算法的路径覆盖测试数据生成方法,将否定选择策略融入遗传算法,动态优化遗传算法的种群数据,自动生成覆盖目标路径的测试数据.多个基准程序和工业程序的实验结果表明,与随机方法和遗传算法比较,文中方法能够提高路径覆盖率,减少冗余测试数据的生成.

关键词: 软件测试, 遗传算法, 否定选择, 路径覆盖, 测试数据

Abstract: Path coverage is one of the most important testing methods in the field of software testing. It is a challenging problem to find a set of test data to satisfy the path coverage in the search space. Therefore, automatically generating test data is a key issue in software testing. In this paper, a generation method of test data based on the negative selection genetic algorithm is proposed. The negative selection strategy is integrated into the genetic algorithm, and the population data of the genetic algorithm is dynamically optimized, and the test data covering the target path is automatically generated. The experimental results show that compared with the random method and the genetic algorithm, the proposed method can improve the path coverage and reduce the generation of redundant test data.

Key words: software test, genetic algorithm, negative selection, path coverage, test data

中图分类号: