首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到18条相似文献,搜索用时 140 毫秒
1.
传统基路径覆盖测试用例生成方法通过程序图求出圈复杂度,然后再得出程序的一组基路径,最后分别针对基路径组中的每条路径求出相应的测试用例,不仅繁琐,而且忽视了代码的语义相关性,导致存在路径不可达问题,也就无法生成对应的测试用例.提出了一种新的方法,利用遗传算法动态运行程序,逐渐逼近被测程序的真实逻辑圈复杂度,直接生成满足基路径覆盖测试用例的最小集合,不存在路径不可达问题.实验结果表明,该算法能够有效地生成满足基路径覆盖的测试用例.  相似文献   

2.
赵会群  卢飞 《计算机科学》2017,44(4):114-117
路径测试是一种根据路径设计测试用例的白盒测试技术,而 基本路径测试是其中运用最广泛的一种路径测试方法。基本路径测试是在被测程序的控制流图的基础上导出基本的可执行的路径集合,因此程序控制流图是基本路径集自动生成的关键。考虑到依赖程序控制流图生成基本路径集的低效性,提出基于模型代数的基本路径集的自动生成方法。该方法通过分析被测程序,自动生成程序的模型代数表达式,并在模型代数表达式的基础上生成基本路径集。最后通过经典案例证明了该方法的有效性。  相似文献   

3.
覆盖测试是软件测试中的重要方法,路径覆盖测试中路径集的自动生成能提高测试效率。该文提出了一种描述程序分支情况的分支关系图,给出了基于分支关系图的路径集自动生成算法,实验证明了该方法的正确性,能有效地求出程序路径集。  相似文献   

4.
覆盖测试是软件测试中的重要方法,路径覆盖测试中路径集的自动生成能提高测试效率。该文提出了一种描述程序分支情况的分支关系图,给出了基于分支关系图的路径集自动生成算法,实验证明了该方法的正确性,能有效地求出程序路径集。  相似文献   

5.
针对Java单元测试自动化程度和测试效率较低的问题,对基于Java程序的基本路径测试方法进行研究,提出了基于Java代码的基本路径生成方法和程序插桩方法,给出了插桩节点和控制流图节点的定义。首先,通过对Java源代码进行分析,构建程序的控制流图,进而对控制流图进行遍历生成基本路径集合;然后,对被测程序进行插桩,以获取程序的执行路径,插桩过程中保持节点和基本路径中的节点一致,使得插桩后的被测程序执行时得到的路径能够和基本路径集合进行自动化比对;最后,通过以测试数据为输入执行被测程序,对执行路径和基本路径进行比较,判断测试数据集对基本路径的覆盖度。通过实验,验证了所提出方法的有效性。  相似文献   

6.
为了提高IR46智能电表软件白盒测试的效率,提出一种新的基路径集生成方法.对程序进行分析识别,得到节点连接关系、语句类型等信息;对常用程序结构进行错误源分析,并给出错误倾向权重用以表示该路径在测试中的重要性;优化二进制蝙蝠算法,并将其用于基路径集搜索.算例仿真表明:优化二进制蝙蝠算法有更好的路径生成效率,该方法能够估量程序的错误倾向并产生带优先级的基路径集,有助于促进智能电表软件测试的精细化和高效化.  相似文献   

7.
设计了一个通用的基于控制流和数据流的结构测试数据自动生成的工具。该工具根据控制流和数据流测试中所采用的覆盖标准来选取测试路径,并以改进后的迭代松弛法为核心,对所选取的路径生成测试数据。同时工具采用Fibonacci法优化选取路径,对不可达路径进行处理,并对测试数据的分支覆盖率、DCP覆盖率等进行了统计。实验结果表明该工具是可行的。  相似文献   

8.
不可达路径增加了程序的复杂度和冗余度,不可达路径的检测是结构测试中的一个关键问题。提出了一种包含异常处理结构的程序不可达路径的静态检测方法。该方法根据数据流信息判断产生冲突的分支,进而利用分支冲突检测路径的可达性;在数据流分析时考虑异常处理结构和变量别名对数据流信息的影响。实例分析结果表明,该方法可以进一步提高路径可达性检测的准确度。  相似文献   

9.
结构测试中的可达路径选择方法   总被引:1,自引:0,他引:1  
万琳  肖庆  宫云战 《计算机工程》2003,29(2):42-43,46
在简单介绍了传统的不可达路径的排除方法后,主要介绍能有效改善其缺陷的可达路径选择方法,基于最少谓词思想的路径生成方法得到广泛的认可,但其实现方法的不同同样会影响路径的可达效果,文中介绍的综合利用控制流信息和数据流信息的方法较之单纯地利用控制流或数据流信息会生成更好的路径。  相似文献   

10.
对于大型软件来说,程序中不可达路径的存在增加了软件测试的耗费并严重影响了测试的准确性。通过在已生成的基本路径集中排除不可达路径的影响,有利于结构测试中各阶段的实现。提出了一种利用数据流分析信息检测不可达路径的方法。通过对条件分支相关性的探测进而确定了程序中的不可达路径,并通过适当地选取条件谓词,提高了检测分支的覆盖率。  相似文献   

11.
路径测试中基本路径集的自动生成   总被引:1,自引:0,他引:1       下载免费PDF全文
路径测试是一种重要的白盒测试技术,具有较高的故障覆盖率。基本路径集覆盖了程序中所有语句和分支,该文测试了基本路径集中的路径,在测试资源有限的情况下得到较好的测试效果,并提出了基于图的深度优先搜索的基本路径集的生成方法,该算法采用的生成子路径的方法可以有效地减少路径生成过程中的搜索过程,提高路径生成的效率。 关键词:  相似文献   

12.
ContextEvolutionary algorithms have proved to be successful for generating test data for path coverage testing. However in this approach, the set of target paths to be covered may include some that are infeasible. It is impossible to find test data to cover those paths. Rather than searching indefinitely, or until a fixed limit of generations is reached, it would be desirable to stop searching as soon it seems likely that feasible paths have been covered and all remaining un-covered target paths are infeasible.ObjectiveThe objective is to develop criteria to halt the evolutionary test data generation process as soon as it seems not worth continuing, without compromising testing confidence level.MethodDrawing on software reliability growth models as an analogy, this paper proposes and evaluates a method for determining when it is no longer worthwhile to continue searching for test data to cover un-covered target paths. We outline the method, its key parameters, and how it can be used as the basis for different decision rules for early termination of a search. Twenty-one test programs from the SBSE path testing literature are used to evaluate the method.ResultsCompared to searching for a standard number of generations, an average of 30–75% of total computation was avoided in test programs with infeasible paths, and no feasible paths were missed due to early termination. The extra computation in programs with no infeasible paths was negligible.ConclusionsThe method is effective and efficient. It avoids the need to specify a limit on the number of generations for searching. It can help to overcome problems caused by infeasible paths in search-based test data generation for path testing.  相似文献   

13.
In general, LCSAJ testing more thoroughly exercises the control structure of a piece of software than does either statement or branch testing. Despite this, the exceptionally small number of papers which detail experience of using LCSAJ testing clearly indicates that its popularity falls considerably short of that of the other two methods. One factor that has contributed to this situation is the apparent absence of any attempt to assess the effort entailed by LCSAJ testing in practice, thereby precluding any meaningful cost-effectiveness analysis of the method. Such an attempt is reported in this paper.A significant influence on the effort associated with LCSAJ testing is the number of test paths that must be generated to achieve a specified level of cover, and this is determined by the number of such paths that are found to be infeasible. Effort, therefore, is dependent upon the effectiveness of the path generation method/strategy in avoiding infeasible paths. The attempt to assess the effort entailed by LCSAJ testing which is reported here makes use of a new path selection strategy. This strategy seeks to reduce,a priori, the incidence of infeasible paths in the test set that is generated. Details of the strategy are presented, as are the results which were obtained by applying it to a set of subroutines. From the results, a measure of the effort entailed in employing the strategy is deduced. Subsequently, it is argued that features of the strategy enable pertinent comments to be made not only about the effort associated with employing the strategy, but also about the effort entailed by LCSAJ testing in general.  相似文献   

14.
通过构造新的程序流图,利用Fibonacci法优化选取路径.为指定的分支生成测试数据。提出了路径测试数据生成代价的概念,并给出了代价的计算方法。当所选路径的分支谓词均为线性表达式时,直接求解线性约束集即可生成测试数据,或判定路径不可行;当分支谓词含有非线性表达式时,利用均差近似导数将非线性函数线性化,通过简单的迭代,亦能容易生成测试数据或判定路径在很大程度上不可行。若所选路径不可行或在很大程度上不可行,则选取新的路径,重复以上过程,直至求出所期望的数据,或无新的路径被选取,给定分支不可达。实例和实验表明,算法可行、有效。  相似文献   

15.
Path testing is the strongest coverage criterion in white box testing. Finding target paths is a key challenge in path testing. Genetic algorithms have been successfully used in many software testing activities such as generating test data, selecting test cases and test cases prioritization. In this paper, we introduce a new genetic algorithm for generating test paths. In this algorithm the length of the chromosome varies from iteration to another according to the change in the length of the path. Based on the proposed algorithm, we present a new technique for automatically generating a set of basis test paths which can be used as testing paths in any path testing method. The proposed technique uses a method to verify the independency of the generated paths to be included in the basis set of paths. In addition, this technique employs a method for checking the feasibility of the generated paths. We introduce new definitions for the key concepts of genetic algorithm such as chromosome representation, crossover, mutation, and fitness function to be compatible with path generation. In addition, we present a case study to show the efficiency of our technique. We conducted a set of experiments to evaluate the effectiveness of the proposed path generation technique. The results showed that the proposed technique causes substantial reduction in path generation effort, and that the proposed GA algorithm is effective in test path generation.  相似文献   

16.
Software testing techniques based upon automated analysis of control flow are useful for improving software reliability. The fundamental types of control flow analysis, in ascending order of effectiveness, are statement, branch, and path coverage. Automated tools that perform branch coverage analysis are now accepted practice and researchers are exploring the area that exists between branch and path analysis. Path testing is complicated by the huge number of paths in ordinary programs and by anomalies, such as infeasible paths. The Ct testing strategy is a method for obtaining a manageable set of path classes by specifying a minimum iteration count k. The Ct test coverage metric is a measurement of the proportion of Ct path classes that are exercised within a program. This paper describes an initial experiment in which a special, automated tool was used to evaluate the Ct coverage of tests for a C program of significant size. The results of the study showed that high values of branch coverage may not necessarily imply high path coverage, that approximately 15% of the functions analysed were too complex to analyse effectively, and that the majority of the remaining functions achieved on the order of 11% Ct k=1 coverage. Experimental work in the attainment of high Ct coverage suggests the development of a new, more efficient software testing strategy, which combines Ct path and data flow analysis.  相似文献   

17.
Mutation testing is a technique for testing software units that has great potential for improving the quality of testing, and thereby increasing the ability to assure the high reliability of critical software. It will be shown that recent advances in mutation research have brought a practical mutation testing system closer to reality. One recent advance is a partial solution to the problem of automatically detecting equivalent mutant programs. Equivalent mutants are currently detected by hand, which makes it very expensive and time-consuming. The problem of detecting equivalent mutants is a specific instance of a more general problem, commonly called the feasible path problem, which says that for certain structural testing criteria some of the test requirements are infeasible in the sense that the semantics of the program imply that no test case satisfies the test requirements. Equivalent mutants, unreachable statements in path testing techniques, and infeasible DU-pairs in data flow testing are all instances of the feasible path problem. This paper presents a technique that uses mathematical constraints, originally developed for test data generation, to detect some equivalent mutants and infeasible paths automatically. © 1997 John Wiley & Sons, Ltd.  相似文献   

18.
针对传统蚁群算法在机器人路径规划时存在收敛速度慢、易陷入局部最优等问题,提出了一种基于自适应归档更新的蚁群算法。根据路径性能指标建立多目标性能评估模型,对最优路径进行多指标优化;采用路径方案归档更新策略进行路径方案的更新和筛选,提高算法的收敛速度;当搜索路径进入不可行区域时,采用自适应路径补偿策略转移不可行路径节点,构造可行路径,减少死锁蚂蚁数量;若算法无法避开障碍或者进入停滞状态,则进行种群重新初始化,增加物种多样性,避免算法陷入局部最优。仿真实验表明,改进后的算法收敛速度更快、收敛精度更高、稳定性更好。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

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