基于EFSM的测试用例自动化生成关键技术研究
发布时间:2018-04-12 13:09
本文选题:测试用例生成 + 扩展有限状态机 ; 参考:《南京大学》2015年博士论文
【摘要】:信息化技术的快速发展使得软件系统的规模越来越大、更新换代的速度越来越快,开发过程中引入错误的可能性也越来越大。为了尽可能地减少在软件产品中的错误,研究者和开发者们提出了许多软件质量保障手段,然而到目前为止,软件测试仍然是保证软件质量和可靠性的最重要也是最有效的方法,对于保证和提高软件产品的质量起着不可替代的重要作用,并逐渐受到人们越来越多的重视。软件测试是一项耗时且开销巨大的工作,使用自动化测试方法可以提高测试效率、减少测试代价。自动化测试已经成为当前软件测试发展的趋势,而其中一个关键就是自动化测试用例生成。自动化生成测试用例的一种常用方法是创建软件的测试模型,并在模型的基础上自动化生成测试用例。扩展有限状态机(EFSM)模型以表达能力强、易于理解的特性使得在当前的测试研究领域受到了更多的关注。在扩展有限状态机模型中,测试数据的生成还存在许多挑战,并且通常和路径的可行性紧密相关,目前已经存在一些关于这方面的研究,但总体来说基于EFSM模型的测试数据生成技术仍然很不成熟。此外,目前的研究中较少考虑最终的测试用例集优化问题,对于测试预言(Test Oracle)自动化生成的研究也还相对较少。针对上述问题,本文提出一种基于EFSM模型的自动化测试用例生成方法(ATGEM)。为了解决不可行路径问题,我们提出了一种路径可行性度量方法来预测路径的可行性概率,使得在测试数据生成过程中尽可能避开不可行路径,提高生成的效率。为了生成能够触发可行路径的测试数据及相关的预言信息,我们通过开发可执行模型来获取运行时反馈信息,在此基础上提出了一种新的适应度函数(Fitness Function),并利用分散搜索(Scatter Search, SS)算法在排序后的候选路径集中挑选可行路径并自动生成相应的测试用例。可执行模型定义了模型的动态行为,并通过使用语义执行使得静态模型具有类似动态程序的执行能力。利用可执行模型可以获得运行时反馈信息计算适应度函数,就可以忽略不同数据类型带来的差异性问题,使得该适应度函数能够使用在多种数据类型中,因此适用范围较广。可执行模型带来的另一个优点是可以在模型动态执行过程中自动化的生成预言信息。以往的研究表明,数量较少但较长的测试用例优于数量较多但较短的测试用例,更容易发现系统中的错误。因此,在ATGEM方法还利用以上几个子方法迭代来寻找一个具有较长路径和较小路径数量的较优可行路径集合。在提出以上的路径可行性度量方法时,虽然已经考虑了路径长度和可行性评估值的平衡问题,但仍然不够精确。由于路径的长度和可行性相互矛盾,找到较优可行路径集问题可以转化为一个优化平衡的问题。因此我们提出了一种基于多目标优化(Multi-objective Optimization)的新方法ATGEMmot,并提出了两个对应的适应度函数来获取Pareto前沿解集。为了验证提出的ATGEM和ATGEMmop方法,我们设计了一系列的实验,将提出的两种方法应用于多个EFSM模型,用来检验两种方法中测试用例生成、路径可行性度量方法和路径集多目标优化方法的有效性及效率,并实际检验模型中的不可行路径的数量,分析原因。实验结果表明ATGEM方法在路径可行性度量、生成较优可行路径子集、生成测试数据和预言信息达到指定覆盖方面是行之有效的。在测试数据生成方面,与现有方法相比,ATGEM方法在总体上具有更好的效率。ATGEMmop方法与ATGEM方法相比,除了时间效率上略有下降,其它指标上都占有优势,在生成具有较少数量、较长路径的较优测试用例集方面具有更好的表现。
[Abstract]:The rapid development of information technology makes the software system more and more large scale, faster replacement, in the process of developing into the possibility of error is also growing. In order to minimize the error in the software product, researchers and developers have put forward a lot of software quality assurance means, yet so far still, software testing is to ensure software quality and reliability of the most important and effective method for ensuring and plays an irreplaceable role in improving the quality of software products, and gradually paid more and more attention. Software testing is a time-consuming and expensive work, the use of automated testing methods can improve the test efficiency, reduce test cost. Automated testing has become the development trend of software testing, and one of the key is the automated test case generation automatically. A common method of test case generation is to create software testing model, and automated test case generation based on the model. The extended finite state machine (EFSM) model with strong expression ability, easy to understand the characteristics of received more attention in the research field of the test. In the extended finite state machine model in the test data generation there are still many challenges, and usually the feasibility and path are closely related, there have been some studies on that, but overall, based on the test data of EFSM model generation technology is still immature. In addition, the current study is seldom considered in the final set of test cases for the optimization problem. Test Oracle (Test Oracle) on automatic generation is also relatively small. In view of the above problems, this paper presents a Cheng Fangfa automation test case based on EFSM model (ATG EM). In order to solve the infeasible path problem, we propose a feasible path metric method to predict the probability of the path in the test data generation process as far as possible to avoid the infeasible path, improve the generating efficiency. In order to test data generation can trigger the feasible path and the predicted information, we can feedback the execution model to get running through the development, this paper puts forward a new fitness function (Fitness Function), and the use of scatter search (Scatter Search SS) algorithm in the sorted candidate path chosen feasible path and automatically generate the corresponding test cases. The executable defines the dynamic behavior model by using semantic model, and makes the static execution model has similar dynamic program execution ability. The executable model can obtain runtime feedback information to calculate fitness Should the function, you can ignore the differences of different data types, the fitness function can be used in a variety of data types, so the application range is wide. Another advantage of the execution model is brought about by the generation can be automated in the dynamic model in the implementation of the predicted information. Previous studies have shown that the number of but fewer test cases than a large number of long but shorter test cases, easier to find errors in the system. Therefore, the sub iteration method in ATGEM method is also used for more than a few to find a better and feasible path set has a number of smaller and longer path path. The path feasibility in the above measure. Although the balance of the path length and the feasibility evaluation value has been considered, but it is still not accurate. Because of the length and the feasibility of the path are contradictory, find the better road Set size problem can be transformed into an optimization balance. We propose a multi-objective optimization based on ATGEMmot (Multi-objective Optimization) of the new method, and puts forward two corresponding fitness function to obtain the Pareto front solution set. ATGEM and ATGEMmop in order to validate the proposed approach, we designed a series of this experiment, two methods are applied to the multiple EFSM model, test case generation used to test two kinds of methods, the effectiveness and efficiency of the feasibility of the path metrics and path optimization method in multi targets, and the actual number of inspection, in the model of infeasible path analysis. The experimental results show that the ATGEM method in measurement the feasibility of the path generating optimal feasible path subset, generate test data and information to achieve the specified coverage predictions is effective. In the test data generation, and the existing methods Compared with the ATGEM method, the ATGEM method has better efficiency in general. Compared with the ATGEM method, the.ATGEMmop method has advantages over other indicators, and has better performance in generating better test suite with fewer number and longer path.
【学位授予单位】:南京大学
【学位级别】:博士
【学位授予年份】:2015
【分类号】:TP311.53
【参考文献】
相关期刊论文 前6条
1 张涌,钱乐秋,王渊峰;基于扩展有限状态机测试中测试输入数据自动选取的研究[J];计算机学报;2003年10期
2 公茂果;焦李成;杨咚咚;马文萍;;进化多目标优化算法研究[J];软件学报;2009年02期
3 周晓煜,屈玉贵,赵保华;利用逆向判定性缩短EFSM的测试序列的长度[J];通信学报;2000年11期
4 庞其祥,程时端,金跃辉;EFSM的等价转换和通信协议一致性测试[J];通信学报;1997年04期
5 杨瑞;陈振宇;张智轶;刘子聪;徐宝文;;一种基于扩展有限状态机的自动化测试用例生成方法[J];中国科学:信息科学;2014年05期
6 赵保华;陈波;屈玉贵;;一种改进的转换可执行分析测试序列生成算法[J];中国科学技术大学学报;2007年09期
,本文编号:1739882
本文链接:https://www.wllwen.com/shoufeilunwen/xxkjbs/1739882.html