Skip to main content
Foutse Khomh and Yann-Gaël Guéhéneuc
© Khomh, 2008
Ptidej Team – OO Programs Quality Evaluation and Enhancement using Patterns
Group of Open, Distributed Systems, Experimental Software Engineering
Department of Informatics and Operations Research
University of Montreal
GEODES
Do Design Patterns Impact
Software Quality Positively?
foutsekh@iro.umontreal.ca, guehene@iro.umontreal.ca
CSMR'08
2/??
Context
Design patterns (as presented by the GoF) have
been said to have a positive impact on quality
characteristics
– Expandability
– Reusability
– Understandability
But, some studies presented counter-examples, i.e.,
Wendorff (Assessment of design patterns during
software reengineering: Lessons learned from a large
commercial project.)
3/??
Study Design (1/2)
Hypothesis: “Design patterns have a
positive impact on quality
characteristics”
Objective: prove or disprove the
hypothesis with concrete evidence
4/??
Study Design (2/2)
Required choices
– Quality characteristics
– Kind of study
Our choices
– 10 quality characteristics related to design,
implementation, and runtime
– Empirical study (vs. absolute, vs. relative)
• Manual activity
• Developers' perception
5/??
Method
Choice of design patterns of interest
– 23 design patterns in the GoF book
Identification and definition of quality characteristics
of interest
– 10 characteristics
Definition of a scale
– Likert scale of 5 points + "I don't know"
Generality
Modularity at runtime
Scalability
Robustness
Learnability
Understandability
Modularity
Expandability
Simplicity
Reusability
RuntimeImplementationDesign
6/??
Data Collection
Questionnaire send out to colleagues
with a good knowledge of design
patterns between January and May
2007
Questionnaire posted on mailing-lists
refactoring@yahoogroups.com
patterns-discussion@cs.uiuc.edu
gang-of-4-patterns@cs.uiuc.edu
7/??
Data Processing
Number of received questionnaires: 30
– Number of complete questionnaires: 18
– Number of almost complete (90%) questionnaires: 2
– Incomplete questionnaires or with “I don't know”:10
Number of kept questionnaires: 20
Answers A and B aggregated in Positive, C in
Neutral, and D and E in Negative
– Some questionnaire were clearly generally more
positive/negative than others
8/??
Results (1/2)
9/??
Results (2/2)
We discuss detailed results
– Three well-known design patterns
• Composite
• Abstract Factory
• Flyweight
– Three quality characteristics mentioned in
the GoF
• Reusability
• Expandability
• Understandability
10/??
Composite
Overall positive
impact on quality
attributes
Scalability and
robustness not so
positively impacted
11/??
Abstract Factory
Overall neutral
impact on quality
attributes
Expandability,
generality, and
modularity as
expected
Robustness
surprising
12/??
Flyweight
Overall negative
impact on quality
attributes
Positive impact
only on scalability
as expected
13/??
Reusability
Bridge
Decorator
Flyweight
Command
Interpreter
State
Visitor
Builder
Singleton
Facade
Mediator
Memento
Proxy
A.Factory
F.Method
Prototype
Adapter
Composite
Ch.Of.Resp.
Iterator
Observer
Strategy
T.Method
NegativeNeutralPositive
10 positive impacts
6 neutral impacts
7 negative impacts
14/??
Expandability
SingletonFlyweight
Memento
Proxy
A.Factory
Builder
F.Method
Prototype
Adapter
Bridge
Composite
Decorator
Facade
Ch.Of.Resp.
Command
Interpreter
Iterator
Mediator
Observer
State
Strategy
T.Method
Visitor
NegativeNeutralPositive
19 positive impacts
3 neutral impacts
1 negative impact
15/??
Understandability
Decorator
Flyweight
Ch.Of.Resp.
Command
Visitor
Proxy
Memento
T.Method
A.Factory
Builder
F.Method
Prototype
Singleton
Adapter
Bridge
Composite
Facade
Interpreter
Iterator
Mediator
Observer
State
Strategy
NegativeNeutralPositive
15 positive impacts
3 neutral impacts
5 negative impacts
16/??
Null Hypothesis Test
17/??
Conclusion (1/2)
Globally, design patterns have a
positive impact on quality attributes
16+ / 7-
Simplicity
11+ / 12-
Reusabilit
y
14+ / 9-
Learnabilit
y
11+ / 12-
Understandabilit
y
19+ / 4-Number of
Positive/Negative
Patterns
ExpandabilityQuality
Characteristics
18+ / 5-
Modularity
0+ / 23-1+ / 22-11+/ 12-19+ / 4-Number of
Positive/Negative
Patterns
RobustnessScalabilityMod. at runtimeGeneralityQuality Characteristics
18/??
Conclusion (2/2)
Pattern by pattern, their impact on
quality varies and includes negative
impact!
So, design patterns do not always
improve the quality of systems, thus
they should be use with caution
19/??
Help Wanted
Please help us refine this study by
downloading and filling in the
questionnaire
http://www.ptidej.net/downloads/