江西财经大学信息管理学院,江西南昌 330013
[ "钱忠胜 男,1977年1月出生,江西鹰潭人.2008年在上海大学获工学博士学位.江西财经大学教授,博士生导师.主要研究方向为软件工程、机器学习、智能化软件等.E-mail: changesme@163.com" ]
[ "宋佳 女,1997年6月出生,四川眉山人.江西财经大学信息管理学院硕士研究生. 主要研究方向为软件工程、智能推荐系统等." ]
收稿:2021-07-20,
修回:2021-10-02,
纸质出版:2022-07-25
移动端阅览
钱忠胜,宋佳,俞情媛等.利用函数影响力的相似程序间测试用例重用与生成[J].电子学报,2022,50(07):1696-1707.
QIAN Zhong-sheng,SONG Jia,YU Qing-yuan,et al.Test Case Reuse and Generation Between Similar Programs Based on Function Influence[J].ACTA ELECTRONICA SINICA,2022,50(07):1696-1707.
钱忠胜,宋佳,俞情媛等.利用函数影响力的相似程序间测试用例重用与生成[J].电子学报,2022,50(07):1696-1707. DOI: 10.12263/DZXB.20210953.
QIAN Zhong-sheng,SONG Jia,YU Qing-yuan,et al.Test Case Reuse and Generation Between Similar Programs Based on Function Influence[J].ACTA ELECTRONICA SINICA,2022,50(07):1696-1707. DOI: 10.12263/DZXB.20210953.
在回归测试过程中,用例重用是一项很重要的工作,其充分利用软件升级变更前的已有资源,提高测试的效率.从已有研究来看,回归测试的研究大部分侧重于用例优化方面,少部分提到利用程序升级变更前后的相似性来重用测试用例以提高用例生成效率.针对回归测试用例重用问题,提出一种重用变更前相似程序的测试信息,并通过设计的适应度函数为变更后程序进化生成新用例的方法.该方法利用构建的函数调用图进行程序相似部分的检测,并根据函数影响力设计适应度函数来调整个体的适应度值,保留适应度值高的优秀个体;再通过重用变更前相似部分的用例,以及进化生成的变更后的部分用例,来构成回归测试中新程序的用例.实验结果表明,在目标路径覆盖率上,对于中小规模和大规模工业程序,本文方法比经典方法分别可提高8%和17%.
In the process of regression testing
the reuse of test cases is a critical activity. It makes full use of the resources before updating the software to improve the efficiency of software testing. According to the existing results
most of them on regression testing focus on the test case prioritization
and a few mention the use of similarity before and after the programs upgrade changes to reuse test cases to improve the efficiency of test case generation. Aiming at the test case reuse in regression testing
this paper proposes an approach to reuse test data of similar programs before the change
and employs the fitness function designed to evolve to generate new test cases for the program after the change. It utilizes the function call graph constructed to detect similar parts of the programs. And according to the function influence
the fitness function is designed to adjust the fitness value of the individual
and excellent individuals with high fitness value are retained. Then
it reuses the test cases of the similar part before the change and the part of the test cases generated in the evolutionary process after the change
to form the test cases of the new program in the regression test. The experimental results show that
compared to the classical methods
the target path coverage rate of the proposed method is increased by 8% and 17% for small- and medium-sized
and large-sized industrial programs
respectively.
DI NUCCI D , PANICHELLA A , ZAIDMAN A , et al . A test case prioritization genetic algorithm guided by the hypervolume indicator [J]. IEEE Transactions on Software Engineering , 2020 , 46 ( 6 ): 674 - 696 .
PEI Han-yu , YIN Bei-bei , XIE Min , et al . Dynamic random testing with test case clustering and distance-based parameter adjustment [J/OL]. Information and Software Technology , 2021 , 131 : 106470 . https://doi.org/10.1016/j.infsof.2020.106470 https://doi.org/10.1016/j.infsof.2020.106470 .
NAIR A , ROY A , MEINKE K . funcGNN: A graph neural network approach to program similarity [C]// ESEM'20: Proceedings of the 14th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement(ESEM) . New York, USA : ACM , 2020 : 1 - 11 .
李玫 , 高庆 , 马森 , 等 . 面向代码相似性检测的相似哈希改进方法 [J]. 软件学报 , 2021 , 32 ( 7 ): 2242 - 2259 .
LI Mei , GAO Qing , MA Sen , et al . Enhanced simhash algorithm for code similarity detection [J]. Journal of Software , 2021 , 32 ( 7 ): 2242 - 2259 . (in Chinese)
刘芳 , 李戈 , 胡星 , 等 . 基于深度学习的程序理解研究进展 [J]. 计算机研究与发展 , 2019 , 56 ( 8 ): 1605 - 1620 .
LIU Fang , LI Ge , HU Xing , et al . Program comprehension based on deep learning [J]. Journal of Computer Research and Development , 2019 , 56 ( 8 ): 1605 - 1620 . (in Chinese)
ZHANG B , SHAN C , HUSSAIN M , et al . Software crucial functions ranking and detection in dynamic execution sequence patterns [J]. International Journal of Software Engineering and Knowledge Engineering , 2020 , 30 ( 5 ): 695 - 719 .
夏春艳 , 张岩 , 万里 , 等 . 基于否定选择遗传算法的路径覆盖测试数据生成 [J]. 电子学报 , 2019 , 47 ( 12 ): 2630 - 2638 .
XIA Chun-yan , ZHANG Yan , WAN Li , et al . Test data generation of path coverage based on negative selection genetic algorithm [J]. Acta Electronica Sinica , 2019 , 47 ( 12 ): 2630 - 2638 . (in Chinese)
王曙燕 , 王瑞 , 孙家泽 . 基于改进细菌觅食算法的测试用例生成方法 [J]. 计算机应用 , 2019 , 39 ( 3 ): 845 - 850 .
WANG Shu-yan , WANG Rui , SUN Jia-ze . Test case generation method based on improved bacterial foraging optimization algorithm [J]. Journal of Computer Applications , 2019 , 39 ( 3 ): 845 - 850 . (in Chinese)
夏春艳 , 张岩 , 宋丽 . 基于节点概率的路径覆盖测试数据进化生成 [J]. 软件学报 , 2016 , 27 ( 4 ): 802 - 813 .
XIA Chun-yan , ZHANG Yan , SONG Li . Evolutionary generation of test data for paths coverage based on node probability [J]. Journal of Software , 2016 , 27 ( 4 ): 802 - 813 . (in Chinese)
姚香娟 , 巩敦卫 , 李彬 . 融入神经网络的路径覆盖测试数据进化生成 [J]. 软件学报 , 2016 , 27 ( 4 ): 828 - 838 .
YAO Xiang-juan , GONG Dun-wei , LI Bin . Evolutional test data generation for path coverage by integrating neural network [J]. Journal of Software , 2016 , 27 ( 4 ): 828 - 838 . (in Chinese)
ZHAO G , HUANG J . DeepSim: Deep learning code functional similarity [C]// ESEC/FSE 2018: Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering . New York, USA : ACM , 2018 : 141 - 151 .
LIU B C , HUO W , ZHANG C , et al . αDiff: cross-version binary code similarity detection with DNN [C]// ASE 2018: Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering . New York, USA : ACM , 2018 : 667 - 678 .
汪洁 , 王长青 . 子图相似性的恶意程序检测方法 [J]. 软件学报 , 2020 , 31 ( 11 ): 3436 - 3447 .
WANG Jie , WANG Chang-qing . Malware detection method based on subgraph similarity [J]. Journal of Software , 2020 , 31 ( 11 ): 3436 - 3447 . (in Chinese)
MU Y M , GAO X X , SHEN M E . Research of reuse technology of test case based on function calling path [J]. Chinese Journal of Electronics , 2018 , 27 ( 4 ): 768 - 775 .
钱忠胜 , 俞情媛 , 宋涛 , 等 . 基于支持向量机回归模型的测试用例生成与重用 [J]. 电子学报 , 2021 , 49 ( 7 ): 1386 - 1391 .
QIAN Zhong-sheng , YU Qing-yuan , SONG Tao , et al . Test case generation and reuse based on support vector machine regression model [J]. Acta Electronica Sinica , 2021 , 49 ( 7 ): 1386 - 1391 . (in Chinese)
廖伟志 , 夏小云 , 贾小军 . 基于蚁群算法的多路径覆盖测试数据生成 [J]. 电子学报 , 2020 , 48 ( 7 ): 1330 - 1342 .
LIAO Wei-zhi , XIA Xiao-yun , JIA Xiao-jun . Test data generation for multiple paths coverage based on ant colony algorithm [J]. Acta Electronica Sinica , 2020 , 48 ( 7 ): 1330 - 1342 . (in Chinese)
范书平 , 张岩 , 马宝英 , 等 . 基于均衡优化理论的路径覆盖测试数据进化生成 [J]. 电子学报 , 2020 , 48 ( 7 ): 1303 - 1310 .
FAN Shu-ping , ZHANG Yan , MA Bao-ying , et al . Evolutionary generation of test data for paths coverage based on balance optimization theory [J]. Acta Electronica Sinica , 2020 , 48 ( 7 ): 1303 - 1310 . (in Chinese)
BAJAJ A , SANGWAN O P . A survey on regression testing using nature-inspired approaches [C]// Proceedings of the 2018 4th International Conference on Computing Communication and Automation(ICCCA) . Greater Noida, India : IEEE , 2018 : 1 - 5 .
0
浏览量
10
下载量
0
CSCD
关联资源
相关文章
相关作者
相关机构
京公网安备11010802024621