SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
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

Más contenido relacionado

Similar 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
 

Similar 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
 

Más 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
 

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

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Último (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

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