基于遗传算法的测试用例自动生成技术研究
时间:2018-07-08 16:42 来源:毕业论文 作者:毕业论文 点击:次
摘要软件测试是为了发现软件中存在的缺陷或错误而进行的过程,是保证软件质量和可靠性的重要手段。目前大多数的软件在实际开发过程中,测试人员经常采用的是手工生成的方法来得到所需要的测试数据。而当开发的程序规模增大并且程序路径繁多复杂时,测试数据的生成这一部分工作量就会增加,完成对程序所有路径的覆盖就会变得异常困难。作为人工测试的重要补充,测试数据自动生成技术可以节省测试时间,降低开发成本,拓展测试人员的能力,在许多测试领域发挥着不可替代的作用。25430 测试数据生成问题中一个重要的方向是面向路径覆盖问题,从准确评估测试用例个体的目的出发,提出基于遗传算法的测试数据生成方法。该方法对于小概率事件搜索行之有效。本论文给出了基于遗传算法的测试用例生成的方法,并以三角形分类问题为例,应用遗传算法进行测试用例生成的模拟。结果表明,应用遗传算法进行测试用例生成是可行且有效的。 关键词 软件测试 遗传算法 测试用例生成 路径覆盖 毕业论文设计说明书外文摘要 Title Research on Test Cases Generation Techniques Based on Genetic Algorithm Abstract Software testing is the process to find defects or errors in the software and carried out, and it is an important means to ensure the quality and reliability of software.In most of the actual software development process, software testers often use a manual method to generate the required test data. When the size of program increases and program has many complex paths, the workload taken in generation of test data will increases.Then it will be very difficult to complete the coverage of all the paths of the program. As an important complement of manual testing, automatic test data generation can reduce test time. It will reduce the costs of expoitation, expand capacity of testers, and play an irreplaceable role in many areas of testing. Oriented-path coverage test data generation is one of the test data generation issue,which is important to be resolved. From the accurate assessment of inpidual test purposes, this paper presents test data generation method based on genetic algorithm. This method works well for small probability events search. This paper gives a method based on genetic algorithm test case generation and uses the triangle classification problem as an example, applying genetic algorithms to generate simulated test results, which show that the application of genetic algorithms to generate test cases is feasible and effective. Keywords Software Testing; Genetic Algorithms; Test Cases Generation; Path Coverage 目 录 1. 绪论 1 1.1 立题背景 1 1.2 研究现状 2 1.3 论文的结构 2 2. 软件测试及测试用例自动生成 4 2.1 软件测试 4 2.1.1 软件测试原则 4 2.1.2 软件测试方法 4 2.2 测试用例生成方法 5 3. 遗传算法 7 3.1 遗传算法基本概念及操作 7 3.2 遗传算法特点 11 4. 基于遗传算法的测试用例生成 12 4.1 基本思路 12 4.2 设计与实现 12 4.3 本文用到的实验及结果 14 (责任编辑:qin) |