17
Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

  • View
    222

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Identifying Architectural Bad Smells

Joshua Garcia, Daniel Popescu,

George Edwards and Nenad

Medvidovic

University of Southern California

Page 2: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Contribution

• Definition of notion Architectural Smell

• Definition of four concrete architectural smells

• Quality impact of each smell

2

Page 3: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Motivation

• Successful systems are maintained over multiple years

• System’s Life-Cycle Properties worsen over time

• Understandability

• Testability

• Extensibility

• Reusability

• Restructuring/Refactoring helps to improve life-cycle properties

• What structures need to be refactored?

3

Page 4: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Code Smells

• Code smells are implementation structures that negatively affect system lifecycle properties

• Defined in terms of implementation-level constructs

• Classes

• Methods

• Statements

• Examples

• Long parameter list

• Large methods

• Code smells do not address architectural decisions

4

Page 5: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Software Architecture

• Software system’s architecture is the set of

principal design decisions made about the system

• Usually includes system decomposition

• Subsystems/Components

• Services offered and required by a component

• Component interactions

5

Page 6: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Examples of Architectural Decompositions

6

GW 2

G Top Calc.

GW 1

Client 1

LNIS

Connector

Client 2

Connector

Master GW

Client 3

G Top Reconf.

Connector

GSD Handler

GSD

LSD

LSD Handler

LSD

LSD Handler

Legend:

Request port

Reply port

Distribution Request Port

Distribution Reply Port

File

GNISL Top. Calc.

File

File

LNIS.L Top. Calc.

Page 7: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Architectural Smell

• Architectural smell • A commonly used architectural decision that negatively impacts lifecycle properties

• Possible Causes• Applying a design solution in an inappropriate context

• Mixing design fragments that have undesirable emergent behaviors

• Architectural Refactoring – The remedy• Altering the internal structure of the system

• Altering the behaviors of internal system elements

• No change of the external system behavior

• Goal: Clearly codifying architectural smells will allow engineers to avoid and/or correct common design pitfalls.

7

Page 8: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Concrete Architectural Smells

• Definition of four concrete architectural smells1. Connector Envy

2. Scattered Functionality

3. Ambiguous Interfaces

4. Extraneous Connector

• Quality impact of each smell

• Source: • Recovery 18 Grid systems

• Refactoring of industrial middleware

8

Page 9: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Ambiguous Interfaces – Description

• An Ambiguous Interface

offers only one public interface

• Internally dispatches to

multiple services

• Appears especially in event-

based publish-subscribe

systems

9

Page 10: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Ambiguous Interfaces – Quality Impact

• User has to inspect the component’s implementation before knowing about its offered services

• Negatively affects• Analyzability

• Understandability

•Example: JMS

10

Page 11: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Connector Envy – Description

• Connector roles• Communication

• Coordination

• Conversion

• Facilitation • Components with Connector Envy encompass extensive interaction-related functionality•Example: Gridfarm Filesystem Daemon

11

Page 12: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Connector Envy – Quality Impact

• Violates separation of

concerns

• Negatively affects

• Reusability

• Understandability

• Testability

12

Page 13: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Scattered Functionality – Description

• Multiple components are

responsible for realizing the same

high-level concern

• Some of those components are

responsible for orthogonal

concerns

•Example: Linux’s Status Reporting

13

Page 14: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Scattered Functionality – Quality Impact

• Violates the principle of

separation of concerns twice

• Negatively affects

• Reusability

• Understandability

• Testability

14

Page 15: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Extraneous Connector - Description

• Two connectors of different

types are used to link a pair of

component

• Example: Events vs.

Procedure Calls

•Example system: Example:

Old MIDAS version

15

Page 16: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Extraneous Connector – Quality Impact

• Benefits of each connector type may cancel each other out

• This example negatively impacts

• Understandability

• Reusability

• Adaptability

16

Page 17: Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad Medvidovic University of Southern California

Contribution

• Definition of Architectural Smell

• Identification of concrete architectural smells

• Definition of four concrete smells• Connector Envy

• Scattered Functionality

• Ambiguous Interfaces

• Extraneous Connector

• Discussed quality impact of each smell

17