江苏科技信息 ›› 2019, Vol. 36 ›› Issue (7): 41-44.doi: 10.1004-7530/2019-36-7-41

• 基础研究 • 上一篇    下一篇

面向路径覆盖测试用例生成方法

李晓玉1,贺肖雄2,罗杨1,*   

  1. 1. 南华大学 计算机学院,湖南 衡阳 421001
    2. 南华大学 数理学院,湖南 衡阳 421001
  • 出版日期:2019-03-10 发布日期:2019-07-09
  • 通讯作者: 罗杨
  • 作者简介:李晓玉(1993— ),女,河南洛阳人,硕士研究生;研究方向:软件测试。
  • 基金资助:
    南华大学研究生科学基金项目(2018KYY084)

Research on the path-oriented test case generation method

Xiaoyu Li1,Xiaoxiong He2,Yang Luo1,*   

  1. 1. School of Computer, University of South China, Hengyang 421001, China
    2. School of Math, University of South China, Hengyang 421001, China
  • Online:2019-03-10 Published:2019-07-09
  • Contact: Yang Luo

摘要:

测试用例的生成在软件测试中起到关键性的作用,然而在全路径覆盖这一准则中,往往会遇到极少数路径被遗忘等问题。针对此问题,文章提出了一种面向路径的测试用例生成方法,即贝叶斯网络与人工鱼群组合算法。首先,将表示各参数间的关系引入贝叶斯网络,达到路径覆盖准则的效果。然后,使用人工鱼群算法对近优的贝叶斯网络模型进行搜索获取测试用例集,进一步提高效率。 实验结果表明:与已有的方法相比,在满足路径覆盖的同时,该方法在性能上有明显优势。

关键词: 路径覆盖, 朴素贝叶斯, 人工鱼群算法, 测试用例生成

Abstract:

The generation of test cases plays a key role in software testing. However, in the principle of full path coverage, it is often encountered that a very small number of paths are forgotten. Aiming at this problem, a path-oriented test case generation method is proposed, which is a combination of Bayesian network and artificial fish swarm algorithm. First, it is shown that the relationship between the parameters is introduced into the Bayesian network to achieve the effect of the path coverage criterion. Then, the artificial fish swarm algorithm is used to search the near-optimal Bayesian network model to obtain a test case set, which further improves the efficiency. The experimental results show that compared with the existing methods, the method has the obvious advantages in performance while satisfying the path coverage.

Key words: path coverage criteria, naive bayes, artificial fish swarm algorithm, test case generation

中图分类号: