SlideShare a Scribd company logo
1 of 29
Download to read offline
Refactorings of Design Defects using
    Relational Concept Analysis

Naouel Moha, Amine Mohamed Rouane Hacene,
  Petko Valtchev, and Yann-Gaël Guéhéneuc

                         LORIA, France
            DIRO, University of Montréal, Canada
   LATECE, Université du Québec à Montréal, Montréal, Canada



                       ICFCA’08
    Montréal (Qc), Canada, February 25-28, 2008
Context




Moha ©    Refactorings of Design Defects using RCA   2
Context




Moha ©    Refactorings of Design Defects using RCA   3
Context




Moha ©    Refactorings of Design Defects using RCA   4
Context: Overall Process
             Textual descriptions
              of design defects


                 1       S                        3
                         P
                                            S
                         E
                                            U
                         C
                                            G
                         I
                                            G
                         F
                                            E
                         I
                                            S
                         C
                                            T
                         A
                                            I
                         T
                                            O
                         I
                                            N
                         O
                         N


                      Rules          Refactorings

                  2      D
                                            C     4
                                            O
                         E
                                            R
                         T
                                            R
                         E
                                            E
                         C
                                            C
                         T
                                            T
                         I
                                            I
                         O
                                            O
                         N
                                            N




                Classes having          Better
                design defects          Design
Moha ©       Refactorings of Design Defects using RCA   5
Context: Overall Process
             Textual descriptions
              of design defects


                 1       S                        3
                         P
                                            S
                         E
                                            U
                         C
                                            G
                         I
                                            G
                         F
                                            E
                         I
                                            S
                         C
                                            T
                         A
                                            I
                         T
                                            O
                         I
                                            N
                         O
                         N


                      Rules          Refactorings

                  2      D
                                            C     4
                                            O
                         E
                                            R
                         T
                                            R
                         E
                                            E
                         C
                                            C
                         T
                                            T
                         I
                                            I
                         O
                                            O
                         N
                                            N




                Classes having          Better
                design defects          Design
Moha ©       Refactorings of Design Defects using RCA   6
Context: Overall Process
  1-2. Specification and Detection of DDs
         More and more tools and techniques
            Actively researched area
            Method DECOR (Defect dEtection for CORrection) [Moha 06]

  3. Suggestion
  3 S      ti
         Manual identification of the modifications
            Time-, resource-consuming, error-prone activity
                 ,                  g,       p            y

  4. Correction
         Refactorings
                   g
         Technique used to change “the internal structure of software to make it
         easier to understand and cheaper to modify without changing its
         observable behavior”


Moha ©                         Refactorings of Design Defects using RCA     7
What Kind of Defects ?
   Design Patterns are “good” solutions to recurring design problems

   Design Defects (DDs)
         are “bad” solutions to recurring problems, Antipatterns [Brown 98]

         hinder d
         hi d development and maintenance by making programs h d t
                  l       t d     i t     b    ki            harder to
         comprehend and/or evolve

   DDs of interest: infected by low cohesion and high coupling
         Cohesion: how closely the methods are related to the variables in
         the class

         Coupling: the degree of its reliance on services provided by other
         classes



Moha ©                         Refactorings of Design Defects using RCA       8
What Kind of Defects ?
  An example of DDs [Brown 98]

                    Blob (God Class)
                    “ Procedural-style design leads to one object with a
                    lion’s share of the responsibilities while most other
                    objects only hold data or execute simple processes ”


                       Large controller class

                       Many fields and methods with a low cohesion

                       High coupled with the data stored in
                       associated data classes




Moha ©                Refactorings of Design Defects using RCA          9
An Example
         Blob




         Before




Moha ©            Refactorings of Design Defects using RCA   10
An Example
                     How t correct th d f t ?
                     H   to      t the defect




                      Before                                 After
         Large and complex class               Large class becomes less complex
         Small data classes                    Data classes gain more behaviour
         Not object-oriented                   More object-oriented style
Moha ©                       Refactorings of Design Defects using RCA         11
An Example
         Redistribute l
         R di t ib t class members among existing classes ( ith possibly
                                b             i ti  l      (with    ibl
         new classes) to increase cohesion and–or decrease coupling




                 Before                                              After




Moha ©                    Refactorings of Design Defects using RCA           12
Contribution
  Suggestion
         RCA [Rouane 07, Ph.D. Thesis]
           Extension of FCA to relational d
           E       i   f             l i  l data
           Models the inter-object links and infers description logics role like
           relations between concepts
           RCA provides a suitable framework for clustering individuals along
           the properties they share and their links with other individuals
           Identify methods that share common fields and methods that call
           common methods          cohesive sets low coupled




Moha ©                         Refactorings of Design Defects using RCA     13
Contribution
  Suggestion
         RCA [Rouane 07, Ph.D. Thesis]
           Extension of FCA to relational d
           E       i   f             l i  l data
           Models the inter-object links and infers description logics role like
           relations between concepts
           RCA provides a suitable framework for clustering individuals along
           the properties they share and their links with other individuals
           Identify methods that share common fields and methods that call
           common methods          cohesive sets low coupled


  «D
   Develop an automated approach f suggesting d f t
       l         t    t d         h for  ti defect-
   correcting refactorings using RCA »



Moha ©                         Refactorings of Design Defects using RCA     14
An Example
                     How t correct th d f t ?
                     H   to      t the defect




                      Before                                 After
         Large and complex class               Large class becomes less complex
         Small data classes                    Data classes gain more behaviour
         Not object-oriented                   More object-oriented style
Moha ©                       Refactorings of Design Defects using RCA         15
An Example
         How t correct th d f t ?
         H   to      t the defect




         Blob                                   Cohesive Sets




Moha ©          Refactorings of Design Defects using RCA        16
An Example
                            How t correct th d f t ?
                            H   to      t the defect




                                      I = {W-borrow_date_Book, W-return_date_book}
                                      E = {}
  I = {‘check_Availability_Book()’}
  E = {check_Availability_Book()}



                                                         I = {call:c4}
                                                         E = {}

         I = {‘borrow_Book()’}        I = {‘reserve_Book()’, W-reserved_book}
         E = {borrow_Book()}          E = {reserve_Book()}



                              Lattice                                                 Cohesive Set




Moha ©                                     Refactorings of Design Defects using RCA                  17
An Example
                 How t correct th d f t ?
                 H   to      t the defect




         Cohesive Sets                                    After Refactoring *


                                               * Move Method Mode Field, Create Class
                                                      Method,     Field


Moha ©                   Refactorings of Design Defects using RCA                18
Suggestion




Moha ©       Refactorings of Design Defects using RCA   19
Suggestion
1.       RCF Modeling




Moha ©                  Refactorings of Design Defects using RCA   20
Suggestion
2.       RCA Al
             Algorithms
                  ith




Moha ©                    Refactorings of Design Defects using RCA   21
Suggestion
2.       RCA Al
             Algorithms
                  ith




              9
                  I = {W-library opened}
                      {W library_opened}
                  E={}

                                       10
                                            I = {‘open_Library()’}
                                            E = {open Library()}
                                                {open_Library()}
                     7
                         I = {‘close_Library()’}
                         E = {close_Library()}




Moha ©                              Refactorings of Design Defects using RCA   22
Suggestion
2.       RCA Al
             Algorithms
                  ith




Moha ©                    Refactorings of Design Defects using RCA   23
Suggestion
2.       RCA Al
             Algorithms
                  ith




             4
                 I = {‘check_Availability_Book()’}
                 E = {check_Availability_Book()}




                                                                                     19
                                                                                          I = {call:c4}
                                                                                          E={}


                                   3                                12
                                       I = {‘borrow_Book()’}             I = {‘reserve_Book()’,W-reserved_book}
                                       E = {borrow_Book() }              E = {reserve_Book()}




Moha ©                                 Refactorings of Design Defects using RCA                               24
Suggestion
 3.      Interpretation




            Cohesive Sets                                       After Refactoring



                                                  * Move Method Mode Field, Create Class
                                                         Method,     Field


Moha ©                      Refactorings of Design Defects using RCA                25
Experimental Study
  Tooling
         PADL to model source code and generate contexts
         Galicia to construct and visualize the concept lattices


  Experiments
  E    i   t
         Goal: evaluate the relevance of the cohesive sets suggested
         4 different open-source programs




Moha ©                         Refactorings of Design Defects using RCA   26
System   Experimental Study
                                                                               Nb of fields/       Nb of    Nb of real
                                                            Size (fields +
                            Blob Class          LOC                             methods          cohesive   cohesive     Precision
                                                              methods)
                                                                                 moved             sets       sets
                     DHTTransportUDPImpl        2,049       (42+66) 108         (27+32) 59         10           7          70%
V2.3.0.6
Azureus




                     DHTControlImpl             1,868       (47+80) 127         (35+62) 97         19          11          58%
                     TRTrackerBTAnnouncerImpl   1,393        (36+47) 83         (24+33) 57         16           5          31%
V0.7.1 V1.4 V1.2.1




                     LogBrokerMonitor           1,142       (29+105)134        (23+85) 108         31          17          55%
         ene Log4j




                     Category                   387           (9+53) 62          (8+44) 52         18           9          50%
                     IndexReader                236           (7+52) 59          (5+30) 35          4           2          50%
Nutch Luce




                     QueryParser                829          (36+48) 84         (24+37) 61         13          10          77%
                     FSNamesystem               710          (24+35) 59         (17+25) 42         18           9          50%
                     JobTracker                 555          (
                                                             (22+31) 53
                                                                   )            (
                                                                                (17+18) 35
                                                                                      )            11           8          73%
                                                                                                  Average Precision:       57%




         Moha ©                                       Refactorings of Design Defects using RCA                             27
Conclusion
    Contribution
         an approach that uses RCA to suggest refactorings to correct
         certain DDs in particular Blob
                 DDs,

    Validation
         4 different programs
         Relevant refactorings to improve programs

    Future Work
         -   Generalise to other DDs
         -   Assess more programs via our approach
         -   Discuss the suggested refactorings with their developers and
             apply them



Moha ©                        Refactorings of Design Defects using RCA      28
Questions
         Contact: mohanaou@iro.umontreal.ca
                  http://www-etud.iro.umontreal.ca/~mohanaou




         Thanks for your attention !

Moha ©                           Refactorings of Design Defects using RCA   29

More Related Content

Viewers also liked

23. Ο «χρυσός αιώνας» της τέχνης
23. Ο «χρυσός αιώνας» της τέχνης23. Ο «χρυσός αιώνας» της τέχνης
23. Ο «χρυσός αιώνας» της τέχνηςGeorge Giotis
 
Lucia Russo Urban Coutute Internationa Press Reviews
Lucia Russo Urban Coutute Internationa Press ReviewsLucia Russo Urban Coutute Internationa Press Reviews
Lucia Russo Urban Coutute Internationa Press ReviewsLUCIA RUSSO
 
WT Men's Basketball Game Notes (1-23-16)
WT Men's Basketball Game Notes (1-23-16)WT Men's Basketball Game Notes (1-23-16)
WT Men's Basketball Game Notes (1-23-16)West Texas A&M
 
Henkilöbrändi vahvemmaksi LinkedInin avulla
Henkilöbrändi vahvemmaksi LinkedInin avullaHenkilöbrändi vahvemmaksi LinkedInin avulla
Henkilöbrändi vahvemmaksi LinkedInin avullaHenna Niiranen
 

Viewers also liked (7)

La bios
La biosLa bios
La bios
 
Temarios etapa xxii
Temarios etapa xxiiTemarios etapa xxii
Temarios etapa xxii
 
23. Ο «χρυσός αιώνας» της τέχνης
23. Ο «χρυσός αιώνας» της τέχνης23. Ο «χρυσός αιώνας» της τέχνης
23. Ο «χρυσός αιώνας» της τέχνης
 
Planificación química 3º medio 2013
Planificación química 3º medio 2013Planificación química 3º medio 2013
Planificación química 3º medio 2013
 
Lucia Russo Urban Coutute Internationa Press Reviews
Lucia Russo Urban Coutute Internationa Press ReviewsLucia Russo Urban Coutute Internationa Press Reviews
Lucia Russo Urban Coutute Internationa Press Reviews
 
WT Men's Basketball Game Notes (1-23-16)
WT Men's Basketball Game Notes (1-23-16)WT Men's Basketball Game Notes (1-23-16)
WT Men's Basketball Game Notes (1-23-16)
 
Henkilöbrändi vahvemmaksi LinkedInin avulla
Henkilöbrändi vahvemmaksi LinkedInin avullaHenkilöbrändi vahvemmaksi LinkedInin avulla
Henkilöbrändi vahvemmaksi LinkedInin avulla
 

More from Ptidej Team

From IoT to Software Miniaturisation
From IoT to Software MiniaturisationFrom IoT to Software Miniaturisation
From IoT to Software MiniaturisationPtidej Team
 
Presentation by Lionel Briand
Presentation by Lionel BriandPresentation by Lionel Briand
Presentation by Lionel BriandPtidej Team
 
Manel Abdellatif
Manel AbdellatifManel Abdellatif
Manel AbdellatifPtidej Team
 
Azadeh Kermansaravi
Azadeh KermansaraviAzadeh Kermansaravi
Azadeh KermansaraviPtidej Team
 
CSED - Manel Grichi
CSED - Manel GrichiCSED - Manel Grichi
CSED - Manel GrichiPtidej Team
 
Cristiano Politowski
Cristiano PolitowskiCristiano Politowski
Cristiano PolitowskiPtidej Team
 
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 crisisPtidej Team
 
Thesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptThesis+of+laleh+eshkevari.ppt
Thesis+of+laleh+eshkevari.pptPtidej Team
 
Thesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptThesis+of+nesrine+abdelkafi.ppt
Thesis+of+nesrine+abdelkafi.pptPtidej Team
 

More from 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
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
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, ...apidays
 
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...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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 FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
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...Jeffrey Haguewood
 
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 TerraformAndrey Devyatkin
 
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 SavingEdi Saputra
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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, ...
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
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...
 
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
 
+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...
 
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
 

ICFCA08.ppt

  • 1. Refactorings of Design Defects using Relational Concept Analysis Naouel Moha, Amine Mohamed Rouane Hacene, Petko Valtchev, and Yann-Gaël Guéhéneuc LORIA, France DIRO, University of Montréal, Canada LATECE, Université du Québec à Montréal, Montréal, Canada ICFCA’08 Montréal (Qc), Canada, February 25-28, 2008
  • 2. Context Moha © Refactorings of Design Defects using RCA 2
  • 3. Context Moha © Refactorings of Design Defects using RCA 3
  • 4. Context Moha © Refactorings of Design Defects using RCA 4
  • 5. Context: Overall Process Textual descriptions of design defects 1 S 3 P S E U C G I G F E I S C T A I T O I N O N Rules Refactorings 2 D C 4 O E R T R E E C C T T I I O O N N Classes having Better design defects Design Moha © Refactorings of Design Defects using RCA 5
  • 6. Context: Overall Process Textual descriptions of design defects 1 S 3 P S E U C G I G F E I S C T A I T O I N O N Rules Refactorings 2 D C 4 O E R T R E E C C T T I I O O N N Classes having Better design defects Design Moha © Refactorings of Design Defects using RCA 6
  • 7. Context: Overall Process 1-2. Specification and Detection of DDs More and more tools and techniques Actively researched area Method DECOR (Defect dEtection for CORrection) [Moha 06] 3. Suggestion 3 S ti Manual identification of the modifications Time-, resource-consuming, error-prone activity , g, p y 4. Correction Refactorings g Technique used to change “the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior” Moha © Refactorings of Design Defects using RCA 7
  • 8. What Kind of Defects ? Design Patterns are “good” solutions to recurring design problems Design Defects (DDs) are “bad” solutions to recurring problems, Antipatterns [Brown 98] hinder d hi d development and maintenance by making programs h d t l t d i t b ki harder to comprehend and/or evolve DDs of interest: infected by low cohesion and high coupling Cohesion: how closely the methods are related to the variables in the class Coupling: the degree of its reliance on services provided by other classes Moha © Refactorings of Design Defects using RCA 8
  • 9. What Kind of Defects ? An example of DDs [Brown 98] Blob (God Class) “ Procedural-style design leads to one object with a lion’s share of the responsibilities while most other objects only hold data or execute simple processes ” Large controller class Many fields and methods with a low cohesion High coupled with the data stored in associated data classes Moha © Refactorings of Design Defects using RCA 9
  • 10. An Example Blob Before Moha © Refactorings of Design Defects using RCA 10
  • 11. An Example How t correct th d f t ? H to t the defect Before After Large and complex class Large class becomes less complex Small data classes Data classes gain more behaviour Not object-oriented More object-oriented style Moha © Refactorings of Design Defects using RCA 11
  • 12. An Example Redistribute l R di t ib t class members among existing classes ( ith possibly b i ti l (with ibl new classes) to increase cohesion and–or decrease coupling Before After Moha © Refactorings of Design Defects using RCA 12
  • 13. Contribution Suggestion RCA [Rouane 07, Ph.D. Thesis] Extension of FCA to relational d E i f l i l data Models the inter-object links and infers description logics role like relations between concepts RCA provides a suitable framework for clustering individuals along the properties they share and their links with other individuals Identify methods that share common fields and methods that call common methods cohesive sets low coupled Moha © Refactorings of Design Defects using RCA 13
  • 14. Contribution Suggestion RCA [Rouane 07, Ph.D. Thesis] Extension of FCA to relational d E i f l i l data Models the inter-object links and infers description logics role like relations between concepts RCA provides a suitable framework for clustering individuals along the properties they share and their links with other individuals Identify methods that share common fields and methods that call common methods cohesive sets low coupled «D Develop an automated approach f suggesting d f t l t t d h for ti defect- correcting refactorings using RCA » Moha © Refactorings of Design Defects using RCA 14
  • 15. An Example How t correct th d f t ? H to t the defect Before After Large and complex class Large class becomes less complex Small data classes Data classes gain more behaviour Not object-oriented More object-oriented style Moha © Refactorings of Design Defects using RCA 15
  • 16. An Example How t correct th d f t ? H to t the defect Blob Cohesive Sets Moha © Refactorings of Design Defects using RCA 16
  • 17. An Example How t correct th d f t ? H to t the defect I = {W-borrow_date_Book, W-return_date_book} E = {} I = {‘check_Availability_Book()’} E = {check_Availability_Book()} I = {call:c4} E = {} I = {‘borrow_Book()’} I = {‘reserve_Book()’, W-reserved_book} E = {borrow_Book()} E = {reserve_Book()} Lattice Cohesive Set Moha © Refactorings of Design Defects using RCA 17
  • 18. An Example How t correct th d f t ? H to t the defect Cohesive Sets After Refactoring * * Move Method Mode Field, Create Class Method, Field Moha © Refactorings of Design Defects using RCA 18
  • 19. Suggestion Moha © Refactorings of Design Defects using RCA 19
  • 20. Suggestion 1. RCF Modeling Moha © Refactorings of Design Defects using RCA 20
  • 21. Suggestion 2. RCA Al Algorithms ith Moha © Refactorings of Design Defects using RCA 21
  • 22. Suggestion 2. RCA Al Algorithms ith 9 I = {W-library opened} {W library_opened} E={} 10 I = {‘open_Library()’} E = {open Library()} {open_Library()} 7 I = {‘close_Library()’} E = {close_Library()} Moha © Refactorings of Design Defects using RCA 22
  • 23. Suggestion 2. RCA Al Algorithms ith Moha © Refactorings of Design Defects using RCA 23
  • 24. Suggestion 2. RCA Al Algorithms ith 4 I = {‘check_Availability_Book()’} E = {check_Availability_Book()} 19 I = {call:c4} E={} 3 12 I = {‘borrow_Book()’} I = {‘reserve_Book()’,W-reserved_book} E = {borrow_Book() } E = {reserve_Book()} Moha © Refactorings of Design Defects using RCA 24
  • 25. Suggestion 3. Interpretation Cohesive Sets After Refactoring * Move Method Mode Field, Create Class Method, Field Moha © Refactorings of Design Defects using RCA 25
  • 26. Experimental Study Tooling PADL to model source code and generate contexts Galicia to construct and visualize the concept lattices Experiments E i t Goal: evaluate the relevance of the cohesive sets suggested 4 different open-source programs Moha © Refactorings of Design Defects using RCA 26
  • 27. System Experimental Study Nb of fields/ Nb of Nb of real Size (fields + Blob Class LOC methods cohesive cohesive Precision methods) moved sets sets DHTTransportUDPImpl 2,049 (42+66) 108 (27+32) 59 10 7 70% V2.3.0.6 Azureus DHTControlImpl 1,868 (47+80) 127 (35+62) 97 19 11 58% TRTrackerBTAnnouncerImpl 1,393 (36+47) 83 (24+33) 57 16 5 31% V0.7.1 V1.4 V1.2.1 LogBrokerMonitor 1,142 (29+105)134 (23+85) 108 31 17 55% ene Log4j Category 387 (9+53) 62 (8+44) 52 18 9 50% IndexReader 236 (7+52) 59 (5+30) 35 4 2 50% Nutch Luce QueryParser 829 (36+48) 84 (24+37) 61 13 10 77% FSNamesystem 710 (24+35) 59 (17+25) 42 18 9 50% JobTracker 555 ( (22+31) 53 ) ( (17+18) 35 ) 11 8 73% Average Precision: 57% Moha © Refactorings of Design Defects using RCA 27
  • 28. Conclusion Contribution an approach that uses RCA to suggest refactorings to correct certain DDs in particular Blob DDs, Validation 4 different programs Relevant refactorings to improve programs Future Work - Generalise to other DDs - Assess more programs via our approach - Discuss the suggested refactorings with their developers and apply them Moha © Refactorings of Design Defects using RCA 28
  • 29. Questions Contact: mohanaou@iro.umontreal.ca http://www-etud.iro.umontreal.ca/~mohanaou Thanks for your attention ! Moha © Refactorings of Design Defects using RCA 29