首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 15 毫秒
1.
一种路径测试数据自动生成方法   总被引:1,自引:0,他引:1       下载免费PDF全文
适应值函数的设计是决定测试数据生成质量和效率的关键,为此提出一种重叠路径结构,对程序路径进行描述,并设计基于遗传算法全路径比较的路径测试数据生成适应值函数。为测试数据生成算法定义生成时间期望的综合性能评价指标,以该指标与对照组算法进行比较实验。结果显示,该适应值函数能较好地平衡算法收敛性和消耗时间之间的矛盾。  相似文献   

2.
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.  相似文献   

3.

Context

The extended finite state machine (EFSM) is a modelling approach that has been used to represent a wide range of systems. When testing from an EFSM, it is normal to use a test criterion such as transition coverage. Such test criteria are often expressed in terms of transition paths (TPs) through an EFSM. Despite the popularity of EFSMs, testing from an EFSM is difficult for two main reasons: path feasibility and path input sequence generation. The path feasibility problem concerns generating paths that are feasible whereas the path input sequence generation problem is to find an input sequence that can traverse a feasible path.

Objective

While search-based approaches have been used in test automation, there has been relatively little work that uses them when testing from an EFSM. In this paper, we propose an integrated search-based approach to automate testing from an EFSM.

Method

The approach has two phases, the aim of the first phase being to produce a feasible TP (FTP) while the second phase searches for an input sequence to trigger this TP. The first phase uses a Genetic Algorithm whose fitness function is a TP feasibility metric based on dataflow dependence. The second phase uses a Genetic Algorithm whose fitness function is based on a combination of a branch distance function and approach level.

Results

Experimental results using five EFSMs found the first phase to be effective in generating FTPs with a success rate of approximately 96.6%. Furthermore, the proposed input sequence generator could trigger all the generated feasible TPs (success rate = 100%).

Conclusion

The results derived from the experiment demonstrate that the proposed approach is effective in automating testing from an EFSM.  相似文献   

4.
为提高路径覆盖测试效率,提出采用融入自适应迁移的生物地理学优化算法自动生成满足目标路径覆盖的测试用例。首先,根据路径覆盖难易,在分枝距离法中引入加权因子并转换为栖息地适应指数。然后,综合最优栖息地和迁出地相关因子优化迁入地适应度指数变量,同时对满足条件的种群进行以个体当前值为中心、适应值为幅度的变异操作。对经典基准程序进行生成测试用例的对比实验结果表明,算法不仅能满足目标路径覆盖要求,而且速度和稳定性均有明显优势。  相似文献   

5.
Heuristic search-based test data generation has a potential higher efficiency in software testing with path covering. However, these approaches are suffered in covering the long and complex path. In this paper, we propose a method for generating test data based on program slicing and particle swarm optimization. With the interest points selected from a target path, we perform a program slicing to remove the statements which are irrelevant to the interest points. Our method simplifies the target path and the actual path to get a better fitness value. After program slices obtained, the population is evolved using particle swarm optimization to improve the efficiency of test data generation.  相似文献   

6.
There has been significant interest in automating testing on the basis of an extended finite state machine (EFSM) model of the required behaviour of the implementation under test (IUT). Many test criteria require that certain parts of the EFSM are executed. For example, we may want to execute every transition of the EFSM. In order to find a test suite (set of input sequences) that achieves this we might first derive a set of paths through the EFSM that satisfy the criterion using, for example, algorithms from graph theory. We then attempt to produce input sequences that trigger these paths. Unfortunately, however, the EFSM might have infeasible paths and the problem of determining whether a path is feasible is generally undecidable. This paper describes an approach in which a fitness function is used to estimate how easy it is to find an input sequence to trigger a given path through an EFSM. Such a fitness function could be used in a search-based approach in which we search for a path with good fitness that achieves a test objective, such as executing a particular transition, and then search for an input sequence that triggers the path. If this second search fails then we search for another path with good fitness and repeat the process. We give a computationally inexpensive approach (fitness function) that estimates the feasibility of a path. In order to evaluate this fitness function we compared the fitness of a path with the ease with which an input sequence can be produced using search to trigger the path and we used random sampling in order to estimate this. The empirical evidence suggests that a reasonably good correlation (0.72 and 0.62) exists between the fitness of a path, produced using the proposed fitness function, and an estimate of the ease with which we can randomly generate an input sequence to trigger the path.  相似文献   

7.
面向路径覆盖的演化测试用例生成技术   总被引:6,自引:2,他引:4  
谢晓园  徐宝文  史亮  聂长海 《软件学报》2009,20(12):3117-3136
为了解决目前结构性演化测试主要集中于面向语句、分支等覆盖标准,缺乏面向路径覆盖标准的问题,提出了基于相似性度量的适应值函数构造方法,以用于生成覆盖指定路径的测试用例.首先给出适应值函数构造基本模型,即利用测试数据的真实执行轨迹来评估它相对于指定路径的适应值.该模型的核心在于度量执行轨迹与指定路径之间的相似度,为此给出了3种不同的相似度度量算法.该模型可以完全自动化地为每一条目标路径构造出特定的适应值函数.实验结果表明,相对于其他路径测试方法,该方法在针对复杂路径的情况下具有一定的优势.此外,实验结果还指出了该方法的适用性范围和局限所在.  相似文献   

8.
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 studies 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 evolutionary algorithmis employed to solve the formulatedmodel, and several types of fault detectionmethods are given. Finally, the proposed method is applied to several real-world programs, and compared with a random method and evolutionary optimization 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.  相似文献   

9.
以程序结构测试自动生成为研究背景,提出了一种重叠路径结构用以描述程序路径,并以此为基础设计了一种多路径测试数据生成适应值算法,实现了一次搜索完成多条路径的测试数据生成。算法通过目标路径间共享遗传算法产生的中间个体减少单一路径搜索始于随机产生的无序个体的初期迭代,从而加快搜索收敛的速度。应用于常用的基准程序和取自实际项目的程序,该算法与典型的分支谓词距离算法相比平均消耗时间缩短了70.6%。  相似文献   

10.
传统的随机树生成算法对于大规模树状结构数据集的可视化算法测试有很大的局限性。在经典随机树生成算法-GROW算法的基础上提出了两种新的随机树生成算法,实验表明它们均可以生成接近于期望规模的随机树,但在平衡性、时间复杂度、最终生成树的规模、宽度与深度的随机性方面表现各异。同时对这些特性与相关参数的关系作了探讨,实验结果分析表明参数因子的选取直接影响着生成随机树的最终表现,对于随机算法的选取有着很好的指导性作用。  相似文献   

11.
姚香娟  巩敦卫  李彬 《软件学报》2016,27(4):828-838
利用遗传算法生成复杂软件的测试数据,是软件测试领域一个全新的研究方向.传统的基于遗传算法的测试数据生成技术,需要以每个测试数据作为输入运行被测程序,以获得个体的适应值,因此,需要消耗大量的运行时间.为了降低运行程序带来的时间消耗,提出一种基于神经网络的路径覆盖测试数据进化生成方法,主要思想是:首先,利用一定样本训练神经网络,以模拟个体的适应值;在利用遗传算法生成测试数据时,先利用训练好的神经网络粗略计算个体适应值;对适应值较好的优秀个体,再通过运行程序,获得精确的适应值.最后的实验结果表明,该方法可以有效降低运行程序产生的时间消耗,从而提高测试数据生成的效率.  相似文献   

12.
包晓安  熊子健  张唯  吴彪  张娜 《计算机科学》2018,45(8):174-178, 190
采用遗传算法求解路径覆盖的测试用例生成问题是软件测试自动化的研究热点。针对传统标准遗传方法搜索测试用例易产生早熟收敛和收敛速度较慢的不足,设计了自适应的交叉算子和变异算子,提高了算法的全局寻优能力。基于动态生成算法框架,通过程序静态分析,考虑了分支嵌套深度的影响,结合层接近度和分支距离法,提出一种新的适应度函数。实验结果表明,该算法在面向路径的测试用例生成上优于传统方法,提高了测试效率。  相似文献   

13.
机器学习方法可很好地与软件测试相结合, 增强测试效果, 但少有学者将其运用于测试数据生成方面. 为进一步提高测试数据生成效率, 提出一种结合SVM (support vector machine)和XGBoost (extreme gradient boosting)的链式模型, 并基于此模型借助遗传算法实现多路径测试数据生成. 首先, 利用一定样本训练若干个用于预测路径节点状态的子模型(SVM和XGBoost), 通过子模型的预测精度值筛选最优子模型, 并根据路径节点顺序将其依次链接, 形成一个链式模型C-SVMXGBoost (chained SVM and XGBoost). 在利用遗传算法生成测试用例时, 使用训练好的链式模型代替插桩法获取测试数据覆盖路径(预测路径), 寻找预测路径与目标路径相似的路径集, 对存在相似路径集的预测路径进行插桩验证, 获取精确路径, 计算适应度值. 在交叉变异过程中引入样本集中路径层级深度较大的优秀测试用例进行重用, 生成覆盖目标路径的测试数据. 最后, 保留进化生成中产生的适应度较高的个体, 更新链式模型C-SVMXGBoost, 进一步提高测试效率. 实验表明, C-SVMXGBoost较其他各对比链式模型更适合解决路径预测问题, 可提高测试效率. 并且通过与已有经典方法相比, 所提方法在覆盖率上提高可达15%, 平均进化代数也有所降低, 在较大规模程序上其降低百分比可达65%.  相似文献   

14.
基于内分泌调节机制的粒子群算法   总被引:1,自引:0,他引:1  
借鉴内分泌系统的高级调节机制,提出一种基于内分泌调节机理的粒子群算法.首先设计一种结合当前粒子群的最好适应度、平均适应度和局部适应度的情感评价方法,对下一代粒子群进行情感评价,然后用神经系统和内分泌系统共同作用,对粒子群的行为进行更新,在更新过程中。引入动量项减少局部收敛的发生.文中同时分析了算法的收敛性,并对几个典型函数优化问题和机器人路径规划进行实验,验证方法的有效性.  相似文献   

15.
The most simple evolutionary algorithm (EA), the so-called (1 + 1) EA, accepts an offspring if its fitness is at least as large (in the case of maximization) as the fitness of its parent. The variant (1 + 1)* EA only accepts an offspring if its fitness is strictly larger than the fitness of its parent. Here, two functions related to the class of long-path functions are presented such that the (1 + 1) EA maximizes one in polynomial time and needs exponential time for the other while the (1 + 1)* EA has the opposite behavior. These results demonstrate that small changes of an EA may change its behavior significantly. Since the (1 + 1) EA and the (1 + 1)* EA differ only on plateaus of constant fitness, the results also show how EAs behave on such plateaus. The (1 + 1) EA can pass a path of constant fitness and polynomial length in polynomial time. Finally, for these functions, it is shown that local performance measures like the quality gain and the progress rate do not describe the global behavior of EAs  相似文献   

16.
丁蕊  董红斌  冯宪彬  赵佳华 《计算机应用》2016,36(10):2816-2821
针对面向路径覆盖的测试数据生成问题,提出基于烟花爆炸优化算法的测试数据生成方法。首先使用关键点路径表示法表示路径,由理论路径、易覆盖路径和不可行路径得出难覆盖路径,并记录难覆盖路径邻近的易覆盖路径及其测试数据。这些测试数据将作为部分初始烟花以利用其提供的启发信息,其余初始烟花则随机生成。接着根据个体的适应度值设计自适应策略的爆炸半径以提高收敛速度,对爆炸产生的越界火花则使用边界值测试的思想进行修正。与加了启发信息的自适应爆炸半径的烟花算法(NFEO算法)、烟花爆炸优化(FEO)算法、F-method、NF-method等七种基于优化的测试数据生成算法进行了仿真对比实验,实验结果表明:所提算法在测试数据生成时间和迭代次数上都最优。  相似文献   

17.
The activities of software testing and reliability are integrated for the purpose of demonstrating how the two activities interact in achieving testing efficiency and the reliability resulting from these tests. Integrating means modeling the execution of a variety of tests on a directed graph representation of an example program. A complexity metric is used to construct the nodes, edges, and paths of the example program. Models are developed to represent the efficiency and achieved reliability of black box and white box tests. Evaluations are made of path, independent path, node, program construct, and random tests to ascertain which, if any, is superior with respect to efficiency and reliability. Overall, path testing has the edge in test efficiency. The results depend on the nature of the directed graph in relation to the type of test. Although there is no dominant method, in most cases the tests that provide detailed coverage are better. For example, path testing discovers more faults than independent path testing. Predictions are made of the reliability and fault correction that results from implementing various test strategies. It is believed that these methods can be used by researchers and practitioners to evaluate the efficiency and reliability of other programs. Copyright © 2008 John Wiley & Sons, Ltd.  相似文献   

18.
针对测试数据自动生成问题,首先分析了遗传算法和粒子群算法的工作原理,结合两种算法各自的特点提出了一个基于智能算法的测试数据自动生成系统模型。模型以智能优化算法为核心,通过评价函数计算适配值,多次迭代后在测试环境中输出测试用例。在典型测试问题上进行了仿真实验,结果表明提出的模型能够提高用例生成效率,具有广泛的应用拓展空间。  相似文献   

19.
数据流覆盖可有效地检测软件中的缺陷与错误.针对该覆盖准则中存在的插装监测开销庞大和测试数据生成效率不高的问题,提出一种新的基于定值-引用对覆盖的测试数据进化生成方法.该方法主要分为两部分,首先,通过约减测试目标来减少插装开销,提出的包含关系算法可找到一个定值—引用对子集,使得覆盖该子集就能保证所有测试目标被覆盖;然后,采用遗传算法为所有测试目标生成测试数据,设计的适应度函数综合考虑个体实际执行的路径与每个测试目标的定义明确路径的匹配程度.将该方法用于8个基准程序的测试数据生成,并与其他方法比较,结果显示其可有效提高程序覆盖率和测试数据生成效率.  相似文献   

20.
一种求解参数优化问题的引导交叉算子   总被引:1,自引:0,他引:1       下载免费PDF全文
提出一种应用于参数优化问题的引导交叉算子。该交叉算子利用父代染色体的适应值差异,引导交叉操作产生的子代向适应值高的父代倾斜,以产生高适应值的子代个体。对于连续函数,高适应值个体的邻域内也是高适应值的个体,且在两个个体之间不存在极值时,朝适应值增加的方向可以生成更优的个体。实验表明,对比常用的算术交叉算子,引导交叉算子具有更强的全局、局部搜索能力和更快的搜索速度。  相似文献   

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

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