Font Size: a A A

Research And Implementation Of Automatic Test Case Generation Method Based On Program Variation

Posted on:2021-04-29Degree:MasterType:Thesis
Country:ChinaCandidate:C WangFull Text:PDF
GTID:2518306032459184Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Mutation testing is a software testing technique based on errors,which can systematically simulate various defects in software.Mutation testing has many advantages that other tests do not have.There are two main aspects:on the one hand,the complete test data set constructed by mutation testing can clearly indicate the defects of the test software;on the other hand,the results of mutation testing can often As a test indicator for the adequacy of data set testing and evaluation testing.Although the advantages of mutation testing are obvious,the fatal shortcoming of the high computational cost of mutation testing has become a major stumbling block that restricts its further development.Aiming at the problem of high computational cost of automatically generating test cases for mutation testing,this paper mainly studies the three aspects of reducing the number of test cases,reducing variants and automatically generating test cases,and developed an automatic test case generation software.The specific research content and results are as follows:(1)In order to solve the problem that the cost of mutation test is too high,an improved variant reduction algorithm based on DBSCAN algorithm is proposed.In this paper,the first step is to simplify the case generation process of mutation test and transform it into case generation that meets the criteria of mutation branch coverage.In this step,the idea of test case generation based on the quasi side of weak mutation test is used,and binary coding is used to reduce the ineffective mutation branch and cover as many mutation branches as possible with as few test cases as possible.Then,based on the DBSCAN algorithm,the mutation operator selection method and clustering analysis method are combined.The reduction of mutation operator follows the premise that does not affect the mutation score.After experimental comparison,the improved variant reduction algorithm can achieve the variant reduction more efficiently than DBSCAN algorithm.(2)In order to improve the efficiency of generating test cases,a genetic algorithm is proposed to improve the value of genetic operators.First,establish a mathematical model for generating mutation test data based on weak mutation test criteria;second,in order to better solve the mathematical model and solve the "premature" phenomenon that genetic algorithms will appear,the value of the genetic operator and the average fitness function value of the population Combined,the genetic operator can be dynamically evaluated to efficiently generate test cases.Experiments on four sets of more classic programs,the results show that compared with the standard genetic algorithm,the improved algorithm takes less time,and the efficiency of automatically generating test cases is higher.(3)Based on the above research results,a software for generating test cases is designed and implemented,which includes the functions of importing source program,generating variation branches and variants,reducing variants and generating test cases.The variant reduction algorithm proposed in this paper effectively reduces the calculation cost of mutation test,and test case generation algorithm effectively improves the efficiency and quality of test.These two algorithms have important theoretical significance for the development of mutation test.
Keywords/Search Tags:Mutation testing, Variant reduction, Genetic algorithm, Test case generation
PDF Full Text Request
Related items