计算机应用 ›› 2016, Vol. 36 ›› Issue (9): 2492-2496.DOI: 10.11772/j.issn.1001-9081.2016.09.2492

• 计算机软件技术 • 上一篇    下一篇

基于自适应粒子群优化算法的测试数据扩增方法

王曙燕, 温春琰, 孙家泽   

  1. 西安邮电大学 计算机学院, 西安 710061
  • 收稿日期:2016-01-27 修回日期:2016-03-07 出版日期:2016-09-10 发布日期:2016-09-08
  • 通讯作者: 温春琰
  • 作者简介:王曙燕(1964-),女,陕西西安人,教授,博士,CCF会员,主要研究方向:软件测试、数据挖掘、智能信息处理;温春琰(1991-),男,河南南阳人,硕士研究生,主要研究方向:软件设计与测试、数据挖掘;孙家泽(1980-),男,陕西西安人,副教授,博士,CCF会员,主要研究方向:软件测试、数据挖掘、智能信息处理。
  • 基金资助:
    陕西省自然科学基金资助项目(2015JM6359);西安市科技计划项目(CXY1516(4));陕西省教育厅自然科学基金资助项目(15JK1672,15JK1678);陕西省工业攻关项目(2016GY-089)。

Test data augmentation method based on adaptive particle swarm optimization algorithm

WANG Shuyan, WEN Chunyan, SUN Jiaze   

  1. School of Computer Science and Technology, Xi'an University of Posts and Telecommunications, Xi'an Shaanxi 710061, China
  • Received:2016-01-27 Revised:2016-03-07 Online:2016-09-10 Published:2016-09-08
  • Supported by:
    This work is partially supported by the Science Foundation of Shaanxi Province (2015JM6359), the Science and Technology Project Foundation of Xi'an City (CXY1516 (4)), the Science Foundation of Education Ministry of Shaanxi Province (15JK1672, 15JK1678), the Industrial Research Project of Shaanxi Province (2016GY-089).

摘要: 针对在回归测试中原有测试数据集往往难以满足新版本软件测试需求的问题,提出一种基于自适应粒子群算法(APSO)的测试数据扩增方法。首先,根据原有测试数据在新版本程序上的穿越路径与目标路径的相似度,在原有的测试数据集中选择合适的测试数据,作为初始种群的进化个体;然后,利用初始测试数据的穿越路径与目标路径的不同子路径,确定造成两者路径偏离的输入分量;最后,根据路径相似度构建适应度函数,利用APSO操作输入分量,生成新的测试数据。该方法针对四个基准程序与基于遗传算法(GA)和随机法的测试数据扩增方法相比,测试数据扩增效率分别平均提高了约56%和81%。实验结果表明,所提方法在回归测试方面有效地提高了测试数据扩增的效率,增强了其稳定性。

关键词: 回归测试, 目标路径, 测试数据扩增, 路径相似度, 粒子群优化算法

Abstract: It is difficult for the original test data to meet the requirements of the new version of software testing in regression testing, thus a new test data augmentation method based on Adaptive Particle Swarm Optimization (APSO) algorithm was proposed to solve the problem. Firstly, according to the similarity between the cross path and the target path of the original test data in the new version of the program, the appropriate test data in the original test data was chosen as evolutionary individual of initial population. Secondly, taking advantage of different sub-paths of the cross path of initial test data and target path, the input component which caused deviation between them was confirmed. Finally, the fitness function was created according to the path similarity, and the new data was generated by using the APSO algorithm to operate the input component. Compared with the genetic algorithm based and random algorithm based test data augmentation methods on four benchmark programs, the augmentation efficiency of the proposed method was improved on average by approximately 56% and 81% respectively. The experimental results show that the proposed method can effectively increase the efficiency and improve the stability of test data augmentation in regression testing.

Key words: regression testing, target path, test data augmentation, path similarity, Particle Swarm Optimization (PSO) algorithm

中图分类号: