Identifying Architectural Bad Smells Joshua Garcia, Daniel Popescu, George Edwards and Nenad...

Preview:

Citation preview

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

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

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

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

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.

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

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

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

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

Connector Envy – Description

• Connector roles• Communication

• Coordination

• Conversion

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

11

Connector Envy – Quality Impact

• Violates separation of

concerns

• Negatively affects

• Reusability

• Understandability

• Testability

12

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

Scattered Functionality – Quality Impact

• Violates the principle of

separation of concerns twice

• Negatively affects

• Reusability

• Understandability

• Testability

14

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

Extraneous Connector – Quality Impact

• Benefits of each connector type may cancel each other out

• This example negatively impacts

• Understandability

• Reusability

• Adaptability

16

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

Recommended