计算机应用 ›› 2013, Vol. 33 ›› Issue (11): 3262-3266.

• 计算机软件技术 • 上一篇    下一篇

基本路径测试用例设计算法

王敏1,陈少敏1,陈亚光2   

  1. 1. 武昌理工学院 信息工程学院,武汉 430223
    2. 中南民族大学 生物医学工程学院,武汉 430074
  • 收稿日期:2013-05-13 修回日期:2013-07-20 出版日期:2013-11-01 发布日期:2013-12-04
  • 通讯作者: 王敏
  • 作者简介:王敏(1968-),女,四川眉山人,副教授,主要研究方向:软件测试;陈少敏(1962-),男,四川成都人,讲师,主要研究方向:软件工程与方法;陈亚光(1951-),男,安徽砀山人,教授,主要研究方向:信号处理。
  • 基金资助:
    国家自然科学基金资助项目

Test case design algorithm for basic path test

Wang min1,CHEN Shaomin1,CHEN Yaguang2   

  1. 1. College of Information Engineering, Wuchang University of Technology, Wuhan Hubei 430223, China;
    2. College of Biomedical Engineering, South-Central University for Nationalities, Wuhan Hubei 430074, China
  • Received:2013-05-13 Revised:2013-07-20 Online:2013-12-04 Published:2013-11-01
  • Contact: Wang min

摘要: McCabe提出的基本路径测试法(McCABE T J. A complexity measure. IEEE Transactions on Software Engineering, 1976, SE-2(4): 308-320)是动态白盒测试技术中严谨而有效的方法,但存在测试用例设计效率较低的问题,影响了该方法在工程项目中的广泛应用。为了解决这一问题,从被测程序的基本结构出发,提出一种基于组合的基本路径测试用例设计方法。创建一种基于Z路径覆盖的基本单元图,构建由基本单元图组合形成控制流图的组合规则,以此为基础提出了基本路径组合算法,该算法只需一次扫描程序得到程序基本结构的路径集,将这些路径进行组合即可生成被测程序的基本路径集。该方法比McCabe所提出的方法构造过程简洁,能有效提高基本路径测试用例设计的效率。

关键词: 基本单元, 基本路径测试, 基本路径集, 自动化测试, 白盒测试

Abstract: McCabe's basic path testing method (McCABE T J. A complexity measure. IEEE Transactions on Software Engineering, 1976, SE-2(4): 308-320) is a more rigorous software testing one in dynamic white-box testing techniques, but the efficiency of McCabe method is lower. To solve this problem, this paper proposed an algorithm to design basic path test case according to the basic program structure. The algorithm first created a basic unit chart based on the Z-path coverage. Next, the rules that combined a control flow graph from basic unit were established. On this basis, the combination algorithm of the basic path was constructed. The algorithm collected the path set of basic program structure by scanning a program only once, and then generated the basic path set using those paths by combination ways. This method is more concise than the method proposed by McCabe, and it can improve the efficiency of the basic path test case design.

Key words: basic unit, basic path testing, basic path set, automated testing, white-box testing

中图分类号: