计算机科学与技术耦合度计算,代码相似性耦合性度量方法的研究-计算机科学与技术专业论文.docx...

代码相似性耦合性度量方法的研究-计算机科学与技术专业论文

Classified Index: TP315 U.D.C: 681.3

Dissertation for the Master Degree

RESEARCH ON THE METHODS OF CODE CLONE AND CODE COUPLING DETECTING

Candidate:

Shi Haitao

Supervisor:

Prof.Zhan Dechen

Academic Degree Applied for:

Master of Engineering

Speciality:

Computer Science and Technology

Affiliation:

School of ComputerScienceand

Technology

Date of Defence:

June, 2009

Degree-Conferring-Institution:

Harbin Institute of Technology

哈尔滨工业大学工学硕士学位论文

哈尔滨工业大学工学硕士学位论文

-

- I -

摘 要

研究发现,导致大型软件难于维护的重要原因之一在于软件代码中存在大量 的相似代码。对于大型的企业应用软件,由于大量相似用户界面、相似业务逻辑 的存在,势必导致了大量相似代码的存在。企业应用软件往往包含软件平台和业 务代码两部分,软件平台和业务代码都存在优化的空间。而另一方面,大型软件 在面临变化时,软件往往难于理解和修改。为此,本文通过研究企业应用软件相 似代码问题和代码耦合性问题,旨在提高代码复用度、支持快速开发、提高系统 的可维护性和可扩展性。

理论研究方面,相似性代码是源文件中相同或者相似的代码片段,目前国内 外研究人员提出了一些相似性代码检测的方法和工具。本文提出了一种基于 token 流、转换规则和后缀树算法的静态代码检测方法。本文的创新之处在于将代码检 测的基本比较单元细化到了类的成员方法级,并提出了一系列相似性代码度量指 标。代码耦合性指软件系统中两个模块相互依赖的程度,本文在包、类和类成员 三个层次上分析代码依赖关系,提出了一种新的表示代码依赖关系的模型—层次 依赖模型,并且提出了一种基于层次依赖图的模块再划分的方法。

系统实现方面,本文设计并实现了一个代码相似性耦合性分析系统。该系统 是一个基于 Eclipse 的插件系统,系统实现了对源文件代码的基本度量,相似代码 的检测和度量,耦合代码依赖关系分析和生成层次依赖图。

关键词:代码相似性;代码耦合性;抽象语法树;后缀树算法;层次依赖图

-

- II -

Abstract

Recent studies have shown that it is difficult to maintain for large software systems because of lots of clone codes.In large enterprise appilication software systems, there are a lot of clone codes because of similar user interface and similar business logic. Enterprise appilication software includes software platform and business codes, and they should be optimized. On the other hand, when changes happen, large software is dufficult to understand and modify. For these reasons, clone codes and coupling codes will be researched in this thesis for the purpose of improving software reusing rate, software maintainability, software scalability and supporting the rapid development of software.

In theory, a code clone is a code portion in source files that is identical or similar to another code portion,several code clone detection techniques and tools have been proposed.In this thesis,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值