基于设计模式的面向对象系统再工程

上传人:E**** 文档编号:118225774 上传时间:2019-12-11 格式:PDF 页数:134 大小:1.32MB
返回 下载 相关 举报
基于设计模式的面向对象系统再工程_第1页
第1页 / 共134页
基于设计模式的面向对象系统再工程_第2页
第2页 / 共134页
基于设计模式的面向对象系统再工程_第3页
第3页 / 共134页
基于设计模式的面向对象系统再工程_第4页
第4页 / 共134页
基于设计模式的面向对象系统再工程_第5页
第5页 / 共134页
点击查看更多>>
资源描述

《基于设计模式的面向对象系统再工程》由会员分享,可在线阅读,更多相关《基于设计模式的面向对象系统再工程(134页珍藏版)》请在金锄头文库上搜索。

1、上海交通大学 博士学位论文 基于设计模式的面向对象系统再工程 姓名:黄鹤远 申请学位级别:博士 专业:计算机应用技术 指导教师:张申生 20040901 基于设计模式的面向对象系统再工程 i 上海交通大学博士学位论文 基于设计模式的面向对象系统再工程 摘 要 随着面向对象开发模式的日益普及对面向对象系统的再工程也显得愈加 重要面向对象的软件系统与传统的面向过程软件系统一样有一个维护问题 需要相应的再工程技术来处理面向对象代码而迭代开发过程应用的日益广泛 使得再工程技术在正向工程中的价值也得以显现因此再工程技术在大部分 软件开发模式中都有其用武之地然而目前面向对象系统再工程的研究大多 侧重于再工

2、程周期的特定阶段 缺乏覆盖生命周期多个阶段的系统的组织方法 在过去的十余年中设计模式在软件工程领域得到广泛的应用和研究但 主要是应用于正向工程和软件生命周期的设计阶段本文则将把该技术应用于 逆向工程和再工程 设计模式是微体系结构Micro-Architecture相对类和对象来说它是更 高级别的构建模块类或对象的组合从这个角度看识别现有系统中的设计 模式实例有助于更准确地理解现有系统的设计意图并改善其可维护性 在重构领域已有的文献大多侧重于基本的重构操作在系统再工程过程 中需要大量地应用重构操作 但目前仍然缺乏系统的方法来组织这些重构操作 正如设计模式一书中所说的模式为重构提供了目标本文认为模

3、式作 为微体系结构Micro-Architecture实际上也为系统化地组织重构操作提供了 手段 结合再工程生命周期本文提出一种覆盖再工程生命周期多个阶段的基于 设计模式的面向对象系统再工程方法DPBOOSR具体如下 ? 模型捕获通过识别现有系统中存在的设计模式实例可以帮助我们更 加准确地理解现有系统的设计意图 ? 问题发现通过计算系统的面向对象设计度量找出超出合理度量值区 间的区域从而定位违反灵活性和质量准则的设计缺陷 ? 问题解决可以结合重构操作对度量值的影响对重构操作进行选择 另外通过选择适当的设计模式作为较高层次的目标软件结构可以对 摘 要 ii 重构操作进行系统的组织 ? 重组基于现

4、有工具中提供的重构操作构建复合重构操作如设计模式 重构从而进一步提高重构的效率降低差错率 为此我们将引入三部分工作设计模式重现用于程序理解面向对象 设计度量用于评估设计质量发现设计缺陷和设计模式驱动的重构以设 计模式来组织重构操作具体如下 首先现有设计模式重现方法未能分析系统行为因此重现种类有限并 且会生成大量设计模式的伪实例本文将传统的谓词逻辑与基于时段的时态逻 辑Allen1983 Allen1984相结合作为理论基础提出了一种基于结构与行为特 征分析的设计模式重现方法为验证本文提出的重现方法开发了一个名为 PRAssistor 的重现工具并对两个著名的开放源码项目 JUnit 和 JHo

5、tDraw进行了 分析实验结果表明该重现方法比其它方法的重现范围更大准确率也更高 其次现有面向对象设计耦合度量未能考虑接口类型并且部分耦合度量 存在不正交的情况本文提出了一组正交的面向对象设计耦合度量对 OMPOODCOrthogonal Metric Pairs for Object-Oriented Design Coupling并 引用了 Weyuker 提出的一组形式化评估软件度量性质的定理Weyuker1988对 OMPOODC 进行了评估评估结果表明这一组度量基本都满足这些性质与 C object-oriented metrics, which are used to assess

6、 the qualty of design and identify design defects; design pattern driven refactoring, which makes use of design patterns to organize refactorings. Followings are the abstracts of these solutions. First, existing design pattern recovery approaches could not analyze system behaviors, so that they coul

7、d only recover limited kinds of design patterns, and they would generate a lot of false positive design pattern instances. This dissertation introduces traditional predicate logic combined with interval-based temporal logic Allen1983 Allen1984 as the theory foundation, and presents a design recovery

8、 approach based on both structural and behavioral analysis. To validate our approach, ABSTRACT vi we have developed a tool named PRAssistor and analyzed two well-known open source projects, JUnit and JHotDraw. The experiment results show that, besides larger recoverable scope, the recovery precision

9、 of our approach is much higher than others. Second, existing object-oriented design coupling metrics have not dealt with interface, and there are some coupling metrics which are not orthogonal. This dissertation presents a suite of orthogonal metric pairs for object-oriented design coupling (OMPOOD

10、C), and evaluates the metric suite by using the formal list of desirable properties developed by Weyuker Weyuker1988. The analysis result shows that most metrics in this suite satisfied the list of properties. Compared with coupling metrics in C public abstract class TestCase implements Test public

11、void run(TestResult result) result.run(this); public class TestSuite implements Test private Vector fTests= new Vector(); public void addTest(Test test) fTests.addElement(test); 基于设计模式的面向对象系统再工程 51 上海交通大学博士学位论文 public void run(TestResult result) for (Enumeration e= fTests.elements(); e.hasMoreElemen

12、ts(); ) Test test= (Test)e.nextElement(); test.run(result); public class SimpleTest extends TestCase public static Test suite() return new TestSuite(SimpleTest.class); . public static void main (String args) junit.textui.TestRunner.run(suite(); 首先应用结构分析器分析我们得到下面的结构信息 interface(Test). class(abstract,

13、 public, TestCase). class(public, TestSuite). class(public, SimpleTest). operation(abstract, public, Test, run, TestResult, void, Test). operation(public, TestCase, run, TestResult, void, TestCase). operation(public, TestSuite, addTest, Test, void, TestSuite). operation(public, TestSuite, run, TestR

14、esult, void, TestSuite). operation(public,static, SimpleTest, suite, , Test, SimpleTest). operation(public,static, SimpleTest, main, String, void, 第 3 章 基于设计模式的设计重现 52 SimpleTest). realization(Test, TestCase). realization(Test, TestSuite). generalization(TestCase, SimpleTest). association(TestSuite,

15、 Test, fTests, n). dependency(TestSuite, Test, addTest, depParameter). 应用 ancestor 和 is_add_op 规则我们可以导出下述事实 ancestor(Test, TestCase). ancestor(Test, TestSuite). ancestor(Test, SimpleTest). ancestor(TestCase, SimpleTest). is_add_op(addTest). 按照 Composite 模式的结构特征我们可导出下面的初选模式实例 pre_p_composite(Test, TestCase, TestSuite). pre_p_composite(Test, SimpleTest, TestSuite). 接着我们用行为分析器进行了分析去除无关信息之后我们得到如下 信息 oper

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号