paperbot · PL 论文追踪

全部论文 待读 收藏

P2 C³: Code Clone-Based Identification of Duplicated Components

C³:基于代码克隆的重复组件识别
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 2/10 · 论文聚焦组件级代码克隆检测与重构优先级评估,属于软件工程和程序分析应用,但未涉及用户核心方向(LLM/Agent 与静态分析交叉、Agentic 程序分析、浮点程序分析或贝叶斯程序分析)。其华为工业案例有一定落地参考价值,但整体匹配度较低。引用 2 inbox
Yanming Yang, Ying Zou, Xing Hu, David Lo, Chao Ni, John Grundy, Xin Xia
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 C³,通过组件级代码克隆检测识别文本与功能重复组件,并用六特征评估重构必要性。

软件开发中重复造轮子会导致重复组件,增加维护成本并传播缺陷,但组件级克隆识别仍很困难:组件大小差异大导致相似度难测,组件主功能难以确定导致功能克隆难判。本文提出 C³(组件级代码克隆检测器),同时识别文本克隆与功能克隆组件;并设计基于六种组件级克隆特征的评估方法,按重构必要性对克隆组件排序。作者在华为大规模工业产品数据集上评估,C³ 检测精确率 0.93、召回率 0.91、F1 0.9;用户研究进一步表明评估结果与参与者判断一致,六项“黄金特征”能有效支持重构优先级判断。

问题
重复组件(reinventing the wheel)会增加维护成本并传播缺陷,但组件级克隆检测因组件规模差异大、功能判定难,难以有效识别文本与功能克隆。
方法
提出 C³,组件级代码克隆检测器,结合相似度与组件主功能分析识别文本和功能重复组件,并基于六项组件级克隆特征评估重构必要性。
评估
在华为大规模工业产品数据集上检测克隆组件,达到 precision 0.93、recall 0.91、F1 0.9,并通过用户研究验证评估方法与六项特征对重构优先级排序的有效性。
原文摘要(Abstract)

Reinventing the wheel is a detrimental programming practice in software development that frequently results in the introduction of duplicated components. This practice not only leads to increased maintenance and labor costs but also poses a higher risk of propagating bugs throughout the system. Despite numerous issues introduced by duplicated components in software, the identification of component-level clones remains a significant challenge that existing studies struggle to effectively tackle. Specifically, existing methods face two primary limitations that are challenging to overcome: 1) Measuring the similarity between different components presents a challenge due to the significant size differences among them; 2) Identifying functional clones is a complex task as determining the primary functionality of components proves to be difficult. To overcome the aforementioned challenges, we present a novel approach named C3 (Component-level Code Clone detector) to effectively identify both textual and functional cloned components. In addition, to enhance the efficiency of eliminating cloned components, we develop an assessment method based on six component-level clone features, which assists developers in prioritizing the cloned components based on the refactoring necessity. To validate the effectiveness of C3, we employ a large-scale industrial product developed by Huawei, a prominent global ICT company, as our dataset and apply C3 to this dataset to identify the cloned components. Our experimental results demonstrate that C3 is capable of accurately detecting cloned components, achieving impressive performance in terms of precision (0.93), recall (0.91), and F1-score (0.9). Besides, we conduct a comprehensive user study to further validate the effectiveness and practicality of our assessment method and the proposed clone features in assessing the refactoring necessity of different cloned components. Our study establishes solid alignment between assessment outcomes and participant responses, indicating the accurate prioritization of clone components with a high refactoring necessity through our method. This finding further confirms the usefulness of the six “golden features” in our assessment.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{YangZH00G023,
  title = {C³: Code Clone-Based Identification of Duplicated Components},
  author = {Yanming Yang and Ying Zou and Xing Hu and David Lo and Chao Ni and John Grundy and Xin Xia},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3613883}
}