首页 | 本学科首页   官方微博 | 高级检索  
     

一种基于分支覆盖的测试数据自动生成算法
引用本文:陈继锋,朱利,沈钧毅,王志海.一种基于分支覆盖的测试数据自动生成算法[J].计算机科学,2006,33(12):261-264.
作者姓名:陈继锋  朱利  沈钧毅  王志海
作者单位:1. 西安交通大学计算机软件研究所,西安,710049
2. 西安交通大学软件学院,西安,710049
基金项目:国家高技术研究发展计划(863计划)
摘    要:通过构造新的程序流图,利用Fibonacci法优化选取路径.为指定的分支生成测试数据。提出了路径测试数据生成代价的概念,并给出了代价的计算方法。当所选路径的分支谓词均为线性表达式时,直接求解线性约束集即可生成测试数据,或判定路径不可行;当分支谓词含有非线性表达式时,利用均差近似导数将非线性函数线性化,通过简单的迭代,亦能容易生成测试数据或判定路径在很大程度上不可行。若所选路径不可行或在很大程度上不可行,则选取新的路径,重复以上过程,直至求出所期望的数据,或无新的路径被选取,给定分支不可达。实例和实验表明,算法可行、有效。

关 键 词:分支覆盖  谓词函数  线性算术表示

Automatic Test Data Generation Algorithm on Branch Coverage
CHEN Ji-Feng,ZHU Li,SHEN Jun-Yi,WANG Zhi-Hai.Automatic Test Data Generation Algorithm on Branch Coverage[J].Computer Science,2006,33(12):261-264.
Authors:CHEN Ji-Feng  ZHU Li  SHEN Jun-Yi  WANG Zhi-Hai
Abstract:In order to generate test data for a given branch, a new program flow graph is constructed, and Fibonacci method is used to optimize the path selection. The conception and calculation to path-based test data generation complexity is presented. If all branch predicates on the selected path are linear expression, the linear constrain set is constructed and solved to generate test data, otherwise the path can be determined infeasible. Else, the derivatives of a predicate function is approximated by its divided difference, and the nonlinear function is linearized. The test data can also be generated by simple iteration or the path is determined as likely infeasible. If the selected path is infeasible or likely infeasible, a new path is selected. The process above is repeated until the desired test data is obtained or there is no new path to be selected, and the given branch is infeasible. Example and experiment show that the algorithm is feasible and effective.
Keywords:Branch coverage  Predicate function  I  inear arithmetic representation
本文献已被 CNKI 维普 万方数据 等数据库收录!
点击此处可从《计算机科学》浏览原始摘要信息
点击此处可从《计算机科学》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号