Font Size: a A A

Test Cases-based Fault Localization

Posted on:2017-02-19Degree:DoctorType:Dissertation
Country:ChinaCandidate:H ZhangFull Text:PDF
GTID:1318330542951422Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the growing size and the incresing complexity of program, fault localization consumes more and more time and efforts during the software development and testing.To date, major debuggers are the ones employed in the integrated development environment, but developers have been challenged by higher requirements about how to set the breakpoints in that they should thoroughly understand the program charactersitics such as logic, structure,function and semantics and are required to be very experienced. As the debugging program needs to treat the possiblity of fault in all statements as the same rather than considering the checking sequence of these statements by one priority,a lot of time and efforts will be consumed. In order to solve the problems of manually operated debugger,people have proposed a lot of automated fault localization approaches over the last decades. Exactly speaking, the range of searching results can be narrowed using the automated fault localization approaches,and then the root cause to fault will be manually identified. Of these approaches, the coverage-based fault localization approaches run a number of test cases to obtain the information and test results of program entities covered by test cases and utilize the coverage to get the ranking of fault suspiciousness of each program entity. Such fault localization approaches have been extensively used due to low degree of calculation complexity. However, such approaches also have their own deficiencies, for example,they insufficiently analyze the correlations (i.e.: control dependence and data dependence). In addition, regression test and software debugging are iteratively performed until no fault is detected during the software development and testing, if all regression test cases are used for fault localization, it will add a lot to the development and testing cost. Further,if there are the same or similar test cases among regression test cases, coincidental correctness test cases and program change including adding new program, deleting unnecessary program and revising the original program, regression test cases may produce outdated, uncontrolled, redundant or new test cases. And the module call,function call,effects of control dependence and data dependence in one function on regression test cases have not been considered.To solve the above-described problems,this thesis considers the impact analysis,dependence and weight, and the improved genetic algorithm and software-metrics fault localization approach based on regression test cases, its major achievements include:(1) This work proposes the impact analysis-based regression test priority fault localization approach, which firstly utilizes Ochiai fault localization approach to obtain the initial statement suspiciousness and the ranking of suspiciousness.Secondly, it utilizes the control dependence graph and data dependence graph to create a joint dependence graph, gets the suspiciousness of each node and the ranking of suspiciousness through the initial statement suspiciousness and joint dependence graph, and obtains the final ranking of suspiciousness by adding the initial statement suspiciousness with the suspiciousness of each node. In the end, it calculates the sum of the ranking of final suspiciousness covered by each test case statement through the final ranking of suspiciousness, where the test case with greater value means higher priority, and the test case with better ranking will be used for the regression test fault localization in accordance with the priority.Through the experimental study and analysis,the impact analysis-based regression test priority fault localization approach can improve the fault locating efficiency in localization program.(2) This work proposes obtaining the statement frequently covered by successful or failed test cases to buffer the effects of same or similar test cases on ranking of suspiciousness degree and deepening the understanding under the context of program failure, based on the coverage total count of control dependence and data dependence in the execution of each statement by the successful or failed test cases, according to the control dependence and data dependence, test case covering tables and test results. Then it runs the equation of vector angular cosine weight to calculate the weight of each successful test case to weaken the effects of coincidental correctness test cases on the calculation of suspiciousness degree. Finally it ranks the suspiciousness of statements using the suspiciousness equation: the coverage total count of control dependence and data dependence in the execution of each statement by the failed test cases divided by the absolute value of the sum of weights in the execution of each statement by the successful test cases, assuring the effective fault localization of regression test case.Experimental results show that the fault localization efficiency of the proposed approach of regression test cases is better than any of the coverage-based or the dependence analysis-based fault localization approaches of regression test cases.(3) This work proposes the fault localization approach of regression test cases generated by the improved genetic immune algorithm, the artificial immune algorithm (AIA) is added to the genetic algorithm (GA) and improvement,improving the quality of regression test cases oriented for fault localization. In regression test, the code changes include adding codes, deleting unnecessary codes and revising the original codes. As a result, some changes happen to the regression test cases with the generation of outdated, uncontrolled, redundant and new test cases. It modifies the calculation of fitness degree in the improved genetic algorithm by substituting the calculation of fitness degree with the calculation of affinity and concentration to closely link the changed codes with the regression test cases and assures the diversity of regression test cases, and combines the genetic algorithm employing crossover as the primary operation and mutation as the auxiliary one and the artificial immune algorithm employing mutation as the primary operation and crossover as the auxiliary one to assure the ability of test cases to execute several paths. Then it guarantees that the test cases after the crossover and mutation remain closely linked with the changed codes through clone inhibition and vaccination. In the end, the optimal antibodies are obtained from population regeneration which can completely cover Antigen A. Therefore,the proposed approach can alleviate the problem of outdated, uncontrolled,redundant and new test cases generated from the regression test cases.(4) This work proposes the optimized fault localization approach based on the software metrics regression test cases,which utilizes the historical defects, accords with the classification of function points, combines the severity and priority of defects, and the call frequency of functional modules to obtain the defect rate of functional call modules, carries out the functional optimization of regression test cases,then obtains the optimized function of regression test cases according to thecall frequency among functions, ultimately obtains the Ochiai suspiciousness of average node based on its historical Ochiai suspiciousness and the control dependence edge and data dependence edge in the program dependence graph.According to the nodes covered by test cases, it obtains the sum of Ochiai suspiciousness of average node in each test case, which is utilized to optimize the regression test statements of test cases. In the end, fault localization is done using Ochiai approach according to the regression test optimization set.
Keywords/Search Tags:Fault Localization, Regression Test, Test Cases, Dependence, Weight, Genetic Immune Algorithm
PDF Full Text Request
Related items