电子学报 ›› 2021, Vol. 49 ›› Issue (7): 1386-1391.DOI: 10.12263/DZXB.20200426

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

基于支持向量机回归模型的测试用例生成与重用

钱忠胜, 俞情媛, 宋涛, 朱懿敏, 祝洁, 赵畅   

  1. 江西财经大学信息管理学院, 江西 南昌 330013
  • 收稿日期:2020-05-08 修回日期:2021-02-26 出版日期:2021-07-25 发布日期:2021-08-11
  • 作者简介:钱忠胜(通信作者) 男,1977年1月出生,江西鹰潭人.2008年在上海大学获工学博士学位.现为江西财经大学教授,博士生导师.主要研究方向为软件工程等.E⁃mail:changesme@163.com
    俞情媛 女,1997年5月出生,江苏淮安人.江西财经大学信息管理学院硕士研究生.主要研究方向为软件测试等.
  • 基金资助:
    国家自然科学基金(61762041);江西省自然科学基金(20181BAB202009);江西省教育厅科技重点项目(GJJ180250)

Test Case Generation and Reuse Based on Support Vector Machine Regression Model

Zhong-sheng QIAN, Qing-yuan YU, Tao SONG, Yi-min ZHU, Jie ZHU, Chang ZHAO   

  1. School of Information Management,Jiangxi University of Finance & Economics,Nanchang,Jiangxi 330013,China
  • Received:2020-05-08 Revised:2021-02-26 Online:2021-07-25 Published:2021-08-11

摘要:

在软件测试领域,利用遗传算法生成测试用例是一个研究热点.传统方法在利用遗传算法生成测试用例时,需要计算每个个体的适应度.为了降低适应度计算的时间消耗并重用测试用例,提出一种融入支持向量机回归模型的测试用例生成与重用的方法.在使用遗传算法生成测试用例的过程中,利用一定数量的个体及其适应度作为样本训练支持向量机回归模型.在之后的种群进化中,根据回归模型计算个体适应度,同时利用回归模型查找适应度较高的个体并重用到新种群的进化中.在某大型程序实验中,该方法与同类经典方法相比,覆盖率提高了3%,平均进化代数也有所降低,其降低百分比达85.97%.

关键词: 测试用例, 测试重用, 支持向量机, 遗传算法, 适应度

Abstract:

In the field of software testing, it is a hot research spot to generate test cases using genetic algorithm. In the traditional process of generating test cases by genetic algorithm, it is necessary to calculate the fitness of each individual. In order to reduce the time consumption of fitness calculation and reuse test cases, a test case generation and reuse method based on support vector machine regression model is proposed. In the process of using genetic algorithm to generate test cases, a certain number of individuals and their fitness are used as samples to train the support vector machine regression model. In the subsequent population evolution, individual fitness is calculated according to the regression model. At the same time, individuals with higher fitness are found by the regression model and applied to the evolution of the new population. In the experiment on a large program, compared with that of the same classical method, the coverage rate of this approach is increased by 3% and the average evolutional time is also reduced by 85.97%.

Key words: test case, test reuse, support vector machine, genetic algorithm, fitness

中图分类号: