共查询到18条相似文献,搜索用时 218 毫秒
1.
《计算机辅助设计与图形学学报》2015,(10)
为了提高测试数据自动生成的效率,提出基于改进遗传算法的多路径测试数据生成方法.首先将定向变异算子引入遗传算法,根据当前最优解产生变异个体,使变异向有利的方向进行,在保持种群多样性的同时提高局部搜索能力;然后综合考虑执行路径与目标路径间的路径相似程度以及谓词分支距离,设计了个体适应度评价函数,以有效地区分个体的优劣程度.针对基准程序进行实验,验证了该方法相对于传统方法的优越性. 相似文献
2.
3.
4.
提出一种基于蜕变关系的多路径覆盖测试数据生成方法。在多路径测试数据进化生成过程中,对于已生成的测试数据,利用被测程序的蜕变关系衍生新的测试数据,以新数据为输入执行被测程序,如果穿越的路径是未找到测试数据的目标路径,则该路径的测试数据同时被生成,从而提高多路径覆盖测试数据的进化生成效率。在典型三角形分类基准测试程序中的应用结果验证了该方法的有效性。 相似文献
5.
6.
针对在回归测试中原有测试数据集往往难以满足新版本软件测试需求的问题,提出一种基于自适应粒子群算法(APSO)的测试数据扩增方法。首先,根据原有测试数据在新版本程序上的穿越路径与目标路径的相似度,在原有的测试数据集中选择合适的测试数据,作为初始种群的进化个体;然后,利用初始测试数据的穿越路径与目标路径的不同子路径,确定造成两者路径偏离的输入分量;最后,根据路径相似度构建适应度函数,利用APSO操作输入分量,生成新的测试数据。该方法针对四个基准程序与基于遗传算法(GA)和随机法的测试数据扩增方法相比,测试数据扩增效率分别平均提高了约56%和81%。实验结果表明,所提方法在回归测试方面有效地提高了测试数据扩增的效率,增强了其稳定性。 相似文献
7.
面向路径覆盖的演化测试用例生成技术 总被引:6,自引:2,他引:4
为了解决目前结构性演化测试主要集中于面向语句、分支等覆盖标准,缺乏面向路径覆盖标准的问题,提出了基于相似性度量的适应值函数构造方法,以用于生成覆盖指定路径的测试用例.首先给出适应值函数构造基本模型,即利用测试数据的真实执行轨迹来评估它相对于指定路径的适应值.该模型的核心在于度量执行轨迹与指定路径之间的相似度,为此给出了3种不同的相似度度量算法.该模型可以完全自动化地为每一条目标路径构造出特定的适应值函数.实验结果表明,相对于其他路径测试方法,该方法在针对复杂路径的情况下具有一定的优势.此外,实验结果还指出了该方法的适用性范围和局限所在. 相似文献
8.
9.
数据流覆盖可有效地检测软件中的缺陷与错误.针对该覆盖准则中存在的插装监测开销庞大和测试数据生成效率不高的问题,提出一种新的基于定值-引用对覆盖的测试数据进化生成方法.该方法主要分为两部分,首先,通过约减测试目标来减少插装开销,提出的包含关系算法可找到一个定值—引用对子集,使得覆盖该子集就能保证所有测试目标被覆盖;然后,采用遗传算法为所有测试目标生成测试数据,设计的适应度函数综合考虑个体实际执行的路径与每个测试目标的定义明确路径的匹配程度.将该方法用于8个基准程序的测试数据生成,并与其他方法比较,结果显示其可有效提高程序覆盖率和测试数据生成效率. 相似文献
10.
11.
孙宁 《计算机与数字工程》2010,38(1):52-57
提出了基于GA的多路径测试数据生成的概念和实现方法。讨论了为了实现多路径测试数据生成,设计有效的和高效的适配函数应考虑的因素,用实际案例针对提出的适配函数进行了功能性能验证。结果表明了适配函数设计的有效性。 相似文献
12.
以程序结构测试自动生成为研究背景,提出了一种重叠路径结构用以描述程序路径,并以此为基础设计了一种多路径测试数据生成适应值算法,实现了一次搜索完成多条路径的测试数据生成。算法通过目标路径间共享遗传算法产生的中间个体减少单一路径搜索始于随机产生的无序个体的初期迭代,从而加快搜索收敛的速度。应用于常用的基准程序和取自实际项目的程序,该算法与典型的分支谓词距离算法相比平均消耗时间缩短了70.6%。 相似文献
13.
Karnig Derderian Robert M. Hierons Mark Harman Qiang Guo 《Automated Software Engineering》2010,17(1):33-56
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. 相似文献
14.
15.
16.
The software testing phase in the software development process is considered a time-consuming process. In order to reduce
the overall development cost, automatic test data generation techniques based on genetic algorithms have been widely applied.
This research explores a new approach for using genetic algorithms as test data generators to execute all the branches in
a program. In the literature, existing approaches for test data generation using genetic algorithms are mainly focused on
maintaining a single-population of candidate tests, where the computation of the fitness function for a particular target
branch is based on the closeness of the input execution path to the control dependency condition of that branch. The new approach
utilizes acyclic predicate paths of the program’s control flow graph containing the target branch as goals of separate search
processes using distinct island populations. The advantages of the suggested approach is its ability to explore a greater
variety of execution paths, and in certain conditions, increasing the search effectiveness. When applied to a collection of
programs with a moderate number of branches, it has been shown experimentally that the proposed multiple-population algorithm
outperforms the single-population algorithm significantly in terms of the number of executions, execution time, time improvement,
and search effectiveness. 相似文献
17.
适应度函数的设计在基于搜索的测试用例生成技术中占据重要的位置,然而在某些特殊的程序中,如存在嵌套、非结构性跳转或因return,break等语句跳出循环的程序,已有的适应度函数无法评价到所有的分支.目前的方法是修改程序的源代码,以使每个分支得到评价.但修改源代码不但可能影响程序的原有结构、引入错误,而且很难实现自动化.针对这一问题,提出一种基于模式组合的粒子群优化测试用例生成方法.首先,将分支条件定义为"模式",即,一类具有相同特征且能提高适应度值的个体集合,并改变其分支函数的插桩方式,可解决分支条件不完全评价的问题;然后,设计一种新的交叉算子,寻找到所有使模式的分支函数值最小的个体,将这些个体中含有模式的部分通过交叉算子组合到一个个体上,既可防止模式在进化过程中被破坏,又可因多种模式的组合而提高个体的适应度值;最后,使用局部搜索策略对种群中的最优个体进行搜索,提高粒子群优化算法的局部搜索精度,进一步提高测试用例生成效率.为了评价该方法的有效性,基于一组基准程序和开源程序进行实验.实验结果表明:对于含有模式的程序,该测试用例生成方法与已有方法相比,在覆盖率和平均进化代数上均有明显优势. 相似文献