Design Pattern Detection and Software Architecture Reconstruction: an Integrated Approach Based on Software Micro-Structures
Total Page:16
File Type:pdf, Size:1020Kb
Università degli Studi di Milano-Bicocca Dipartimento di Informatica, Sistemistica e Comunicazione Dottorato di Ricerca in Informatica – XXII Ciclo Design Pattern Detection and Software Architecture Reconstruction: an Integrated Approach based on Software Micro-structures Ph.D. Candidate: Stefano Maggioni Thesis advisor: Prof. Francesca Arcelli Fontana Thesis tutor: Prof. Francesco Tisato Academic Year 2008-2009 Table of Contents Chapter 1 - Introduction.................................................................................................................. 6 1.1. The research field ........................................................................................................................................... 6 1.1.1. Design pattern detection (DPD) ....................................................................................................................... 7 1.1.2. Software architecture reconstruction (SAR) ................................................................................................... 10 1.2. A brief overview on software micro-structures for DPD and SAR ....................................................... 12 1.2.1. Elemental design patterns ............................................................................................................................... 13 1.2.2. Design pattern clues ....................................................................................................................................... 13 1.2.3. Micro patterns ................................................................................................................................................. 13 1.2.4. Usefulness of micro-structures for DPD and SAR ......................................................................................... 14 1.3. Thesis objectives and aims .......................................................................................................................... 14 1.4. Thesis outline ................................................................................................................................................ 15 Chapter 2 - Related works ............................................................................................................ 17 2.1. Related works on design pattern detection .............................................................................................. 17 2.1.1. Categorizations of approaches and methodologies for design pattern detection .............................................. 17 2.1.2. Approaches and tools for design pattern detection .......................................................................................... 19 2.1.3. Comparisons among tools for design pattern detection ................................................................................... 23 2.2. Related works on software architecture reconstruction ......................................................................... 24 2.2.1. Approaches and tools for software architecture reconstruction ...................................................................... 24 2.2.2. Taxonomies and comparisons of software architecture reconstruction tools .................................................. 30 2.2.3. A novel comparative framework proposal for SAR tools ................................................................................. 31 Chapter 3 - Software micro-structures ....................................................................................... 34 3.1. Software micro-structures ........................................................................................................................... 34 3.1.1. Elemental design patterns ............................................................................................................................... 35 3.1.2. Design pattern clues ....................................................................................................................................... 35 3.1.3. Micro patterns ................................................................................................................................................. 36 3.2. Towards a unique micro-structures catalogue ......................................................................................... 37 3.2.1. Code atoms definitions .................................................................................................................................... 40 3.2.2. Elemental design patterns definitions ............................................................................................................. 42 3.2.3. Design pattern clues definitions ..................................................................................................................... 45 3.2.4. Micro patterns definitions ............................................................................................................................... 50 3.3. The Micro-structures detector .................................................................................................................... 52 3.4. Concluding remarks .................................................................................................................................... 53 Chapter 4 - Micro-structures for design pattern detection ..................................................... 54 4.1. Micro-structures for design pattern detection .......................................................................................... 54 4.2. An analysis of micro-structures based on six aspects ............................................................................. 55 4.2.1. Elemental design patterns ............................................................................................................................... 55 4.2.2. Design pattern clues ....................................................................................................................................... 56 4.2.3. Micro patterns ................................................................................................................................................. 57 4.3. A comparison among micro-structures ..................................................................................................... 58 4.4. The role of micro-structures in the detection of design patterns ........................................................... 59 4.4.1. Micro-structures detection in sample design pattern implementations .......................................................... 60 4.4.2. Micro-structures relevance evaluation for design pattern detection ............................................................... 70 4.4.3. Micro-structures detection in design pattern implementation variants ......................................................... 75 4.5. An association among pattern roles and micro-structures for their detection .................................... 80 4.6. Concluding remarks .................................................................................................................................... 83 Chapter 5 - Micro-structures for the validation and refinement of design pattern detection tools results .................................................................................................................... 85 5.1. Detection of design patterns through four design pattern detection tools .......................................... 85 5.2. Refinement rules definition ........................................................................................................................ 87 5.3. The pattern instances refinement process ................................................................................................. 92 5.4. Application of the rules to the detected instances ................................................................................... 95 5.5. Refinement results evaluation .................................................................................................................... 97 5.6. Concluding remarks .................................................................................................................................. 100 Chapter 6 - Micro-structures for software architecture reconstruction .............................. 102 6.1. Elemental design patterns and micro patterns for SAR purposes ....................................................... 102 6.2. Elemental design patterns for SAR .......................................................................................................... 106 6.2.1. Views ............................................................................................................................................................. 107 6.2.2. Metrics .......................................................................................................................................................... 109 6.2.3. Structural antipatterns ................................................................................................................................. 115 6.3. Micro patterns for SAR .............................................................................................................................. 118 6.3.1. Micro patterns identifying classes of particular interest .............................................................................. 118 6.3.2. Object-oriented antipatterns ........................................................................................................................