| Mutation testing is a software testing technique for defect detection.As an effective method for improving software reliability,it can not only simulate the real defects of the software under test and construct a complete test dataset revealing defects,but also evaluate the adequacy of the test dataset.However,the industrialization of mutation testing has been hampered,with numerous variants and inefficient test data generation methods leading to the high cost of mutation testing when applied to largescale programs.Therefore,reducing testing costs and improving testing efficiency are the goals of mutation testing research.Thus,this thesis mainly studies how to effectively reduce the number of variants and efficiently generate test data.This thesis proposes a variant reduction method based on affinity propagation clustering algorithm for variant problems.Firstly,the similarity measurement used in previous clustering algorithms has been improved.By considering the quantity relationship of "1" in the "0-1" string representing variants in the kill matrix,as well as the positional relationship of mutation statements and mutation operator relationships that generate variants,a new calculation method for the similarity matrix between variants has been proposed;Then,cluster the variants based on the affinity propagation clustering algorithm,and treat each discrete variant as a class;Finally,select the cluster centers of each class to form a reduced set of variants.Through experiments,it has been proven that this method can effectively reduce variants without affecting the adequacy of testing.To solve the problem of test data generation,this thesis proposes a weak mutation test data generation method based on domain knowledge,and applies the improved genetic algorithm.First,the Reverse learning algorithm is used to generate the initial population uniformly in the input domain;Secondly,calculate the individual fitness function value.If there is no required test data in the initial population,select the optimal fitness value and its corresponding test data,change the variable value of the test data respectively,and judge the correlation between each variable and the input variable according to whether the fitness function value changes;Then,when generating data to kill variants,genetic operations are performed on the input domain of their related variables;Finally,experimental verification was conducted,and compared to traditional genetic algorithms,this method can not only obtain higher mutation scores,ensure test effectiveness,but also accelerate convergence speed during test data generation,reduce running time,and improve generation efficiency.In this thesis,there are 15 drawings,10 tables,and 85 references. |