计算机科学 ›› 2019, Vol. 46 ›› Issue (7): 146-150.doi: 10.11896/j.issn.1002-137X.2019.07.023

• 软件与数据库技术 • 上一篇    下一篇

基于粒子群优化算法的测试用例生成方法

张娜1,滕赛娜1,吴彪2,包晓安1   

  1. (浙江理工大学信息学院 杭州310018)1
    (山口大学东亚研究科 山口753-8514)2
  • 收稿日期:2018-06-07 出版日期:2019-07-15 发布日期:2019-07-15
  • 作者简介:张 娜(1977-),女,硕士,副教授,主要研究方向为软件工程、软件测试;滕赛娜(1994-),女,硕士生,主要研究方向为软件工程、软件测试;吴 彪(1989-),男,博士生,主要研究方向为软件工程、软件测试;包晓安(1973-),男,硕士,教授,主要研究方向为自适应软件、软件测试与智能信息处理,E-mail:baoxiaoan@zstu.edu.cn(通信作者)。
  • 基金资助:
    国家自然科学基金(61502430,61562015),广西自然科学重点基金(2015GXNSFDA139038),浙江理工大学521人才培养计划项目资助

Test Case Generation Method Based on Particle Swarm Optimization Algorithm

ZHANG Na1,TENG Sai-na1,WU Biao2,BAO Xiao-an1   

  1. (School of Information Science and Technology,Zhejiang Sci-tech University,Hangzhou 310018,China)1
    (The Graduate School of East Asian Studies,Yamaguchi University,Yamaguchi-shi 753-8514,Japan)2
  • Received:2018-06-07 Online:2019-07-15 Published:2019-07-15

摘要: 针对标准粒子群算法(Particle Swarm Optimization,PSO)中存在的早熟收敛、易于陷入局部极值的问题,提出了一种基于反向学习与再次搜索的粒子群优化算法(Reverse-Learning and Search-Again PSO,RSAPSO)用于测试用例生成。首先,通过非线性递减的惯性权重函数对学习因子进行改进,实现对种群的初步搜索,并采用梯度下降法完成对最优解与次优解的再次搜索;其次,以极值点为中心设定禁忌区域,对禁忌区域外的粒子进行反向学习,改善种群多样性;最后,采用分支距离法构造适应度函数,评判测试用例的优劣程度。实验结果表明,提出的改进方法在覆盖率、迭代次数和缺陷检测率指标上均有优势。

关键词: 测试用例生成, 反向学习, 粒子群算法, 学习因子, 再次搜索

Abstract: In order to solve the problem of premature convergence and being easy to fall into local extremum in standard particle swarm optimization,this paper put forward a particle swarm optimization based on reverse-learning and search-again for test case generation.Firstly,the learning factor is improved by the nonlinear decreasing inertia weight function,realizing the preliminary search for the population,and the gradient descent method is used to complete the search-again of the optimal solution and the suboptimal solution.Secondly,setting taboo areas with extreme points as the center,the population diversity is improved by the reverse learning of the particles outside the taboo region.Finally,the branch distance method is used to construct fitness function to evaluate the quality of test cases.Experiment results show that the proposed method has advantages in coverage,iteration times and defect detection rate.

Key words: Learning factors, Particle swarm optimization, Reverse learning, Search again, Test case generation

中图分类号: 

  • TP311
[1]CHEN H Y,TSE T H,CHEN T Y.TACCLE:a methodology for object-oriented software testing at the class and clusterle-vels.ACM Transactions on Software Engineering & Metho-dology,2001,10(1):56-109.
[2]GALLAGHER M N,ARASIMHAN V L.ADT EST:A Test Data Generation Suite for A da Software Systems[J].IEEE Transactions on Software Engineering,1997,23(8):473-484.
[3]SHI Y,EBERHART R C.Fuzzy adaptive particle swarm optimization[C]∥Proceedings of the IEEE Congress on Evolutio-nary Computation.Seoul,Korea,2001:101-106.
[4]XIA X W,LIU J N,GAO K F,et al.An improved particle swarm optimizer based on tabu detecting and local learning strategy in a shrunk search space[J].Applied Soft Computing,2014,23(1):76-90.(in Chinese)
夏学文,刘经南,高柯夫,等.具备反向学习和局部学习能力的粒子群算法[J].计算机学报,2015,38(7):1397-1407.
[5]MENDES R,KENNEDY J,NEVES J.The fully informed particle swarm:Simpler,maybe better[J].IEEE Transactions on Evolutionary Computation,2004,8(3):204-210.
[6]ZHANG Y,GONG D W,SUN X Y,et al.Adaptive barebones particle swarm optimization algorithm and its convergence analysis[J]. Soft Computing,2014,18(7):1337-1352.
[7]BAO X A,YANG Y J,ZHANG N,et al.Composite test case generation method based on Adaptive Particle Swarm Optimization[J].Computer Science,2017,44(6):177-181.(in Chinese)
[1] 周天清, 岳亚莉.
超密集物联网络中多任务多步计算卸载算法研究
Multi-Task and Multi-Step Computation Offloading in Ultra-dense IoT Networks
计算机科学, 2022, 49(6): 12-18. https://doi.org/10.11896/jsjkx.211200147
[2] 邱旭, 卞浩卜, 吴铭骁, 朱晓荣.
基于5G毫米波通信的高速公路车联网任务卸载算法研究
Study on Task Offloading Algorithm for Internet of Vehicles on Highway Based on 5G MillimeterWave Communication
计算机科学, 2022, 49(6): 25-31. https://doi.org/10.11896/jsjkx.211100198
[3] 徐汝利, 黄樟灿, 谢秦秦, 李华峰, 湛航.
基于金字塔演化策略的彩色图像多阈值分割
Multi-threshold Segmentation for Color Image Based on Pyramid Evolution Strategy
计算机科学, 2022, 49(6): 231-237. https://doi.org/10.11896/jsjkx.210300096
[4] 李晓东, 於志勇, 黄昉菀, 朱伟平, 涂淳钰, 郑伟楠.
面向河道环境监测的群智感知参与者选择策略
Participant Selection Strategies Based on Crowd Sensing for River Environmental Monitoring
计算机科学, 2022, 49(5): 371-379. https://doi.org/10.11896/jsjkx.210200005
[5] 孙振强, 罗永龙, 郑孝遥, 章海燕.
一种融合用户情感与相似度的智能旅游路径推荐方法
Intelligent Travel Route Recommendation Method Integrating User Emotion and Similarity
计算机科学, 2021, 48(6A): 226-230. https://doi.org/10.11896/jsjkx.200900119
[6] 刘炜, 李东坤, 徐畅, 田钊, 佘维.
应急通信网络中基于粒子群优化的信道分配算法
Channel Assignment Algorithm Based on Particle Swarm Optimization in Emergency Communication Networks
计算机科学, 2021, 48(5): 277-282. https://doi.org/10.11896/jsjkx.200400042
[7] 汪文轩, 胡军, 胡建成, 康介祥, 王辉, 高忠杰.
一种面向形式化表格需求模型的测试用例生成方法
Test Case Generation Method Oriented to Tabular Form Formal Requirement Model
计算机科学, 2021, 48(5): 16-24. https://doi.org/10.11896/jsjkx.201000048
[8] 刘奇, 陈红梅, 罗川.
基于改进的蝗虫优化算法的红细胞供应预测方法
Method for Prediction of Red Blood Cells Supply Based on Improved Grasshopper Optimization Algorithm
计算机科学, 2021, 48(2): 224-230. https://doi.org/10.11896/jsjkx.200600016
[9] 栾凌, 潘连武, 闫雷, 武小琳.
基于边缘计算的输变电工程全环节单元确认的精准造价智能管控技术研究
Research on Intelligent Control Technology of Accurate Cost for Unit Confirmation in All Links of Power Transmission and Transformation Project Based on Edge Computing
计算机科学, 2021, 48(11A): 688-692. https://doi.org/10.11896/jsjkx.201100200
[10] 张天瑞, 魏铭琦, 高秀秀.
基于IPSO-WRF的选择性激光烧结件气泡溶解时间预测模型
Prediction Model of Bubble Dissolution Time in Selective Laser Sintering Based on IPSO-WRF
计算机科学, 2021, 48(11A): 638-643. https://doi.org/10.11896/jsjkx.210300080
[11] 田梦丹, 梁晓磊, 符修文, 孙媛, 李章洪.
具有博弈概率选择的多子群粒子群算法
Multi-subgroup Particle Swarm Optimization Algorithm with Game Probability Selection
计算机科学, 2021, 48(10): 67-76. https://doi.org/10.11896/jsjkx.200800128
[12] 吉顺慧, 张鹏程.
基于支配关系的数据流测试用例生成方法
Test Case Generation Approach for Data Flow Based on Dominance Relations
计算机科学, 2020, 47(9): 40-46. https://doi.org/10.11896/jsjkx.200700021
[13] 汤洪涛, 闫伟杰, 陈青丰, 鲁建厦, 詹燕.
自动化立体仓库货位分配与作业调度集成优化
Integrated Optimization of Location Assignment and Job Scheduling in Automated Storage andRetrieval System
计算机科学, 2020, 47(5): 204-211. https://doi.org/10.11896/jsjkx.190400042
[14] 孟利民, 王锟, 郑增乾, 蒋维.
基于粒子群算法的D2D内容边缘缓存架构策略
Architecture Strategy of D2D Content Edge Cache Based on Particle Swarm Optimization
计算机科学, 2020, 47(11A): 345-348. https://doi.org/10.11896/jsjkx.200500079
[15] 李宝胜, 秦传东.
基于粒子群优化的SVM多分类的电动车价格预测研究
Study on Electric Vehicle Price Prediction Based on PSO-SVM Multi-classification Method
计算机科学, 2020, 47(11A): 421-424. https://doi.org/10.11896/jsjkx.191200132
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!