Font Size: a A A

Evolutionary Generation Of Test Cases For Path Coverage Integrated With Statistical Analysis

Posted on:2023-01-29Degree:MasterType:Thesis
Country:ChinaCandidate:X T BaiFull Text:PDF
GTID:2557306788469324Subject:Statistics
Abstract/Summary:PDF Full Text Request
Software testing is an important part of software cycle and an important means to ensure software quality.Path coverage testing is an important testing technology in the field of software testing.Its purpose is to generate test cases covering the specified target path.As a probabilistic search algorithm,genetic algorithm has been widely used in the automatic generation of path coverage test cases,and achieved good results.However,with the increasing complexity of code,the efficiency of traditional genetic algorithm to generate test cases can not meet the actual test needs.In view of this,this thesis studies the evolutionary generation theory and method of path coverage test cases integrated with statistical analysis.The purpose is to improve the generation efficiency of test cases from two different angles: fitness evaluation and evolutionary operator implementation.Aiming at the phenomenon that the source program needs to be executed repeatedly when calculating the fitness value,a path coverage test case generation method based on Naive Bayesian evaluation fitness value is proposed.Firstly,the probability values of new test cases belonging to different categories are calculated by Bayesian formula,and the obtained probability is used to evaluate the fitness value of test cases in genetic algorithm;Then,for the test case whose fitness value is greater than the given threshold,verify whether the test case can cover the target path through the execution program;Finally,the experimental results show that compared with the traditional method,this method can greatly save the overhead of repeatedly executing the source program,so as to reduce the time cost of test case generation.Aiming at the problems of many input variables and huge input fields in complex software,a path coverage test case generation method with dynamic reduction of search space is proposed.Firstly,the correlation between each branch node and variable in the program is analyzed,and the variables are classified according to the correlation;Then,the individual genes are segmented according to the classification results of variables;During cross mutation,the segmented gene segments are cross mutated from left to right.When the variables corresponding to the previous gene segments meet the coverage requirements of the target path,this part of the gene segments are fixed,so as to reduce the implementation scope of subsequent cross mutation and reduce the search space of the algorithm;The final experimental results show that in this way,the search range of the algorithm can be greatly reduced and the search efficiency of the algorithm can be significantly improved.Aiming at the path coverage criterion,this thesis studies the evolutionary generation theory and method of path coverage test cases integrated with statistical analysis.The research results can not only improve the efficiency of path coverage test data generation and ensure the quality of software,but also further enrich the path coverage evolutionary testing theory,so as to provide ideas for the wide application of genetic algorithm in software testing.Therefore,this study has important theoretical significance and practical application value.There are totally 4 figures,5 tables and 85 references in this thesis.
Keywords/Search Tags:Path coverage test, Genetic algorithm, Naive Bayes, Fitness function, Reduce search space
PDF Full Text Request
Related items