Abstract:Defect locating is an important stage in the software debugging process. By mining the relationship between the dynamic information and the execution results during the execution of the program, the defect location can be effectively located.Therefore, a function defect location method based on random forest algorithm (FDLRF) is proposed. The specific idea is: first, dynamically execute the test case to obtain the dynamic call graph of the function and generate a DOT file, parse the file to obtain the trajectory information of each function, and establish a feature matrix;Secondly, use the synthetic minority over-sampling technique (SMOTE) to obtain balanced samples;Finally, the random forest algorithm is used to train the data to obtain the contribution information of each attribute, that is, the function defect probability.Experimental results show that the method has a certain degree of improvement in positioning accuracy compared with traditional algorithms.