Software defects are hidden dangers existing in the whole process of software development.Once defects occur in the software operation process,serious consequences will be caused,such as loss of economic property,disclosure of sensitive data,casualties of related personnel and so on.However,removing software defects manually is a time-consuming and tedious task.Therefore,in recent years,researchers have proposed automatic program repair technology,aiming at using computers to automatically locate software defects and correct repair,improve the efficiency of software development.The primary problem of automatic program repair technology is how to accurately locate software defects.Currently,the more common software defect location technology includes the method based on program defect report,the method based on program slice,the method based on program operation coverage information,the method based on program state modification and the method based on program variation.The basic idea of program mutation method is to use mutation operator to mutate the original program and generate a series of variants(also known as variant programs).The variant is used to simulate the influence of program elements(such as statements)containing defects on program operation,and then the suspicious degree of program elements containing defects is calculated by the suspicious degree formula,and the location of the code most likely to contain software defects is finally determined,thus laying the foundation for the next step of defect repair.Compared with other methods,the method based on program variation has higher accuracy in software defect location,but it also has some shortcomings according to the current research status.This kind of method is only limited to first-order mutation operator,that is,only one change is made to the program to generate first-order mutation.The information obtained by this kind of mutation is not comprehensive and rich enough to simulate the influence of program elements containing defects on program operation.Therefore,there is a certain gap between this type of mutation operator and the defect location requirements of complex programs in the real world.This thesis focuses on complex program defects,and proposes to generate a more complex second-order mutation operator by combining simple mutation operators,so as to simulate the effect of defects in the real world on program operation.However,combinatorial simple mutation operators face the challenge of combinatorial explosion,which will cause a lot of time and space waste.In this thesis,the Program Dependency algorithm was designed by using data dependency and control dependency information in the program dependency method,and then four classes of second-order mutation operators were screened out.Using these mutation operators,a series of variants are generated on the original program,and key information is obtained according to the execution of the variants.By calculating the suspicious degree formula,the suspicious degree of all original program statements is obtained,and then the statement code most likely to contain defects is sorted.In order to verify the validity of the second-order mutation operator designed in this thesis,experiments were conducted on Defects4j,a mainstream Java data set,to compare the advantages and disadvantages of the traditional first-order mutation operator and the second-order mutation operator in terms of the accuracy and efficiency of defect location.Experimental results show that the new operator designed by us can significantly improve the accuracy of software defect location,and the efficiency of software defect detection is higher.Compared with the first-order mutation operator,it can reduce the cost of defect location by 21.63%. |