相似代码检测工具及其案例分析  被引量:2

A Code Similarity Detection Tool and Its Case Study

在线阅读下载全文

作  者:李卓[1] 邓明荣[1] 

机构地区:[1]浙江大学管理学院,浙江杭州310028

出  处:《计算机工程与科学》2010年第4期71-74,135,共5页Computer Engineering & Science

摘  要:软件系统中的相似代码给软件维护带来很大困难,也是最易见的重构对象。如何有效地检测相似代码是软件工程领域的一个重要研究课题。本文介绍了常见的基于文本匹配的相似代码检测算法,尤其是检测源文件之间相似代码的动态文本匹配算法和源文件内部相似代码的后缀树算法,并将这两种算法结合起来,实现一个相似代码检测工具。该工具提供了时空代价平衡的相似代码检测能力,提供了精确有效的相似代码检测手段,帮助开发人员锁定相似代码,提高了重构活动的效率。本文介绍了该工具的架构和内部处理流程,并应用该工具搜索了若干实际应用系统的重复代码,检验了工具的可用性。还简单讨论了该工具和其他一些相似代码检测工具的优劣。Similar code detection is a common entry point of software refactoring activities. The paper firstly introduces texts mapping-based similar code detection algorithms like the dynamic text mapping algorithm and the suffix tree algorithm- Based on the combination of these two algorithms, a tool for automated similar code detection is implemented. This tool provides not only a capability to detect similar code both between and within the source files, for an improved accuracy, but also an automatic approach to help developers secure similar code candidates, hence improves the efficiency of software refactoring. Finally, the paper analyzes the experimental outputs of practical programs in a financial information system. Its practicality is shown.

关 键 词:相似代码检测 动态文本匹配 后缀树 重构 

分 类 号:TP311.5[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象