计算机科学 ›› 2024, Vol. 51 ›› Issue (6): 95-103.doi: 10.11896/jsjkx.230100012

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

基于ART优化选择策略的遗传算法生成测试数据方法

李志博, 李清宝, 兰明敬   

  1. 中国人民解放军战略支援部队信息工程大学 郑州 450001
  • 收稿日期:2023-01-02 修回日期:2023-05-11 出版日期:2024-06-15 发布日期:2024-06-05
  • 通讯作者: 李志博(lizhibo1019@163.com)
  • 基金资助:
    国家自然科学基金(62172433,62172434)

Method of Generating Test Data by Genetic Algorithm Based on ART Optimal Selection Strategy

LI Zhibo, LI Qingbao, LAN Mingjing   

  1. PLA Strategic Support Force Information Engineering University,Zhengzhou 450001,China
  • Received:2023-01-02 Revised:2023-05-11 Online:2024-06-15 Published:2024-06-05
  • About author:LI Zhibo,born in 1982,Ph.D,associate professor,master supervisor.Her main research interests include software testing and big data analysis.
  • Supported by:
    National Natural Science Foundation of China(62172433,62172434).

摘要: 测试数据自动生成方法是软件测试领域研究的热点。基于遗传算法的启发式搜索算法是一种路径覆盖生成测试数据的方法。文中提出了一种基于自适应随机测试(Adaptive Random Testing,ART) 算法更新种群的方法,将ART融入遗传算法,优化选择操作,动态更新种群,从而增加种群进化过程中的个体多样性,提高了收敛速度,有效地减少了陷入局部最优。 实验结果显示,与传统遗传算法生成测试数据的方法相比,改进的算法明显提高了路径覆盖率,减少了种群平均进化代数。

关键词: 软件测试, 测试数据生成, 遗传算法, 路径覆盖, 自适应随机测试

Abstract: Automatic generation of test data is a hot topic in the field of software testing.The heuristic search algorithm based on genetic algorithm is a method to generate test data by path coverage.In this paper,a method based on adaptive random testing(ART) to update population is proposed.ART is integrated into genetic algorithm to optimize the selection operation and dyna-mically update the population.As a result,the individual diversity in the process of population evolution is increased,the convergence speed is improved,and the falling into local optimum is effectively reduced.Experimental results show that the path cove-rage is significantly improved and the average number of generations is effectively reduced.

Key words: Software testing, Test data generation, Genetic algorithm, Path coverage, Adaptive random testing(ART)

中图分类号: 

  • TP311
[1]LI Z,WU Y H,WANG H F,et al.Review of Softeware MultipleFault Localization Approaches[J].Chinese Journal of Compu-ters,2022,45(2):256-288.
[2]ZHANG W Y,ZHANG L,MAO J L,et al.An AutomatedMethod of Unknown Protocol Fuzzing Test[J].Chinese Journal of Computers,2020,43(4):653-667.
[3]MA H,NIE C H,WU H Y.History-Based Fault Injection Testing for Cloud Platform[J].Chinese Journal of Computers,2019,42(10):2281-2296.
[4]XU H R,WANG Y J,HUANG Z J,et al.Compiler FuzzingTest Case Generation with Feed-forward Neural Network[J].Journal of Software,2022,33(6):1996-2011.
[5]WU S Y,LUO X,WANG W P,et al.Malicious URL Detection Based on Multiple Feature Fusion[J].Journal of Software,2021,32(9):2916-2934.
[6]ZHU X L,WANG H C,YOU H M,et al.Survey on Testing of Intelligent Systems in Autonomous Vehicles[J].Journal of Software,2021,32(7):2056-2077.
[7]WU H,WANG H,SU X,et al.Security Testing of Visual Perception Module in Autonomous Driving System[J].Journal of Computer Research and Development,2022,59(5):1133-1147.
[8]WENG Z J,CHEN J J,JIANG Y G.On the Generalization of Face Fogery Detection with Domain Adversarial Learning[J].Journal of Computer Research and Development,2021,58(7):1476-1489.
[9]JIANG F L,LIU P C,ZHOU X D.A Review on Face Anti-spoofing[J].ACTA Automatica Sinica,2021,47(8):1799-1821.
[10]GAO F J,WANG Y,SITU L Y,et al.Deep Learning-based Hybrid Fuzz Testing[J].Journal of Software,2021,32(4):988-1005.
[11]REN Z Z,ZHENG H,ZHANG J Y,et al.A Review of Fuzzing Techniques[J].Journal of Computer Research and Development,2021,58(5):944-963.
[12]ZHENG W,TANG H,CHEN X,et al.State-of-the Art Survey of Compatibility Test for Android Mobile Application[J].Journal of Computer Research and Development,2022,59(6):1370-1387.
[13]QIAN Z S,SONG T.Reuse of Test Cases Between Similar Programs Based on Keyword Flow Graph[J].Journal of Software,2021,32(9):2691-2712.
[14]DING Y R,ZHANG Y M,JIANG S J,et al.Generation Method of Class Integration Test Order Based on Reinforcement Lear-ning[J].Journal of Software,2022,33(5):1674-1698.
[15]QIAN Z S,ZHU J,ZHU Y M,et al.Multi-path Coverage Stra-tegy Combining Key Point Probaility and Path Similarity[J].Journal of Software,2022,33(2):434-454.
[16]CHEN L Z,WU J,YANG H Y,et al.Microservice Test suite Minimization Technology Based on Logs Mining[J].Journal of Software,2021,32(9):2729-2743.
[17]ZHONG W K,GE J D,CHEN X,et al.Multi-granularity Metamorphic Testing for Neural Machine Translation System[J].Journal of Software,2021,32(4):1051-1066.
[18]ZHANG Y,DONG C H,LIU H,et al.Code Smell Detection Approach Based on Pre-training Model and Multi-level Information[J].Journal of Software,2022,33(5):1551-1568.
[19]LIAO W Z,XIA X Y,JIA X J.Test Data Generation for Multiple Paths Coverage Based on Ant Colony Algorithm[J].ACTA Electronica Sinica,2020,48(7):1330-1342.
[20]XIAO H H,WAN C X.Improved Flower Pollination Algorithm Based on Multi-strategy[J].Journal of Software,2021,32(10):3151-3175.
[21]LIU Y,YANG Y H,ZHANG C R,et al.A Novel Method for Fuzzing Test Cases Generating Based on Genetic Algorithm[J].ACTA Electronica Sinica,2017,45(3):552-556.
[22]HE Y,ZHANG Y G,ZHANG G H.Android Driver Vulnerabi-lity Discovery Based on Black-Box Genetic Algorithm[J].Chinese Journal of Computers,2017,40(5):1031-1043.
[23]WANG W W,LI Y C,ZHAO R L,et al.Parallel Test Case Ge-neration Based on Front and Back End of Web Applications with Genetic Algorithm[J].Journal of Software.,2020,31(5):1314-1331.
[24]XIA C Y,ZHANG Y,WAN L,et al.Test Data Generation of Path Coverage Based on Negative Selection Genetic Algorithm[J].Acta Electronica Sinica,2019,47(12):2630-2638.
[25]YU T T,WITAWAS S A,COHEN M B,et al.A hybrid approach to testing for nonfunctional faults in embedded systems using genetic algorithms[J].Software Testing Verification & Reliability,2018,28(7):1686-1713.
[26]QIAN Z S,YU Q Y,SONG T,et al.Test Case Generation and Reuse Based on Support Vector Machine Regression Model[J].ACTA Electronic Sinica,2019,47(12):2631-2638.
[27]FAN S P,ZHANG Y,MA B Y,et al.Evolutionary Generation of Test Data for Paths Coverage Based on Balance Optimization Theory[J].ACTA Electronic Sinica,2020,48(7):1303-1310.
[28]CHEN T Y,LEUNG H,MAK I K.Adaptive Random Testing[C]//Advances in Computer Science-asian,Higher-level Decision Making,Asian Computing Science Conference,Dedicated to Jean-louis Lassez on the Occasion of His Cycle Birthday,Chiang Mai,Thailand,December.Springer,Berlin,Heidelberg,2004.
[29]LI Z B,LI Q B,LAN M J,et al.MART Algorithm Based on Mirror Selection Order Optimization[J].Acta Electronica Sinica,2022,50(2):314-325.
[30]LI Z B,LI Q B,YU L,et al.Survey on Adaptive Random Testing by Partitioning[J].Computer Science,2019,46(3):25-35.
[31]LI Z B,LI Q B,YU L.An enhanced Adaptive Random Testing by dividing dimensions independently[J].Mathematical Problems in Engineering,2019,2019:9381728.
[32]XIE W G,CHEN J F,GE H H,et al.Adaptive random testing approach based on coverage for object oriented software[J].Journal of Jiangsu University(Natural Science Edition),2019,40(3):313-319.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!