基于改进粒子群算法的嵌入式软件测试用例自动生成技术
发布时间:2018-01-27 07:45
本文关键词: 粒子群算法 自动化测试 测试用例 嵌入式软件 数据流依赖 出处:《浙江大学》2017年硕士论文 论文类型:学位论文
【摘要】:随着应用软件的需求和规模不断增大,自动化测试早已变成软件测试的主流趋势。传统的人工生成测试用例的方法产生的用例较少,且耗时耗力,需要高水平且经验丰富的测试人员来保证代码覆盖率。在软件的快速迭代过程中,手工的生成方法往往会影响软件测试的进度。然而由于待测程序的多样性和测试用例的不确定性,如何高效地自动生成覆盖率高、尽量精简的测试用例集,这成为一项技术上的难点。而由于测试用例的生成为不可判定性问题,很多搜索算法都存在着固有的缺陷与不足。粒子群算法具有简单易用、计算迅速、鲁棒性好的优点,但是传统的粒子群算法也存在着容易陷入局部极值、出现早熟收敛或停滞等现象的缺点。本文针对程序中的数据流依赖关系,结合提出的进化性结构测试系统,对粒子群算法进行了四个方面的改进:粒子群初始化、邻域拓扑、参数设置和混合策略。对算法的主要的改进包括采用非均匀随机分布的方式来初始化粒子群,结合全面学习粒子算法来对邻域进行拓扑,采取收缩因子而非惯性系数的速度更新方法,以及算法各项相关参数的取值设置。最后做实验对比改进后的粒子群算法与作为基准的随机算法,证明本文的算法确实在测试用例的生成效率以及生成用例集的精简程度上有了一定的提升。然后将本文设计的测试系统应用于实验室的一个综合测试验证平台中,结合基于场景的测试方法,对某DSP的CAN通信程序进行测试用例的自动生成,最终获得了覆盖率高且较为精简的测试用例集。
[Abstract]:With the increasing demand and scale of application software, automated testing has become the mainstream trend of software testing. High level and experienced testers are needed to ensure code coverage. During the rapid iteration of the software. Manual generation methods often affect the progress of software testing. However, due to the diversity of test programs and the uncertainty of test cases, how to generate test cases with high coverage and concise test cases efficiently and automatically. This has become a technical difficulty. However, because the test case generation is indeterminate, many search algorithms have inherent defects and shortcomings. Particle swarm optimization algorithm is simple and easy to use. The advantages of good robustness, but the traditional particle swarm optimization algorithm also has some shortcomings such as easy to fall into local extremum, premature convergence or stagnation, etc. This paper aims at the data stream dependency in the program. Combined with the proposed evolutionary structure testing system, the particle swarm optimization algorithm is improved in four aspects: particle swarm initialization, neighborhood topology. Parameter setting and hybrid strategy. The main improvements of the algorithm include the use of non-uniform random distribution to initialize the particle swarm optimization, combined with the comprehensive learning particle algorithm to carry out the topology of the neighborhood. The velocity updating method of shrinkage factor instead of inertia coefficient is adopted, and the value setting of the relevant parameters of the algorithm is set. Finally, the improved particle swarm optimization algorithm is compared with the random algorithm as a benchmark. It is proved that the algorithm in this paper has a certain improvement in the efficiency of test case generation and the simplification of generating use case set. Then, the test system designed in this paper is applied to a comprehensive test verification platform in the laboratory. . Combined with the test method based on the scenario, the test cases of a DSP CAN communication program are generated automatically, and a set of test cases with high coverage and relatively simple coverage is obtained.
【学位授予单位】:浙江大学
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP311.53;TP18
【参考文献】
相关期刊论文 前4条
1 殷永峰;刘斌;姜同敏;;基于UML的嵌入式软件测试用例生成方法研究[J];计算机应用研究;2008年10期
2 ;Testing Result Statistics-Based Rapid Testing Method for Safety-Critical System[J];Journal of Electronic Science and Technology of China;2008年03期
3 薛明志;左秀会;钟伟才;刘静;;正交微粒群算法[J];系统仿真学报;2005年12期
4 单锦辉,姜瑛,孙萍;软件测试研究进展[J];北京大学学报(自然科学版);2005年01期
,本文编号:1467986
本文链接:https://www.wllwen.com/kejilunwen/ruanjiangongchenglunwen/1467986.html