作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2012, Vol. 38 ›› Issue (04): 158-160. doi: 10.3969/j.issn.1000-3428.2012.04.051

• 人工智能及识别技术 • 上一篇    下一篇

基于改进遗传算法的面向路径测试数据生成

王 林,尤 枫,赵瑞莲   

  1. (北京化工大学计算机系,北京 100029)
  • 收稿日期:2011-07-22 出版日期:2012-02-20 发布日期:2012-02-20
  • 作者简介:王 林(1986-),男,硕士研究生,主研方向:软件可靠性测试;尤 枫,副教授;赵瑞莲,教授
  • 基金资助:
    国家自然科学基金资助项目(61073035,60903002)

Path-oriented Test Data Generation Based on Improved Genetic Algorithm

WANG Lin, YOU Feng, ZHAO Rui-lian   

  1. (Dept. of Computer Science, Beijing University of Chemical Technology, Beijing 100029, China)
  • Received:2011-07-22 Online:2012-02-20 Published:2012-02-20

摘要: 在遗传算法中,面向路径测试数据自动生成存在迭代次数多、效率低的问题。为此,提出一种改进型的遗传算法。通过分析被测源程序得到其结构信息,并利用该结构信息,控制遗传算法中交叉、变异操作发生的位置及范围,提高遗传操作的精确性和目的性。实验结果表明,与传统遗传算法相比,该算法具有更快的收敛速度,测试数据生成效率更高。

关键词: 遗传算法, 面向路径, 测试数据生成, 程序结构信息, 分支表达式, 交叉, 变异

Abstract: For the problem that Genetic Algorithm(GA) suffers from large iteration times and low efficiency in path-oriented test data generation, this paper proposes a Modified Genetic Algorithm(MGA), through analyzing the source code, structural information is gained and used to control the crossover and mutation point and range in order to make the genetic operation more accurate and purposeful. Experimental result shows that MGA has faster convergence speed and higher test data generation efficiency compared with traditional genetic algorithm.

Key words: Genetic Algorithm(GA), path-oriented, test data generation, program structural information, branch expression, crossover, mutation

中图分类号: