• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2013, Vol. 35 ›› Issue (12): 134-140.

• 论文 • 上一篇    下一篇

用于基本路径测试的路径字符串组合算法

王敏1,陈亚光2   

  1. (1.武昌理工学院信息工程学院,湖北 武汉 430223;2.中南民族大学生物医学工程学院,湖北 武汉 430074)
  • 收稿日期:2012-06-11 修回日期:2012-09-06 出版日期:2013-12-25 发布日期:2013-12-25
  • 基金资助:

    国家自然科学基金资助项目(60972158,61072075)

A path string combination algorithm for basic path testing   

WANG Min1,CHEN Yaguang2   

  1. (1.College of Information Engineering,Wuchang University of Technology,Wuhan 430223;
    2.College of Biomedical Engineering,South-Central University for Nationalities,Wuhan 430074,China)
  • Received:2012-06-11 Revised:2012-09-06 Online:2013-12-25 Published:2013-12-25

摘要:

自McCabe提出基本路径测试法以来,人们一直在探索基本路径集的求解算法,以提高基本路径测试的效率。为此,提出一种基于路径字符串组合的基本路径集的求解算法,算法把被测程序看作是若干基本结构的组合,构建了各基本结构路径字符串的构成方式和组合方式,制定了路径字符串的组合规则。依据这些方式及规则导出了基本路径集的求解算法。实验表明,在满足相同覆盖准则的情况下,该算法比McCabe所提出的方法求解过程更简洁,并且输出的中间结果易于理解,便于测试用例集的优化。

关键词: 路径字符串, 基本路径测试, 基本路径集, 白盒测试

Abstract:

Since McCabe proposed the basic path testing method, researchers has been exploring the efficient algorithm of acquiring the basic path set from a program. Therefore, a path string combination algorithm is proposed to obtain the basis path set. In this algorithm, a program is regarded as a combination of several basic structures, the composition and combination of the basic structure of the path string are created, and the combination rules of the path string are designed. Then, according to these rules, the algorithm of obtaining the basic path set is derived. Experiments show that, under the condition of meeting the same coverage criteria, the algorithm is more concise than the method proposed by McCabe and the intermediate results are easy to understand so as to facilitate the optimization of the artificial test case set.

Key words: path string;basic path testing;basic path set;whitebox testing