首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 15 毫秒
1.
一种结构测试数据自动生成的框架   总被引:1,自引:0,他引:1       下载免费PDF全文
针对结构测试中控制流和数据流覆盖测试数据的生成都可以归结为面向路径的测试数据生成的问题,提出了一个通用的基于控制流和数据流的结构测试数据自动生成的框架。该框架根据控制流和数据流测试中所采用的覆盖标准优化选取测试路径,并以改进后的迭代松弛法为核心,对所选取的路径生成测试数据。以基于路径覆盖、分支覆盖和数据流覆盖测试数据自动生成这3种算法为核心,开发了一个测试数据自动生成的框架原型。实验结果表明该框架是可行的。  相似文献   

2.
为了实现对软件配置项和软件系统的接口测试的测试用例自动生成,建立了基于通信协议的接口测试用例自动生成框架,对该生成框架的输入模型和算法集合进行研究。提出了基于通信协议的接口测试用例生成框架的输入模型,并在输入模型中建立数据帧之间的一级关联矩阵和数据帧内字段间的二级关联矩阵。以输入模型为基础,说明发送端和接收端的接口测试用例自动生成算法。结合实际项目中的通信协议,介绍了如何将通信协议信息转换至输入模型,如何通过算法集合自动生成测试用例集。实验结果表明:基于通信协议的接口测试用例自动生成框架生成的接口测试用例可以替代人工生成的接口测试用例,极大地提高了软件接口测试工作的效率。  相似文献   

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

4.

Unit testing is widely used in software development. One important activity in unit testing is automatic test data generation. Constraint-based test data generation is a technique for automatic generation of test data, which uses symbolic execution to generate constraints. Unit testing only tests functions instead of the whole program, where individual functions typically have preconditions imposed on their inputs. Conventional symbolic execution cannot detect these preconditions, let alone converting these preconditions into constraints. To overcome these limitations, we propose a novel unit test data generation approach using rule-directed symbolic execution for dealing with functions with missing input preconditions. Rule-directed symbolic execution uses predefined rules to detect preconditions in the individual function, and generates constraints for inputs based on preconditions. We introduce implicit constraints to represent preconditions, and unify implicit constraints and program constraints into integrated constraints. Test data generated based on integrated constraints can explore previously unreachable code and help developers find more functional faults and logical faults. We have implemented our approach in a tool called CTS-IC, and applied it to real-world projects. The experimental results show that rule-directed symbolic execution can find preconditions (implicit constraints) automatically from an individual function. Moreover, the unit test data generated by our approach achieves higher coverage than similar tools and efficiently mitigates missing input preconditions problems in unit testing for individual functions.

  相似文献   

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

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

7.
Improved method to generate path-wise test data   总被引:4,自引:0,他引:4       下载免费PDF全文
Gupta et al.,propsed a method ,which is referred to as the Iterative Relaxation Method ,to generate test data for a given path in a program by linearizing the predicate functions.In this paper,a model language is presented and the properties of static and dynamic data depen-dencies are investigated ,The notions in the Interative Relaxation Method are defined formally.The predicate slice proposed by Gupta et al.is extended to path-wise static slice.The correctness of the constructional algorithm is proved afterward The improvement shows that the constructions of predicate slice and input dependency set can be omitted .The equivalence of systems of constraints generated by both methods is proved ,The prototype of path-wise test data generator is presented in this paper,The experiments show shat our method is practical ,and fits the path-wise automatic generation of test data for both whicte -bos testing and black-blx testing.  相似文献   

8.
传统基于随机算法、约束求解以及面向白盒测试的测试数据生成方法往往忽略了测试数据与数据库系统之间的依赖关系,同时并不适用于数据复用、Web应用测试。提出一种面向业务流程数据约束的测试数据生成与筛选方法,通过在Web业务流程模型中引入对测试数据的半形式化约束,利用数据池存储技术,并提高测试数据的复用性。通过案例表明,新的测试数据生成技术能够以较低的开销生成可用性高的测试数据集。  相似文献   

9.
面向路径的测试数据自动生成工具的设计与实现   总被引:1,自引:0,他引:1  
面向路径的测试数据生成问题是软件测试中的一个基本问题。Gupta等提出一种线性化谓词函数的迭代松驰方法求解该问题。文献[2]改进了该方法,证明改进后的方法与原方法生成的约束系统相同,文章以改进后的方法为核心算法,根据软件工程的思想,采用面向对象的方法,使用UML进行设计,并且在Linux Red Hat7.0操作系统下用C++语言言实现一个为程序路径自动生成测试数据的原型工具,然后将它移植到Windows操作系统。  相似文献   

10.
This paper presents an automatic method for calculating the path condition for programs with real time constraints. We model concurrent systems using timed transition systems and translate them into extended timed automata. Then an acyclic extended timed automaton is constructed and the path condition is calculated backwards over it. This method can be used for semiautomatic verification of a unit of code in isolation, i.e., without providing the exact values of parameters with which it is called. It can also be used for test case generation for real-time systems. Such a symbolic model checking algorithm was implemented previous in the PET system [E. Gunter, D. Peled, Unit checking: Symbolic model checking for a unit of code, Verification: Theory and Practice 2003, Essays Dedicated to Zohar Manna on the Occasion of his 64th Birthday, Lecture Notes in Computer Science, vol. 2772, Springer, 548–567] for untimed systems. Our method can also be used for the automatic generation of test cases for unit testing. The current generalization of the calculation of path condition for the timed case turns out to be quite tricky, since not only the selected path contributes to the path condition, but also timing constraints of alternative choices in the code.  相似文献   

11.
Existing methods for testing an SDL specification mainly allow for either black box simulation or conformance testing to verify that the behavior of an implementation matches its corresponding model. However, this relies on the potentially hazardous assumption that the model is completely correct. We propose a test generation method that can accomplish conformance verification as well as coverage criteria-driven white box testing of the specification itself. We first reformat a set of EFSMs equivalent to the processes in an SDL specification and identify “hot spots” – nodes or edges in the EFSM which should be prioritized during testing to effectively increase coverage. Then, we generate test sequences intended to cover selected hot spots; we address the possible infeasibility of such a test sequence by allowing for its rejection decided by a constraint solver and re-generation of an alternate test sequence to the hot spot. In this paper, we present our test generation method and tool, and provide case studies on five SDL processes demonstrating the effectiveness of our coverage-based test sequence selection.  相似文献   

12.
王元珍  顾鹏 《计算机工程》2006,32(13):196-197,205
测试用例的产生是软件测试过程中的重要环节,也是瓶颈之一。遗传算法作为一种高效的搜索寻优算法,近年来较多地用于自动化测试中产生测试用例。该文结合数据库管理系统源代码的特点,在基本遗传算法的基础上,结合“位权重”和“邻居影响”的思想,提出了用于产生多条路径上测试用例的改进遗传算法,并通过实验验证了该算法的有效性。  相似文献   

13.
运用程序控制流图,可以方便地度量程序的逻辑复杂度,确定软件测试中控制结构独立路径的基本集合。文章提出了根据程序设计的伪码,自动生成程序控制流图的数据结构和详细的算法,为进行控制优化、软件基本路径测试以及程序控制相关性分析提供了良好的基础。  相似文献   

14.
基于蚁群算法的软件测试数据自动生成   总被引:16,自引:0,他引:16  
傅博 《计算机工程与应用》2007,43(12):97-99,211
提出了一种基于蚁群算法的测试数据自动生成方法。该方法采用位串形式编码,实现了被测程序输入空间到蚂蚁路径网络的映射模型。根据程序插装函数定义的路径信息素轨迹强度,蚂蚁进行群体协作搜索最佳路径,生成测试数据。在基本蚁群算法基础上,通过引入变异算子和自适应挥发系数,提高了蚂蚁路径的多样性,克服了早熟停滞的缺陷。和模拟退火遗传算法进行了对比实验研究,结果表明了该方法的可行性,生成测试数据的效率优于模拟退火遗传算法。  相似文献   

15.
测试用例自动生成是提高软件测试效率的重要手段.针对传统遗传算法的测试用例自动生成方法存在早熟收敛、迭代后期种群多样性降低等问题,提出了一种基于混沌遗传算法的测试用例自动生成模型,运用反向学习策略初始化种群,结合层接近度改进个体适应度的评价方法,并利用混沌序列优化遗传算法的交叉、变异操作.实验结果表明,与已有测试用例自动...  相似文献   

16.
基于DDGRAPH图的路径覆盖研究   总被引:3,自引:0,他引:3  
软件测试分为静态分析、路径选择、测试数据生成和动态分析四个阶段,而路径选择的自动生成是软件测试的关键技术之一。路径覆盖是软件测试中一种十分重要的方法,它使程序的每个分支至少执行一次。文中通过对DDGRAPH图的分析,提出了DDGRAPH图中弧的支配树和蕴含树的表示方法,然后给出由支配树和蕴含树确定非限制弧的方法,通过近似最少谓词覆盖策略以确定覆盖所有非限制弧的路径测试子集。  相似文献   

17.
基于进化算法的软件测试数据生成的自动化   总被引:1,自引:0,他引:1  
介绍了进化算法在测试数据生成中的应用思想,分析了在不同的覆盖准则下应用进化算法时适值函数的设计方法,把遗传算法等进化算法应用到测试数据生成中的进化测试技术,克服了局部搜索算法无法为较复杂程序的分支生成测试输入的问题。  相似文献   

18.
软件测试分为静态分析、路径选择、测试数据生成和动态分析四个阶段,而测试数据的自动生成是软件测试的关键技术之一。文章通过对被测试程序的分析,提出了生成测试数据的平衡力法,对任意的输入变量,判断变量移动范围及进行谓词中变量的函数极小化,得到测试数据,并给出了具体实现方法。  相似文献   

19.
20.
丁蕊  董红斌  张岩  冯宪彬 《软件学报》2016,27(4):814-827
测试数据的自动生成,是提高软件测试效率的重要手段.从软件测试工程实践的角度提出快速生成测试数据的完整模型,更有利于提高测试数据生成效率.为此:(1)提出关键点路径表示法,以得出待测程序的理论路径数,并快速确定已覆盖路径的邻近路径;(2)用随机生成的数据运行简化后的插装程序,得到部分测试数据;(3)将理论路径分成易覆盖路径、难覆盖路径和不可行路径;(4)根据已覆盖路径及其测试数据提供的信息,使用遗传算法生成难覆盖路径的测试数据.仿真实验结果表明了所提方法的有效性.  相似文献   

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

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