| With the continuous expansion of the scale and complexity of modern software,it not only brings convenience to human production and life,but also brings greater challenges to software debugging.Fault localization is considered to be one of the most tedious and complex parts of software debugging.Traditional software fault localization relies on manual completion by developers,which costs a lot of manpower and time.The automatic fault localization method can not only reduce the cost of fault localization,but also provide more accurate location guidance.Therefore,it is of great practical significance to study a more effective automatic fault localization method.To date,researchers have proposed dozens of automated software fault localization methods.Among them,spectrum based fault localization is more prominent,but there are still some shortcomings.These mainly include:(1)The existing spectrum-based fault localization methods do not fully exploit the differences between failed test cases,and do not make full use of the execution context information of failed test cases,so the scope of statement investigation is too large,and the efficiency of fault localization is low.(2)The existing spectrum-based fault localization methods are all affected by coincidental correct test cases,resulting in low suspiciousness values of fault statements,thus reducing the accuracy of fault localization.To address the above two problems,the main research work of this thesis is as follows:(1)A fault localization method based on Page Rank algorithm(PFL)is proposed,and verified its effectiveness.The method first extracts the failed test case coverage graph and method call graph and constructs the transition matrix.Secondly,the Page Rank algorithm was iterated by the transfer matrix,and the weight of all failed test cases was calculated to distinguish them,and the failed test case with the highest weight was selected.Finally,based on the spectrum-based fault localization,the execution context slice of the selected failed test case(that is,the statement set covered by the test case)is used to reduce the statements that need to be checked in the list of suspicious degree and narrow the scope of investigation.Experimental results show that the PFL method can improve the localization efficiency of existing fault localization methods.(2)A fault localization method based on the identification of coincidental correct test cases(CCFL)is proposed,and verified its effectiveness.This method first uses the union of statements covered by failed test cases to reduce the dimension of the coverage matrix.Then,fuzzy C-means clustering is used to cluster successful test cases into two categories: truly successful tests and accidentally correct tests.Then,an elimination strategy is used to utilize the identified accidentally correct test cases and construct a new test set.Finally,based on the new test set,spectrum-based fault localization is performed to increase the suspiciousness value of fault statements.Experimental results show that compared with the baseline method,the CCFL method improves the accuracy and recall rate of accidental correct test case identification,and thus improves the accuracy of fault localization.(3)An automated fault localization tool is designed and implemented using Java and shell languages.This tool simplifies the implementation process of part of fault localization and provides a visual interface to assist in locating program faults.There are 28 pictures,17 tables and 83 references in this thesis. |