摘要
随着系统内部复杂度的提高及外部交联关系的增多,人们将更多地采用自动化测试手段和工具来提高测试效率和测试结果的可信性。测试用例自动生成作为自动化测试的重要环节,其关键在于测试数据的自动生成。首先,分析了遗传算法及模拟退火算法的原理及优缺点,提出了一种算法融合遗传思想和退火算法,并且在选择、变异、交叉和适应度函数设计等4个方面对融合算法进行改进,形成了一种改进的遗传退火算法;其次,两种基础算法的融合体现在将退火思想引入遗传算法的选择阶段,之后改进交叉、变异算子,使交叉、变异依据适应度数值做适应性调整,设计出更优的适应度函数,为优化适应度函数的构造引入调节因子;最后,采用经典的三角形判断程序,将所提的改进遗传退火算法与其他代表性文献所提的遗传算法在平均进化代数和总搜索时间两个方面做比较分析,实验结果表明:该算法在上述两个评价因素上均获得了更好的结果,证明了所提的算法在数据自动生成上的有效性和高效性。
With the increase of internal complexity and external crosslinking relationship of the system,automatical test methods and tools will be used more and more to improve the test efficiency and the credibility of test results.As an important part of automatic test,the key of automatic test case generation is the automatic generation of test data.Firstly,the principle,advantages and disadvantages of genetic algorithm and simulated annealing algorithm are analyzed,an algorithm combining genetic and annealing algorithm is proposed.And the fusion algorithm is improved in four aspects of selection,mutation,crossover and fitness function design,and an improved genetic annealing algorithm is formed.The fusion of the two basic algorithms is reflected in the introduction of the annealing idea into the selection stage of the genetic algorithm,and the crossover and mutation operators are improved,so that the crossover and mutation can be adaptively adjusted according to the fitness value,and a better fitness function can be designed.And the adjustment factor is introduced for optimizing the construction of fitness function.Finally,using the classic triangle judgment procedure,the proposed improved genetic annealing algorithm and the genetic algorithm proposed in other representative literatures are compared and analyzed in terms of average evolutionary algebra and total search time.The experimental results show that this algorithm achieves better results in the above two evaluation factors,which proves the effectiveness and the efficiency of the proposed algorithm in automatic data generation.
作者
虞飞
徐军
YU Fei;XU Jun(CEPREI,Guangzhou 511370,China)
出处
《电子产品可靠性与环境试验》
2022年第S01期8-12,共5页
Electronic Product Reliability and Environmental Testing
关键词
测试用例自动生成
遗传算法
退火算法
测试数据自动生成
test cases automatic generation
genetic algorithm
simulated annealing algorithm
test data automatic generation
作者简介
虞飞(1991-),女,安徽安庆人,工业和信息化部电子第五研究所软件质量工程中心工程师,硕士,从事软件可靠性、软件自动化测试研究工作;通信作者:徐军(1989-),男,河北衡水人,工业和信息化部电子第五研究所软件质量工程中心工程师,从事故障注入、软体可靠性等方面的研究工作。