文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > Program Analyses Course Structure (1) Introduction
侵权投诉

Program Analyses Course Structure (1) Introduction

(2) Information extraction and basic analysis (3) Metrics and their applications (4) Design patterns / anti-patterns, detection and applications

Program Analyses Course Structure (1) (2) (3) (4) Introduction Information extraction and basic analysis Metrics and their applications Design patterns/ anti-patterns, detection and applications (5) Clustering of classes to components (6) Multi-Version analyses (7) Software visualization 1

Patterns Design patterns: Standard implementation for standard design problems Used in forward engineering to reuse designs

Antipatterns: Also known as bad smell code Usual mistakes in oo design Used to indicate need and place for refactorings (local improvements) or reengineering (larger improvements) of code Part of reengineering (process) patterns 2

Graph Rewrite Systems Relational graph rewrite systems System is represented by a (host) graph Nodes represents constants, their different types unary relations (e.g.“A” is a class,“m” is a method) Edges represent general relations between constants (e.g.“m” is contained in“A”) Host graphs are, e.g., containment tree, class hierarchy DAG and call/usage graphs

Graph Rewrite Systems (cont’d) A pattern is a finite graph A redex in the host graph is a subgraph homomorphic to the pattern, Pattern matching is finding all/ one redex of a pattern in a host graph NP complete, In practice often OK, sometimes not (for some large patterns and graphs and non-clever restriction of search space)

Graph structure corresponds to meta-model to model of software, individual graphs are models 3

A graph rewrite rule is a pair of pattern and rewrite graph the redex is substituted with (not needed in this context) 4

Design pattern detection in practice Pattern definition: Structure: classes, methods, method call statements Behavior: sequence of instantiation and method calls Subject

Example: Observer structure Observer for all o in observers{ o->update()} update()

attach(Observer) detach(Observer) notify()

Pattern detection Find sets of classes and methods conforming to the pattern structure– candidates (redex) Check behavior of candidates 5

ConcreteSubject getState() setState() subjectState return subjectState

subject

ConcreteObserver update() observerState= subject->getState()

6

Program Analyses Course Structure (1) Introduction

第1页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email