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 条
[11]  
Kong D., DETECT FUNCTIONALLY
[12]   CP-Miner: Finding copy-paste and related bugs in large-scale software code [J].
Li, ZM ;
Lu, S ;
Myagmar, S ;
Zhou, YY .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2006, 32 (03) :176-192
[13]  
Lina Q., 2011, RES STATIC PREDICTIO, P1
[14]   Comparison and evaluation of code clone detection techniques and tools: A qualitative approach [J].
Roy, Chanchal K. ;
Cordy, James R. ;
Koschke, Rainer .
SCIENCE OF COMPUTER PROGRAMMING, 2009, 74 (07) :470-495
[15]  
Wang Q., 2009, WIRELESS COMMUNICATI, P1, DOI DOI 10.1109/ICICS.2009.5397494
[16]  
Yu Dong-qi, 2009, Journal of Chinese Computer Systems, V30, P1752