首页|基于改进模拟退火遗传算法的测试用例优化方法研究

基于改进模拟退火遗传算法的测试用例优化方法研究

扫码查看
面向对象软件不同于传统的面向过程软件,其具有封装性、继承性和多态性。面向对象软件中类的方法中可能会调用其他类的对象,导致很难获取其他类的对象状态,并且由于其继承性和多态性,程序中可能存在多种执行路径,如果用传统方法生成测试用例,很难达到较高的测试覆盖率。针对这个问题,提出一种新的面向对象软件单元测试用例生成方法。这一方法基于改进的模拟退火遗传算法,使得优化过的测试序列可以覆盖到程序中更多的分支,生成的测试用例具有更高的覆盖率。通过实验验证方法的可行性,并与其他方法进行对比实验。实验结果证明该方法具有较高的分支覆盖率。
A Method of Test Case Optimization Based on Improved Simulated Annealing Genetic Algorithm
Different from procedure-oriented software, object-oriented program has encapsulation, inheritance and polymorphism. The methods of classes in object-oriented program may call the objects of other classes. But it is too difficult to get the real objects state. And because of its inheritance and polymorphism, there may have a variety of program execution path. It is difficult to achieve satisfy the test coverage if it use the conventional method to generate the test cases. Aiming at this problem, proposes an approach of object-oriented program unit test case generation based on improved simulated annealing genetic algorithm. The test sequences optimized by simulated annealing ge-netic algorithm can cover more branches in the program, the generated test cases will have higher coverage. Finally, the feasibility of the method is verified by the experiments and compared with other methods. Experimental results show that the proposed approach has higher branch coverage.

Test Case GenerationMethod-Call SequenceSimulated Annealing Genetic AlgorithmsBranch Coverage

郑佳琪、何洋、王存伟

展开 >

四川大学计算机学院,成都 610065

测试用例生成 方法调用序列 模拟退火遗传算法 分支覆盖率

四川省应用基础研究项目

2014JY0112

2015

现代计算机(普及版)
中山大学

现代计算机(普及版)

影响因子:0.202
ISSN:1007-1423
年,卷(期):2015.(11)
  • 1
  • 1