SlideShare a Scribd company logo
1 of 37
Download to read offline
This presentation has been given at APSEC 2004, the 2nd of December 2004, in Busan, Korea.



        Systematic Study of UML Class
         Diagram Constituents for their
         Abstract and Precise Recovery


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

                                                                      2004/12/02


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

       n UML   is a standard
        – Used in industry
        – Taught in universities


       n UML   is not a standard
        – Imprecise
        – Heavy

2/25
Problem

       n But   “lost” class diagrams
         – Missing, out-of-date


       n Maintenance       > 50% of cost
         – Program understanding > 50% of time
           • Developers           • Architecture
           • Maintainers          • Behaviour
                                  • Design choices
3/25                              • Implementation
Problem (cont’d)

       n Lack   of automated recovery tools
         – Class diagrams
           • Abstract
                – Concentrate the essential qualities of anything more
                  extensive or of several things
                  (≠ Graphical representations of source code)
           • Precise
                – Extent to which a given measurement agrees with a
                  standard value
                  (Original and–or expected class diagrams)

4/25
Example




5/25
Example




       public class A { ... }

       public class Example1 {
           private A[] listOfAs = new A[10];
           private int numberOfAs = 0;
           public void addA(final A a) {
               this.listOfAs[numberOfAs++] = a;
           }
           public A getA(final int index) {
               return this.listOfAs[index];
           }
           public void removeA(final A a) {
               // ...
           }
           public static void main(final String[] args) {
               final Example1 example1 = new Example1();
               example1.addA(new A());
5/25           // ...
           }
       }
Example




       public class A { ... }

       public class Example1 {
           private A[] listOfAs = new A[10];
           private int numberOfAs = 0;
           public void addA(final A a) {
               this.listOfAs[numberOfAs++] = a;
           }
           public A getA(final int index) {
               return this.listOfAs[index];
           }
           public void removeA(final A a) {
               // ...
           }
           public static void main(final String[] args) {
               final Example1 example1 = new Example1();
               example1.addA(new A());
5/25           // ...
           }
       }
Example (cont’d)




6/25
Example (cont’d)




       public class A { ... }

       public class Example2 {
           private List listOfAs = new ArrayList();
           public void addA(final A a) {
               this.listOfAs.add(a);
           }
           public A getA(final int index) {
               return (A) this.listOfAs.remove(index);
           }
           public void removeA(final A a) {
               this.listOfAs.remove(a);
           }
           public static void main(final String[] args) {
               final Example2 example2 = new Example2();
               example2.addA(new A());
               // ...
6/25       }
       }
Example (cont’d)




       public class A { ... }

       public class Example2 {
           private List listOfAs = new ArrayList();
           public void addA(final A a) {
               this.listOfAs.add(a);
           }
           public A getA(final int index) {
               return (A) this.listOfAs.remove(index);
           }
           public void removeA(final A a) {
               this.listOfAs.remove(a);
           }
           public static void main(final String[] args) {
               final Example2 example2 = new Example2();
               example2.addA(new A());
               // ...
6/25       }
       }
Example (cont’d)




7/25
Example (cont’d)




            Precise
7/25
Example (cont’d)




                Precise
7/25    Association à Aggregation
Example (cont’d)




                Precise             Abstract
7/25    Association à Aggregation
Example (cont’d)




                Precise                  Abstract
7/25    Association à Aggregation   List is not important
Solution

       n Systematic study of class diagram
        constituents for their abstract and
        precise recovery

         – 34 constituents (UML meta-model)

         – C++, Java, and Smalltalk

         – Prototype tool
8/25
Related Work

       n Numberof constituents of class
        diagrams handled by tools
               Recovered UML constituents in %
               ArgoUML              7/34   21
               Chava                7/34   21
               Fujaba               7/34   21
               IDEA                16/34 48
               Rational Rose        8/34   24
               Borland Together/J   8/34   24
               Womble               9/34   28
9/25
Hypotheses

        n Class-based   programming languages

        n Classdiagrams document design
         during development and maintenance

        n Context dependant definitions of the
         constituents (⇒ incrementality)
10/25
Abstract, Precise



        Systematic Study

        n Classifier   features
          – Attribute üü
          – Method üü
          – Operations üû
             • Abstract public methods
             • Overloaded methods
             • (Comments, documentation)


11/25
Abstract, Precise



        Systematic Study

        n   Classifier relationships
            –   Binary association üü   –   N-ary association ûû
            –   Association end N/A     –   Aggregation üü
            –   Multiplicity üû         –   Composition üû
            –   Qualifier üû            –   Generalisation ûü
            –   Association class ûû    –   Dependency ûû




12/25
Abstract, Precise



        Systematic Study
        n   Classifiers
            –   Class üü                         –   Bound Element üü
            –   Nested class ûü                  –   Metaclass üü
            –   Type üü                          –   Powertype ûû
            –   Implementation class üü          –   Data Type üü
            –   Interface üü                     –   Enumeration üü
            –   Parameterised class üü           –   Utility class üü
                                                                Relationships
              Classifiers    Attributes Operations M ethods to Other from Other
                                                                 Classifiers
        Class                    ü         ü          ü        ü           ü
        Implementation Class     ü          û         ü        û           û
        Interface                û         ü          û        û           ü
13/25   Type                     ü         ü          û        ü           ü
Abstract, Precise



        Systematic Study

        n   Miscellaneous
            –   Stereotype üû           –   Link N/A
            –   Class pathname üü       –   Instance of üü
            –   Importing packages üü   –   Derived element
            –   Object N/A              –   List compartment N/A
            –   Composite object N/A    –   Name compartment N/A




14/25
Discussion

        n Consensual   definitions?

        n Base   of comparison?




15/25
Prototype Tool

        n Ptidej
          – Pattern Trace Identification, Detection, and
            Enhancement in Java
             • Also “breakfast” in French slang J

          – Open framework for high-level program
            analyses, visualisation, pattern detection
             • More at www.ptidej.net
                   – Executable (.exe, .jar)
                   – Source code
16/25
Prototype Tool (cont’d)

        n Ptidej

                                        Abstract and
                                        Precise Model
              PADL
            Meta-Model                           Transformations
                                                 based on the
                                                 Systematic Study
                          Model

                             Dedicated Parsers

             C++
17/25              Java
Prototype Tool (cont’d)

        n Ptidej

                   Recovered UML constituents in %
                   ArgoUML              7/34   21
                   Chava                7/34   21
                   Fujaba               7/34   21
                   IDEA                16/34 48
                   Ptidej              21/34 62
                   Rational Rose        8/34   24
                   Borland Together/J   8/34   24
                   Womble               9/34   28
18/25
Prototype Tool (cont’d)

        n Ptidej
          – Association, aggregation, and composition
            binary class relationships
             • Message sends
             • Invocation sites
                   – Simple fields
                   – Arrays, collections
             • Lifetime and exclusivity properties


19/25
Prototype Tool (cont’d)

        n Ptidej
          – Classes, data types, implementation
            classes, interfaces, types, utility classes
             •   Abstractness
             •   Attributes
             •   Methods (instance vs. class)
             •   Operations
             •   Relationships
             •   Super-classes
20/25
Example revisited




        public class A { ... }

        public class Example1 {
            private A[] listOfAs = new A[10];
            private int numberOfAs = 0;
            public void addA(final A a) {
                this.listOfAs[numberOfAs++] = a;
            }
            public A getA(final int index) {
                return this.listOfAs[index];
            }
            public void removeA(final A a) {
                // ...
            }
            public static void main(final String[] args) {
                final Example1 example1 = new Example1();
                example1.addA(new A());
21/25           // ...
            }
        }
Example revisited




        public class A { ... }

        public class Example1 {
            private A[] listOfAs = new A[10];
            private int numberOfAs = 0;
            public void addA(final A a) {
                this.listOfAs[numberOfAs++] = a;
            }
            public A getA(final int index) {
                return this.listOfAs[index];
            }
            public void removeA(final A a) {
                // ...
            }
            public static void main(final String[] args) {
                final Example1 example1 = new Example1();
                example1.addA(new A());
21/25           // ...
            }
        }
Example revisited (cont’d)




        public class A { ... }

        public class Example2 {
            private List listOfAs = new ArrayList();
            public void addA(final A a) {
                this.listOfAs.add(a);
            }
            public A getA(final int index) {
                return (A) this.listOfAs.remove(index);
            }
            public void removeA(final A a) {
                this.listOfAs.remove(a);
            }
            public static void main(final String[] args) {
                final Example2 example2 = new Example2();
                example2.addA(new A());
                // ...
22/25       }
        }
Example revisited (cont’d)




        public class A { ... }

        public class Example2 {
            private List listOfAs = new ArrayList();
            public void addA(final A a) {
                this.listOfAs.add(a);
            }
            public A getA(final int index) {
                return (A) this.listOfAs.remove(index);
            }
            public void removeA(final A a) {
                this.listOfAs.remove(a);
            }
            public static void main(final String[] args) {
                final Example2 example2 = new Example2();
                example2.addA(new A());
                // ...
22/25       }
        }
Example revisited (cont’d)




23/25
Example revisited (cont’d)




            Precise
23/25
Example revisited (cont’d)




            Precise             Abstract
23/25
Conclusion

        n Exhaustive
                   and systematic study of
         UML class diagram constituents

        n Prototype tool implementing algorithms
         for abstract and precise recovery

        n Recovery  of more constituents than any
         other tools
24/25
Future Work

        n UML v2.0
        n Other programming languages
            – Eiffel
        n   Other source of information
            – Comments, names
            – Documentation
        n   Other diagrams
            – Sequence diagrams + Integration
        n   Base(s) of comparison
25/25

More Related Content

What's hot

UML Class Diagram G-3-122139
UML Class Diagram G-3-122139UML Class Diagram G-3-122139
UML Class Diagram G-3-122139
Hansi Thenuwara
 

What's hot (16)

MatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On PlottingMatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On Plotting
 
Generic and Meta-Transformations for Model Transformation Engineering
Generic and Meta-Transformations for Model Transformation EngineeringGeneric and Meta-Transformations for Model Transformation Engineering
Generic and Meta-Transformations for Model Transformation Engineering
 
Fundamentals of matlab programming
Fundamentals of matlab programmingFundamentals of matlab programming
Fundamentals of matlab programming
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
 
Time Series Estimation of Gas Furnace Data in IMPL and CPLEX Industrial Model...
Time Series Estimation of Gas Furnace Data in IMPL and CPLEX Industrial Model...Time Series Estimation of Gas Furnace Data in IMPL and CPLEX Industrial Model...
Time Series Estimation of Gas Furnace Data in IMPL and CPLEX Industrial Model...
 
Matlab
MatlabMatlab
Matlab
 
Advanced MATLAB Tutorial for Engineers & Scientists
Advanced MATLAB Tutorial for Engineers & ScientistsAdvanced MATLAB Tutorial for Engineers & Scientists
Advanced MATLAB Tutorial for Engineers & Scientists
 
Representing and visiting graphs
Representing and visiting graphsRepresenting and visiting graphs
Representing and visiting graphs
 
MATLAB guide
MATLAB guideMATLAB guide
MATLAB guide
 
Matlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLABMatlab day 1: Introduction to MATLAB
Matlab day 1: Introduction to MATLAB
 
Intro to Programming: Modularity
Intro to Programming: ModularityIntro to Programming: Modularity
Intro to Programming: Modularity
 
Matlab
Matlab Matlab
Matlab
 
Recursion in Java
Recursion in JavaRecursion in Java
Recursion in Java
 
UML Class Diagram G-3-122139
UML Class Diagram G-3-122139UML Class Diagram G-3-122139
UML Class Diagram G-3-122139
 
Uml class Diagram
Uml class DiagramUml class Diagram
Uml class Diagram
 

Similar to APSEC04.ppt

ICSM04 Poster.ppt
ICSM04 Poster.pptICSM04 Poster.ppt
ICSM04 Poster.ppt
Ptidej Team
 
RelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdfRelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdf
10GUPTASOUMYARAMPRAK
 
UML (Hemant rajak)
UML (Hemant rajak)UML (Hemant rajak)
UML (Hemant rajak)
hrajak5
 
Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02
Getachew Ganfur
 

Similar to APSEC04.ppt (20)

Apsec04.ppt
Apsec04.pptApsec04.ppt
Apsec04.ppt
 
Apsec04.ppt
Apsec04.pptApsec04.ppt
Apsec04.ppt
 
ICSM04 Poster.ppt
ICSM04 Poster.pptICSM04 Poster.ppt
ICSM04 Poster.ppt
 
RelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdfRelationalAlgebra-RelationalCalculus-SQL.pdf
RelationalAlgebra-RelationalCalculus-SQL.pdf
 
CASCON04.ppt
CASCON04.pptCASCON04.ppt
CASCON04.ppt
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
 
TOOLS USA01.ppt
TOOLS USA01.pptTOOLS USA01.ppt
TOOLS USA01.ppt
 
UML (Hemant rajak)
UML (Hemant rajak)UML (Hemant rajak)
UML (Hemant rajak)
 
Mathematical Modeling With Maple
Mathematical Modeling With MapleMathematical Modeling With Maple
Mathematical Modeling With Maple
 
Class 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented ProgrammingClass 7 - PHP Object Oriented Programming
Class 7 - PHP Object Oriented Programming
 
Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02Ccourse 140618093931-phpapp02
Ccourse 140618093931-phpapp02
 
C++ Programming Course
C++ Programming CourseC++ Programming Course
C++ Programming Course
 
Java02
Java02Java02
Java02
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
UML Basics
UML BasicsUML Basics
UML Basics
 
Object Oriented Principle’s
Object Oriented Principle’sObject Oriented Principle’s
Object Oriented Principle’s
 
Introduction to new features in java 8
Introduction to new features in java 8Introduction to new features in java 8
Introduction to new features in java 8
 
Introduction to new features in java 8
Introduction to new features in java 8Introduction to new features in java 8
Introduction to new features in java 8
 
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMUAutomated Refactoring of Legacy Java Software to Default Methods Talk at GMU
Automated Refactoring of Legacy Java Software to Default Methods Talk at GMU
 
Automatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to InterfacesAutomatic Migration of Legacy Java Method Implementations to Interfaces
Automatic Migration of Legacy Java Method Implementations to Interfaces
 

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

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[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
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

APSEC04.ppt

  • 1. This presentation has been given at APSEC 2004, the 2nd of December 2004, in Busan, Korea. Systematic Study of UML Class Diagram Constituents for their Abstract and Precise Recovery Yann-Gaël Guéhéneuc guehene@iro.umontreal.ca 2004/12/02 Software Engineering Laboratory Department of Computing Science and Operations Research University of Montreal © Yann-Gaël Guéhéneuc
  • 2. Context n UML is a standard – Used in industry – Taught in universities n UML is not a standard – Imprecise – Heavy 2/25
  • 3. Problem n But “lost” class diagrams – Missing, out-of-date n Maintenance > 50% of cost – Program understanding > 50% of time • Developers • Architecture • Maintainers • Behaviour • Design choices 3/25 • Implementation
  • 4. Problem (cont’d) n Lack of automated recovery tools – Class diagrams • Abstract – Concentrate the essential qualities of anything more extensive or of several things (≠ Graphical representations of source code) • Precise – Extent to which a given measurement agrees with a standard value (Original and–or expected class diagrams) 4/25
  • 6. Example public class A { ... } public class Example1 { private A[] listOfAs = new A[10]; private int numberOfAs = 0; public void addA(final A a) { this.listOfAs[numberOfAs++] = a; } public A getA(final int index) { return this.listOfAs[index]; } public void removeA(final A a) { // ... } public static void main(final String[] args) { final Example1 example1 = new Example1(); example1.addA(new A()); 5/25 // ... } }
  • 7. Example public class A { ... } public class Example1 { private A[] listOfAs = new A[10]; private int numberOfAs = 0; public void addA(final A a) { this.listOfAs[numberOfAs++] = a; } public A getA(final int index) { return this.listOfAs[index]; } public void removeA(final A a) { // ... } public static void main(final String[] args) { final Example1 example1 = new Example1(); example1.addA(new A()); 5/25 // ... } }
  • 9. Example (cont’d) public class A { ... } public class Example2 { private List listOfAs = new ArrayList(); public void addA(final A a) { this.listOfAs.add(a); } public A getA(final int index) { return (A) this.listOfAs.remove(index); } public void removeA(final A a) { this.listOfAs.remove(a); } public static void main(final String[] args) { final Example2 example2 = new Example2(); example2.addA(new A()); // ... 6/25 } }
  • 10. Example (cont’d) public class A { ... } public class Example2 { private List listOfAs = new ArrayList(); public void addA(final A a) { this.listOfAs.add(a); } public A getA(final int index) { return (A) this.listOfAs.remove(index); } public void removeA(final A a) { this.listOfAs.remove(a); } public static void main(final String[] args) { final Example2 example2 = new Example2(); example2.addA(new A()); // ... 6/25 } }
  • 12. Example (cont’d) Precise 7/25
  • 13. Example (cont’d) Precise 7/25 Association à Aggregation
  • 14. Example (cont’d) Precise Abstract 7/25 Association à Aggregation
  • 15. Example (cont’d) Precise Abstract 7/25 Association à Aggregation List is not important
  • 16. Solution n Systematic study of class diagram constituents for their abstract and precise recovery – 34 constituents (UML meta-model) – C++, Java, and Smalltalk – Prototype tool 8/25
  • 17. Related Work n Numberof constituents of class diagrams handled by tools Recovered UML constituents in % ArgoUML 7/34 21 Chava 7/34 21 Fujaba 7/34 21 IDEA 16/34 48 Rational Rose 8/34 24 Borland Together/J 8/34 24 Womble 9/34 28 9/25
  • 18. Hypotheses n Class-based programming languages n Classdiagrams document design during development and maintenance n Context dependant definitions of the constituents (⇒ incrementality) 10/25
  • 19. Abstract, Precise Systematic Study n Classifier features – Attribute üü – Method üü – Operations üû • Abstract public methods • Overloaded methods • (Comments, documentation) 11/25
  • 20. Abstract, Precise Systematic Study n Classifier relationships – Binary association üü – N-ary association ûû – Association end N/A – Aggregation üü – Multiplicity üû – Composition üû – Qualifier üû – Generalisation ûü – Association class ûû – Dependency ûû 12/25
  • 21. Abstract, Precise Systematic Study n Classifiers – Class üü – Bound Element üü – Nested class ûü – Metaclass üü – Type üü – Powertype ûû – Implementation class üü – Data Type üü – Interface üü – Enumeration üü – Parameterised class üü – Utility class üü Relationships Classifiers Attributes Operations M ethods to Other from Other Classifiers Class ü ü ü ü ü Implementation Class ü û ü û û Interface û ü û û ü 13/25 Type ü ü û ü ü
  • 22. Abstract, Precise Systematic Study n Miscellaneous – Stereotype üû – Link N/A – Class pathname üü – Instance of üü – Importing packages üü – Derived element – Object N/A – List compartment N/A – Composite object N/A – Name compartment N/A 14/25
  • 23. Discussion n Consensual definitions? n Base of comparison? 15/25
  • 24. Prototype Tool n Ptidej – Pattern Trace Identification, Detection, and Enhancement in Java • Also “breakfast” in French slang J – Open framework for high-level program analyses, visualisation, pattern detection • More at www.ptidej.net – Executable (.exe, .jar) – Source code 16/25
  • 25. Prototype Tool (cont’d) n Ptidej Abstract and Precise Model PADL Meta-Model Transformations based on the Systematic Study Model Dedicated Parsers C++ 17/25 Java
  • 26. Prototype Tool (cont’d) n Ptidej Recovered UML constituents in % ArgoUML 7/34 21 Chava 7/34 21 Fujaba 7/34 21 IDEA 16/34 48 Ptidej 21/34 62 Rational Rose 8/34 24 Borland Together/J 8/34 24 Womble 9/34 28 18/25
  • 27. Prototype Tool (cont’d) n Ptidej – Association, aggregation, and composition binary class relationships • Message sends • Invocation sites – Simple fields – Arrays, collections • Lifetime and exclusivity properties 19/25
  • 28. Prototype Tool (cont’d) n Ptidej – Classes, data types, implementation classes, interfaces, types, utility classes • Abstractness • Attributes • Methods (instance vs. class) • Operations • Relationships • Super-classes 20/25
  • 29. Example revisited public class A { ... } public class Example1 { private A[] listOfAs = new A[10]; private int numberOfAs = 0; public void addA(final A a) { this.listOfAs[numberOfAs++] = a; } public A getA(final int index) { return this.listOfAs[index]; } public void removeA(final A a) { // ... } public static void main(final String[] args) { final Example1 example1 = new Example1(); example1.addA(new A()); 21/25 // ... } }
  • 30. Example revisited public class A { ... } public class Example1 { private A[] listOfAs = new A[10]; private int numberOfAs = 0; public void addA(final A a) { this.listOfAs[numberOfAs++] = a; } public A getA(final int index) { return this.listOfAs[index]; } public void removeA(final A a) { // ... } public static void main(final String[] args) { final Example1 example1 = new Example1(); example1.addA(new A()); 21/25 // ... } }
  • 31. Example revisited (cont’d) public class A { ... } public class Example2 { private List listOfAs = new ArrayList(); public void addA(final A a) { this.listOfAs.add(a); } public A getA(final int index) { return (A) this.listOfAs.remove(index); } public void removeA(final A a) { this.listOfAs.remove(a); } public static void main(final String[] args) { final Example2 example2 = new Example2(); example2.addA(new A()); // ... 22/25 } }
  • 32. Example revisited (cont’d) public class A { ... } public class Example2 { private List listOfAs = new ArrayList(); public void addA(final A a) { this.listOfAs.add(a); } public A getA(final int index) { return (A) this.listOfAs.remove(index); } public void removeA(final A a) { this.listOfAs.remove(a); } public static void main(final String[] args) { final Example2 example2 = new Example2(); example2.addA(new A()); // ... 22/25 } }
  • 35. Example revisited (cont’d) Precise Abstract 23/25
  • 36. Conclusion n Exhaustive and systematic study of UML class diagram constituents n Prototype tool implementing algorithms for abstract and precise recovery n Recovery of more constituents than any other tools 24/25
  • 37. Future Work n UML v2.0 n Other programming languages – Eiffel n Other source of information – Comments, names – Documentation n Other diagrams – Sequence diagrams + Integration n Base(s) of comparison 25/25