Journal of Frontiers of Computer Science and Technology ›› 2019, Vol. 13 ›› Issue (6): 961-972.DOI: 10.3778/j.issn.1673-9418.1807035

Previous Articles     Next Articles

Transition Path Generation Method Based on State Diagram Test

ZHANG Yiwei+, BEN Kerong   

  1. College of Electronic Engineering, Naval University of Engineering, Wuhan 430033, China
  • Online:2019-06-01 Published:2019-06-14



  1. 海军工程大学 电子工程学院,武汉 430033

Abstract: Computer software occupies an increasing proportion of military equipment. The quality of software determines the quality of equipment, and software testing is an important method to improve software quality. UML state diagram is a modeling method widely used for model-based testing. Transition coverage is one of the important test coverage criteria. The dependency relationship between the transitions in the state diagram will make the transitions path unable to be executed according to the input sequence, and it results in a decrease of the coverage rate and affects the testing effect. For this reason, this paper proposes an improved group genetic algorithm to automatically generate the feasible transition path, solving the problem by legitimately designing coding methods and fitness functions. In the algorithm, adaptive crossover operator and mutation operator and the simulated annealing mechanism are introduced to the genetic manipulation to increase the speed of solution, repair operator is also used to limit the length of individual. Experiment result shows that the method can increase transition coverage based on the reduction of genetic population size and amount of the genetic generation.

Key words: software testing, grouping genetic algorithm, heuristic information, transition path generation

摘要: 计算机软件在军用装备中所占比重越来越大,软件质量的好坏决定着装备质量的高低,而软件测试则是提高软件质量的重要手段。UML状态图是一种广泛用于基于模型测试的建模方法,迁移覆盖是其中重要的测试覆盖准则。状态图中迁移之间的依赖关系会使得迁移路径不能按照输入序列来执行,从而导致覆盖率的下降,影响测试效果。为此,提出了一种改进的分组遗传算法来实现可执行迁移路径的自动生成,该算法通过合理设计编码方式和适应度函数来解决问题。算法在遗传操作中引入自适应的交叉和变异算子以及模拟退火机制来提高求解速度,加入修补算子对个体长度进行限制。实验结果表明,该方法能够在缩小遗传种群规模和减少遗传代数的基础上提高迁移覆盖率。

关键词: 软件测试, 分组遗传算法, 启发式信息, 迁移路径生成