SlideShare a Scribd company logo
Yann-Gaël Guéhéneuc
© Yann-Gaël Guéhéneuc
This presentation has been given at WCRE, the 10th of November 2004, in Delft, Netherlands.
Software Engineering Laboratory
Department of Computing Science and Operations Research
University of Montreal
Fingerprinting Design
Patterns
Houari Sahraoui
{guehene,sahraouh}@iro.umontreal.ca
2004/11/10
2/22
Motivations
n Design patterns propose standard
solutions (design motifs) to recurrent
design problems
n Detecting partial/complete occurrences
of design motifs (DM) helps
– Understanding solved design problems
– Changing/refactoring programs
3/22
Motivations
n DM define roles
n Occurrence of a DM = Combination of
classes that matches the roles
n Detecting occurrences of DMs = Finding
among all possible combinations of
classes those that match the roles
– Complex and time- and resource-
consuming task
4/22
Example
n Detecting occurrences of Abstract
Factory in a medium size program
– JREFACTORY (575 classes)
– 5 roles (AbstractFactory, ConcreteFactory,
AbstractProduct, Product, and Client)
– ~ 5755 = 6.28549E+13 possible
combinations
5/22
Idea
n Reduce the search space using
heuristics
n Efficient heuristic
– Quantitative characterization of DM roles
n Not really new
– For example, [Antoniol et al., 98]
6/22
Idea
n Limitations of current approaches
– Quantitative characterization extracted
from design pattern description manually
– Strong assumption: Implementation is
conform to theory
n Solution
– Automatic quantitative characterization
from past-discovered occurrences
7/22
Fingerprinting Principle
n Use internal attributes of classes
– Size, inheritance, coupling, cohesion
n Values of internal attributes are not unique
– A class can play more than one role
– Two or more classes can play a same role
n Attributes can be used to reduce the search
space
– Eliminating classes that do not play a particular
role obviously
8/22
Building Fingerprints
Repository
creation
Candidate rule
derivation
Rule
validation
9/22
Building Fingerprints
n Repository creation
– Sources
• Studies in the literature (cf., [Bieman et al., 03])
• Home-made tool for structural detection [Guéhéneuc, 01]
• Assignments in a graduate course
– Structure
• <program><designmotif><occurrence><role>
Repository
creation
Candidate rule
derivation
Rule
validation
10/22
Building Fingerprints
n Repository creation
Repository
creation
Candidate rule
derivation
Rule
validation
JHOTDRAW
v5.1
JREFACTORY
v2.6.24
JUNIT
v3.7
LEXI
v0.0.1α
NETBEANS
v1.0.x
QUICKUML
2001
Total
Number of classes 173 575 157 127 5812 224 7 068
Design motif Number of DM occurrences per program
Number of
roles
[Gamma,
1994]
Number of
classes
playing a
role per
design motif
Abstract Factory 12 1 13 5 217
Adapter 1 17 8 26 4 230
Builder 2 1 1 4 4 24
Command 1 1 1 3 5 67
Composite 1 1 2 4 4 107
Decorator 1 1 2 4 64
Factory Method 3 1 4 4 67
Iterator 1 5 6 5 30
Observer 2 3 2 1 8 4 93
Prototype 2 2 3 32
Singleton 2 2 2 2 1 9 1 9
State 2 2 4 3 32
Strategy 4 4 3 36
Template Method 2 2 2 36
Visitor 2 2 4 138
Total 93 55 1 182
11/22
Building Fingerprints
n Repository creation
– Metric extraction for each class in the repository
Repository
creation
Candidate rule
derivation
Rule
validation
Acronyms Descriptions References
NM Number of methods [Lorenz, 94]
NMA Number of new methods [Lorenz, 94]
NMI Number of inherited methods [Lorenz, 94]
NMO Number of overridden methods [Lorenz, 94]
Size
WMC Weighted methods per class [Chidamber, 93]
CLD Class to leaf depth [Tegarden, 95]
DIT Depth of inheritance tree [Chidamber, 93]Inheritance
NOC Number of children [Chidamber, 93]
C Connectivity [Hitz , 95]
Cohesion
LCOM5 Lack of cohesion in methods [Briand 97]
ACMIC Antecedent class-method import coupling [Briand 97]
CBO Coupling between objects [Chidamber, 93]Coupling
DCMEC Descendent class-method import coupling [Briand 97]
12/22
Building Fingerprints
n Candidate rule derivation
– Rule learner, JRIP (from Weka tool)
– Learning dataset (for each role): 4 × n cases
• n classes playing the role
• 3 × n classes chosen randomly
– Each case
• <metric1, metric2, …, metricm, role>
Repository
creation
Candidate rule
derivation
Rule
validation
13/22
Building Fingerprints
n Candidate rule derivation
– Rules shape
Rules for <Role>:
Fingerprint1, confidence
…
Fingerprintk, confidence
where
Fingerprint1: {metric1 ∈ D11; … ; metricm ∈ Dm1}
Repository
creation
Candidate rule
derivation
Rule
validation
14/22
Building Fingerprints
n Candidate rule validation
– Roles without a significant number of occurrences
are eliminated (20 over 55)
– Cross-validation
• Leave-one-out method
• Roles with a recall less than 75% are eliminated
(15 over 35)
• For the 20 remaining roles, error < 10%
Repository
creation
Candidate rule
derivation
Rule
validation
15/22
Building Fingerprints
n Rule validation
Repository
creation
Candidate rule
derivation
Rule
validation
Design motifs Roles Error (%) Recall (%)
Iterator Client 0,00 100,00
Observer Subject 0,00 100,00
Observer Observer 2,38 100,00
Template Method Concrete Class 0,00 97,06
Prototype Concrete Prototype 0,00 96,30
Decorator Concrete Component 4,17 89,58
Visitor Concrete Visitor 0,00 88,89
Strategy Context 3,70 88,89
Visitor Concrete Element 2,04 88,78
Singleton Singleton 8,33 87,50
Factory Method Concrete Creator 4,30 87,10
Factory Method Concrete Product 3,45 86,21
Adapter Target 4,00 84,00
Composite Leaf 6,47 82,09
Decorator Concrete Decorator 0,00 80,00
Iterator Iterator 0,00 80,00
Command Receiver 6,67 80,00
State Concrete State 6,67 80,00
Strategy Concrete Strategy 2,38 78,57
Command Concrete Command 3,23 77,42
16/22
Using Fingerprints
n Structural detection with constraints
– {V, C, D}
– Variables represent roles in a DM
– Domains contain all classes of a program
n Fingerprints reduce the domains
n Fingerprints reduce the number of
possible combinations
17/22
Composite DM
n Without fingerprints
– S = All classes
– Variables
• client, Dcl = S
• component, Dcn = S
• composite, Dco = S
• leaf, Dle = S
– Constraints
• association(client, component), inheritance(component,
composite), inheritance(component, leaf),
composition(composite, component)
n With fingerprints
– Scl, Scn, Sco, and Sle ⊆ S
– Variables
• client, Dcl = Scl
• component, Dcn = Scn
• composite, Dco = Sco
• leaf, Dle = Sle
Scl, Scn, Sco, and Sle = Classes
matching fingerprints of the
four roles
18/22
Composite DM
n Rules for “Leaf”
• NMI = 26 ∧ DIT = 5, 23/67
• NMI = 25 ∧ NMO = 2, 45/67
• DIT = 3 ∧ NM = 12, 9/67
n Search space reduction
Fingerprints Number of classes Reduction (%)
NMI = 26 ∧ DIT = 5 20 69,00
NIM = 25 ∧ NMO = 2 7 89,15
DIT = 3 ∧ NM = 12 10 84,50
19/22
Side Effects
n DM vs. Quality
20/22
Conclusion
n Experimental study for mining role
fingerprints (quantitative characterization)
n Role fingerprints defined using metrics
n Role fingerprints used for DM occurrences
detection
n Significant reduction in time and resources
n Applicable to partial occurrence detection
21/22
Future work (just a joke)
21/22
Future work (just a joke)
n Fingerprinting components
21/22
Future work (just a joke)
n Fingerprinting components
n Fingerprinting frameworks
21/22
Future work (just a joke)
n Fingerprinting components
n Fingerprinting frameworks
n Fingerprinting aspects
21/22
Future work (just a joke)
n Fingerprinting components
n Fingerprinting frameworks
n Fingerprinting aspects
n Fingerprinting refactorings
21/22
Future work (just a joke)
n Fingerprinting components
n Fingerprinting frameworks
n Fingerprinting aspects
n Fingerprinting refactorings
n Fingerprinting services
21/22
Future work (just a joke)
n Fingerprinting components
n Fingerprinting frameworks
n Fingerprinting aspects
n Fingerprinting refactorings
n Fingerprinting services
n Fingerprinting metrics
21/22
Future work (just a joke)
n Fingerprinting components
n Fingerprinting frameworks
n Fingerprinting aspects
n Fingerprinting refactorings
n Fingerprinting services
n Fingerprinting metrics
n …
22/22
Data
n Accuracy depends on the repository
– P-MARt (Pattern-like Micro-Architecture
Repository) is a repository of micro-architectures
similar to design motifs
– P-MARt and its associated tools are freely
available under the LPGL
Please contribute!
– Information, downloads, and contributions at
http://www2.iro.umontreal.ca/~labgelo/p-mart/

More Related Content

Similar to Wcre04.ppt

Final Report Defense 021509
Final Report Defense 021509Final Report Defense 021509
Final Report Defense 021509
Matthew Ostrander, PMP
 
Enrich your Toolbox: Gain efficiency with the right techniques, tools & methods
Enrich your Toolbox: Gain efficiency with the right techniques, tools & methodsEnrich your Toolbox: Gain efficiency with the right techniques, tools & methods
Enrich your Toolbox: Gain efficiency with the right techniques, tools & methods
Derk-Jan de Grood
 
PR-272: Accelerating Large-Scale Inference with Anisotropic Vector Quantization
PR-272: Accelerating Large-Scale Inference with Anisotropic Vector QuantizationPR-272: Accelerating Large-Scale Inference with Anisotropic Vector Quantization
PR-272: Accelerating Large-Scale Inference with Anisotropic Vector Quantization
Sunghoon Joo
 
Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017
Gwendal Daniel
 
Trondheim Test Conference: Increase your effectiveness with the right test te...
Trondheim Test Conference: Increase your effectiveness with the right test te...Trondheim Test Conference: Increase your effectiveness with the right test te...
Trondheim Test Conference: Increase your effectiveness with the right test te...
Derk-Jan de Grood
 
VISSOFTPresentation.pdf
VISSOFTPresentation.pdfVISSOFTPresentation.pdf
VISSOFTPresentation.pdf
NourJiheneAgouf
 
Assessing the Reliability of a Human Estimator
Assessing the Reliability of a Human EstimatorAssessing the Reliability of a Human Estimator
Assessing the Reliability of a Human Estimator
Tim Menzies
 
Symbexecsearch
SymbexecsearchSymbexecsearch
Symbexecsearch
Abhik Roychoudhury
 
Caepia presentation
Caepia presentationCaepia presentation
Caepia presentation
Álvaro Gutiérrez Rodríguez
 
Collaborative 3D Modeling by the Crowd
Collaborative 3D Modeling by the CrowdCollaborative 3D Modeling by the Crowd
Collaborative 3D Modeling by the Crowd
Ryohei Suzuki
 
talk1
talk1talk1
Optimising Autonomous Robot Swarm Parameters for Stable Formation Design
Optimising Autonomous Robot Swarm Parameters for Stable Formation DesignOptimising Autonomous Robot Swarm Parameters for Stable Formation Design
Optimising Autonomous Robot Swarm Parameters for Stable Formation Design
Daniel H. Stolfi
 
How to easily find the optimal solution without exhaustive search using Genet...
How to easily find the optimal solution without exhaustive search using Genet...How to easily find the optimal solution without exhaustive search using Genet...
How to easily find the optimal solution without exhaustive search using Genet...
Viach Kakovskyi
 
6sigma
6sigma6sigma
6sigma
Yasser Hamed
 
TOOLS USA01.ppt
TOOLS USA01.pptTOOLS USA01.ppt
TOOLS USA01.ppt
Ptidej Team
 
Dominoes: Exploratory Data Analysis of Software Repositories Through GPU Proc...
Dominoes: Exploratory Data Analysis of Software Repositories Through GPU Proc...Dominoes: Exploratory Data Analysis of Software Repositories Through GPU Proc...
Dominoes: Exploratory Data Analysis of Software Repositories Through GPU Proc...
Jose Ricardo da Silva Junior
 
SP18 Generative Design - Week 8 - Optimization
SP18 Generative Design - Week 8 - OptimizationSP18 Generative Design - Week 8 - Optimization
SP18 Generative Design - Week 8 - Optimization
Danil Nagy
 
On the Semantics of Real-Time Domain Specific Modeling Languages
On the Semantics of Real-Time Domain Specific Modeling LanguagesOn the Semantics of Real-Time Domain Specific Modeling Languages
On the Semantics of Real-Time Domain Specific Modeling Languages
Jose E. Rivera
 
Manufacturing processes
Manufacturing processesManufacturing processes
Manufacturing processes
Kazi Mostafa
 
Lessons Learned from Building Machine Learning Software at Netflix
Lessons Learned from Building Machine Learning Software at NetflixLessons Learned from Building Machine Learning Software at Netflix
Lessons Learned from Building Machine Learning Software at Netflix
Justin Basilico
 

Similar to Wcre04.ppt (20)

Final Report Defense 021509
Final Report Defense 021509Final Report Defense 021509
Final Report Defense 021509
 
Enrich your Toolbox: Gain efficiency with the right techniques, tools & methods
Enrich your Toolbox: Gain efficiency with the right techniques, tools & methodsEnrich your Toolbox: Gain efficiency with the right techniques, tools & methods
Enrich your Toolbox: Gain efficiency with the right techniques, tools & methods
 
PR-272: Accelerating Large-Scale Inference with Anisotropic Vector Quantization
PR-272: Accelerating Large-Scale Inference with Anisotropic Vector QuantizationPR-272: Accelerating Large-Scale Inference with Anisotropic Vector Quantization
PR-272: Accelerating Large-Scale Inference with Anisotropic Vector Quantization
 
Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017
 
Trondheim Test Conference: Increase your effectiveness with the right test te...
Trondheim Test Conference: Increase your effectiveness with the right test te...Trondheim Test Conference: Increase your effectiveness with the right test te...
Trondheim Test Conference: Increase your effectiveness with the right test te...
 
VISSOFTPresentation.pdf
VISSOFTPresentation.pdfVISSOFTPresentation.pdf
VISSOFTPresentation.pdf
 
Assessing the Reliability of a Human Estimator
Assessing the Reliability of a Human EstimatorAssessing the Reliability of a Human Estimator
Assessing the Reliability of a Human Estimator
 
Symbexecsearch
SymbexecsearchSymbexecsearch
Symbexecsearch
 
Caepia presentation
Caepia presentationCaepia presentation
Caepia presentation
 
Collaborative 3D Modeling by the Crowd
Collaborative 3D Modeling by the CrowdCollaborative 3D Modeling by the Crowd
Collaborative 3D Modeling by the Crowd
 
talk1
talk1talk1
talk1
 
Optimising Autonomous Robot Swarm Parameters for Stable Formation Design
Optimising Autonomous Robot Swarm Parameters for Stable Formation DesignOptimising Autonomous Robot Swarm Parameters for Stable Formation Design
Optimising Autonomous Robot Swarm Parameters for Stable Formation Design
 
How to easily find the optimal solution without exhaustive search using Genet...
How to easily find the optimal solution without exhaustive search using Genet...How to easily find the optimal solution without exhaustive search using Genet...
How to easily find the optimal solution without exhaustive search using Genet...
 
6sigma
6sigma6sigma
6sigma
 
TOOLS USA01.ppt
TOOLS USA01.pptTOOLS USA01.ppt
TOOLS USA01.ppt
 
Dominoes: Exploratory Data Analysis of Software Repositories Through GPU Proc...
Dominoes: Exploratory Data Analysis of Software Repositories Through GPU Proc...Dominoes: Exploratory Data Analysis of Software Repositories Through GPU Proc...
Dominoes: Exploratory Data Analysis of Software Repositories Through GPU Proc...
 
SP18 Generative Design - Week 8 - Optimization
SP18 Generative Design - Week 8 - OptimizationSP18 Generative Design - Week 8 - Optimization
SP18 Generative Design - Week 8 - Optimization
 
On the Semantics of Real-Time Domain Specific Modeling Languages
On the Semantics of Real-Time Domain Specific Modeling LanguagesOn the Semantics of Real-Time Domain Specific Modeling Languages
On the Semantics of Real-Time Domain Specific Modeling Languages
 
Manufacturing processes
Manufacturing processesManufacturing processes
Manufacturing processes
 
Lessons Learned from Building Machine Learning Software at Netflix
Lessons Learned from Building Machine Learning Software at NetflixLessons Learned from Building Machine Learning Software at Netflix
Lessons Learned from Building Machine Learning Software at Netflix
 

More from Yann-Gaël Guéhéneuc

Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0
Yann-Gaël Guéhéneuc
 
Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5
Yann-Gaël Guéhéneuc
 
Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1
Yann-Gaël Guéhéneuc
 
Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22
Yann-Gaël Guéhéneuc
 
Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3
Yann-Gaël Guéhéneuc
 
Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9
Yann-Gaël Guéhéneuc
 
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
Yann-Gaël Guéhéneuc
 
An Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its ConsequencesAn Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its Consequences
Yann-Gaël Guéhéneuc
 
Are CPUs VMs Like Any Others? v1.0
Are CPUs VMs Like Any Others? v1.0Are CPUs VMs Like Any Others? v1.0
Are CPUs VMs Like Any Others? v1.0
Yann-Gaël Guéhéneuc
 
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Yann-Gaël Guéhéneuc
 
Well-known Computer Scientists v1.0.2
Well-known Computer Scientists v1.0.2Well-known Computer Scientists v1.0.2
Well-known Computer Scientists v1.0.2
Yann-Gaël Guéhéneuc
 
On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1
Yann-Gaël Guéhéneuc
 
On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6
Yann-Gaël Guéhéneuc
 
ICSOC'21
ICSOC'21ICSOC'21
Vissoft21.ppt
Vissoft21.pptVissoft21.ppt
Vissoft21.ppt
Yann-Gaël Guéhéneuc
 
Service computation20.ppt
Service computation20.pptService computation20.ppt
Service computation20.ppt
Yann-Gaël Guéhéneuc
 
Serp4 iot20.ppt
Serp4 iot20.pptSerp4 iot20.ppt
Serp4 iot20.ppt
Yann-Gaël Guéhéneuc
 
Msr20.ppt
Msr20.pptMsr20.ppt
Iwesep19.ppt
Iwesep19.pptIwesep19.ppt
Icsoc20.ppt
Icsoc20.pptIcsoc20.ppt

More from Yann-Gaël Guéhéneuc (20)

Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0Some Pitfalls with Python and Their Possible Solutions v1.0
Some Pitfalls with Python and Their Possible Solutions v1.0
 
Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5Advice for writing a NSERC Discovery grant application v0.5
Advice for writing a NSERC Discovery grant application v0.5
 
Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1Ptidej Architecture, Design, and Implementation in Action v2.1
Ptidej Architecture, Design, and Implementation in Action v2.1
 
Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22Evolution and Examples of Java Features, from Java 1.7 to Java 22
Evolution and Examples of Java Features, from Java 1.7 to Java 22
 
Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3Consequences and Principles of Software Quality v0.3
Consequences and Principles of Software Quality v0.3
 
Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9Some Pitfalls with Python and Their Possible Solutions v0.9
Some Pitfalls with Python and Their Possible Solutions v0.9
 
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
An Explanation of the Unicode, the Text Encoding Standard, Its Usages and Imp...
 
An Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its ConsequencesAn Explanation of the Halting Problem and Its Consequences
An Explanation of the Halting Problem and Its Consequences
 
Are CPUs VMs Like Any Others? v1.0
Are CPUs VMs Like Any Others? v1.0Are CPUs VMs Like Any Others? v1.0
Are CPUs VMs Like Any Others? v1.0
 
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
Informaticien(ne)s célèbres (v1.0.2, 19/02/20)
 
Well-known Computer Scientists v1.0.2
Well-known Computer Scientists v1.0.2Well-known Computer Scientists v1.0.2
Well-known Computer Scientists v1.0.2
 
On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1On Java Generics, History, Use, Caveats v1.1
On Java Generics, History, Use, Caveats v1.1
 
On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6On Reflection in OO Programming Languages v1.6
On Reflection in OO Programming Languages v1.6
 
ICSOC'21
ICSOC'21ICSOC'21
ICSOC'21
 
Vissoft21.ppt
Vissoft21.pptVissoft21.ppt
Vissoft21.ppt
 
Service computation20.ppt
Service computation20.pptService computation20.ppt
Service computation20.ppt
 
Serp4 iot20.ppt
Serp4 iot20.pptSerp4 iot20.ppt
Serp4 iot20.ppt
 
Msr20.ppt
Msr20.pptMsr20.ppt
Msr20.ppt
 
Iwesep19.ppt
Iwesep19.pptIwesep19.ppt
Iwesep19.ppt
 
Icsoc20.ppt
Icsoc20.pptIcsoc20.ppt
Icsoc20.ppt
 

Recently uploaded

Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 

Recently uploaded (20)

Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 

Wcre04.ppt

  • 1. Yann-Gaël Guéhéneuc © Yann-Gaël Guéhéneuc This presentation has been given at WCRE, the 10th of November 2004, in Delft, Netherlands. Software Engineering Laboratory Department of Computing Science and Operations Research University of Montreal Fingerprinting Design Patterns Houari Sahraoui {guehene,sahraouh}@iro.umontreal.ca 2004/11/10
  • 2. 2/22 Motivations n Design patterns propose standard solutions (design motifs) to recurrent design problems n Detecting partial/complete occurrences of design motifs (DM) helps – Understanding solved design problems – Changing/refactoring programs
  • 3. 3/22 Motivations n DM define roles n Occurrence of a DM = Combination of classes that matches the roles n Detecting occurrences of DMs = Finding among all possible combinations of classes those that match the roles – Complex and time- and resource- consuming task
  • 4. 4/22 Example n Detecting occurrences of Abstract Factory in a medium size program – JREFACTORY (575 classes) – 5 roles (AbstractFactory, ConcreteFactory, AbstractProduct, Product, and Client) – ~ 5755 = 6.28549E+13 possible combinations
  • 5. 5/22 Idea n Reduce the search space using heuristics n Efficient heuristic – Quantitative characterization of DM roles n Not really new – For example, [Antoniol et al., 98]
  • 6. 6/22 Idea n Limitations of current approaches – Quantitative characterization extracted from design pattern description manually – Strong assumption: Implementation is conform to theory n Solution – Automatic quantitative characterization from past-discovered occurrences
  • 7. 7/22 Fingerprinting Principle n Use internal attributes of classes – Size, inheritance, coupling, cohesion n Values of internal attributes are not unique – A class can play more than one role – Two or more classes can play a same role n Attributes can be used to reduce the search space – Eliminating classes that do not play a particular role obviously
  • 9. 9/22 Building Fingerprints n Repository creation – Sources • Studies in the literature (cf., [Bieman et al., 03]) • Home-made tool for structural detection [Guéhéneuc, 01] • Assignments in a graduate course – Structure • <program><designmotif><occurrence><role> Repository creation Candidate rule derivation Rule validation
  • 10. 10/22 Building Fingerprints n Repository creation Repository creation Candidate rule derivation Rule validation JHOTDRAW v5.1 JREFACTORY v2.6.24 JUNIT v3.7 LEXI v0.0.1α NETBEANS v1.0.x QUICKUML 2001 Total Number of classes 173 575 157 127 5812 224 7 068 Design motif Number of DM occurrences per program Number of roles [Gamma, 1994] Number of classes playing a role per design motif Abstract Factory 12 1 13 5 217 Adapter 1 17 8 26 4 230 Builder 2 1 1 4 4 24 Command 1 1 1 3 5 67 Composite 1 1 2 4 4 107 Decorator 1 1 2 4 64 Factory Method 3 1 4 4 67 Iterator 1 5 6 5 30 Observer 2 3 2 1 8 4 93 Prototype 2 2 3 32 Singleton 2 2 2 2 1 9 1 9 State 2 2 4 3 32 Strategy 4 4 3 36 Template Method 2 2 2 36 Visitor 2 2 4 138 Total 93 55 1 182
  • 11. 11/22 Building Fingerprints n Repository creation – Metric extraction for each class in the repository Repository creation Candidate rule derivation Rule validation Acronyms Descriptions References NM Number of methods [Lorenz, 94] NMA Number of new methods [Lorenz, 94] NMI Number of inherited methods [Lorenz, 94] NMO Number of overridden methods [Lorenz, 94] Size WMC Weighted methods per class [Chidamber, 93] CLD Class to leaf depth [Tegarden, 95] DIT Depth of inheritance tree [Chidamber, 93]Inheritance NOC Number of children [Chidamber, 93] C Connectivity [Hitz , 95] Cohesion LCOM5 Lack of cohesion in methods [Briand 97] ACMIC Antecedent class-method import coupling [Briand 97] CBO Coupling between objects [Chidamber, 93]Coupling DCMEC Descendent class-method import coupling [Briand 97]
  • 12. 12/22 Building Fingerprints n Candidate rule derivation – Rule learner, JRIP (from Weka tool) – Learning dataset (for each role): 4 × n cases • n classes playing the role • 3 × n classes chosen randomly – Each case • <metric1, metric2, …, metricm, role> Repository creation Candidate rule derivation Rule validation
  • 13. 13/22 Building Fingerprints n Candidate rule derivation – Rules shape Rules for <Role>: Fingerprint1, confidence … Fingerprintk, confidence where Fingerprint1: {metric1 ∈ D11; … ; metricm ∈ Dm1} Repository creation Candidate rule derivation Rule validation
  • 14. 14/22 Building Fingerprints n Candidate rule validation – Roles without a significant number of occurrences are eliminated (20 over 55) – Cross-validation • Leave-one-out method • Roles with a recall less than 75% are eliminated (15 over 35) • For the 20 remaining roles, error < 10% Repository creation Candidate rule derivation Rule validation
  • 15. 15/22 Building Fingerprints n Rule validation Repository creation Candidate rule derivation Rule validation Design motifs Roles Error (%) Recall (%) Iterator Client 0,00 100,00 Observer Subject 0,00 100,00 Observer Observer 2,38 100,00 Template Method Concrete Class 0,00 97,06 Prototype Concrete Prototype 0,00 96,30 Decorator Concrete Component 4,17 89,58 Visitor Concrete Visitor 0,00 88,89 Strategy Context 3,70 88,89 Visitor Concrete Element 2,04 88,78 Singleton Singleton 8,33 87,50 Factory Method Concrete Creator 4,30 87,10 Factory Method Concrete Product 3,45 86,21 Adapter Target 4,00 84,00 Composite Leaf 6,47 82,09 Decorator Concrete Decorator 0,00 80,00 Iterator Iterator 0,00 80,00 Command Receiver 6,67 80,00 State Concrete State 6,67 80,00 Strategy Concrete Strategy 2,38 78,57 Command Concrete Command 3,23 77,42
  • 16. 16/22 Using Fingerprints n Structural detection with constraints – {V, C, D} – Variables represent roles in a DM – Domains contain all classes of a program n Fingerprints reduce the domains n Fingerprints reduce the number of possible combinations
  • 17. 17/22 Composite DM n Without fingerprints – S = All classes – Variables • client, Dcl = S • component, Dcn = S • composite, Dco = S • leaf, Dle = S – Constraints • association(client, component), inheritance(component, composite), inheritance(component, leaf), composition(composite, component) n With fingerprints – Scl, Scn, Sco, and Sle ⊆ S – Variables • client, Dcl = Scl • component, Dcn = Scn • composite, Dco = Sco • leaf, Dle = Sle Scl, Scn, Sco, and Sle = Classes matching fingerprints of the four roles
  • 18. 18/22 Composite DM n Rules for “Leaf” • NMI = 26 ∧ DIT = 5, 23/67 • NMI = 25 ∧ NMO = 2, 45/67 • DIT = 3 ∧ NM = 12, 9/67 n Search space reduction Fingerprints Number of classes Reduction (%) NMI = 26 ∧ DIT = 5 20 69,00 NIM = 25 ∧ NMO = 2 7 89,15 DIT = 3 ∧ NM = 12 10 84,50
  • 19. 19/22 Side Effects n DM vs. Quality
  • 20. 20/22 Conclusion n Experimental study for mining role fingerprints (quantitative characterization) n Role fingerprints defined using metrics n Role fingerprints used for DM occurrences detection n Significant reduction in time and resources n Applicable to partial occurrence detection
  • 22. 21/22 Future work (just a joke) n Fingerprinting components
  • 23. 21/22 Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks
  • 24. 21/22 Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects
  • 25. 21/22 Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects n Fingerprinting refactorings
  • 26. 21/22 Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects n Fingerprinting refactorings n Fingerprinting services
  • 27. 21/22 Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects n Fingerprinting refactorings n Fingerprinting services n Fingerprinting metrics
  • 28. 21/22 Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects n Fingerprinting refactorings n Fingerprinting services n Fingerprinting metrics n …
  • 29. 22/22 Data n Accuracy depends on the repository – P-MARt (Pattern-like Micro-Architecture Repository) is a repository of micro-architectures similar to design motifs – P-MARt and its associated tools are freely available under the LPGL Please contribute! – Information, downloads, and contributions at http://www2.iro.umontreal.ca/~labgelo/p-mart/