| Regression testing is a hot area of research subjects,and also the main work in software tesing. When source code changed,most tester can effectively save the time and cost of regression testing by using the "re-test partially" strategy to cut efficiently the cout of the regression testing cases,which just choose the test cases that be affected by the new changes to go through the new software.But how to choose the sufficient test cases that be affected by the new changes is a challege in the research field.There are two steps to cut the cost of regression testing in this paper,trying to reduce the count of the envental test cases.First,Improving the idea of program slicing, which is to slice the program basing on single code, by slicing the entire program basing on the methods.It is a rough way to slice program that is called "method slicing" in this paper,which doesn't take the details of source codes but just the communication of methods into consideration. Method slicing can rapidly get the eventual test cases affected by change in regression testing,and can be applied to large softwares smoothly. First,just as with the program slicing, regression testing with method slicing also need to compare the two versions of source code to find the changes.Instead of changed codes,it finds the changed methods which are marked as slicing-criterion. Then,analyse the whole program source code to get the method dependent graph(MDG),with witch we could get the method slicing dependent graph of the slicing criterion.At last,we reduce the slicing dependent graph to entry-dependent graph,which represents the methods that must be checked when run each regression testing case. It's very rough to get regression testing cases affected by new change in such a way.Some of the eventual test cases is not affected by the new change, but it doest good when applied to large software after all; Then reduce the test cases which we get in step one by eliminating the redundance to get the eventual test cases. First of all,we must get the table to represent requirements and test cases,which is called R-T table in this paper. Then,use the improved test case reduction algorithm called G-GRE to reduce the redunce of the R-T table,after this operation,we get the eventual regression test cases,with which to re-test the while software can reduce cost of regression testing in theory.Experimental results show that these steps can get a regression test suite. Using this test suite ,in theory, it can achieve the effect of re-test all the test cases, but their number is often far less than all the test cases. To some extent ,it improves the efficiency of regression testing, and saves testing time and cost. |