SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
This presentation has been given at WCRE, the 10th of November 2004, in Delft, Netherlands.




            Fingerprinting Design
                  Patterns

                                                Yann-Gaël Guéhéneuc
                                                  Houari Sahraoui
                                         {guehene,sahraouh}@iro.umontreal.ca
                                                     2004/11/10

              Software Engineering Laboratory
              Department of Computing Science and Operations Research
              University of Montreal                                                          © Yann-Gaël Guéhéneuc
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

2/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
3/22
Example

       n Detectingoccurrences 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


4/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]

5/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
6/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
7/22         role obviously
Building Fingerprints
          Repository   Candidate rule     Rule
           creation      derivation     validation




8/22
Building Fingerprints
             Repository       Candidate rule          Rule
              creation          derivation          validation

       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>



9/22
Building Fingerprints
              Repository                                  Candidate rule                                         Rule
               creation                                     derivation                                         validation

        n   Repository creation
                                     JH OTD RAW   JREFACTORY   JU NIT    LEXI     N ETBEANS QUICKUML   Total   Number of    Number of
                                        v5.1        v2.6.24     v3.7    v0.0.1α     v1.0.x    2001                roles      classes
                                                                                                                [Gamma,     playing a
                 Number of classes      173          575        157      127        5812      224      7 068      1994]      role per
                                                                                                                           design motif
                   Design motif                       Number of DM occurrences per program
                 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
10/22
Building Fingerprints
              Repository                     Candidate rule                                 Rule
               creation                        derivation                                 validation

        n   Repository creation
            – Metric extraction for each class in the repository

                                 Acronyms                  Descriptions                  References
                                    NM      Number of methods                           [Lorenz, 94]
                                   NMA      Number of new methods                       [Lorenz, 94]
                        Size       NMI      Number of inherited methods                 [Lorenz, 94]
                                   NMO      Number of overridden methods                [Lorenz, 94]
                                   WMC      Weighted methods per class                [Chidamber, 93]
                                   CLD      Class to leaf depth                        [Tegarden, 95]
                     Inheritance    DIT     Depth of inheritance tree                 [Chidamber, 93]
                                   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]
                      Coupling     CBO      Coupling between objects                  [Chidamber, 93]
                                 DCMEC      Descendent class-method import coupling      [Briand 97]
11/22
Building Fingerprints
              Repository         Candidate rule            Rule
               creation            derivation            validation

        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
               • <metric 1, metric2, …, metricm, role>



12/22
Building Fingerprints
              Repository           Candidate rule               Rule
               creation              derivation               validation

        n   Candidate rule derivation
            – Rules shape
               Rules for <Role>:
                    Fingerprint1, confidence
                    …
                    Fingerprintk, confidence

               where
                    Fingerprint1: {metric 1 ∈ D11; … ; metric m ∈ Dm1}


13/22
Building Fingerprints
              Repository        Candidate rule          Rule
               creation           derivation          validation

        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%


14/22
Building Fingerprints
              Repository                     Candidate rule                            Rule
               creation                        derivation                            validation

        n   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

15/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
16/22
Composite DM
        n   Without fingerprints         n   With fingerprints
            – S = All classes                 – Scl, Scn, Sco, and S le ⊆ S
            – Variables                       – Variables
                                                  •   client, Dcl = Scl
                •   client, Dcl = S
                                                  •   component, Dcn = Scn
                •   component, Dcn = S
                                                  •   composite, Dco = Sco
                •   composite, Dco = S
                                                  •   leaf, Dle = Sle
                •   leaf, Dle = S
                                                Scl, Scn, Sco, and S le = Classes
                                                matching fingerprints of the
                                                four roles
            – Constraints
                • association(client, component), inheritance(component,
                  composite), inheritance(component, leaf),
17/22             composition(composite, component)
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
18/22
Side Effects

        n DM   vs. Quality




19/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


20/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   …




21/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
22/22         http://www2.iro.umontreal.ca/~labgelo/p-mart/

Más contenido relacionado

Destacado

my presentation of the paper "FAST'12 NCCloud"
my presentation of the paper "FAST'12 NCCloud"my presentation of the paper "FAST'12 NCCloud"
my presentation of the paper "FAST'12 NCCloud"
Shuai Yuan
 

Destacado (11)

FYP Presentation
FYP PresentationFYP Presentation
FYP Presentation
 
Introduction to Network Coding
Introduction to Network CodingIntroduction to Network Coding
Introduction to Network Coding
 
Distributed storage system
Distributed storage systemDistributed storage system
Distributed storage system
 
my presentation of the paper "FAST'12 NCCloud"
my presentation of the paper "FAST'12 NCCloud"my presentation of the paper "FAST'12 NCCloud"
my presentation of the paper "FAST'12 NCCloud"
 
Survey of distributed storage system
Survey of distributed storage systemSurvey of distributed storage system
Survey of distributed storage system
 
Tachyon: An Open Source Memory-Centric Distributed Storage System
Tachyon: An Open Source Memory-Centric Distributed Storage SystemTachyon: An Open Source Memory-Centric Distributed Storage System
Tachyon: An Open Source Memory-Centric Distributed Storage System
 
Identity Based Secure Distributed Storage Scheme
Identity Based Secure Distributed Storage SchemeIdentity Based Secure Distributed Storage Scheme
Identity Based Secure Distributed Storage Scheme
 
Network Coding in Disruption Tolerant Network (DTN)
Network Coding in Disruption Tolerant Network (DTN)Network Coding in Disruption Tolerant Network (DTN)
Network Coding in Disruption Tolerant Network (DTN)
 
Software Defined Networks Explained
Software Defined Networks ExplainedSoftware Defined Networks Explained
Software Defined Networks Explained
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 
Distributed computing ).ppt him
Distributed computing ).ppt himDistributed computing ).ppt him
Distributed computing ).ppt him
 

Similar a WCRE04.ppt

Structured conceptualization approach to survey design slideshare 0213 dmf
Structured conceptualization approach to survey design slideshare 0213 dmfStructured conceptualization approach to survey design slideshare 0213 dmf
Structured conceptualization approach to survey design slideshare 0213 dmf
David Filiberto
 
GlennVanderburg_CraftAndSoftwareEngineering
GlennVanderburg_CraftAndSoftwareEngineeringGlennVanderburg_CraftAndSoftwareEngineering
GlennVanderburg_CraftAndSoftwareEngineering
Kostas Mavridis
 
Uav project.mpp
Uav project.mppUav project.mpp
Uav project.mpp
rajibaus
 
Manning Struts 2 In Action
Manning Struts 2 In ActionManning Struts 2 In Action
Manning Struts 2 In Action
Syed Shahul
 
IWLCS'2007: Substructural Surrogates for Learning Decomposable Classification...
IWLCS'2007: Substructural Surrogates for Learning Decomposable Classification...IWLCS'2007: Substructural Surrogates for Learning Decomposable Classification...
IWLCS'2007: Substructural Surrogates for Learning Decomposable Classification...
Albert Orriols-Puig
 
The Railpocket Wifi Project Anonymous
The Railpocket Wifi Project AnonymousThe Railpocket Wifi Project Anonymous
The Railpocket Wifi Project Anonymous
kielegat
 
The Dissertation
The DissertationThe Dissertation
The Dissertation
phooji
 
Day 13 graphing linear equations from tables
Day 13 graphing linear equations from tablesDay 13 graphing linear equations from tables
Day 13 graphing linear equations from tables
Erik Tjersland
 
Evolutionary Algorithms and their Applications in Civil Engineering - 1
Evolutionary Algorithms and their Applications in Civil Engineering - 1Evolutionary Algorithms and their Applications in Civil Engineering - 1
Evolutionary Algorithms and their Applications in Civil Engineering - 1
shreymodi
 

Similar a WCRE04.ppt (20)

Wcre04.ppt
Wcre04.pptWcre04.ppt
Wcre04.ppt
 
Structured conceptualization approach to survey design slideshare 0213 dmf
Structured conceptualization approach to survey design slideshare 0213 dmfStructured conceptualization approach to survey design slideshare 0213 dmf
Structured conceptualization approach to survey design slideshare 0213 dmf
 
Profiling blueprints
Profiling blueprintsProfiling blueprints
Profiling blueprints
 
GlennVanderburg_CraftAndSoftwareEngineering
GlennVanderburg_CraftAndSoftwareEngineeringGlennVanderburg_CraftAndSoftwareEngineering
GlennVanderburg_CraftAndSoftwareEngineering
 
Uav project.mpp
Uav project.mppUav project.mpp
Uav project.mpp
 
Manning Struts 2 In Action
Manning Struts 2 In ActionManning Struts 2 In Action
Manning Struts 2 In Action
 
User manual Scrivener 2.3 for Mac
User manual Scrivener 2.3 for Mac User manual Scrivener 2.3 for Mac
User manual Scrivener 2.3 for Mac
 
IWLCS'2007: Substructural Surrogates for Learning Decomposable Classification...
IWLCS'2007: Substructural Surrogates for Learning Decomposable Classification...IWLCS'2007: Substructural Surrogates for Learning Decomposable Classification...
IWLCS'2007: Substructural Surrogates for Learning Decomposable Classification...
 
Thesis+of+soumaya+medini.ppt
Thesis+of+soumaya+medini.pptThesis+of+soumaya+medini.ppt
Thesis+of+soumaya+medini.ppt
 
OO Development 2 - Software Development Methodologies
OO Development 2 - Software Development MethodologiesOO Development 2 - Software Development Methodologies
OO Development 2 - Software Development Methodologies
 
Merj sort
Merj sortMerj sort
Merj sort
 
The Railpocket Wifi Project Anonymous
The Railpocket Wifi Project AnonymousThe Railpocket Wifi Project Anonymous
The Railpocket Wifi Project Anonymous
 
The Dissertation
The DissertationThe Dissertation
The Dissertation
 
Day 13 graphing linear equations from tables
Day 13 graphing linear equations from tablesDay 13 graphing linear equations from tables
Day 13 graphing linear equations from tables
 
Evolutionary Algorithms and their Applications in Civil Engineering - 1
Evolutionary Algorithms and their Applications in Civil Engineering - 1Evolutionary Algorithms and their Applications in Civil Engineering - 1
Evolutionary Algorithms and their Applications in Civil Engineering - 1
 
Automation of Discovery Technology Lab Workflows
Automation of Discovery Technology Lab WorkflowsAutomation of Discovery Technology Lab Workflows
Automation of Discovery Technology Lab Workflows
 
User manual Scrivener 2.1 for Mac
User manual Scrivener 2.1 for MacUser manual Scrivener 2.1 for Mac
User manual Scrivener 2.1 for Mac
 
Integratedbook
IntegratedbookIntegratedbook
Integratedbook
 
Bug Prediction Based on Fine-Grained Module Histories
Bug Prediction Based on Fine-Grained Module HistoriesBug Prediction Based on Fine-Grained Module Histories
Bug Prediction Based on Fine-Grained Module Histories
 
Applying your Convolutional Neural Networks
Applying your Convolutional Neural NetworksApplying your Convolutional Neural Networks
Applying your Convolutional Neural Networks
 

Más de Ptidej Team

Más de Ptidej Team (20)

From IoT to Software Miniaturisation
From IoT to Software MiniaturisationFrom IoT to Software Miniaturisation
From IoT to Software Miniaturisation
 
Presentation
PresentationPresentation
Presentation
 
Presentation
PresentationPresentation
Presentation
 
Presentation
PresentationPresentation
Presentation
 
Presentation by Lionel Briand
Presentation by Lionel BriandPresentation by Lionel Briand
Presentation by Lionel Briand
 
Manel Abdellatif
Manel AbdellatifManel Abdellatif
Manel Abdellatif
 
Azadeh Kermansaravi
Azadeh KermansaraviAzadeh Kermansaravi
Azadeh Kermansaravi
 
Mouna Abidi
Mouna AbidiMouna Abidi
Mouna Abidi
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel Grichi
 
Cristiano Politowski
Cristiano PolitowskiCristiano Politowski
Cristiano Politowski
 
Will io t trigger the next software crisis
Will io t trigger the next software crisisWill io t trigger the next software crisis
Will io t trigger the next software crisis
 
MIPA
MIPAMIPA
MIPA
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.ppt
 
Thesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptThesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.ppt
 
Medicine15.ppt
Medicine15.pptMedicine15.ppt
Medicine15.ppt
 
Qrs17b.ppt
Qrs17b.pptQrs17b.ppt
Qrs17b.ppt
 
Icpc11c.ppt
Icpc11c.pptIcpc11c.ppt
Icpc11c.ppt
 
Icsme16.ppt
Icsme16.pptIcsme16.ppt
Icsme16.ppt
 
Msr17a.ppt
Msr17a.pptMsr17a.ppt
Msr17a.ppt
 
Icsoc15.ppt
Icsoc15.pptIcsoc15.ppt
Icsoc15.ppt
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

WCRE04.ppt

  • 1. This presentation has been given at WCRE, the 10th of November 2004, in Delft, Netherlands. Fingerprinting Design Patterns Yann-Gaël Guéhéneuc Houari Sahraoui {guehene,sahraouh}@iro.umontreal.ca 2004/11/10 Software Engineering Laboratory Department of Computing Science and Operations Research University of Montreal © Yann-Gaël Guéhéneuc
  • 2. 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 2/22
  • 3. 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 3/22
  • 4. Example n Detectingoccurrences 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 4/22
  • 5. 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] 5/22
  • 6. 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 6/22
  • 7. 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 7/22 role obviously
  • 8. Building Fingerprints Repository Candidate rule Rule creation derivation validation 8/22
  • 9. Building Fingerprints Repository Candidate rule Rule creation derivation validation 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> 9/22
  • 10. Building Fingerprints Repository Candidate rule Rule creation derivation validation n Repository creation JH OTD RAW JREFACTORY JU NIT LEXI N ETBEANS QUICKUML Total Number of Number of v5.1 v2.6.24 v3.7 v0.0.1α v1.0.x 2001 roles classes [Gamma, playing a Number of classes 173 575 157 127 5812 224 7 068 1994] role per design motif Design motif Number of DM occurrences per program 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 10/22
  • 11. Building Fingerprints Repository Candidate rule Rule creation derivation validation n Repository creation – Metric extraction for each class in the repository Acronyms Descriptions References NM Number of methods [Lorenz, 94] NMA Number of new methods [Lorenz, 94] Size NMI Number of inherited methods [Lorenz, 94] NMO Number of overridden methods [Lorenz, 94] WMC Weighted methods per class [Chidamber, 93] CLD Class to leaf depth [Tegarden, 95] Inheritance DIT Depth of inheritance tree [Chidamber, 93] 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] Coupling CBO Coupling between objects [Chidamber, 93] DCMEC Descendent class-method import coupling [Briand 97] 11/22
  • 12. Building Fingerprints Repository Candidate rule Rule creation derivation validation 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 • <metric 1, metric2, …, metricm, role> 12/22
  • 13. Building Fingerprints Repository Candidate rule Rule creation derivation validation n Candidate rule derivation – Rules shape Rules for <Role>: Fingerprint1, confidence … Fingerprintk, confidence where Fingerprint1: {metric 1 ∈ D11; … ; metric m ∈ Dm1} 13/22
  • 14. Building Fingerprints Repository Candidate rule Rule creation derivation validation 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% 14/22
  • 15. Building Fingerprints Repository Candidate rule Rule creation derivation validation n 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 15/22
  • 16. 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 16/22
  • 17. Composite DM n Without fingerprints n With fingerprints – S = All classes – Scl, Scn, Sco, and S le ⊆ S – Variables – Variables • client, Dcl = Scl • client, Dcl = S • component, Dcn = Scn • component, Dcn = S • composite, Dco = Sco • composite, Dco = S • leaf, Dle = Sle • leaf, Dle = S Scl, Scn, Sco, and S le = Classes matching fingerprints of the four roles – Constraints • association(client, component), inheritance(component, composite), inheritance(component, leaf), 17/22 composition(composite, component)
  • 18. 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 18/22
  • 19. Side Effects n DM vs. Quality 19/22
  • 20. 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 20/22
  • 21. Future work (just a joke) 21/22
  • 22. Future work (just a joke) n Fingerprinting components 21/22
  • 23. Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks 21/22
  • 24. Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects 21/22
  • 25. Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects n Fingerprinting refactorings 21/22
  • 26. Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects n Fingerprinting refactorings n Fingerprinting services 21/22
  • 27. 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
  • 28. Future work (just a joke) n Fingerprinting components n Fingerprinting frameworks n Fingerprinting aspects n Fingerprinting refactorings n Fingerprinting services n Fingerprinting metrics n … 21/22
  • 29. 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 22/22 http://www2.iro.umontreal.ca/~labgelo/p-mart/