首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 15 毫秒
1.
The aim of software testing is to find faults in a program under test, so generating test data that can expose the faults of a program is very important. To date, current stud- ies on generating test data for path coverage do not perform well in detecting low probability faults on the covered path. The automatic generation of test data for both path coverage and fault detection using genetic algorithms is the focus of this study. To this end, the problem is first formulated as a bi-objective optimization problem with one constraint whose objectives are the number of faults detected in the traversed path and the risk level of these faults, and whose constraint is that the traversed path must be the target path. An evolution- ary algorithm is employed to solve the formulated model, and several types of fault detection methods are given. Finally, the proposed method is applied to several real-world programs, and compared with a random method and evolutionary opti- mization method in the following three aspects: the number of generations and the time consumption needed to generate desired test data, and the success rate of detecting faults. The experimental results confirm that the proposed method can effectively generate test data that not only traverse the target path but also detect faults lying in it.  相似文献   

2.
Generating test data that can expose the faults of the program is an important issue in software testing. Although previous methods of covering path can generate test data to traverse target path, the test data generated by these methods are difficult in detecting some low-probabilistic faults that lie on the covered paths. We present a method of generating test data for covering multiple paths to detect faults in this study. First, we transform the problem of covering multiple paths and detecting faults into a multi-objective optimization problem with constraint, and construct a mathematical model for it. Then, we give a strategy of solving the model based on a weighted genetic algorithm. Finally, we apply our method to several real-world programs, and compare it with several methods. The experimental results confirm that the proposed method can more efficiently generate test data that not only traverse the target paths but also detect faults lying in them than other methods.  相似文献   

3.
This paper presents a technique that uses a genetic algorithm for automatic test‐data generation. A genetic algorithm is a heuristic that mimics the evolution of natural species in searching for the optimal solution to a problem. In the test‐data generation application, the solution sought by the genetic algorithm is test data that causes execution of a given statement, branch, path, or definition–use pair in the program under test. The test‐data‐generation technique was implemented in a tool called TGen, in which parallel processing was used to improve the performance of the search. To experiment with TGen, a random test‐data generator called Random was also implemented. Both Tgen and Random were used to experiment with the generation of test‐data for statement and branch coverage of six programs. Copyright © 1999 John Wiley & Sons, Ltd.  相似文献   

4.
结构测试数据自动生成是结构测试结构测试数据自动生成方法后,重点对基于演化算法的结构测试数据自动生成方法加以评述.归纳了该方法的基本思想和基本流程,按照适应度函数构造方式的不同将其划分为面向覆盖法、面向距离法和综合法三大类,并结合相关文献分析了这三类方法各自的技术特点,比较了各自的优劣.最后,指出了存在的不足,探讨了发展方向.  相似文献   

5.
复杂软件大规模路径覆盖测试数据生成问题普遍存在,但缺乏有效的解决方法,为此提出一种基于自适应分组的大规模路径覆盖测试数据进化生成方法.在进化过程中,通过合并满足条件的组,将测试数据生成问题转化为数量不断减少的约束多目标优化问题,采用多种群遗传算法加以解决,并给出了合并后的种群形成策略.将所提出的方法应用于基准测试程序,结果表明可以大大减少测试数据生成时间,为提高软件测试效率提供了一条可行途径.  相似文献   

6.
Automated test data generation plays an important part in reducing the cost and increasing the reliability of software testing. However, a challenging problem in path-oriented test data generation is the existence of infeasible program paths, where considerable effort may be wasted in trying to generate input data to traverse the paths. In this paper, we propose a heuristics-based approach to infeasible path detection for dynamic test data generation. Our approach is based on the observation that many infeasible program paths exhibit some common properties. Through realizing these properties in execution traces collected during the test data generation process, infeasible paths can be detected early with high accuracy. Our experiments show that the proposed approach efficiently detects most of the infeasible paths with an average precision of 96.02% and a recall of 100% of all the cases.  相似文献   

7.
刘继华  陈策 《计算机应用》2012,32(11):3075-3081
为解决基于状态节点搜索的完全路径覆盖所产生的测试用例数过多和难以实现连续测试的问题,提出了一种基于变迁的完全路径覆盖测试准则,并设计和实现了一种深度优先搜索与宽度优先搜索相结合的基于变迁完全路径覆盖测试用例自动生成算法。实验结果表明,基于变迁的完全路径覆盖准则比基于状态的完全路径覆盖准则更为严格,相应的算法可以产生更优的测试用例集,能更方便地完成软件的连续动态测试。  相似文献   

8.
Previous research using genetic algorithms to automate the generation of data for path testing has utilized several different fitness functions, assessing their usefulness by comparing them to random generation. This paper describes two sets of experiments that assess the performance of several fitness functions, relative to one another and to random generation. The results demonstrate that some fitness functions provide better results than others, generating fewer test cases to exercise a given program path. In these studies, the branch predicate and inverse path probability approaches were the best performers, suggesting that a two‐step process combining these two methods may be the most efficient and effective approach to path testing. Copyright © 2005 John Wiley & Sons, Ltd.  相似文献   

9.
综合考虑影响适应度函数设计的因素,提出一种基于层次分析法的适应度函数设计方法。该方法首先将影响路径之间相似度的因素归结为三要素,并建立层次分析模型。根据不同因素对路径间相似度的作用重要程度不同,建立因素之间两两比较的判断矩阵,确定每个因素的权重系数,进而构造适应度函数。最后,将该方法用于基于遗传算法的多路径覆盖的测试数据生成。实验结果表明,对于解决多路径覆盖的测试数据生成问题,与已有方法相比,该方法具有较好的优越性。  相似文献   

10.
有效降低测试成本是软件测试优化的重要研究问题。将遗传算法引入到软件测试中,对生成测试场景提供了必要的动力,然而遗传算法局域搜索能力差,在进化后期搜索效率低,导致算法比较费时。基于UML活动图提出了混合遗传算法生成测试场景的方法,该方法结合遗传算法和爬山法,有效地加快了测试场景的生成速度。为了避免局部性问题,在算法每次进行爬山操作之前调用种群生成函数。实验结果表明,与简单的遗传算法相比,混合遗传算法不仅有效地解决了局部性问题,而且较大地提高了生成测试场景的效率,降低了软件测试成本。  相似文献   

11.
Automatic test data generation is a very popular domain in the field of search‐based software engineering. Traditionally, the main goal has been to maximize coverage. However, other objectives can be defined, such as the oracle cost, which is the cost of executing the entire test suite and the cost of checking the system behavior. Indeed, in very large software systems, the cost spent to test the system can be an issue, and then it makes sense by considering two conflicting objectives: maximizing the coverage and minimizing the oracle cost. This is what we did in this paper. We mainly compared two approaches to deal with the multi‐objective test data generation problem: a direct multi‐objective approach and a combination of a mono‐objective algorithm together with multi‐objective test case selection optimization. Concretely, in this work, we used four state‐of‐the‐art multi‐objective algorithms and two mono‐objective evolutionary algorithms followed by a multi‐objective test case selection based on Pareto efficiency. The experimental analysis compares these techniques on two different benchmarks. The first one is composed of 800 Java programs created through a program generator. The second benchmark is composed of 13 real programs extracted from the literature. In the direct multi‐objective approach, the results indicate that the oracle cost can be properly optimized; however, the full branch coverage of the system poses a great challenge. Regarding the mono‐objective algorithms, although they need a second phase of test case selection for reducing the oracle cost, they are very effective in maximizing the branch coverage. Copyright © 2011 John Wiley & Sons, Ltd.  相似文献   

12.
改进遗传算法用于移动机器人路径规划   总被引:3,自引:0,他引:3  
对三维机器人路径空间进行分解,采用栅格法建立路径空间模型,根据栅格序号编码的特点以及栅格序号在路径空间中的分布规律,设计一种随机快速搜索算法产生遗传算法的初始种群.对遗传算子进行适当的改进,以避免种群退化现象的出现,使算法能够快速收敛.把路径最短和能量消耗最少同时作为优化目标,对改进的遗传算法进行了仿真测试,测试结果表明,该算法简单而有效,并且对机器人路径空间的变化具有一定的适应能力.  相似文献   

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

14.
15.
Software testing is one of the most crucial and analytical aspect to assure that developed software meets prescribed quality standards. Software development process invests at least 50% of the total cost in software testing process. Optimum and efficacious test data design of software is an important and challenging activity due to the nonlinear structure of software. Moreover, test case type and scope determines the quality of test data. To address this issue, software testing tools should employ intelligence based soft computing techniques like particle swarm optimization (PSO) and genetic algorithm (GA) to generate smart and efficient test data automatically. This paper presents a hybrid PSO and GA based heuristic for automatic generation of test suites. In this paper, we described the design and implementation of the proposed strategy and evaluated our model by performing experiments with ten container classes from the Java standard library. We analyzed our algorithm statistically with test adequacy criterion as branch coverage. The performance adequacy criterion is taken as percentage coverage per unit time and percentage of faults detected by the generated test data. We have compared our work with the heuristic based upon GA, PSO, existing hybrid strategies based on GA and PSO and memetic algorithm. The results showed that the test case generation is efficient in our work.  相似文献   

16.
多维数据实视图选择问题是一个NP完全问题。提出一种基于约束的多目标优化遗传算法,将查询代价和维护代价分开考虑,更有效地解决复杂的实视图选择问题。实验结果表明,该算法具有更好的性能,特别是在获得的Pareto前沿的分布性上。  相似文献   

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

18.
19.
In this paper, the authors describe a novel technique based on continuous genetic algorithms (CGAs) to solve the path generation problem for robot manipulators. We consider the following scenario: given the desired Cartesian path of the end-effector of the manipulator in a free-of-obstacles workspace, off-line smooth geometric paths in the joint space of the manipulator are obtained. The inverse kinematics problem is formulated as an optimization problem based on the concept of the minimization of the accumulative path deviation and is then solved using CGAs where smooth curves are used for representing the required geometric paths in the joint space through out the evolution process. In general, CGA uses smooth operators and avoids sharp jumps in the parameter values. This novel approach possesses several distinct advantages: first, it can be applied to any general serial manipulator with positional degrees of freedom that might not have any derived closed-form solution for its inverse kinematics. Second, to the authors’ knowledge, it is the first singularity-free path generation algorithm that can be applied at the path update rate of the manipulator. Third, extremely high accuracy can be achieved along the generated path almost similar to analytical solutions, if available. Fourth, the proposed approach can be adopted to any general serial manipulator including both nonredundant and redundant systems. Fifth, when applied on parallel computers, the real time implementation is possible due to the implicit parallel nature of genetic algorithms. The generality and efficiency of the proposed algorithm are demonstrated through simulations that include 2R and 3R planar manipulators, PUMA manipulator, and a general 6R serial manipulator.  相似文献   

20.
J. Zhang  P. D. Roberts 《Knowledge》1992,5(4):277-288
The self learning of diagnostic rules can ease knowledge-acquisition effort, and it is more desirable in cases where experience about certain faults is not available. Applications of genetic algorithms to the self learning of diagnostic rules for a pilot-scale mixing process and a continuous stirred-tank reactor system are described in the paper. In this method, a set of training data, which could be obtained from simulations and/or from the recorded data of the previous operations of the real process, is required. The training data is divided into various groups corresponding to various faults and the normal operating condition. Corresponding to each fault, there is a group of initial rules which are coded into binary strings. These rules are evaluated by a genetic algorithm which contains the three basic operators, reproduction, crossover and mutation, and an added operator which preserves the best rule ever discovered. Through this biological-type evaluation, new fitted rules are discovered. The results demonstrate that diagnostic rules fitted with a given set of training data can be efficiently discovered through genetic learning, and, hence, that genetic algorithms provide a means for the automatic creation of rules from a set of training data. It is also demonstrated that bad training data and the inappropriate formulation of rules could degrade the performance of the learning system.  相似文献   

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

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