SlideShare uma empresa Scribd logo
Using FCA to Suggest Refactorings
    to Correct Design Defects


Naouel Moha, Jihene Rezgui, Yann-Gaël Guéhéneuc,
    Petko Valtchev, and Ghizlane El Boussaidi
          DIRO, University of Montreal, Canada


           Présenté par Ghada Gasmi

                        CLA 2006
          Oct 30 – Sept 1st , 2006, Tunis, Tunisie
Context
   Design Patterns are “good” solutions to recurring design problems

   Design Defects (DDs)
        are “bad” solutions to recurring problems
        transgress good OO (Object-Oriented) principles
           Cohesion
           Coupling


   Why it is important to detect and correct DDs ?
        DDs lessen the quality of OO architectures and impede their
        evolution and their maintenance
        Maintenance is expensive because of DDs [PER 92] : adding,
        debugging, and evolving of features are difficult
        A good software architecture without DDs: easier to understand,
        change, and thus maintain
Moha © CLA 2006         Using FCA to Suggest Refactorings to Correct Design Defects   2
Context
  An example of high-level DDs

                       Blob
                             Large controller class
                             Many fields and methods with a low cohesion*
                             Highly coupled** with data stored in associated
                             data classes


                        *Cohesion: How closely the methods (Lack of Cohesioninstance
                       variables in the class. Measure: LCOM
                                                             are related to the
                                                                                Metric)

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


     Bad impact : low cohesion and high coupling!

Moha © CLA 2006       Using FCA to Suggest Refactorings to Correct Design Defects   3
Overview

                  Related Work
                  Problem Description
                  Proposed Approach
                  Implementation
                  Conclusion



Moha © CLA 2006     Using FCA to Suggest Refactorings to Correct Design Defects   4
Related Work
   Huchard and LeBlanc (ASE, 2000)
        use FCA to suggest restructurations of class hierarchies
        to maximise the sharing of data structure and code through fields and
        methods


   Arévalo et al. (ICFCA, 2005)
        applied FCA to identify implicit dependencies among classes in
        program models

   None of these approaches attempts to suggest refactorings to correct
   DDs!




Moha © CLA 2006         Using FCA to Suggest Refactorings to Correct Design Defects   5
Overview

                  Related Work
                  Problem Description
                  Proposed Approach
                  Methodology
                  Validation
                  Conclusion

Moha © CLA 2006     Using FCA to Suggest Refactorings to Correct Design Defects   6
Problem Description

                  What are the problems ?
                    Lack of (semi-)automated techniques and tools
                    Lack of work on high-level DDs
                    Semi-manual detection and correction
                    The detection and correction are time-consuming and
                    error-prone activities




Moha © CLA 2006             Using FCA to Suggest Refactorings to Correct Design Defects   7
Overview

                  Related Work
                  Problem Description
                  Proposed Approach
                  Implementation

                  Conclusion



Moha © CLA 2006     Using FCA to Suggest Refactorings to Correct Design Defects   8
Proposed Approach
          We propose to apply FCA on a suitable representation of a program
          to suggest appropriate refactorings for certain DDs.



   Refactorings ?
        Change performed on the source code of a program to improve its
        internal structure without changing its external behaviour [Fowler].


   We illustrate our approach with the Blob
   Azureus version 2.3.0.6
        A peer-to-peer program
        143 Blobs for 1,449 classes (191,963 lines of code)

   We show that FCA can suggest relevant refactorings to improve the program!

Moha © CLA 2006          Using FCA to Suggest Refactorings to Correct Design Defects   9
Proposed Approach




Moha © CLA 2006   Using FCA to Suggest Refactorings to Correct Design Defects   10
Encoding Blobs into Formal Contexts 1/2
 To Identify cohesive sets of methods and fields, we define
 three formal contexts:

       K1, individuals are methods of a suspect large class and
      properties are fields of that class.
                  allows to assess the cohesion of a class because methods sharing the same fields
                  are, by definition, cohesive.

      K2, both individuals and properties are methods of the
      suspect large class.
                  highlights subsets of cohesive methods, because methods invoking the same set
                  of other methods are highly cohesive.

      K3, individuals are methods and fields of the large class and
      properties are the surrounding data classes.
                  allows to assess the coupling between the large class and its data classes.


Moha © CLA 2006                 Using FCA to Suggest Refactorings to Correct Design Defects     11
Encoding Blobs into Formal Contexts 2/2




         Context K1 linking methods of the large class to fields of the class.

Moha © CLA 2006           Using FCA to Suggest Refactorings to Correct Design Defects   12
Interpretation of Lattice Structure 1/3
    We build Lattices from the 3 contexts K1, K2, K3 to
         Interpret the inner structure of the large class
         Suggest refactorings


    We define two interpretations rules:
         Rule1: collection of cohesive and independent subsets (figure, zone2)
         Rule2: Detect large cohesive subset (figure, zone1)




Moha © CLA 2006          Using FCA to Suggest Refactorings to Correct Design Defects   13
Interpretation of Lattice Structure 2/3




Moha © CLA 2006   Using FCA to Suggest Refactorings to Correct Design Defects   14
Interpretation of Lattice Structure 3/3

          Refactorings:
            Split large class into 2 ways:
     1.     Move disjoint and cohesive subsets of methods and/or fields
            that are related to a data class.
     2.     Organise cohesive subsets that are not related to data class in
            separate classes.

            Azureus, class DHTTransportUDPImpl
                  Before the refactorings: cohesion: 0.542, coupling: 41
                  After the refactorings: cohesion: 0.278, coupling: 39




Moha © CLA 2006               Using FCA to Suggest Refactorings to Correct Design Defects   15
Overview

                  Related Work
                  Problem Description
                  Proposed Approach
                  Implementation
                  Conclusion



Moha © CLA 2006     Using FCA to Suggest Refactorings to Correct Design Defects   16
Implementation
        PADL (Pattern and Abstract-level Description Language)
            Metamodel of the tool suite Ptidej
            To model source code


        GALICIA
            Multi-tool open-source plateform for creating, visualizing, and
            storing lattices


        Both tools communicate by means of XML files
            Ptidej generates contexts in the XML format of Galicia
            Galicia tranforms the contexts into lattices




Moha © CLA 2006           Using FCA to Suggest Refactorings to Correct Design Defects   17
Overview

                  Related Work
                  Problem Description
                  Proposed Approach
                  Implementation
                  Conclusion



Moha © CLA 2006     Using FCA to Suggest Refactorings to Correct Design Defects   18
Conclusion
     DDs transgress good OO principles
         Low coupling and high cohesion

     Our approach
         Joint use of metrics and FCA to suggest refactorings to correct
         DDs
         Can be generalised to other DDs characterised by a high
         coupling and a low cohesion

     Future Work
         Fully automatic correction mechanisms
         An integrated tool plateform to support FCA-based refactorings
         Refinement of the proposed rules for lattice structure
         interpretation

Moha © CLA 2006         Using FCA to Suggest Refactorings to Correct Design Defects   19
Questions




                                      For any question,
                             please contact directly the authors at
                                             mohanaou@iro.umontreal.ca
                                              rezguiji@iro.umontreal.ca




Moha © CLA 2006   Using FCA to Suggest Refactorings to Correct Design Defects   20

Mais conteúdo relacionado

Semelhante a CLA06.ppt

Tech challenges in a large scale agile project
Tech challenges in a large scale agile projectTech challenges in a large scale agile project
Tech challenges in a large scale agile projectHarald Soevik
 
An Integrated Solver For Optimization Problems
An Integrated Solver For Optimization ProblemsAn Integrated Solver For Optimization Problems
An Integrated Solver For Optimization ProblemsMonica Waters
 
A Novel Scheduling Mechanism for Hybrid Cloud Systems
A Novel Scheduling Mechanism for Hybrid Cloud SystemsA Novel Scheduling Mechanism for Hybrid Cloud Systems
A Novel Scheduling Mechanism for Hybrid Cloud SystemsIRJET Journal
 
Capella Based System Engineering Modelling and Multi-Objective Optimization o...
Capella Based System Engineering Modelling and Multi-Objective Optimization o...Capella Based System Engineering Modelling and Multi-Objective Optimization o...
Capella Based System Engineering Modelling and Multi-Objective Optimization o...MehdiJahromi
 
Getting relational database from legacy data mdre approach
Getting relational database from legacy data mdre approachGetting relational database from legacy data mdre approach
Getting relational database from legacy data mdre approachAlexander Decker
 
From Concepts to Implementation: Why I Missed My First Paper Submission Deadline
From Concepts to Implementation: Why I Missed My First Paper Submission DeadlineFrom Concepts to Implementation: Why I Missed My First Paper Submission Deadline
From Concepts to Implementation: Why I Missed My First Paper Submission DeadlineMiguel Velez
 
Learning Software Performance Models for Dynamic and Uncertain Environments
Learning Software Performance Models for Dynamic and Uncertain EnvironmentsLearning Software Performance Models for Dynamic and Uncertain Environments
Learning Software Performance Models for Dynamic and Uncertain EnvironmentsPooyan Jamshidi
 
Service Oriented & Model Driven Architectures
Service Oriented & Model Driven ArchitecturesService Oriented & Model Driven Architectures
Service Oriented & Model Driven ArchitecturesPankaj Saharan
 
Configurability for Cloud-Native Applications: Observability and Control
Configurability for Cloud-Native Applications: Observability and ControlConfigurability for Cloud-Native Applications: Observability and Control
Configurability for Cloud-Native Applications: Observability and ControlCognizant
 
A Comparative Study of Forward and Reverse Engineering
A Comparative Study of Forward and Reverse EngineeringA Comparative Study of Forward and Reverse Engineering
A Comparative Study of Forward and Reverse Engineeringijsrd.com
 
[ Capella Day 2019 ] Augmenting requirements with models to improve the artic...
[ Capella Day 2019 ] Augmenting requirements with models to improve the artic...[ Capella Day 2019 ] Augmenting requirements with models to improve the artic...
[ Capella Day 2019 ] Augmenting requirements with models to improve the artic...Obeo
 
A Framework for Model-Driven Evolution in Families of Software Architectures
A Framework for Model-Driven Evolution in Families of Software ArchitecturesA Framework for Model-Driven Evolution in Families of Software Architectures
A Framework for Model-Driven Evolution in Families of Software ArchitecturesPooyan Jamshidi
 
MODAClouds - Underpinning the Leap to DevOps Movement on Clouds scenarios
MODAClouds - Underpinning the Leap to DevOps Movement on Clouds scenariosMODAClouds - Underpinning the Leap to DevOps Movement on Clouds scenarios
MODAClouds - Underpinning the Leap to DevOps Movement on Clouds scenariosOliver Barreto Rodríguez
 
An Adjacent Analysis of the Parallel Programming Model Perspective: A Survey
 An Adjacent Analysis of the Parallel Programming Model Perspective: A Survey An Adjacent Analysis of the Parallel Programming Model Perspective: A Survey
An Adjacent Analysis of the Parallel Programming Model Perspective: A SurveyIRJET Journal
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented ProgrammingRodger Oates
 
Soa design pattern
Soa design patternSoa design pattern
Soa design patternLap Doan
 
Software engineering principles in system software design
Software engineering principles in system software designSoftware engineering principles in system software design
Software engineering principles in system software designTech_MX
 

Semelhante a CLA06.ppt (20)

Cla06.ppt
Cla06.pptCla06.ppt
Cla06.ppt
 
Object oriented framework
Object oriented frameworkObject oriented framework
Object oriented framework
 
Tech challenges in a large scale agile project
Tech challenges in a large scale agile projectTech challenges in a large scale agile project
Tech challenges in a large scale agile project
 
An Integrated Solver For Optimization Problems
An Integrated Solver For Optimization ProblemsAn Integrated Solver For Optimization Problems
An Integrated Solver For Optimization Problems
 
Icfca08.ppt
Icfca08.pptIcfca08.ppt
Icfca08.ppt
 
A Novel Scheduling Mechanism for Hybrid Cloud Systems
A Novel Scheduling Mechanism for Hybrid Cloud SystemsA Novel Scheduling Mechanism for Hybrid Cloud Systems
A Novel Scheduling Mechanism for Hybrid Cloud Systems
 
Capella Based System Engineering Modelling and Multi-Objective Optimization o...
Capella Based System Engineering Modelling and Multi-Objective Optimization o...Capella Based System Engineering Modelling and Multi-Objective Optimization o...
Capella Based System Engineering Modelling and Multi-Objective Optimization o...
 
Getting relational database from legacy data mdre approach
Getting relational database from legacy data mdre approachGetting relational database from legacy data mdre approach
Getting relational database from legacy data mdre approach
 
From Concepts to Implementation: Why I Missed My First Paper Submission Deadline
From Concepts to Implementation: Why I Missed My First Paper Submission DeadlineFrom Concepts to Implementation: Why I Missed My First Paper Submission Deadline
From Concepts to Implementation: Why I Missed My First Paper Submission Deadline
 
Learning Software Performance Models for Dynamic and Uncertain Environments
Learning Software Performance Models for Dynamic and Uncertain EnvironmentsLearning Software Performance Models for Dynamic and Uncertain Environments
Learning Software Performance Models for Dynamic and Uncertain Environments
 
Service Oriented & Model Driven Architectures
Service Oriented & Model Driven ArchitecturesService Oriented & Model Driven Architectures
Service Oriented & Model Driven Architectures
 
Configurability for Cloud-Native Applications: Observability and Control
Configurability for Cloud-Native Applications: Observability and ControlConfigurability for Cloud-Native Applications: Observability and Control
Configurability for Cloud-Native Applications: Observability and Control
 
A Comparative Study of Forward and Reverse Engineering
A Comparative Study of Forward and Reverse EngineeringA Comparative Study of Forward and Reverse Engineering
A Comparative Study of Forward and Reverse Engineering
 
[ Capella Day 2019 ] Augmenting requirements with models to improve the artic...
[ Capella Day 2019 ] Augmenting requirements with models to improve the artic...[ Capella Day 2019 ] Augmenting requirements with models to improve the artic...
[ Capella Day 2019 ] Augmenting requirements with models to improve the artic...
 
A Framework for Model-Driven Evolution in Families of Software Architectures
A Framework for Model-Driven Evolution in Families of Software ArchitecturesA Framework for Model-Driven Evolution in Families of Software Architectures
A Framework for Model-Driven Evolution in Families of Software Architectures
 
MODAClouds - Underpinning the Leap to DevOps Movement on Clouds scenarios
MODAClouds - Underpinning the Leap to DevOps Movement on Clouds scenariosMODAClouds - Underpinning the Leap to DevOps Movement on Clouds scenarios
MODAClouds - Underpinning the Leap to DevOps Movement on Clouds scenarios
 
An Adjacent Analysis of the Parallel Programming Model Perspective: A Survey
 An Adjacent Analysis of the Parallel Programming Model Perspective: A Survey An Adjacent Analysis of the Parallel Programming Model Perspective: A Survey
An Adjacent Analysis of the Parallel Programming Model Perspective: A Survey
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
Soa design pattern
Soa design patternSoa design pattern
Soa design pattern
 
Software engineering principles in system software design
Software engineering principles in system software designSoftware engineering principles in system software design
Software engineering principles in system software design
 

Mais de 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
 

Mais 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

Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxEasyPrinterHelp
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfChristopherTHyatt
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101vincent683379
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKUXDXConf
 

Último (20)

Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 

CLA06.ppt

  • 1. Using FCA to Suggest Refactorings to Correct Design Defects Naouel Moha, Jihene Rezgui, Yann-Gaël Guéhéneuc, Petko Valtchev, and Ghizlane El Boussaidi DIRO, University of Montreal, Canada Présenté par Ghada Gasmi CLA 2006 Oct 30 – Sept 1st , 2006, Tunis, Tunisie
  • 2. Context Design Patterns are “good” solutions to recurring design problems Design Defects (DDs) are “bad” solutions to recurring problems transgress good OO (Object-Oriented) principles Cohesion Coupling Why it is important to detect and correct DDs ? DDs lessen the quality of OO architectures and impede their evolution and their maintenance Maintenance is expensive because of DDs [PER 92] : adding, debugging, and evolving of features are difficult A good software architecture without DDs: easier to understand, change, and thus maintain Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 2
  • 3. Context An example of high-level DDs Blob Large controller class Many fields and methods with a low cohesion* Highly coupled** with data stored in associated data classes *Cohesion: How closely the methods (Lack of Cohesioninstance variables in the class. Measure: LCOM are related to the Metric) **Coupling: the degree of reliance on services provided by other classes. Bad impact : low cohesion and high coupling! Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 3
  • 4. Overview Related Work Problem Description Proposed Approach Implementation Conclusion Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 4
  • 5. Related Work Huchard and LeBlanc (ASE, 2000) use FCA to suggest restructurations of class hierarchies to maximise the sharing of data structure and code through fields and methods Arévalo et al. (ICFCA, 2005) applied FCA to identify implicit dependencies among classes in program models None of these approaches attempts to suggest refactorings to correct DDs! Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 5
  • 6. Overview Related Work Problem Description Proposed Approach Methodology Validation Conclusion Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 6
  • 7. Problem Description What are the problems ? Lack of (semi-)automated techniques and tools Lack of work on high-level DDs Semi-manual detection and correction The detection and correction are time-consuming and error-prone activities Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 7
  • 8. Overview Related Work Problem Description Proposed Approach Implementation Conclusion Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 8
  • 9. Proposed Approach We propose to apply FCA on a suitable representation of a program to suggest appropriate refactorings for certain DDs. Refactorings ? Change performed on the source code of a program to improve its internal structure without changing its external behaviour [Fowler]. We illustrate our approach with the Blob Azureus version 2.3.0.6 A peer-to-peer program 143 Blobs for 1,449 classes (191,963 lines of code) We show that FCA can suggest relevant refactorings to improve the program! Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 9
  • 10. Proposed Approach Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 10
  • 11. Encoding Blobs into Formal Contexts 1/2 To Identify cohesive sets of methods and fields, we define three formal contexts: K1, individuals are methods of a suspect large class and properties are fields of that class. allows to assess the cohesion of a class because methods sharing the same fields are, by definition, cohesive. K2, both individuals and properties are methods of the suspect large class. highlights subsets of cohesive methods, because methods invoking the same set of other methods are highly cohesive. K3, individuals are methods and fields of the large class and properties are the surrounding data classes. allows to assess the coupling between the large class and its data classes. Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 11
  • 12. Encoding Blobs into Formal Contexts 2/2 Context K1 linking methods of the large class to fields of the class. Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 12
  • 13. Interpretation of Lattice Structure 1/3 We build Lattices from the 3 contexts K1, K2, K3 to Interpret the inner structure of the large class Suggest refactorings We define two interpretations rules: Rule1: collection of cohesive and independent subsets (figure, zone2) Rule2: Detect large cohesive subset (figure, zone1) Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 13
  • 14. Interpretation of Lattice Structure 2/3 Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 14
  • 15. Interpretation of Lattice Structure 3/3 Refactorings: Split large class into 2 ways: 1. Move disjoint and cohesive subsets of methods and/or fields that are related to a data class. 2. Organise cohesive subsets that are not related to data class in separate classes. Azureus, class DHTTransportUDPImpl Before the refactorings: cohesion: 0.542, coupling: 41 After the refactorings: cohesion: 0.278, coupling: 39 Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 15
  • 16. Overview Related Work Problem Description Proposed Approach Implementation Conclusion Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 16
  • 17. Implementation PADL (Pattern and Abstract-level Description Language) Metamodel of the tool suite Ptidej To model source code GALICIA Multi-tool open-source plateform for creating, visualizing, and storing lattices Both tools communicate by means of XML files Ptidej generates contexts in the XML format of Galicia Galicia tranforms the contexts into lattices Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 17
  • 18. Overview Related Work Problem Description Proposed Approach Implementation Conclusion Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 18
  • 19. Conclusion DDs transgress good OO principles Low coupling and high cohesion Our approach Joint use of metrics and FCA to suggest refactorings to correct DDs Can be generalised to other DDs characterised by a high coupling and a low cohesion Future Work Fully automatic correction mechanisms An integrated tool plateform to support FCA-based refactorings Refinement of the proposed rules for lattice structure interpretation Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 19
  • 20. Questions For any question, please contact directly the authors at mohanaou@iro.umontreal.ca rezguiji@iro.umontreal.ca Moha © CLA 2006 Using FCA to Suggest Refactorings to Correct Design Defects 20