Professional Documents
Culture Documents
SUPERVISORS
Prof. Hoda A. Ali Prof. Kamal A. El-Dahshan
Prof. of Mathematics, Faculty of Prof. of Computer Science,
Science (Girls), Al- Azhar Faculty of Science
University- Cairo Al- Azhar University
Cairo
Supervisors
1- Prof. Hoda Abdel Daiem Ali
Professor of Mathematics, Faculty of Science (Girls), Al-Azhar
University
Approval Sheet
Assoc.Prof. of Computer
Assoc. Prof. Eman Science, Faculty of No ………….
Karam Elsayed Science (Girls), Al-Azhar
University
To
My parents
And
My family
ABSTRACT
A
Abstract
B
Contents
CONTENTS
………….…………………………………Abstract A
.……….………….…………………List of Figures I
..………………...……………………List of Charts IV
.………………………………Nomenclatures Table V
1. Introduction
1.1 Problem Description...................................................1
1.2 Thesis Motivation and Contribution ..........................4
1.3 Thesis Outcomes and Organization............................6
Glossary ……………………………………………………….103
References ................................................................................106
Arabic Summary
List of Figures
LIST OF FIGURES
Figure No. Page
…………………………………Figure 3.1: Application structure 20
...........……….…………………Figure 3.2: UML diagrams types 24
..…….……………Figure 5.1: The validation via using StarUML 42
....……………………Figure 5.2: The proposed detection method 43
Figure 5.3: Merging of the two class diagrams of mobile
..………………………………………………………applications 47
I
List of Figures
Figure 6.2: The OWL Ontology representing the Lazy class smell 79
II
List of Tables
LIST OF TABLES
Table Page
Table 5.2: The evaluation of the detection process between tools ... 41
Table 5.3: The Description of the mobile Apps under Analysis…… 54
III
List of Tables
LIST OF CHARTS
Chart Page
……… Chart 5.1: The visibility of anti-patterns groups 65
IV
Nomenclatures Table
Nomenclatures Table
Symbol Meaning
OMG Object Management Group
UML Unified Modeling Language
OWL Web Ontology Language
XML Extensible Mark-up Language
OCL Object Constraint Language
EA Enterprise Architecture
OLED Ontology Lightweight Editor
RDF Resource Description Framework
RE Reverse Engineering
FE Forward Engineering
DX Dalvik Executable
IL Intermediate Language
OO Object Oriented
V
Nomenclatures Table
DF Degree of Freedom
GO Gene Ontology
VI
Chapter (1) Introduction
Chapter (1)
INTRODUCTION
1.1 Problem Description
1
Chapter (1) Introduction
3
Chapter (1) Introduction
4
Chapter (1) Introduction
5
Chapter (1) Introduction
Chapter 1: Introduction
6
Chapter (1) Introduction
7
Chapter (1) Introduction
8
Chapter (1) Introduction
9
Chapter (2) Patterns and Anti-patterns
Overview
Chapter (2)
10
Chapter (2) Patterns and Anti-patterns
Overview
11
Chapter (2) Patterns and Anti-patterns
Overview
12
Chapter (2) Patterns and Anti-patterns
Overview
2.4 Anti-patterns
2.4.1 Anti-pattern Definition
13
Chapter (2) Patterns and Anti-patterns
Overview
14
Chapter (2) Patterns and Anti-patterns
Overview
15
Chapter (2) Patterns and Anti-patterns
Overview
16
Chapter (2) Patterns and Anti-patterns
Overview
17
Chapter (2) Patterns and Anti-patterns
Overview
18
Chapter (2) Patterns and Anti-patterns
Overview
Chapter (3)
Mobile Applications, Unified Modeling
Language (UML), and Ontology
This chapter presents the main concepts of the proposed work,
their definition, structure and advantages.
19
Chapter (2) Patterns and Anti-patterns
Overview
20
Chapter (2) Patterns and Anti-patterns
Overview
21
Chapter (2) Patterns and Anti-patterns
Overview
22
Chapter (2) Patterns and Anti-patterns
Overview
There are many UML tools, some of them are open source
such as ArgoUML [30], StarUML [31] and UMLet [32], and
Modelio [33], and some are not such as Rational Rose XDE [34],
RISE [35] and UModel [36].
23
Chapter (2) Patterns and Anti-patterns
Overview
24
Chapter (2) Patterns and Anti-patterns
Overview
25
Chapter (2) Patterns and Anti-patterns
Overview
3.3 Ontology
26
Chapter (2) Patterns and Anti-patterns
Overview
27
Chapter (2) Patterns and Anti-patterns
Overview
systems.
Ontology has the reasoner plugin that we can use to detect the
28
Chapter (2) Patterns and Anti-patterns
Overview
29
Chapter (2) Patterns and Anti-patterns
Overview
30
Chapter (2) Patterns and Anti-patterns
Overview
Chapter (4)
Related Works
This chapter presents the related works of the proposed work. It is
divided into four parts:
31
Chapter (2) Patterns and Anti-patterns
Overview
33
Chapter (2) Patterns and Anti-patterns
Overview
34
Chapter (2) Patterns and Anti-patterns
Overview
35
Chapter (2) Patterns and Anti-patterns
Overview
36
Chapter (2) Patterns and Anti-patterns
Overview
Chapter (5)
Reverse engineering approach for improving
the quality of mobile application
5.1 Introduction
37
Chapter (2) Patterns and Anti-patterns
Overview
38
Chapter (2) Patterns and Anti-patterns
Overview
Reversed FE RE
UML Tools No.
elements (Java code) (Java code)
√ √ √ ArgoUML 1
√ √ √ StarUml 2
× × × Gaphor 3
× × × yEd 4
Classes × √ Violet UML Editor 5
√ √ √ Papyrus 6
√ √ √ Bouml 7
√ √ √ Modelio 8
39
Chapter (2) Patterns and Anti-patterns
Overview
Classes √ √ UMLet 9
The tool that has the sign (√) has the functionality for
making the process while the tool has the sign (×) does not have
it. So not all UML tools support the engineering process.
40
Chapter (2) Patterns and Anti-patterns
Overview
Tools
Class
#
Attributes
Operations
stereotypes
Association
of
appearances
Elements
ArgoUML X x x x x x x
StarUml √ √ √ √ √ √ x
41
Chapter (2) Patterns and Anti-patterns
Overview
Papyrus X x x x √ √ √
Bouml X x x x x x x
Modelio √ √ √ √ √ √ √
42
Chapter (2) Patterns and Anti-patterns
Overview
can validate the class diagram which was generated from the
mobile app or not.
43
Chapter (2) Patterns and Anti-patterns
Overview
44
Chapter (2) Patterns and Anti-patterns
Overview
45
Chapter (2) Patterns and Anti-patterns
Overview
46
Chapter (2) Patterns and Anti-patterns
Overview
47
Chapter (2) Patterns and Anti-patterns
Overview
48
Chapter (2) Patterns and Anti-patterns
Overview
• The First Phase: APK files are zip files used for the installation
of mobile apps. We used the unzip utility for extracting the files
stored inside the APK. It contained the AndroidManifest.xml,
49
Chapter (2) Patterns and Anti-patterns
Overview
graphical utility that displays the Java code of ".class" files. The
input of the first phase was the APK file of the mobile application
and the output was the java classes of the APK application as in
Figure 5.5.
Figure. 5.5. The first phase of the proposed method: Generating Java
Classes
50
Chapter (2) Patterns and Anti-patterns
Overview
F
i
g
u
r
. e
5
.
6. The Second phase of the proposed method: Generating UML class
diagram and anti-patterns detection in Modelio
51
Chapter (2) Patterns and Anti-patterns
Overview
Figure 5.7. The third phase of the proposed method: Semantic anti-
patterns detection
52
Chapter (2) Patterns and Anti-patterns
Overview
53
Chapter (2) Patterns and Anti-patterns
Overview
55
Chapter (2) Patterns and Anti-patterns
Overview
56
Chapter (2) Patterns and Anti-patterns
Overview
Fi
g
e. ur
5.
. 11
he T
cl
s as
di
ag
m ra
hi
er
ar
al ch
of
e th
mobile App
57
Chapter (2) Patterns and Anti-patterns
Overview
58
Chapter (2) Patterns and Anti-patterns
Overview
59
Chapter (2) Patterns and Anti-patterns
Overview
Figure 5.17 NameSpace is Leaf and is Figure 5.18 Classifier has attributes
derived with the same name
60
Chapter (2) Patterns and Anti-patterns
Overview
61
Chapter (2) Patterns and Anti-patterns
Overview
62
Chapter (2) Patterns and Anti-patterns
Overview
63
Chapter (2) Patterns and Anti-patterns
Overview
64
Chapter (2) Patterns and Anti-patterns
Overview
65
Chapter (2) Patterns and Anti-patterns
Overview
1262
Total
66
Chapter (2) Patterns and Anti-patterns
Overview
67
Chapter (2) Patterns and Anti-patterns
Overview
68
Chapter (2) Patterns and Anti-patterns
Overview
69
Chapter (2) Patterns and Anti-patterns
Overview
Correlation
Specification Systems
Coefficient(r)
70
Chapter (2) Patterns and Anti-patterns
Overview
71
Chapter (2) Patterns and Anti-patterns
Overview
For explaining the relation among the three tools and the
anti-patterns' groups, we used the analysis of variance ANOVA
test. That is to determine whether there are any statistically
significant differences between the means of anti-patterns
detection by each one of the tools. Also, if there is any relation
between anti-patterns groups and the features of mobile
applications.
72
Chapter (2) Patterns and Anti-patterns
Overview
73
Chapter (2) Patterns and Anti-patterns
Overview
Integration
UML by 49 8 58 115
Modelio
Integration
OWL
51 64 13 128
Ontology by
Prompt
74
Chapter (2) Patterns and Anti-patterns
Overview
75
Chapter (2) Patterns and Anti-patterns
Overview
76
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Chapter (6)
ONTOPYTHO: Python Framework for
improving big Ontologies Quality
6.1 Introduction
Class, Large Class, and Singleton which did not be detected using
the proposed method. These negative effects called bad smells or
anti-patterns. However, detecting these smells is not also
supported in any Ontology editor.
So, we were looking for a method that can detect these anti-
patterns and also manipulated the ontology for correction
purpose. The proposed detection method can detect structural
smells without using the reasoners and whatever the Ontology
size.
79
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
80
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
81
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Figure.
6.2. The OWL
Ontology
82
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
83
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
85
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
86
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?Blob_classes (count(?d) as ?NO_Operations)
(count(?A) as ?No_Attributes)
where{{?d a owl:ObjectProperty.
?d rdfs:domain ?Blob_classes} UNION
{?A a owl:DatatypeProperty. ?A rdfs:domain ?Blob_classes} }
group by ?Blob_classes having(?No_Operations>?x && ?
No_Attributes>?y)
87
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
88
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
where{?d a owl:ObjectProperty.
?d rdfs:domain ?Large_classes.}
group by ?Large_classes having(?No_Op>?y)
SELECT ?Sing_classes
where{?d a owl:ObjectProperty.
?d rdfs:domain ?Sing_classes.
?r rdfs:range ?Sing_classes.
filter (?d=?r).
?in rdf:type ?Sing_classes.
filter exists {?o ?p ?d}.
?A a owl:DatatypeProperty.
?A rdfs:domain ?Sing_classes.}
group by ?Sing_classes
having(count(?A)=1)
6.5 Experimental Evaluation
89
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Table 6.1
Description of Owl Ontologies under analysis
OWL
Specification Classes Size Ontology
Projects
90
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
739 dbpedia_2015-
2.32 MB
The DBpedia datasets, each release of 10.owl
this Ontology corresponds to a new
release of the DBpedia data set which 754 2.36 MB dbpedia_2016-
contains instance data extracted from 04.owl
the different language versions of
dbpedia_2016-
Wikipedia 760 2.37 MB 10.owl
91
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
92
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Table 6.2
Design smells per OWL Ontologies
Smells
OWL
Large Lazy Blob
Singleton Ontologies
Classes Classes
0 17 490 8 dbpedia_2015-
10.owl
0 14 502 7 dbpedia_2016-
04.owl
0 14 506 7 dbpedia_2016-
10.owl
Gene
0 0 44155 0
Ontology
(go.owl)
0 9 393 2 IFC2X3_Final
.owl
0 10 2742 0
EDAM.owl
0 7 10023 3
gaz.owl
0 18 12052 8
chebi.owl
93
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
0 13 5500 5
foodon.owl
0 8 36735 4
hp-full.owl
0 4 1515 0
xao.owl
0 0 2724 0
zfa.owl
94
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Figure 6.6. The appearance of the detected smells in the DBpedia OWL
.Ontologies versions
Table 6.3
ONTOPYTHO results for the detection of 3 smells in 12 OWL
Ontologies
Class Smells
Large Lazy Class Blob
Class
From Table 3, we can note that Lazy class smell has the
maximum ratio of smells which is 99.865% while Blob smell has
the minimum ratio which is 0.0374%. But is there any relation
between the three smells?
95
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Table 6.4
The SPSS Pearson correlation coefficient matrix between the class’
smells.
96
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Figure 6.7. The similarity between the means of "Blob and Large-class"
smells and differences between them and "Lazy class" smell
97
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Table 6.5
The Ratio of smells according to the classes of OWL Ontologies
515 739
69.68%
dbpedia_2015-10.owl
69.36% 523 754
dbpedia_2016-04.owl
69.34%
527 760
dbpedia_2016-10.owl
71.54%
44155 61714
Gene Ontology (go.owl)
98
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
.Table 6.6
The SPSS Pearson correlation coefficient matrix between the size of the
.Ontologies and the smells
99
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
Table 6.7
The comparison between "ONTOPYTHO" and other techniques
# #
Software #
occurrences Detected The techniques
Systems projects
of smells Smells
Bayesian Belief
19 - 1 2
Networks [57]
46 - 3 2 BDTEX [58]
1025 - 4 8 Arcan [60]
725 - 3 7 MOGP [61]
513 - 4 10 DÉCOR [62]
0 OWL 5 1 EvoOnt [63]
445 - 3 4 OCEAN[64]
3612 OWL 7 1 OntoUml[65]
0 OWL 11 0 OWL catalogue
100
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
[66]
ONTOPYTHO
117495 OWL 4 12
Proposed method
# #
The techniques
LazyClass Blob
Bayesian Belief
- 19
Networks [57]
- 13 BDTEX [58]
- 44 DÉCOR [62]
- 9 EvoOnt [63]
21 134 OCEAN [64]
ONTOPYTHO
117337 44
Proposed method
101
Chapter (6) ONTOPYTHO: Python Framework for
improving big Ontologies Quality
operations between the other classes and delete the lazy classes.
That leads to minimize the Ontology' size to be suitable to
manipulate it in any Ontology editors, save time, and minimize
storage.
102
Chapter (7) Conclusion and Future Work
Chapter (7)
Conclusion and Future Work
7.1 Conclusion
We want to build a hard and stable base generally for new
software projects and particularly for mobile applications.
Definitely, there are no mobile applications without anti-patterns;
we proposed two general methods for the detection of structural
and semantic anti-patterns.
The first method scopes on the design of UML class diagram
and the OWL Ontology of the mobile applications. The proposed
detection method is a general method to automatically detect anti-
patterns not by using specific queries, but by using Modelio,
OLED, and Protégé in a specific order to get positive results. This
method detected 15 structural and semantic anti-patterns. The
detected anti-patterns appeared 1262 in 29 mobile applications.
For evaluation of the proposed method, we applied it on a
sample of 29 mobile applications. According to the proposed
classification of anti-patterns, ''the anti-patterns in the class
group'' was the most frequent anti-pattern, and ''the anti-patterns
in the attribute group'' was the least frequent. From the
perspective of anti-patterns detection, the analysis of results also
showed that there is a correlation between the Modelio and
103
Chapter (7) Conclusion and Future Work
104
Chapter (7) Conclusion and Future Work
105
Chapter (7) Conclusion and Future Work
patterns in the code level, but we will refine a metric method for
detecting code level anti-patterns on big Ontology. Also, we will
create a semantic web application for anti-patterns to collect all
detection tools of the two levels and anti-patterns catalog. Also,
we will insert the ONTOPYTHO into Python as a library. Finally,
we will analyze the reasons of the relation between Blob and
Large-class smells in Ontology and how can we avoid smells
happen.
106
Chapter (7) Conclusion and Future Work
Glossary
Concept Definition
107
Chapter (7) Conclusion and Future Work
108
Chapter (7) Conclusion and Future Work
communicate a message.
109
Chapter (7) Conclusion and Future Work
References
[1] Khomh, F., & Guéhéneuc, Y. (2018). Design patterns impact on software
quality: Where are the theories? 2018 IEEE 25th International
Conference on Software Analysis, Evolution and Reengineering
(SANER), 15-25.
[2] Sreeji, K. S., & Lakshmi, C. (2018). Dynamic Understanding of Software
System Using Structural and Semantic Based Detection of Design
Patterns and Antipatterns. Journal of Computational and Theoretical
Nanoscience, 15(9-10), 3037-3043.
[3] Matthew Stephan, James R. Cordy, “Identifying Instances of Model
Design Patterns and Antipatterns Using Model Clone Detection”,
Software Engineering (MiSE), (2015).
[5] Douglas Schmidt, Michael Stal, Hans Rohnert and Frank Buschmann,
Pattern-Oriented Software Architecture, Patterns for Concurrent and
Networked Objects, Vol. 2, ISBN: 0471606952, John Wiley & Sons,
2013.
[9] Colin J Neill, Philip A. Laplante, Colin J. Neill and Joanna F. DeFranco.
Anti-patterns: managing software organizations and people.2nd Edition
Boca Raton, London, 2012.
110
Chapter (7) Conclusion and Future Work
[15] Alharbi, K., Blackshear, S., Kowalczyk, E., Memon, A. M., Chang, B.
Y. E., & Yeh, T. (2014, April). Android apps consistency scrutinized. In
CHI'14 Extended Abstracts on Human Factors in Computing Systems, 26
April – 01 May 2014; Toronto, Ontario, Canada. New York, NY, USA:
ACM. pp. 2347-2352. ACM.
[16] Joorabchi, M. E., Ali, M., & Mesbah, A. (2015, November). Detecting
inconsistencies in multi-platform mobile apps. In IEEE 26th
International Symposium on Software Reliability Engineering (ISSRE),
02 - 05 Nov. 2015; Gaithersbury, MD, USA. IEEE. pp. 450-460.
111
Chapter (7) Conclusion and Future Work
[20] Meier, R., & Lake, I. (2018). Professional Android. John Wiley & Sons.
[22] Venters, C. C., Capilla, R., Betz, S., Penzenstadler, B., Crick, T.,
Crouch, S., & Carrillo, C. (2018). Software sustainability: Research and
practice from a software architecture viewpoint. Journal of Systems and
Software, 138, 174-188.
[23] Liu, H., Li, B., Yang, Y., Ma, W., & Jia, R. (2018). Exploring the
impact of code smells on fine-grained structural change-proneness.
International Journal of Software Engineering and Knowledge
Engineering, 28(10), 1487-1516.
[25] Palomba, F., Di Nucci, D., Panichella, A., Zaidman, A., & De Lucia, A.
(2019). On the impact of code smells on the energy consumption of
mobile applications. Information and Software Technology, 105, 43-55.
[26] Hecht, G., Benomar, O., Rouvoy, R., Moha, N., & Duchien, L. (2015,
November). Tracking the software quality of android applications along
their evolution (t). In 30th IEEE/ACM International Conference
on Automated Software Engineering (ASE), 9-13 Nov. 2015; Lincoln,
NE, USA. Washington, DC, USA: IEEE, pp. 236-247.
[28] Hecht, G., Moha, N., & Rouvoy, R. (2016, May). An empirical study of
112
Chapter (7) Conclusion and Future Work
[37] Nyvlt, V., & Novotny, R. (2019, February). Ontology as a Tool for
Building Life Cycle Modelling. In IOP Conference Series: Materials
Science and Engineering (Vol. 471, No. 10, p. 102007). IOP Publishing.
[38] Guizzardi, G., & Mylopoulos, J. (2019). Taking It to the Next Level:
Nicola Guarino, Formal Ontology and Conceptual Modeling. In
Ontology Makes Sense (pp. 223-241).
[39] Xiao, P., Toivonen, H., Gross, O., Cardoso, A., Correia, J., Machado,
P., ... & Díaz, A. (2019). Conceptual Representations for Computational
Concept Creation. ACM Computing Surveys (CSUR), 52(1), 9.
113
Chapter (7) Conclusion and Future Work
[40] Calero, C., Ruiz, F., & Piattini, M. (Eds.). (2006). Ontologies for software
engineering and software technology. Springer Science & Business
Media.
114
Chapter (7) Conclusion and Future Work
[51] Song, L., Tang, Z., Li, Z., Gong, X., Chen, X., Fang, D., & Wang, Z.
(2017, December). AppIS: Protect Android Apps Against Runtime
Repackaging Attacks. In Parallel and Distributed Systems (ICPADS),
2017 IEEE 23rd International Conference on (pp. 25-32). IEEE.
[52] Zhou, X., Wu, K., Cai, H., Lou, S., Zhang, Y., & Huang, G. (2018).
LogPruner: detect, analyze and prune logging calls in Android apps.
Science China Information Sciences, 61, pp. 1-3.
[53] Arnatovich, Y. L., Wang, L., Ngo, N. M., & Soh, C. (2018). A
Comparison of Android Reverse Engineering Tools via Program
Behaviors Validation Based on Intermediate Languages Transformation.
IEEE Access, 6, 12382-12394.
[55] Palomba, F., Di Nucci, D., Panichella, A., Zaidman, A., & De Lucia, A.
(2017, February). Lightweight detection of Android-specific code
smells: The aDoctor project. In IEEE 24th International Conference on
115
Chapter (7) Conclusion and Future Work
[56] Hecht, G., Benomar, O., Rouvoy, R., Moha, N., & Duchien, L. (2015,
November). Tracking the software quality of android applications along
their evolution (t). In 30th IEEE/ACM International Conference on
Automated Software Engineering (ASE), 9-13 Nov. 2015; Lincoln, NE,
USA. Washington, DC, USA: IEEE, pp. 236-247.
116
Chapter (7) Conclusion and Future Work
[70] K. Jezek, and R. Lipka. Smells causing memory bloat: A case study. In
2017 IEEE 24th International Conference on Software Analysis,
Evolution and Reengineering (SANER), Klagenfurt, Austria, IEEE,
2017, pp. 306-315.
[71] Mumtaz, H., Alshayeb, M., Mahmood, S., & Niazi, M. (2019). A survey
on UML model smells detection techniques for software refactoring.
Journal of Software: Evolution and Process, 31(3), e2154.
117
Chapter (7) Conclusion and Future Work
118