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

计算机工程 ›› 2009, Vol. 35 ›› Issue (7): 39-41. doi: 10.3969/j.issn.1000-3428.2009.07.013

• 软件技术与数据库 • 上一篇    下一篇

基于LCC的测试程序控制流路径子集生成算法

陈 宇1,李志蜀1,金 虎1,2,何 江1   

  1. (1. 四川大学计算机学院,成都 610064;2. 成都信息工程学院计算机系,成都 610041)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2009-04-05 发布日期:2009-04-05

Control Flow Paths Subset of Tested Program Generation Algorithm Based on LCC

CHEN Yu1, LI Zhi-shu1, JIN Hu1,2, HE Jiang1   

  1. (1. School of Computer, Sichuan University, Chengdu 610064; 2. Department of Computer Science, Chengdu University of Info. Tech., Chengdu 610041)
  • Received:1900-01-01 Revised:1900-01-01 Online:2009-04-05 Published:2009-04-05

摘要: 针对路径覆盖测试技术中如何计算被测试程序的有效控制流路径子集的关键性问题,提出一种利用LCC编译器的前端结果来生成基于一次循环策略的测试程序控制流路径子集的算法。该算法通过引入邻接矩阵并借助自定义的堆栈数据结构来完成控制流路径子集的生成。通过实验程序对算法进行检验,结果表明,该方法能高效准确地计算出待测源程序片的控制流路径子集。

关键词: LCC编译器, 控制流路径, 邻接矩阵

Abstract: To solve the key problem of how to calculate the effective subset of the control flow paths of the tested program, this paper proposes an algorithm for working out the subset of the whole control flow paths of the program with the help of the LCC compiler in software coverage testing. The control flow paths in the subset are based on the strategy that the loop statements in the program execute less than twice. Adjoining matrix is introduced by the algorithm to work out the subset of the control flow paths with the help of customized stack structure. The correctness of the algorithm is verified on a sample program, which indicates that the subset of the whole control flow paths of the tested program can be calculated efficiently and accurately with this method.

Key words: LCC compiler, control flow path, adjoining matrix

中图分类号: