AntiPatterns-Patterns in Software Engineering-Lecture 16 Slides-Computer Engineering, Slides of Software Engineering

AntiPatterns, Viewpoints, Development, Lava Flow, Ambiguous Viewpoint, Functional Decomposition, Poltergeists, Golden Hammer, Cut and Paste Programming, Mushroom Management, Raman Ramsin, Lecture Slides, Patterns in Software Engineering, Department of Computer Engineering, Sharif University of Technology, Iran.

Typology: Slides

2011/2012

Uploaded on 02/19/2012

hester
hester 🇮🇷

4.5

(13)

84 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Patterns in
Software Engineering
Lecturer: Raman Ramsin
Lecture 16
AntiPatterns
Part 1
Department of Computer Engineering 1Sharif University of Technology
Part
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download AntiPatterns-Patterns in Software Engineering-Lecture 16 Slides-Computer Engineering and more Slides Software Engineering in PDF only on Docsity!

Patterns in Software Engineering Lecturer: Raman Ramsin^ Lecture 16^ AntiPatterns

Part 1

Department of Computer Engineering

1

Part^1 Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatternsAntiPatterns „^ Compiled and presented by Brown et al

in 1998

„^ Compiled

and presented by Brown et al. in 1998.

„^ "An AntiPattern describes a commonly occurring solution to a„^ An AntiPattern describes a commonly occurring solution to aproblem that generates decidedly negative consequences." „^ The AntiPattern may be the result of a manager or developer:t k

i^ b tt not knowing any better, not having sufficient knowledge or experience in solving a particulartype of problem^ ortype of problem, or having applied a perfectly good pattern in the wrong context. Department of Computer Engineering

2

Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatterns: DevelopmentAntiPatterns:

Development

„^ The Blob: Procedural−style design leads to one object with most of theresponsibilities, while most other objects only hold data or simple operations. „^ Lava Flow:

Dead code and forgotten design information is frozen in anever-changing design. „^ Ambiguous Viewpoint:

Object-oriented analysis and design models presented without clarifying the viewpoint represented by the model.

f

„^ Functional Decomposition:

The output of nonobject

−oriented developers

who design and implement an application in an object

−oriented language.

P^ lt^ i t^

Cl^ ith^

li^ it d^ l^

d^ ff^ ti^ lif^

l^ Th

„^ Poltergeists:

Classes with very limited roles and effective life cycles. They often start processes for other objects.Department of Computer Engineering

4

Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatterns: Development (Contd.)AntiPatterns:

Development (Contd.)

„^ Golden Hammer:

A familiar technology or concept applied obsessively to many software problems. „ Spaghetti Code:

Ad hoc software structure makes it difficult to extend and optimize code. „ Walking through a Minefield:

Using today’s software technology is analogous to walking through a high-tech mine field: bugs abound. C^ d^ P

P^

i^ C d^

d b^ i

„^ Cut−and−

Paste Programming:

Code reused by copying source statements leads to significant maintenance problems. M^ h^ M

t^

K^ i^ t^

d^ l^ i^

l t d f^ th

„^ Mushroom Management:

Keeping system developers isolated from the system’s end users.Department of Computer Engineering

5

Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatterns: Development –

Lava Flow p

„^ Lava Flow:

Dead code and forgotten design information is frozen in an ever-changing design. „^ Causes:^ ^ R&D code placed into production without configuration management.

p^ p^

g^ g

^ Uncontrolled distribution of unfinished code. ^ Implementation of several trial approaches for implementing a function. ^ Single developer (lone wolf) design or written code ^ Single-developer (lone wolf) design or written code. ^ Lack of configuration management or process management policies. ^ Lack of architecture, or non-architecture-driven development. ^ Repetitive development process. ^ Architectural scars: Architectural mistakes not removed. „ To solve:^ include a configuration management process that eliminates dead codeand evolves or refactors design toward increasing quality. „ To avoid:^ ensure that sound architecture precedes code development.Department of Computer Engineering

7 p^ p Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatterns: Development –

Ambiguous Viewpoint p g^

p

„^ Ambiguous Viewpoint:

Object-oriented analysis and design (OOA&D) guous^ e^

po^ Objec^

o e^ ed a a ys s a d des g

(OO^ &^ )

models that are presented without clarifying the viewpoint represented bythe model. „ There are three fundamental

viewpoints for OOA&D models:

^ Business^ viewpoint (Problem-Domain/Conceptual/Essential) ^ Specification

viewpoint (System)

^ Implementation

viewpoint (Software/Design) p^

p^ (^

/^ g )

„^ By default, OOA&D models denote an implementation viewpoint that ispotentially the least useful. Mixed viewpoints don’t allow the fundamentalseparation of interfaces from implementation details. „^ Solution:^

Separate Viewpoints explicitly. Department of Computer Engineering

8

Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatterns: Development –

Poltergeists p g

„^ Poltergeists:

Classes with limited responsibilities and roles to

play in the system; therefore,^

^ their effective life cycle is quite brief;^ ^ they clutter software designs, creating unnecessary abstractions;^ ^ They can be excessively complex

hard to understand

and hard to

^ They can be excessively complex, hard to understand, and hard tomaintain. „ Solution:^ Remove them from the class hierarchy altogether.The functionality that was provided by it must be replaced; ^ Move the controlling actions initially encapsulated in the Poltergeist intothe related classes that they invoked.Department of Computer Engineering

10

Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatterns: Development –

Golden Hammer p

„^ Golden Hammer:

A Golden Hammer is a familiar technology

or concept applied obsessively to many software problems.p^

pp^

y^ y^

p

„^ "When your only tool is a hammer, everything else is a nail." „^ Solution:^

^ expanding the knowledge of developers through education ^ expanding

the knowledge of developers through education,training, and book study groups to expose developers toalternative technologies and approaches.

Department of Computer Engineering

11

Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatterns: Development –

Walking through a Minefield p g^

g

Walking through a Minefield:

Using today’s software technology is

„^ Walking^

through a Minefield:

Using^ today’s software technology is

analogous to walking through a high-tech mine field: Numerous bugsare found in released software products.

p

„^ Solution:^

^ Proper investment in software testing is required to make systemsrelatively bug-free. In some progressive companies, the size of testingstaff exceeds programming staff.

p^ g^ g

^ The most important change to make to testing procedures isconfiguration control of test cases. ^ automation of test execution and test design.Department of Computer Engineering

13

Sharif University of Technology

Patterns in Software Engineering – Lecture 16 AntiPatterns: Development –

Cut−and−Paste Programming p

g^ g

„^ Cut−and

−Paste Programming:

Code reused by copying

source statements. „ It comes from the notion that it’s easier to modify existingsoftware than program from scratch. S^ l^ ti „ Solution:^

^ Eliminate duplication through refactoring and reengineering.^ ^ Replace white-box reuse with black-box reuse.Department of Computer Engineering

14

Sharif University of Technology

Patterns in Software Engineering – Lecture 16 R fReference „ Brown, W. J., Malveau, R. C., McCormick, H., Mowbray, T.,Antipatterns: Refactoring Software, Architectures, and Projectsin Crisis. Wiley, 1998.Department of Computer Engineering

16

Sharif University of Technology