Functionally Equivalent C Code Clone Refactoring by Combining Static Analysis with Dynamic Testing

xiaohong su,fanlong zhang,xia li,peijun ma,tiantian wang
DOI: https://doi.org/10.1007/978-81-322-1695-7_28
2014-01-01
Abstract:Software with code clones is difficult for maintenance. It increases the cost of software maintenance. To solve the key problems of function optimization and parameter matching during the process of functionally equivalent code clone refactoring, this paper puts forward an approach for restructuring the fourth type (functionally equivalent) code clone by combining static analysis and dynamic testing. First, two kinds of function optimization strategy are proposed, i.e., running time and static characteristics. Then, determine the optimization function in each functionally equivalent code clone group according to the proposed optimization strategy. Finally, use the method of static analysis and dynamic testing to match the parameter matching for the replacement of procedure. On the basis of parameter matching, replace other clones with the optimization function and then complete the C code clone refactoring. Functionally equivalent C code clone refactoring system prototype is developed. Experimental results on the open source program show that the method can be accurately and effectively refactor the functionally equivalent C clone code.
What problem does this paper attempt to address?