首页 | 本学科首页   官方微博 | 高级检索  
     

基于代码克隆检测的代码来源分析方法
引用本文:李锁,吴毅坚,赵文耘.基于代码克隆检测的代码来源分析方法[J].计算机应用与软件,2020,37(2):8-14.
作者姓名:李锁  吴毅坚  赵文耘
作者单位:复旦大学软件学院 上海 201203;上海市数据科学重点实验室 上海 201203
摘    要:随着软件生态系统和开源社区的发展,代码常在多个软件系统中复制、传播和演化,给软件系统带来了软件质量的不确定性和风险,因此,高效地查找软件系统代码可能的来源是当前研究的热点之一。提出一种基于代码克隆检测的代码来源分析方法,将目标软件代码以方法为单位切割为代码片段,转换为词袋后,在大规模代码资源库中进行并行化代码克隆检测,从而实现方法粒度的代码来源分析。基于该方法,设计并实现了一个代码来源分析工具。该工具能自动分析被测软件项目代码与代码资源库中多个项目以及版本之间的可能来源。实验结果表明,该系统能够有效地找出目标项目在大规模代码库中的代码来源信息,辅助软件维护人员理解和维护代码。

关 键 词:代码来源分析  Hash词袋模型  代码克隆  克隆检测

CODE PROVENANCE ANALYSIS BASED ON CODE CLONE DETECTION
Li Suo,Wu Yijian,Zhao Wenyun.CODE PROVENANCE ANALYSIS BASED ON CODE CLONE DETECTION[J].Computer Applications and Software,2020,37(2):8-14.
Authors:Li Suo  Wu Yijian  Zhao Wenyun
Affiliation:(School of Software,Fudan University,Shanghai 201203,China;Shanghai Key Laboratory of Data Science,Shanghai 201203,China)
Abstract:With the development of software ecosystems and open source communities,code often replicates,propagates,and evolves in multiple software systems,bringing uncertainty and risk to software quality.Therefore,how to find the possible source of software system code efficiently is one of the hot spots of current research.This paper proposes a code provenance analysis method based on code cloning detection.The target software code was cut into code fragments in terms of methods,and then converted into word bags.Then,parallel code clone detection was performed in a large-scale code resource library,so as to achieve the code source analysis of method granularity.Based on this method,a code provenance analysis tool was designed and implemented.The tool automatically analyzed the possible source between the tested software project code and multiple projects and versions in the code repository.The experimental results show that the system can effectively find the provenance code information of the target project in the large-scale code base,and assist the software maintenance personnel to understand and maintain the code.
Keywords:Code provenance analysis  Hash word bag  Code clone  Clone detection
本文献已被 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号