Rule-Directed Code Clone Synchronization

被引:0
|
作者
Cheng, Xiao [1 ]
Zhong, Hao [1 ]
Chen, Yuting [1 ]
Hu, Zhenjiang [2 ]
Zhao, Jianjun [1 ,3 ]
机构
[1] Shanghai Jiao Tong Univ, Dept Comp Sci & Engn, Shanghai 200030, Peoples R China
[2] Natl Inst Informat, Tokyo, Japan
[3] Kyushu Univ, Fukuoka 812, Japan
关键词
MANAGEMENT;
D O I
暂无
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Code clones are prevalent in software systems due to many factors in software development. Detecting code clones and managing consistency between them along code evolution can be very useful for reducing clone-related bugs and maintenance costs. Despite some early attempts at detecting code clones and managing the consistency between them, the state-of-the-art tool can only handle simple code clones whose structures are identical or quite similar. However, existing empirical studies show that clones can have quite different structures with their evolution, which can easily go beyond the capability of the state-of-the-art tool. In this paper, we propose CCSync, a novel, rule-directed approach, which paves the structure differences between the code clones and synchronizes them even when code clones become quite different in their structures. The key steps of this approach are, given two code clones, to (1) extract a synchronization rule from the relationship between the clones, and (2) once one code fragment is updated, propagate the modifications to the other following the synchronization rule. We have implemented a tool for CCSync and evaluated its effectiveness on five Java projects. Our results shows that there are many code clones suitable for synchronization, and our tool achieves precisions of up to 92% and recalls of up to 84%. In particular, more than 76% of our generated revisions are identical with manual revisions.
引用
收藏
页数:10
相关论文
共 50 条
  • [1] Rule-directed and discovery learning in SCUBA-diving
    Moeller, Fabian
    Hoffmann, Uwe
    Steinberg, Fabian
    Vogt, Tobias
    [J]. INTERNATIONAL JOURNAL OF SPORTS SCIENCE & COACHING, 2023, 18 (03) : 737 - 747
  • [2] Verifying Systems Rules Using Rule-Directed Symbolic Execution
    Cui, Heming
    Hu, Gang
    Wu, Jingyue
    Yang, Junfeng
    [J]. ACM SIGPLAN NOTICES, 2013, 48 (04) : 329 - 341
  • [3] Unit Test Data Generation for C Using Rule-Directed Symbolic Execution
    Ming-Zhe Zhang
    Yun-Zhan Gong
    Ya-Wen Wang
    Da-Hai Jin
    [J]. Journal of Computer Science and Technology, 2019, 34 : 670 - 689
  • [4] Unit Test Data Generation for C Using Rule-Directed Symbolic Execution
    Zhang, Ming-Zhe
    Gong, Yun-Zhan
    Wang, Ya-Wen
    Jin, Da-Hai
    [J]. JOURNAL OF COMPUTER SCIENCE AND TECHNOLOGY, 2019, 34 (03) : 670 - 689
  • [5] THE EFFECTS OF INSTRUCTIONS ON HUMAN FIXED-INTERVAL PERFORMANCE - RULE-DIRECTED VS CONTINGENCY-SHAPED BEHAVIOR
    BUSKIST, WF
    MILLER, HL
    [J]. BEHAVIOUR ANALYSIS LETTERS, 1982, 2 (05): : 287 - 289
  • [6] Prioritizing Code Clone Detection Results for Clone Management
    Venkatasubramanyam, Radhika D.
    Gupta, Shrinath
    Singh, Himanshu Kumar
    [J]. 2013 7TH INTERNATIONAL WORKSHOP ON SOFTWARE CLONES (IWSC), 2013, : 30 - 36
  • [7] Extracting Clone Genealogies for Tracking Code Clone Changes
    Wang, Chun-Hui
    Tu, Ying
    Zhang, Li-Ping
    Liu, Dong-Sheng
    [J]. INTERNATIONAL JOURNAL OF SECURITY AND ITS APPLICATIONS, 2016, 10 (03): : 21 - 30
  • [8] Refactoring Code Clone Detection
    Othman, Zhala Sarkawt
    Kaya, Mehmet
    [J]. 2019 7TH INTERNATIONAL SYMPOSIUM ON DIGITAL FORENSICS AND SECURITY (ISDFS), 2019,
  • [9] Deep Learning Code Fragments for Code Clone Detection
    White, Martin
    Tufano, Michele
    Vendome, Christopher
    Poshyvanyk, Denys
    [J]. 2016 31ST IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2016, : 87 - 98
  • [10] An Empirical Study of Code Clone Clustering Based on Clone Evolution
    Fanlong Zhang
    Xiaohong Su
    Wen Zhao
    Tiantian Wang
    [J]. Journal of Harbin Institute of Technology(New series), 2017, (02) : 10 - 18