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

被引:3
作者
Su, Xiaohong [1 ]
Zhang, Fanlong [1 ]
Li, Xia [1 ]
Ma, Peijun [1 ]
Wang, Tiantian [1 ]
机构
[1] Harbin Inst Technol, Sch Comp Sci & Technol, Harbin 150006, Peoples R China
来源
PROCEEDINGS OF INTERNATIONAL CONFERENCE ON SOFT COMPUTING TECHNIQUES AND ENGINEERING APPLICATION, ICSCTEA 2013 | 2014年 / 250卷
关键词
Code clone; Code refactoring; Static analysis; Dynamic testing;
D O I
10.1007/978-81-322-1695-7_28
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
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.
引用
收藏
页码:247 / 256
页数:10
相关论文
共 16 条
[1]  
[Anonymous], TECHNICAL REPORT
[2]  
BAKER BS, 1995, SECOND WORKING CONFERENCE ON REVERSE ENGINEERING, PROCEEDINGS, P86, DOI 10.1109/WCRE.1995.514697
[3]   Clone detection using abstract syntax trees [J].
Baxter, ID ;
Yahin, A ;
Moura, L ;
Sant'Anna, M ;
Bier, L .
INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, PROCEEDINGS, 1998, :368-377
[4]  
Cai DX, 2011, LECT NOTES COMPUT SC, V6603, P432, DOI 10.1007/978-3-642-19811-3_30
[5]  
Chou A., 2001, Operating Systems Review, V35, P73, DOI 10.1145/502059.502042
[6]  
Feng J., 2011, COMP COMM NETW ICCCN, P1
[7]  
Fowler M., 2018, Refactoring: Improving the Design of Existing Code
[8]  
Jiang LX, 2007, PROC INT CONF SOFTW, P96
[9]   CCFinder: A multilinguistic token-based code clone detection system for large scale source code [J].
Kamiya, T ;
Kusumoto, S ;
Inoue, K .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2002, 28 (07) :654-670
[10]  
Kim H, 2011, 2011 33RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), P301, DOI 10.1145/1985793.1985835