SlideShare a Scribd company logo
1 of 20
Download to read offline
This presentation has been given at CASCON, the 5th of Octobre 2004, in Markham, ON, Canada.




        A Reverse Engineering Tool
        for Precise Class Diagrams


                                               Yann-Gaël Guéhéneuc
                                              guehene@iro.umontreal.ca



             Software Engineering Laboratory
             Department of Computing Science and Operations Research
             University of Montreal                                                            © Yann-Gaël Guéhéneuc
Statements

       n Maintenance  amounts—at least—for
        50% of the total cost of a program

       n Maintainers spend—at least—50% of
        their time understanding source code

       v Anyhelp in understanding a program
        would reduce the cost
2/20
Context

       n UML  is a de facto standard
       n Developers use UML-like class
         diagrams intensively

       n Class   diagrams
         – Classes, interfaces
         – specialisation, instantiation, use,
           association, aggregation, composition
3/20
Problem

       n Code  is the only source of information
       n Maintainers would benefit from class
         diagrams to understand programs

       n But,   class diagrams
         – Often are obsolete and imprecise
         – Do not reflect the real implementation and
           behaviour
4/20
Problem (cont’d)

       n Maintainershave tools, but these tools
        recover only the simplest constituents
        of UML-like class diagrams

       n Recovered    class diagrams
         – Not precise
         – Because of the lack of definitions at
           design- and implementation-level
5/20
Solution

       n Study
         – Definitions of UML constituents
         – Recovery of UML constituents in object-
           oriented source code


       vA reverse engineering tool for precise
        class diagrams

6/20
Solution (cont’d)

       n Definitions,         recovery
         – Classes, interfaces
         – Specialisation, instantiation, use,
           association, aggregation, composition


       n Tool
         – Ptidej * :

7/20
                   *Pattern   Trace Identification, Detection, and Enhancement in Java
Definitions

       n Classes   (class-based languages)
         – “Matrices” for instances
         – Inner states and public services


       n Interfaces
         – Types
         – Services that instances must provide

8/20
Definitions

       n Specialisation
         – Relationship between a set of similar
           entities and another entity* that contains
           the common aspects of those entities




9/20
                                *An   entity is either a class or an interface
Definitions

        n Use,
             association, aggregation,
         composition
          – Up to now, no consensual definitions
          – Link (message send), relationship

                          Link                                          Relationship




                                               Is described by
          Origin        Means        Target                      Origin    Name        Target
          Entity    D irect / Field  Entity                      Entity     Use        Entity
         Instance       D irect     Instance                     Entity Association    Entity
         Instance        F ield     Instance                     C lass Aggregation    Entity
         Instance       F ield +    Instance                     C lass Composition    Entity
                  Lifetime property
10/20
Recovery

        n Classes
        n Interfaces
        n Specialisation
          – Exist syntactically in the source code
                public interface I {
                      …
                }

                public class C implements I {
                      …
11/20           }
Recovery

        n Use,
             association, aggregation,
         composition
          – Do not exist syntactically in the source code

          – Expressed with four minimal properties of
            the relationships (cf. p. 8)



12/20
Recovery

        n Use,
             association, aggregation,
         composition
          – Exclusivity, EX(A, B) ∈ {true, false}
                             ℵ


          – Invocation site, IS(A, B) ⊆ {field, parameter,
            local variable, …}
          – Lifetime, LT(A, B) ∈ {+, −}
          – Multiplicity, MU(A, B) ⊂ ℵ ∪ {+∞}


13/20
Recovery

        n Use,
             association, aggregation,
         composition
          – Rewriting relationships as conjunctions of
            the four properties (cf. p. 8-9)
            •   US(A, B)
            •   AS(A, B)
            •   AG(A, B)
            •   CO(A, B)

14/20
Recovery

        n Use,
             association, aggregation,
         composition
          – Example
            • AS(A, B) =
                 (IS(A, B) ⊆ {field, parameter, …}) ∧ (IS(B, A) = ∅) ∧
                 (EX(A, B) ∈ {true, false}) ∧ (EX(B, A) ∈ {true, false}) ∧
                 (LT(A, B) ∈ {+, −}) ∧ (LT(B, A) ∈ {+, −}) ∧
                 (MU(A, B) = [0, +∞]) ∧ (MU(B, A) = [0, +∞])


15/20
          – Order among the relationships
Recovery

        n Algorithms
          – Class, interface, specialisation
             • Syntactic analyses


          – Use, association, aggregation, composition
             • Computation for each class of the properties with
               respect to other classes
             • Order among the relationships
             • Dynamic analyses
16/20
Tool

        n JHotDraw




17/20
Conclusion

        n Before
          – Maintainers have tools, but these tools
            recover only the simplest constituents of
            UML-like class diagrams


        n Now
          – Definitions of UML constituents
          – Recovery of UML constituents
18/20     – A tool for precise class diagrams
Future work

        n Use of static analyses instead of
          dynamic analyses
        n Recovery of other UML constituents
          – Data types, implementation classes…
        n Development  of layout algorithms for
          UML-like class diagrams
        n Experimental validation of the recovered
          UML-like class diagrams
19/20
Thanks



                 Questions?

                 Comments?



20/20

More Related Content

Similar to CASCON04.ppt

M04 Design Patterns
M04 Design PatternsM04 Design Patterns
M04 Design PatternsDang Tuan
 
Arev05c icfca05lessonslearned
Arev05c icfca05lessonslearnedArev05c icfca05lessonslearned
Arev05c icfca05lessonslearnedAhmed Mohamed
 
Unified modeling language
Unified modeling languageUnified modeling language
Unified modeling languageamity2j
 
ICSM04 Poster.ppt
ICSM04 Poster.pptICSM04 Poster.ppt
ICSM04 Poster.pptPtidej Team
 
ASE03 Poster.ppt
ASE03 Poster.pptASE03 Poster.ppt
ASE03 Poster.pptPtidej Team
 
Unified modeling language
Unified modeling languageUnified modeling language
Unified modeling languageamity2j
 
Interface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar SinghInterface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar Singhdheeraj_cse
 
C# Summer course - Lecture 1
C# Summer course - Lecture 1C# Summer course - Lecture 1
C# Summer course - Lecture 1mohamedsamyali
 
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
FScaFi: A Core Calculus for Collective Adaptive Systems ProgrammingFScaFi: A Core Calculus for Collective Adaptive Systems Programming
FScaFi: A Core Calculus for Collective Adaptive Systems ProgrammingRoberto Casadei
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UMLyndaravind
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdfHiroshi Ono
 

Similar to CASCON04.ppt (20)

Cascon04.ppt
Cascon04.pptCascon04.ppt
Cascon04.ppt
 
OOPSLA04.ppt
OOPSLA04.pptOOPSLA04.ppt
OOPSLA04.ppt
 
Oopsla04.ppt
Oopsla04.pptOopsla04.ppt
Oopsla04.ppt
 
APSEC04.ppt
APSEC04.pptAPSEC04.ppt
APSEC04.ppt
 
M04 Design Patterns
M04 Design PatternsM04 Design Patterns
M04 Design Patterns
 
Arev05c icfca05lessonslearned
Arev05c icfca05lessonslearnedArev05c icfca05lessonslearned
Arev05c icfca05lessonslearned
 
Unified modeling language
Unified modeling languageUnified modeling language
Unified modeling language
 
ICSM04 Poster.ppt
ICSM04 Poster.pptICSM04 Poster.ppt
ICSM04 Poster.ppt
 
ASE03 Poster.ppt
ASE03 Poster.pptASE03 Poster.ppt
ASE03 Poster.ppt
 
Unified modeling language
Unified modeling languageUnified modeling language
Unified modeling language
 
Interface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar SinghInterface in java By Dheeraj Kumar Singh
Interface in java By Dheeraj Kumar Singh
 
C# Summer course - Lecture 1
C# Summer course - Lecture 1C# Summer course - Lecture 1
C# Summer course - Lecture 1
 
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
FScaFi: A Core Calculus for Collective Adaptive Systems ProgrammingFScaFi: A Core Calculus for Collective Adaptive Systems Programming
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
ASE03.ppt
ASE03.pptASE03.ppt
ASE03.ppt
 
TOOLS USA01.ppt
TOOLS USA01.pptTOOLS USA01.ppt
TOOLS USA01.ppt
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 

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

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

CASCON04.ppt

  • 1. This presentation has been given at CASCON, the 5th of Octobre 2004, in Markham, ON, Canada. A Reverse Engineering Tool for Precise Class Diagrams Yann-Gaël Guéhéneuc guehene@iro.umontreal.ca Software Engineering Laboratory Department of Computing Science and Operations Research University of Montreal © Yann-Gaël Guéhéneuc
  • 2. Statements n Maintenance amounts—at least—for 50% of the total cost of a program n Maintainers spend—at least—50% of their time understanding source code v Anyhelp in understanding a program would reduce the cost 2/20
  • 3. Context n UML is a de facto standard n Developers use UML-like class diagrams intensively n Class diagrams – Classes, interfaces – specialisation, instantiation, use, association, aggregation, composition 3/20
  • 4. Problem n Code is the only source of information n Maintainers would benefit from class diagrams to understand programs n But, class diagrams – Often are obsolete and imprecise – Do not reflect the real implementation and behaviour 4/20
  • 5. Problem (cont’d) n Maintainershave tools, but these tools recover only the simplest constituents of UML-like class diagrams n Recovered class diagrams – Not precise – Because of the lack of definitions at design- and implementation-level 5/20
  • 6. Solution n Study – Definitions of UML constituents – Recovery of UML constituents in object- oriented source code vA reverse engineering tool for precise class diagrams 6/20
  • 7. Solution (cont’d) n Definitions, recovery – Classes, interfaces – Specialisation, instantiation, use, association, aggregation, composition n Tool – Ptidej * : 7/20 *Pattern Trace Identification, Detection, and Enhancement in Java
  • 8. Definitions n Classes (class-based languages) – “Matrices” for instances – Inner states and public services n Interfaces – Types – Services that instances must provide 8/20
  • 9. Definitions n Specialisation – Relationship between a set of similar entities and another entity* that contains the common aspects of those entities 9/20 *An entity is either a class or an interface
  • 10. Definitions n Use, association, aggregation, composition – Up to now, no consensual definitions – Link (message send), relationship Link Relationship Is described by Origin Means Target Origin Name Target Entity D irect / Field Entity Entity Use Entity Instance D irect Instance Entity Association Entity Instance F ield Instance C lass Aggregation Entity Instance F ield + Instance C lass Composition Entity Lifetime property 10/20
  • 11. Recovery n Classes n Interfaces n Specialisation – Exist syntactically in the source code public interface I { … } public class C implements I { … 11/20 }
  • 12. Recovery n Use, association, aggregation, composition – Do not exist syntactically in the source code – Expressed with four minimal properties of the relationships (cf. p. 8) 12/20
  • 13. Recovery n Use, association, aggregation, composition – Exclusivity, EX(A, B) ∈ {true, false} ℵ – Invocation site, IS(A, B) ⊆ {field, parameter, local variable, …} – Lifetime, LT(A, B) ∈ {+, −} – Multiplicity, MU(A, B) ⊂ ℵ ∪ {+∞} 13/20
  • 14. Recovery n Use, association, aggregation, composition – Rewriting relationships as conjunctions of the four properties (cf. p. 8-9) • US(A, B) • AS(A, B) • AG(A, B) • CO(A, B) 14/20
  • 15. Recovery n Use, association, aggregation, composition – Example • AS(A, B) = (IS(A, B) ⊆ {field, parameter, …}) ∧ (IS(B, A) = ∅) ∧ (EX(A, B) ∈ {true, false}) ∧ (EX(B, A) ∈ {true, false}) ∧ (LT(A, B) ∈ {+, −}) ∧ (LT(B, A) ∈ {+, −}) ∧ (MU(A, B) = [0, +∞]) ∧ (MU(B, A) = [0, +∞]) 15/20 – Order among the relationships
  • 16. Recovery n Algorithms – Class, interface, specialisation • Syntactic analyses – Use, association, aggregation, composition • Computation for each class of the properties with respect to other classes • Order among the relationships • Dynamic analyses 16/20
  • 17. Tool n JHotDraw 17/20
  • 18. Conclusion n Before – Maintainers have tools, but these tools recover only the simplest constituents of UML-like class diagrams n Now – Definitions of UML constituents – Recovery of UML constituents 18/20 – A tool for precise class diagrams
  • 19. Future work n Use of static analyses instead of dynamic analyses n Recovery of other UML constituents – Data types, implementation classes… n Development of layout algorithms for UML-like class diagrams n Experimental validation of the recovered UML-like class diagrams 19/20
  • 20. Thanks Questions? Comments? 20/20