| 摘要: |
| 利用遗传算法生成复杂软件的测试数据,是软件测试领域一个全新的研究方向.传统的基于遗传算法的测试数据生成技术,需要以每个测试数据作为输入运行被测程序,以获得个体的适应值,因此,需要消耗大量的运行时间.为了降低运行程序带来的时间消耗,提出一种基于神经网络的路径覆盖测试数据进化生成方法,主要思想是:首先,利用一定样本训练神经网络,以模拟个体的适应值;在利用遗传算法生成测试数据时,先利用训练好的神经网络粗略计算个体适应值;对适应值较好的优秀个体,再通过运行程序,获得精确的适应值.最后的实验结果表明,该方法可以有效降低运行程序产生的时间消耗,从而提高测试数据生成的效率. |
| 关键词: 软件测试 测试数据生成 进化优化 神经网络 路径覆盖 |
| DOI:10.13328/j.cnki.jos.004973 |
| 分类号: |
| 基金项目:国家自然科学基金(61375067,61573362,61203304);软件工程国家重点实验室开放基金(SKLSE20100819);江苏省自然科学基金(BK2012566) |
|
| Evolutional Test Data Generation for Path Coverage by Integrating Neural Network |
|
YAO Xiang-Juan1,2, GONG Dun-Wei3, LI Bin2
|
|
1.State Key Laboratory of Software Engineering(Wuhan University), Wuhan 430072, China;2.College of Science, China University of Mining and Technology, Xuzhou 221116, China;3.School of Information and Electrical Engineering, China University of Mining and Technology, Xuzhou 221116, China
|
| Abstract: |
| It is a novel research direction in the field of software testing to generate test data using genetic algorithms for complex software. Traditional techniques of test data generation based on genetic algorithms need to run a program using each test datum as an input, so as to obtain its fitness value and as a result, they consume a large amount of executing time. In order to reduce the time consumption of running a program, this paper proposes a method of test data generation for path coverage based on neural networks. First, a neural network is trained using a certain amount of samples to simulate an individual's fitness value. Then, when generating test data by the genetic algorithm, an individual's fitness value is roughly estimated using the trained neural network. Finally, for individuals with good estimated fitness values, their precise fitness value are calculated by running the program. The experimental results show that this method can effectively reduce the time consumption of running a program, therefore improve the efficiency of test data generation. |
| Key words: software testing test data generation evolutionary optimization neural network path coverage |