Font Size: a A A

Research On Automatic Test Case Generation Based On Improved PSO Algorithm

Posted on:2016-11-06Degree:MasterType:Thesis
Country:ChinaCandidate:Y HeFull Text:PDF
GTID:2348330488981921Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the rapid development of information industry, software engineering technology has been very widely used in various areas of human's life and production. There are many research achievements show that automatic test case generation is the most important and effective mean to achieve automatic software test, with regards to this, the traditional automatic test case generation algorithm based on particle swarm optimization(PSO)algorithm has been researched and improved and optimized in this paper, the specific research work are as follows:(1)A H-PSO was proposed and applied to automatic test case generation in this paper,which was built by means of combining PSO algorithm with a kind of multiple path coverage testing method based on Huffman coding and improving the fusion algorithm. Firstly, the selected target paths of the program under test are encoded into a binary string using Huffman coding by analyzing the characteristics of the internal structure of path coverage test cases. As a result, the structured program under test is encoded and expressed as a binary tree. Then PSO algorithm is used to generate multiple path coverage test cases. The analysis of the experimental data shows that this method can reduce the amount of calculation effectively,and improve the efficiency of test case generation,and proves that PSO is a high quality algorithm which can be used to automatic test case generation. At the same time, compared with the original automatic test case generation method which expresses the target path combined by using Huffman coding and generates test cases by Genetic Algorithm(GA), the method based on H-PSO has higher efficiency and better algorithm performance.(2)To solve the problem of slow convergence rate, high possibilities of being trapped in local optimum, and low solution accuracy in standard particle swarm optimization(SPSO), an reduced adaptive chaos particle swarm optimization(RACPSO) was presented and applied to software test case generation. Firstly, the original standard evolution equations of SPSO was simplified as non-velocity evolution equation in order to avoid consuming and wasting time to updating the position of particles via their velocity item, which improve the algorithm convergence speed effectively. Then, adaptive inertia weight based on fitness value was proposed to update the position of the particles directly, which can balance the capability of particles between global search and local search. Meanwhile, a particle premature convergence judgment strategy based on the fitness variance of particle swarm was used to judge the degree of PSO algorithm convergence, RACPSO increases the diversity of particlesby applying chaotic searching mechanism to guide the particle swarm to jump out of premature convergence in time. Experimental results show that RACPSO is a efficient method to generate test cases automatically because of its faster convergence rate and higher convergence precision.
Keywords/Search Tags:software testing, automatic test case generation, particle swarm optimization, Huffman coding, adaptive inertia weight, chaos search
PDF Full Text Request
Related items