Problematic Code Clones Identification using Multiple Detection Results

被引:5
作者
Higo, Yoshiki [1 ]
Sawa, Ken-ichi [1 ]
Kusumoto, Shinji [1 ]
机构
[1] Osaka Univ, Grad Sch Informat Sci & Technol, Suita, Osaka 5650871, Japan
来源
APSEC 09: SIXTEENTH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE, PROCEEDINGS | 2009年
关键词
code clone; fault detection;
D O I
10.1109/APSEC.2009.30
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Most code clones are generated by copy-and paste programming. Copy-and-paste programming shortens a time required for implementation because pasted code is a template of the required functionality. However, it sometimes brings on new bugs to the source code. After copy-and-paste, pasted code is somewhat changed fitting for the context of the region surrounding the pasted code. For example, some identifiers are replaced with other identifiers or a few statements are inserted, deleted, or changed. If such modifications are incorrectly performed, bugs occur in code clones. However, not all code clones are problematic, many code clones have decent reasons for their existence. Consequently, simple code clone detection is inefficient for identifying problematic code clones. Firstly, this paper proposes a classification scheme for dividing problematic code clones from non problematic ones. Secondly, it proposes a method for extracting specific code clones classified as problematic ones. Thirdly, it presents results of case studies conducted for evaluating the proposed method. The proposed method uses multiple code clone detection tools, and it doesn't directly analyze program source code. After multiple detections, simple operations are performed to extract code clones that are likely to be problematic. In the case studies conducted on an open source software system, the proposed method could actually identify 22 problematic code clones.
引用
收藏
页码:365 / 372
页数:8
相关论文
共 11 条
  • [1] Parameterized duplication in strings: Algorithms and an application to software maintenance
    Baker, BS
    [J]. SIAM JOURNAL ON COMPUTING, 1997, 26 (05) : 1343 - 1362
  • [2] Clone detection using abstract syntax trees
    Baxter, ID
    Yahin, A
    Moura, L
    Sant'Anna, M
    Bier, L
    [J]. INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, PROCEEDINGS, 1998, : 368 - 377
  • [3] Bellon S., 2007, IEEE T SOFTWARE ENG, V31, P804
  • [4] Evaluating clone detection tools for use during preventative maintenance
    Burd, E
    Bailey, J
    [J]. SCAM 2002: SECOND IEEE INTERNATIONAL WORKSHOP ON SOURCE CODE ANALYSIS MANIPULATION, PROCEEDINGS, 2002, : 36 - 43
  • [5] FOWLER M, 1999, FEFACTORING IMPROVIN
  • [6] Jiang Lingxiao, 2007, P THE 6 JOINT M EUR, P55
  • [7] Kapser C, 2005, PROC IEEE INT CONF S, P305
  • [8] Kim M, 2004, 2004 INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING, PROCEEDINGS, P83
  • [9] CP-Miner: Finding copy-paste and related bugs in large-scale software code
    Li, ZM
    Lu, S
    Myagmar, S
    Zhou, YY
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2006, 32 (03) : 176 - 192
  • [10] Wettel R, 2005, SEVENTH INTERNATIONAL SYMPOSIUM ON SYMBOLIC AND NUMERIC ALGORITHMS FOR SCIENTIFIC COMPUTING, PROCEEDINGS, P63