计算机科学 ›› 2018, Vol. 45 ›› Issue (11): 199-203.doi: 10.11896/j.issn.1002-137X.2018.11.031

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

基于动态调整简化粒子群优化的组合测试用例生成方法

包晓安1, 鲍超1, 金瑜婷1, 陈春宇1, 钱俊彦2, 张娜1   

  1. (浙江理工大学信息学院 杭州310018)1
    (桂林电子科技大学广西可信软件重点实验室 广西 桂林541004)2
  • 收稿日期:2017-10-09 发布日期:2019-02-25
  • 作者简介:包晓安(1973-),男,硕士,教授,主要研究方向为自适应软件、软件测试与智能信息处理;鲍 超(1990-),男,硕士,主要研究方向为软件工程、软件测试;金瑜婷(1994-),女,硕士,主要研究方向为软件测试、软件形式化方法;陈春宇(1994-),男,硕士,主要研究方向为软件工程、软件测试;钱俊彦(1973-),男,博士,教授,CCF高级会员,主要研究方向为软件工程、形式化验证;张 娜(1977-),女,硕士,副教授,主要研究方向为软件工程、软件测试,E-mail:zhangna@zstu.edu.cn(通信作者)。
  • 基金资助:
    本文受国家自然科学基金(61502430,61379036,61562015),广西自然科学重点基金(2015GXNSFDA139038),浙江理工大学521人才培养计划资助。

Combinatorial Test Case Generation Method Based on Simplified Particle Swarm Optimizationwith Dynamic Adjustment

BAO Xiao-an1, BAO Chao1, JIN Yu-ting1, CHEN Chun-yu1, QIAN Jun-yan2, ZHANG Na1   

  1. (School of Information Science and Technology,Zhejiang Sci-Tech University,Hangzhou 310018,China)1
    (Guangxi Key Laboratory of Trusted Software,Guilin University of Electronic Technology,Guilin,Guangxi 541004,China)2
  • Received:2017-10-09 Published:2019-02-25

摘要: 优化的组合测试中的一个关键是生成的测试用例能够覆盖更多的组合,而粒子群算法在生成强组合覆盖用例方面有其独特的优势和能力。文中提出了一种基于动态调整简化粒子群优化的组合测试用例生成方法。该方法基于粒子群算法生成测试用例,结合混合的优先级one-test-at-a-time策略和基于动态调整的简化粒子群算法生成组合测试用例集,排除了速度因素对粒子优化过程的影响。定义了一个粒子收敛指标,以粒子群早熟收敛程度为依据来动态调整惯性权值,以防止粒子陷入局部最优和后期出现收敛速度慢的情况,从而提高粒子群算法所生成的覆盖表的覆盖组合能力。通过对比实验表明,基于动态调整的简化粒子群优化算法在用例规模和时间成本上具有一定的优势。

关键词: 测试用例, 惯性权值, 简化粒子群算法

Abstract: One of the keys for the optimized combinatorial test is that the generated test case can cover more combinations,and the particle swarm algorithm has the distinctive advantage and capability in generating strong combinatorial coverage cases.This paper proposed a combinatorial test case generation method based on simplified particle swarm optimization based on dynamic adjustment.In this method,test case is generated based on particle swarm algorithm,and the mixed priority one-test-at-a-time strategy and simplified particle swarm optimization algorithm based on dynamic adjustment are combined to generate combinatorial test case set,excluding the influence of velocity factors on the process of particle optimization.Then,a particle convergence criterion is defined,and the inertia weight is dynamically adjusted based on the premature convergence degree ofparticle swarm,so as to prevent that the particles fall into the local optimum and its convergence is slow later,thus improving the capability of coverage combination of the coverage table gene-rated by the particle swarm algorithm.Experiments show that the simplified particle swarm optimization algorithm based on dynamic adjustment has certain advantages in the aspect of case scale and time cost.

Key words: Inertia weight, Simplified particle swarm algorithm, Test case

中图分类号: 

  • TP311
[1]WANG Z Y,XU B W,NIE C H,et al.Survey of combinatorial test generation [J].Journal of Frontiers of Computer Science and Technology,2008,2(6):571-588.(in Chinese)
王子元,徐宝文,聂长海,等.组合测试用例生成技术[J].计算机科学与探索,2008,2(6):571-588.
[2]JIA J T.Research of Automatic Testcase Generation Functions Based onParticle Swarm Optimization Algorithm [J].Computer Technology and Development,2010,20(9):24-27.(in Chinese)
贾冀婷.基于粒子群算法的测试用例自动生成方法研究[J].计算机技术与发展,2010,20(9):24-27.
[3]WANG Z Y,NIE C H,XU B W,et al.Optimal Test Suite Ge- neration Methods for Neighbor Factors Combinatorial Testing [J].Chinese Journal of Computers,2007,30(2):200-211.(in Chinese)
王子元,聂长海,徐宝文,等.相邻因素组合测试用例集的最优生成方法[J].计算机学报,2007,30(2):200-211.
[4]WANG Z Y,QIAN J,CHEN L,et al.Generating Variable Strength Combinatorial Test Suite with one-test-at-a-time Stra-tegy [J].Chinese Journal of Computers,2012,35(12):2541-2552.(in Chinese)
王子元,钱巨,陈林,等.基于One-test-at-a-time策略的可变力度组合测试用例生成方法[J].计算机学报,2012,35(12):2541-2552.
[5]BAO X A,YANG Y J,ZHANG N,et al.Test Case Generation Method Based on Adaptive Particle Swarm Optimization[J].Computer Science,2017,44(6):177-181.(in Chinese)
包晓安,杨亚娟,张娜,等.基于自适应粒子群优化的组合测试用例生成方法[J].计算机科学,2017,44(6):177-181.
[6]BERGH F V D,ENGELBRECHT A P.Cooperative learning in neural networks using particle swarm optimizers[J].South African Computer Journal,2000,26:84-90.
[7]RATNAWEERA A,HALGAMUGE S K,WATSON H C.Self-organizing hierarchical particle swarm optimizer with time-varying acceleration coefficients[J].IEEE Transactions on Evolutionary Computation,2004,8(2):240-255.
[8]HU W,LI Z S.A Simpler and More Effective Particle Swarm Optimization Algorithm [J].Journal of Software,2007,18 (4):861-868.(in Chinese)
胡旺,李志蜀.一种更简化而高效的粒子群优化算法[J].软件学报,2007,18(4):861-868.
[9]COHEN D M,DALAL S R,FREDMAN M L,et al.The AETG System:An Approach to Testing Based on Combinatorial Design[J].IEEE Transactions on Software Engineering,1997,23(7):437-444.
[10]CHEN X,GU Q,WANG Z Y,et al.Framework of Particle Swarm Optimization Based Pairwise Testing [J].Journal of Software,2011,22(12):2879-2893.(in Chinese)
陈翔,顾庆,王子元,等.一种基于粒子群优化的成对组合测试算法框架[J].软件学报,2011,22(12):2879-2893.
[11]WILLIAMS A W.Determination of Test Configurations for Pair-Wise Interaction Coverage[C]∥International Conference on Testing Communicating Systems:TOOLS and Techniques.DBLP,2000:59-74.
[12]SHI Y,EBERHART R C.Fuzzy adaptive particle swarm optimization[C]∥Proceedings of the 2001 Congress on Evolutiona-ry Computation.IEEE Xplore,1997:101-106.
[13]EBERHART R C,SHI Y.Tracking and optimizing dynamic systems with particle swarms[C]∥Proceedings of the 2001 Congress on Evolutionary Computation,2001.IEEE,2002:94-100.
[14]YOU B,CHEN G,GUO W.A Discrete PSO-Based Fault-Tole- rant Topology Control Scheme in Wireless Sensor Networks[C]∥Advances in Computation and Intelligence-International Symposium(Isica 2010).Wuhan,China,DBLP,2010:1-12.
[15]GONG M G,JIAO L C,YANG D D,et al.Research on Evolutionary Multi-Objective Optimization Algorithms [J].Journal of Software,2009,20(2):271-289.(in Chinese)
公茂果,焦李成,杨咚咚,等.进化多目标优化算法研究[J].软件学报,2009,20(2):271-289.
[16]ZHANG N,YAO L,BAO X A,et al.Multi-Objective Optimization Based On-Line Adjustment Strategy of Test Case Prioritization[J].Journal of Software,2015,26(10):2451-2464.(in Chinese)
张娜,姚澜,包晓安,等.多目标优化的测试用例优先级在线调整策略[J].软件学报,2015,26(10):2451-2464.
[1] 胡志濠, 潘祖烈.
基于QRNN的网络协议模糊测试用例过滤方法
Testcase Filtering Method Based on QRNN for Network Protocol Fuzzing
计算机科学, 2022, 49(5): 318-324. https://doi.org/10.11896/jsjkx.210300281
[2] 汪文轩, 胡军, 胡建成, 康介祥, 王辉, 高忠杰.
一种面向形式化表格需求模型的测试用例生成方法
Test Case Generation Method Oriented to Tabular Form Formal Requirement Model
计算机科学, 2021, 48(5): 16-24. https://doi.org/10.11896/jsjkx.201000048
[3] 肖蕾, 陈荣赏, 缪淮扣, 洪煜.
融合聚类算法和缺陷预测的测试用例优先排序方法
Test Case Prioritization Combining Clustering Approach and Fault Prediction
计算机科学, 2021, 48(5): 99-108. https://doi.org/10.11896/jsjkx.200400100
[4] 文进, 张星宇, 沙朝锋, 刘艳君.
基于次模函数最大化的测试用例集约简
Test Suite Reduction via Submodular Function Maximization
计算机科学, 2021, 48(12): 75-84. https://doi.org/10.11896/jsjkx.210300086
[5] 吉顺慧, 张鹏程.
基于支配关系的数据流测试用例生成方法
Test Case Generation Approach for Data Flow Based on Dominance Relations
计算机科学, 2020, 47(9): 40-46. https://doi.org/10.11896/jsjkx.200700021
[6] 刘芳, 洪玫, 王潇, 郭丹, 杨正卉, 黄小丹.
面向Java的Randoop自动化单元测试生成工具性能分析
Performance Analysis of Randoop Automated Unit Test Generation Tool for Java
计算机科学, 2020, 47(9): 24-30. https://doi.org/10.11896/jsjkx.200200116
[7] 夏春艳, 王兴亚, 张岩.
基于多目标优化的测试用例优先级排序方法
Test Case Prioritization Based on Multi-objective Optimization
计算机科学, 2020, 47(6): 38-43. https://doi.org/10.11896/jsjkx.191100113
[8] 冯沈峰, 高建华.
基于AHP的回归测试用例优先级排序方法
Test Case Prioritization Method Based on AHP for Regression Testing
计算机科学, 2019, 46(8): 233-238. https://doi.org/10.11896/j.issn.1002-137X.2019.08.038
[9] 黄钊,黄曙光,邓兆琨,黄晖.
基于SEH的漏洞自动检测与测试用例生成
Automatic Vulnerability Detection and Test Cases Generation Method for Vulnerabilities Caused by SEH
计算机科学, 2019, 46(7): 133-138. https://doi.org/10.11896/j.issn.1002-137X.2019.07.021
[10] 张娜,滕赛娜,吴彪,包晓安.
基于粒子群优化算法的测试用例生成方法
Test Case Generation Method Based on Particle Swarm Optimization Algorithm
计算机科学, 2019, 46(7): 146-150. https://doi.org/10.11896/j.issn.1002-137X.2019.07.023
[11] 张娜, 徐海霞, 包晓安, 徐璐, 吴彪.
一种动态约简的多目标测试用例优先级排序方法
Multi-objective Test Case Prioritization Method Combined with Dynamic Reduction
计算机科学, 2019, 46(12): 208-212. https://doi.org/10.11896/jsjkx.181102106
[12] 包晓安, 熊子健, 张唯, 吴彪, 张娜.
一种基于改进遗传算法的路径测试用例生成方法
Approach for Path-oriented Test Cases Generation Based on Improved Genetic Algorithm
计算机科学, 2018, 45(8): 174-178. https://doi.org/10.11896/j.issn.1002-137X.2018.08.031
[13] 杨红, 洪玫, 屈媛媛.
基于模型检测技术的变异测试用例生成方法
Approach of Mutation Test Case Generation Based on Model Checking
计算机科学, 2018, 45(11A): 488-493.
[14] 黄钰尧,李凤英,常亮,孟瑜.
基于符号零压缩二叉决策图的组合测试用例生成方法
Symbolic ZBDD-based Generation Algorithm for Combinatorial Testing
计算机科学, 2018, 45(1): 255-260. https://doi.org/10.11896/j.issn.1002-137X.2018.01.045
[15] 程雪梅,杨秋辉,翟宇鹏,陈伟.
基于半监督聚类方法的测试用例选择技术
Test Case Selection Technique Based on Semi-supervised Clustering Method
计算机科学, 2018, 45(1): 249-254. https://doi.org/10.11896/j.issn.1002-137X.2018.01.044
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!