Professional Documents
Culture Documents
Resaeg
Resaeg
Resaeg
net/publication/319185695
CITATIONS READS
5 6,642
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Alireza Rouhi on 20 August 2017.
Alireza Rouhi
Bahman Zamani
Tel: +98-31-37934537
Fax: +98-31-36699529 , +98-31-37932670
zamani@eng.ui.ac.ir
http://mdse.bahmanzamani.com/
Design Patterns: Current Challenges,
Trends, and Research Directions
Alireza Rouhi and Bahman Zamani
Department of Software Engineering
University of Isfahan
Isfahan, Iran.
{rouhi, zamani}@eng.ui.ac.ir
1 Introduction
Patterns are solutions to recurring design problems [GHJV94, SFJ96]. In this report,
to investigate the issues regarding design patterns, we move on to the current state
of design patterns’ challenges, trends, and research directions. Based on studying
the past and the current researches, we classify the design pattern research field into
two broad categories: 1) design pattern application 2) design pattern detection and
identification (see Figure 1). Design Pattern Application is aimed at applying pattern
solutions in the software design, i.e., it is a forward engineering approach. However,
the Pattern Detection and Identification is a backward and reverse engineering ap-
proach which intends to detect and identify the applied design patterns in the given
source codes. As we know, a design pattern as a solution to a recurring problem
has several components and constituent elements such as the pattern intent, moti-
vation, applicability/known uses, and consequences, to name a few [GHJV94]. Thus,
most of the existing pattern detection tools use other terms such as design motifs
in [Gué07a], i.e. the solution components of design patterns which can be extracted
from the source code or design model in a more tangible way.
In the following, we will explore the details of these techniques through investigating
their practical applications and related researches and studies.
1
Design Patterns
2 Pattern Application
The main drawbacks on the way of pattern application include: expertise and knowl-
edge requirements in the application of correct design patterns; lack of formal basis
and techniques to aid in the systematic pattern selection and application; and little
support to verify the correctness of the applied design patterns and their relationships
[Kim08, FBB+ 14].
2
2.2 Applying PLs in Practice
With the emergence of patterns, pattern collections and PLs in various contexts,
designers are encouraged to use the PLs in a practical sense to solve common software
problems as a whole [HGY14].
Applying suitable and correct patterns of several and inter-connected PLs in practice
together with solving a real business and practical case study have been presented
in [HGY14]. The authors in [HGY14] claims that usage of their proposed framework
for applying patterns not only will provide solutions to specific design problems but
also will help them on how, when, and on what order to apply patterns. The main
steps of [HGY14] framework are (1) adapting existing patterns first, if it is possible
and there are matched patterns with the constraints of current problem context, and
(2) if there is not any pattern match, divide the problem to subproblems and repeat
the step (1) again.
Use of a unique “Sign” stereotype as the indication of a single applied pattern which
is specified by a model designer, [Zam09] verifies the used pattern structure and its
relationships with other applied patterns through the proposed PLV modules, i.e.,
lexical, syntactical and semantical verification modules. In other words, a design
model is developed using patterns of a PL, i.e. Patterns of Enterprise Application
Architecture (PofEAA), then the PLV, named ArgoPLV, verifies that whether the
applied patterns and their relationships are correct or not.
3
to the same problems in the same domain and problem space in the future. Of
course, this process is an approximate approach. Therefore, probably the detected
and identified pattern instances will be approximate and hence controversial and
debatable. Usually, two metrics are used to evaluate the pattern detection tools and
methods applicability: precision and recall. These metrics are defined in [Gué07a]
as follows (Note: here, a design motif is formed from an inter-class structure which
per se is constructed with some defined micro-architectures/µA):
4
AOL
Pattern
Library
D
Metrics
Constraint
Evaluation
Decorated Rj
AOL AST Metrics Constraints
AST
Parser Extractor Evaluator Structural
Constraint
Evaluation
S
Delegation
JAVA Engine Constraint
Evaluation
P
Figure
Figure 2. Pattern
2: Pattern Extraction
Extraction Process.
Process [AFC98]
role of behavioral
with linear complexity, a candidate elements
set for eachin pattern
the design
ele- pattern specification,
tation, the false positive
with cubic complexity [1], in rate
practice, since
ment. of pattern detection results can be reduced with sign the combination
patterns of both static and
are micro-architectures, typical values
In other words, let p = (< e1 ; : : : ; ek >; R) a pattern
dynamic analysis as well as structural and ShPath(ej ; emin ) are limited and usually below 4. A
behavioral analysis [Bin12].
e1 ; : :to: ; ethe
(with elements Due k structural similarity between patterns
) belonging to a pattern collection consequence
like thetheStrategy
complexity
andobserved
State ininthe
practical cases
P , let Mp =< GoFm1 ; : catalog
: : ; mk >[GHJV94],
be the tupleusing
of metrics
only char- almostcan
static analysis linear with the
increase size
the of Cmin
pattern .
detection
acterizing pattern p , where each m
false positive rate.i As a result, the analysis approach must take into account both
is an array of the met-
rics listed in Section
of the3.2 and corresponding
static and dynamic toanalysis
each pattern
in order 3.3.2 Structural
to distinguish and Delegation
correctly Constraints Evalu
aforementioned
element, then candidates for the elements
similar patterns. Following ei this section, we introduce
are elements of tion some of the important and
the set: invaluable tools in the pattern detection field.The previous stages have only imposed, for each patt
2.1.
constituent, the presence of certain pattern relationshi
GENERAL NOTIONS 9
C1 ; : : :fields
Analysis ; Cnand k ( ) k (
call graph
) . In the first stage structural constraints
the tuples extracted from the set collection
(program)
. method signatures
applied and the data S of the candidate tuples formed w
setflow
To further reduce the search space, let’s chooseassociations,
the Ci sets, for example the set Cmin with minimum num-
one of inheritance
the sets r k ( y ) 2 R k y ) that satisfy those constraints is p
(
300
Figure 5: Precision and recall on some benchmark projects [BK12]
reasonable speed too [BK12]. To obtain qualitative pattern detection results in terms
of precision and recall as well as improving the query speed, [Bin12] applies both of
structural and behavioral analyses to detect design motifs in the source code.
A summary of the literature and state of research on the design pattern detection
and related tools are illustrated in Figure 6.
3.4 VPML
Visual Pattern Modeling Language (VPML) [EBL13] intends to detect design patterns
on the Meta-Object Facility (MOF)4 -based modeling languages. Each pattern is
modeled using VPML. Then, the modeled pattern through mapping to a Query,
View, Transformations (QVT)-R 5 transformation, runs on a given model to detect its
used pattern instances. [EBL13] claims that its presented approach with prototyping
on the Eclipse detects some of the GoF design patterns [GHJV94] on the given Unified
Modeling Language (UML) models and Control Flow patterns on the given Business
Process Model Notation (BPMN)6 models.
4
http://www.omg.org/spec/MOF/
5
http://www.omg.org/spec/QVT/
6
http://www.omg.org/spec/BPMN/
7
&ƵũĂďĂ ϵ ϭϬ y y y ϭϬ &ƵũĂďĂ ϯϯ ϰϳ y y y ϰϬ
W/EKd ϭϴ ϵ ϳϴ ϯϰ ϭϰ ϭϴ W/EKd ϱϬ ϭϯ ϯϭ Ϯϰ ϭϴ Ϯϰ
Wd/: ϮϬ ϭϱ Ϯϰ ϯϯ Ϭ ϮϬ Wd/: ϯϯ ϭϴ ϭϮ ϭϴ Ϭ ϭϴ
^^ ϱϭ ϲϯ ϳϬ y ϴϬ ϲϲ ^^ ϰϯ ϱϮ ϰϰ y Ϯϰ ϰϰ
W:& ϭϬϬ ϭϬϬ ϭϬϬ ϭϬϬ ϭϬϬ ϭϬϬ W:& ϲϳ ϲϱ ϴϵ ϵϮ ϵϲ ϴϵ
ϭϬϬ ϭϬϬ
ϵϬ ϵϬ
ϴϬ ϴϬ
ϳϬ ϳϬ
ϲϬ &ƵũĂďĂ ϲϬ &ƵũĂďĂ
ϱϬ ϱϬ
W/EKd W/EKd
ϰϬ ϰϬ
Wd/: Wd/:
ϯϬ ϯϬ
ϮϬ ^^ ^^
ϮϬ
ϭϬ W:& ϭϬ W:&
Ϭ Ϭ
(c) : Precision (graph for Fig. 20a) (d) Recall (graph for Fig. 20b)
Figure 20: Precision and recall on all benchmark projects. The inability of a tool to detect a pattern is indicated by an ’X’ in
the table and a holeFigure 6: The applied basic techniques of analyzed tools [Bin12]
in the graph
3.5 MARPLE-DPD
Tree
(a) (AST),
Time for theanddetection
initialisation analysis is performed by the time
(b) Initialization other two steps named(c) Joiner (which
Pure analysis time
collects detected pattern instances) and Classifier (which determines the correct and
ϭϬϬ ϭϬϬ
incorrect
ϵϬ detected candidate patterns). ϵϬ
ϴϬ ϴϬ
To the
ϳϬ best of our knowledge, none of the aforementioned
ϲϬ WŝŶŽƚ;ĂůůͿ
ϳϬ
ϲϬ
tools [Gué07b, vDMT10b,
Bin12]
ϱϬ consider the relationships between
WƚŝĚĞũ detected design
ϱϬ patterns. WƚŝĚĞũ
ϰϬ ϰϬ ^^
ϯϬ ^^ ϯϬ
W:&
ϮϬ W:& ϮϬ
ϭϬ ϭϬ
Ϭ Ϭ
4 Conclusion
:,ϱ :,ϲ :ĂǀĂ/K td ƌŐŽ
hD>
dĞĂŵ
ŽƌĞ
:,ϱ :,ϲ :ĂǀĂ/K td ƌŐŽ
hD>
dĞĂŵ
ŽƌĞ
(d) Time for initialisation and analysis (e) Pure analysis time
FigureIn
21:this report,
Response timeswe classified
of each the state
tool for detecting of research
all evaluated onIndesign
patterns. patterns
the tables, the fastestinto twoproject
time per mainis red and
a bomb indicates that1)
categories: thepattern
tool crashed on that project.
application, and In 2)
the pattern
graphs, Fujaba is not shown
detection and since it is an order of
identification. We magnitude
slowertried
than most
to explore and present current challenges and issues regarding the aforemen-tools for
other tools, which would have distorted the graphs. Pure analysis time is indicated only for the
which it can be measured separately.
8
static RestrictedCreationClass rcc ;
private RestrictedCreationClass () {
...
}
}
Listing 1. Restricted creation micro pattern example.
1 3
http://essere.disco.unimib.it/reverse/Marple.html. http://jena.apache.org/documentation/
[AB14] Aakash Ahmad and Muhammad Ali Babar. Towards a pattern language
9
for self-adaptation of cloud-based architectures. In Proceedings of the
WICSA 2014 Companion Volume, page 1. ACM, 2014. 2
[AFC98] Giuliano Antoniol, Roberto Fiutem, and Luca Cristoforetti. Design pat-
tern recovery in object-oriented software. In Program Comprehension,
1998. IWPC’98. Proceedings., 6th International Workshop on, pages
153–160. IEEE, 1998. 3, 4, 5
[AFMR11] F Arcelli Fontana, Stefano Maggioni, and Claudia Raibulet. Under-
standing the relevance of micro-structures for design patterns detection.
Journal of Systems and Software, 84(12):2334–2347, 2011. 3
[AFZ11] Francesca Arcelli Fontana and Marco Zanoni. A tool for design pattern
detection and software architecture reconstruction. Information sciences,
181(7):1306–1324, 2011. 3
[AZY14] Awny Alnusair, Tian Zhao, and Gongjun Yan. Rule-based detection
of design patterns in program code. International Journal on Software
Tools for Technology Transfer, 16(3):315–334, 2014. 3, 4
[Bin12] Alexander Binun. High Accuracy Design Pattern Detection. PhD thesis,
University of Bonn, 2012. 5, 6, 7, 8, 9
[BK12] Alexander Binun and Günter Kniesel. DPJF-design pattern detec-
tion with high accuracy. In Software Maintenance and Reengineering
(CSMR), 2012 16th European Conference on, pages 245–254. IEEE,
2012. 7
[BP00] Federico Bergenti and Agostino Poggi. Improving uml designs using
automatic design pattern detection. In 12th International Conference on
Software Engineering and Knowledge Engineering (SEKE), pages 336–
343. Citeseer, 2000. 3
[CDLD+ 05] Gennaro Costagliola, Andrea De Lucia, Vincenzo Deufemia, Carmine
Gravino, and Michele Risi. Design pattern recovery by visual language
parsing. In Software Maintenance and Reengineering, 2005. CSMR 2005.
Ninth European Conference on, pages 102–111. IEEE, 2005. 3
[Don02] Jing Dong. Uml extensions for design pattern compositions. Journal of
object technology, 1(5):151–163, 2002. 3
[EBL13] Maged Elaasar, Lionel C Briand, and Yvan Labiche. VPML: an approach
to detect design patterns of MOF-based modeling languages. Software
& Systems Modeling, pages 1–30, 2013. 3, 7
10
[EBM12] Ghizlane El Boussaidi and Hafedh Mili. Understanding design pattern-
swhat is the problem? Software: Practice and Experience, 42(12):1495–
1529, 2012. 3
[FCSK03] Robert France, S Chosh, Eunjee Song, and Dae-Kyoo Kim. A meta-
modeling approach to pattern-based model refactoring. Software, IEEE,
20(5):52–58, 2003. 2
[FMR13] Francesca Arcelli Fontana, Stefano Maggioni, and Claudia Raibulet. De-
sign patterns: a survey on their micro-structures. Journal of Software:
Evolution and Process, 25(1):27–52, 2013. 3
[FZM11] Francesca Arcelli Fontana, Marco Zanoni, and Stefano Maggioni. Using
design pattern clues to improve the precision of design pattern detection
tools. Journal of Object Technology, 10(4):1–31, 2011. 3
[GHJV94] Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. De-
sign Patterns: Elements of Reusable Object-Oriented Software. Addison-
Wesley Professional, 1st edition, 1994. 1, 4, 5, 7
[HGY14] Hossam Hakeem, Hui Guan, and Hongji Yang. A framework of pat-
terns applicability in software development. In Computer Software and
11
Applications Conference Workshops (COMPSACW), 2014 IEEE 38th
International, pages 486–491. IEEE, 2014. 3
[HHHL03] Dirk Heuzeroth, Thomas Holl, Gustav Hogstrom, and Welf Lowe. Auto-
matic design pattern detection. In Program Comprehension, 2003. 11th
IEEE International Workshop on, pages 94–103. IEEE, 2003. 3
[KB09] Günter Kniesel and Alexander Binun. Witnessing patterns: A data fu-
sion approach to design pattern detection. CS Department III, Uni.
Bonn, Germany, Technical report IAI-TR-2009-02, ISSN, pages 0944–
8535, 2009. 5
[vDMT10a] Markus von Detten, Matthias Meyer, and Dietrich Travkin. Reclipse-a
reverse engineering tool suite. Technical report, Technical Report tr-ri-
10-312, University of Paderborn, Germany, 2010. 6
[vDMT10b] Markus von Detten, Matthias Meyer, and Dietrich Travkin. Reverse
engineering with the reclipse tool suite. In Proceedings of the 32nd
ACM/IEEE International Conference on Software Engineering-Volume
2, pages 299–300. ACM, 2010. 3, 4, 6, 8, 9
[YZC15] Dongjin Yu, Yanyan Zhang, and Zhenli Chen. A comprehensive approach
to the recovery of design pattern instances based on sub-patterns and
method signatures. Journal of Systems and Software, 2015. 3, 4
12
[Zam09] Bahman Zamani. On verifying the use of a pattern language in model
driven design. Dissertation, Concordia University, 2009. 3, 9
[Zdu07] Uwe Zdun. Systematic pattern selection using pattern language gram-
mars and design space analysis. Software: Practice and Experience,
37(9):983–1016, 2007. 9
[ZFS15] Marco Zanoni, Francesca Arcelli Fontana, and Fabio Stella. On applying
machine learning techniques for design pattern detection. Journal of
Systems and Software, 103:102–117, 2015. 3, 9
13