SlideShare a Scribd company logo
Stop the Software
Architecture Erosion


Bernhard Merkle               Frederic Madiot
R&D Software                  Products Manager
SICK AG, Germany              OBEO, France

     Contact us on linkedin.com or xing.com      Page: 1
Agenda

  – Software Architecture

  – Detect Architectural Erosion

  – Eclipse + Open Source Projects

  – Model-Driven Reverse-Engineering

                                       Page: 2
Architecture, Erosion




                        Page: 6
Software-Architecture: Definitions
IEEE 1471-2000:
  The fundamental organization of a system,
  embodied in its components,
  their relationship to each other and the
    environment,
  and the principles governing its design and
    evolution.



                                                Page: 7
Architectural Erosion
“Sometimes the developers manage to
maintain this purity of design through the
initial development and into the first release.

More often something goes wrong.
The software starts to rot like a
piece of bad meat”.

Uncle Bob: “Agile Software Development”      Page: 9
Architectural Erosion
Why should we care ?
  – In (lots of) Projects, Architecture decay happens
  – We are not alone, as we‘ve some good representatives… ;-)




There is/was a plan                                         Page: 10
X-raying Software…




                     Page: 11
Findbugs: the first years




 0.7.2             0.8.6
 (03/2004)         (10/2004)


                               Page: 12
Findbugs: first erosion




 0.8.7 (05/2005)


                          Page: 13
Tangle increase…




 0.8.8             1.0.0
 (05/2005)         (06/2006)   Page: 14
Tangle increase…




                   1.3.0
                               Page: 15
                   (07/2007)
ONE BIG Tangle…




                  1.3.8 (03/2009)
                                    Page: 16
Page: 17
Modeling Subsystems:




                       Page: 20
Fixing Architectural Violations




                                  Page: 21
Fixing Architectural Violations




                                  Page: 22
Fixing Architectural Violations




                                  Page: 23
Fixing Architectural Violations




                                  Page: 24
Fixing Architectural Violations




                                  Page: 25
Fixing Architectural Violations




                                  Page: 26
Fixing Architectural Violations




                                  Page: 27
Tools for Architecture-Analysis
 – SotoArc                       SonarJ
 – Bauhaus                       Lattix
 – Structure101                  Klocwork, Coverity

 – http://code.google.com/p/architecturerules/
 – ODASA, CodeCrawler, Codecity, SeeSoft, XRadar, XDepend,
   SonarSource, Kalistick, Sqoring, …

 – Eclipse-Based: MoDisco (+Modernization of Applications)


http://se-radio.net/
episode-115-architecture-analysis                            Page: 28
Basic Approaches (Dependencies)
  – makedepend, jdepend
  – Eclipse (Java Build Path)
  – OSGI (Dependencies)




                                  Page: 29
Basic Approaches
PDE Dependency Visualization




                               Page: 30
Missing in basic approaches:

Architecture Analysis (Deviation)
Drill-Down + Aggregation
Displaying results
Monitoring changes, trends
Rating of Architecture

  Requirements for Architectural Analysis Tools



                                                  Page: 31
Architecture Analysis (deviation)

 Requirements



 Architecture-     Should-
    Design       Architecture

                                Comparison      “Diff-”      Actions
                                             Architecture

  Extraction         Is-                      •Violations
                                              •Conformance
                 Architecture



 Existing Code

                                                                Page: 32
Displaying results:




                      Page: 33
Architecture: critical for OS-projects


How to augment                               How to replace
the development                              key people ?
and support load ?




                             Open-Source
                               Project

                     Marketplace
                                           How to maintain
 How to develop                            confidence with users?
 a market ?


                                                         Page: 34
Openess limits Erosion
  Developers expose their reputation
     Names are associated to the architecture
  Community can provide feedback
     Warnings, Recommendations, ...




                                                Page: 35
Risks of Erosion in FOSS
           Contributors from several organizations
              Different cultures, processes, tools, …


           Lower pressure from management
              Indirect Business


           Hazardous funding
              Difficulties to calculate costs and benefits




                                                             Page: 36
Eclipse: Architectural Analysis




                                  Page: 37
Eclipse: 10 Years Legacy System




          Eclipse Helios = 33M lines of code

                                               Page: 38
Eclipse Architecture




                       Page: 39
Eclipse Architecture




                       Page: 40
Eclipse Architecture




                       Page: 41
E3.4: Plattf:Ant   JDT:*




                           Page: 42
E3.4: Plattf:Ant   JDT:UI




                            Page: 43
Plattform: CVS   Workb (internal)




                                Page: 44
Team-UI UI-workbench (internal)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=90582




                                                  Page: 45
Antipatterns




               Page: 46
Dependent BaseClass
 – Type:
    • Design Problem


 – Problem:
    • one of more Methods shall implement different
      behavior, depending on the type, passed in
 – Context:
    • make “extensible” systems, frameworks
 – Forces:
    • Programming languages offer, instanceof/typeid funcs.
 – Antipattern:
    • Methods of the baseclass, depend on derived classes, e.g. accessing
      their members, doing switch/case depending on type information

                                                                            Page: 47
AntiPatterns / Bad Smells:
Metrics/1000 Classes        Eclipse   JDK

Dependent Baseclass:          1        16
Multiple Interface Inher.     4        18

Abstractable Methods         80        60
Abstractable Attributes      45       170

Unused Classes               50        150
Unused Methods              950       2500
Unused Attributes            30         20


                                             Page: 48
Code
Code Clones




              Clones
                       Page: 49
Code Clones
 – identical Files
     • E2.0 JDT,CDT
         – jdtdebuginternaluidialogfieldsListDialogField.java
         – cdtdebuginternaluidialogfieldsListDialogField.java
     • E3.4 CDT: identical packages
         – cdtdebuginternaluidialogfields,
           cdtdebugmiinternaluidialogfields


 – variation of former identical Files
    • E3.4 JDT,CDT
         – jdtdebuginternaluidialogfieldsListDialogField.java
         – cdtdebuginternaluidialogfieldsListDialogField.java


                                                                     Page: 50
Rating Eclipse Architecture

Minor Erosions, Code Duplication

  – large codebase,

  – OSGI helps a lot

  – API Police,
  – Guidelines
  – upcoming PDE tools

  – Processes and Tools

                                   Page: 51
Architecture Council Recommend.
•Architectural Recommendations •Community Practices
  • Be asynchronous                                     • Engage your user community
  • Think API
  • Long-running operations should be
    cancelable                                     •Software Development Practices
  • Separate policy and mechanism                       • Unit Test, Unit Test, Unit Test
  • Keep simple things simple                           • Continuous Integration
  • Create Unittests early                              • Integrate in small steps
  • Minimize plug-in dependencies
  • Be aware of the deployment context
  • Package coherence
  • Putting only related things together


     http://wiki.eclipse.org/Architecture_Council/Top_Ten_Project_Development_Practices
     http://wiki.eclipse.org/Architecture_Council/Top_Ten_Recommendations


                                                                                            Page: 52
Yearly Simultaneous Releases Rules
   Projects should leverage only published APIs of
   dependencies
   Version number ends with « qualifier »
   Source code must use ICU4J classes
   The project must contain an « about.html » file
   Packages name should start with the plug-in ID
   Plug-in must not contain JARs files
   Plug-in should contain only one
   « message.properties » and « Message.java » files
   Etc…




  http://www.eclipse.org/indigo/planning/EclipseSimultaneousRelease.php



                                                                          Page: 53
New Eclipse projects …
          driving to new architectures
        Components that are more reusable + customizable
         Service-oriented programming model
         GUI represented by a model and configurable with CSS
         Enabling Javascript app to be executed by Eclipse runtime
         Framework to build SWT app declarativeley


        Ajax-enabled web applications by using a subset of RCP APIs
         Eclipse development model
         Plug-ins & Eclipse workbench extension points
         Widget toolkit using SWT API


        Browser-based tools to develop for the web, in the web
         Client: loosely coupled components written in JavaScript
         Server: services exposed via REST-oriented HTTP APIs


                                                                      Page: 54
Manage architectural transition?



                    ?

   Architecture A   Architecture B




                                     Page: 55
Evolution to e4
 Backward Compatibility Layer
   • Eclipse 3.x plug-ins run on e4
 Challenges
   • Not clean APIs usage?
         Refactoring
   • Using e4 development model?
         Migration
   • Single sourcing?
        Forward Compat. Layer
                     (Session: Singlesourcing for Eclipse 4.x and Eclipse 3.x)

                                                                                 Page: 56
Evolution to RAP
Single sourcing with RAP is not automatic
   •   API differences
   •   Missing extension points
   •   Application startup and Activator scope
   •   API Differences
   •   Field validation                                            Refactoring
   •   SWT ressources
   •   Singletons and Scopes
   •   Jobs and background threads
   •   Internationalization and localization
  (http://eclipsesource.com/fileadmin/doc/2009_product/single_sourcing_guide.pdf)



                                                                                    Page: 57
How to modernize
existing Eclipse plug-ins?




                             Page: 58
Architectural Modernization Process
                           Transformation   Reference
                               Tooling        Tests




                Modernization                       Transformation
                  Strategy                           & Integration




                                                           Non-Regression
        Audit
                                                               Tests




      Legacy                                                   Modernized
     Software                                                   Software
      System                                                     System



                                                                            Page: 59
Anatomy of an Eclipse 3.x Plug-in

                    folders

                                    files

                     .project

                                   .classpath
                                                                           !
                                                                       ity
                  MANIFEST.MF
                                                                  e ne
                                                              g
Eclipse Plug-in                 build.properties
                                                         te ro
                                                    He
                   plugin.xml
                                plugin.properties


                  Source code




                                                                               Page: 60
Model-Driven
Reverse-Engineering
of Eclipse plug-ins




                Page: 61
MoDisco
   use Models to represent and manipulate
                           artifacts of existing systems

              Discover      ExistingUnderstand         Transform
                            Software System




                            Software artifacts :
                            - source code
                                                           New
                  Models                 Viewpoints
                            - configuration files          Software System
                            - tests
                            - database
                            -…


         http://www.eclipse.org/MoDisco/

                                                                         Page: 62
MoDisco Architecture
 Supported Technologies

        Java                  JSP               XML                   EclipsePlugin
          Metamodel            Metamodel         Metamodel
          Discoverer           Discoverer        Discoverer            Metamodel
          Generator            Generator         Generator             Discoverer
          Transfo. to KDM



    Discovery                Model              Customization           OMG/ADM
    Manager                  Browser            & Extensibility         Standards




     Plug and orchestrate      Navigation             Definition of         Pivot
     transformations           through                specific              Metamodels
                               complex models         Viewpoints            (SMM & KDM)


 Infrastructure

 Eclipse Modeling projects


                                                                                          Page: 63
Using EMF to describe a Plug-in

                    folders                         Project’s structure
                                                    (KDMSource)
                                    files
                                                                    .project (XML)
                     .project
                                                     .classpath (XML)
                                   .classpath
                                                                                it y!
                                                                      manifest e
                  MANIFEST.MF
                                                                            en       plugin
                                                     build.properties
                                                                       og            (eclipseplugin)

                                                                   om (XML)
Eclipse Plug-in                 build.properties     (KDMCore)

                                                                Hextensions
                   plugin.xml
                                                     plugin.properties
                                plugin.properties    (KDMCore)
                                                                  Java source code
                  Source code                                     (Java)




                                                                                               Page: 64
Using EMF to describe a Plug-in




                                  Page: 65
What can you do with
the EMF model
of a plug-in ?




                       Page: 66
Leverage Eclipse Modeling components
                                        Inspect
                                        Inspect
                                 (MoDisco Browser, EEF)
                                 (MoDisco Browser, EEF)

                                                Query
                                                Query
                                             (EMF Query)
                                             (EMF Query)


                                                    Vizualize
                                                     Vizualize
                                                  (GMF, Graphiti)
                                                  (GMF, Graphiti)

             EMF Model
         of an Eclipse plug-in                        Compare
                                                      Compare
                                                   (EMF Compare)
                                                   (EMF Compare)


                                                 Transform
                                                 Transform
                                                (ATL, QVTo)
                                                (ATL, QVTo)

                                       Generate code
                                       Generate code
                                    (Acceleo, Xpand, Jet)
                                    (Acceleo, Xpand, Jet)           Page: 67
Architectural Modernization Process

                            Transformation
                            Transformation                 Reference
                                                           Reference
                                Tooling
                                Tooling                      Tests
                                                             Tests




                 Modernization
                 Modernization                                    Transformation
                                                                  Transformation
                   Strategy
                   Strategy                                        & Integration
                                                                   & Integration




                                                                         Non-Regression
                                                                         Non-Regression
         Audit
                                                                             Tests
                                                                              Tests

                                      • Quality Analysis
                                      • Volumetry
                                      • Cartography
       Legacy
       Legacy                                                                Modernized
                                                                             Modernized
      Software
      Software                                                                Software
                                                                              Software
       System
       System                                                                  System
                                                                               System



                                                                                          Page: 68
Validation




             Page: 69
Architecture Visualization

                             GMF diagram
                             created with ObeoDesigner

                             • purple: EMF Model
                             • green: UI




                                                   Page: 70
Architectural Modernization Process

                       Transformation               Reference
                                                    Reference
                           Tooling                    Tests
                                                      Tests




            Modernization
            Modernization                                  Transformation
                                                           Transformation
              Strategy
              Strategy                                      & Integration
                                                            & Integration




                                                                  Non-Regression
                                                                  Non-Regression
        Audit
        Audit
                               • Parsing                              Tests
                                                                       Tests
                               • Transformation rules
                               • Re-generation


      Legacy
      Legacy                                                          Modernized
                                                                      Modernized
     Software
     Software                                                          Software
                                                                       Software
      System
      System                                                            System
                                                                        System



                                                                                   Page: 71
Refactoring & Migration


                  Model                   Model
   Existing   of the existing                                      Transformed
                                     of the migrated
   Plug-in        Plug-in                                             Plug-in
                                          Plug-in




                            Transformation Rules
                       What to change + How to change

              • Renaming
              • Changing code structure
                         (inheritance, attributes, methods, etc)
              • Replacing method calls
              • Changing instructions order
              • Etc



                                                                          Page: 72
Architectural Modernization Process

                        Transformation
                        Transformation               Reference
                            Tooling
                            Tooling                    Tests




             Modernization
             Modernization                                   Transformation
                                                             Transformation
               Strategy
               Strategy                                       & Integration
                                                              & Integration




                               • Tests coverage analysis            Non-Regression
                                                                    Non-Regression
         Audit
         Audit                                                          Tests
                                                                         Tests




       Legacy
       Legacy                                                           Modernized
                                                                        Modernized
      Software
      Software                                                           Software
                                                                         Software
       System
       System                                                             System
                                                                          System



                                                                                     Page: 73
Test coverage analysis




                         Page: 74
Architectural Modernization Process

                        Transformation
                        Transformation               Reference
                                                     Reference
                            Tooling
                            Tooling                    Tests
                                                       Tests




             Modernization
             Modernization                                  Transformation
               Strategy
               Strategy                                      & Integration




                                                                   Non-Regression
                                                                   Non-Regression
         Audit
         Audit                                                         Tests
                                                                        Tests
                             • Automatic transformation
                             • Manual transformation
                             • Build


       Legacy
       Legacy                                                          Modernized
                                                                       Modernized
      Software
      Software                                                          Software
                                                                        Software
       System
       System                                                            System
                                                                         System



                                                                                    Page: 75
Build
                                               IDM++ Research Project (ANR) -> Sept 2011




      Plug-ins to
         build

                          Model of
                       plugins to build
  Team information
   (CVS, SVN, etc)                              constraints solver
                                                                           B3 Model
                                                                     (build configuration)


                          Model of
    Update sites     update sites content
       (p2)



                                            Build Strategies

                                                                                             Page: 76
Summary
Stop the Software Architecture Erosion ?
Analysis is Required
  – Evaluate the architectural situation
  – Take the right decisions at the right time

Modernization is Required
  – Correct erosion consequences
  – Go with architectural Evolutions


=> Continuous Analysis + Modernization
                                                 Page: 77
Thank you !


              Page: 78

More Related Content

PDF
ONLINE_VOTING_SYSTEM.pdf
PDF
[BROCHURE] Choosing the Right MSP to support All of Your Business Devices
PDF
online examination management system
PPTX
Control Room of the Future
PDF
FormsとPower AutomateとTeamsを使った問合せ管理の仕組みをつくる
PPTX
Teams + Power Platform でチームメンバーの状況報告を圧倒的効率化!
PDF
System Modeling And Achitecture Design
PDF
WECON V-BOX Lua Configration
ONLINE_VOTING_SYSTEM.pdf
[BROCHURE] Choosing the Right MSP to support All of Your Business Devices
online examination management system
Control Room of the Future
FormsとPower AutomateとTeamsを使った問合せ管理の仕組みをつくる
Teams + Power Platform でチームメンバーの状況報告を圧倒的効率化!
System Modeling And Achitecture Design
WECON V-BOX Lua Configration

What's hot (20)

PPTX
Embedded Systems
PPT
Passport status tracking system (1)
PDF
Orpak ForeFuel - Automated RFID Fueling Solution
PPTX
Profiting from innovation in the digital economy teece 2018
DOCX
Employee management system report
PPTX
ユースケースとアクティビティとテスト
PPTX
DX実践!~ビジネスアジリティ向上とマイクロサービス技術GraphQLの活用~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
PDF
az-900.pdf
DOCX
Project synopsis on online voting system
DOC
Online Attendance Management System
PPTX
Embedded systems
PPTX
Principle and Operation of DC-DC Boost converter
DOCX
Acknowledgement
PDF
Microix Requisition Module for Abila MIP
PDF
Employee Profile Management System
PDF
Online Exam System_Industrial Report
PPTX
Difference between PCI PCI-X PCIe
PDF
Microsoft Graph APIを活用した社内アプリケーション開発
PDF
Re-collection of embedded software qa in the last decade
PDF
DLL_言語系MicrosoftAIサービス最新情報_202302.pdf
Embedded Systems
Passport status tracking system (1)
Orpak ForeFuel - Automated RFID Fueling Solution
Profiting from innovation in the digital economy teece 2018
Employee management system report
ユースケースとアクティビティとテスト
DX実践!~ビジネスアジリティ向上とマイクロサービス技術GraphQLの活用~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
az-900.pdf
Project synopsis on online voting system
Online Attendance Management System
Embedded systems
Principle and Operation of DC-DC Boost converter
Acknowledgement
Microix Requisition Module for Abila MIP
Employee Profile Management System
Online Exam System_Industrial Report
Difference between PCI PCI-X PCIe
Microsoft Graph APIを活用した社内アプリケーション開発
Re-collection of embedded software qa in the last decade
DLL_言語系MicrosoftAIサービス最新情報_202302.pdf
Ad

Viewers also liked (19)

PPT
Software Accessibility Siddhesh
PPTX
eMee at HR Tech Europe, 26 March, London
DOC
Lead Allocation System's Attribute Driven Design (ADD)
PPTX
Introduction to AntiPatterns & CodeSmells
PPT
Anti Patterns Siddhesh Lecture1 Of3
PDF
Refactoring for Software Architecture Smells - International Workshop on Refa...
PPT
Anti Patterns Siddhesh Lecture2 Of3
KEY
Anti Patterns
PPT
Anti Patterns Siddhesh Lecture3 Of3
PDF
Software Architecture Anti-Patterns
PPTX
Anti patterns part 1
PPT
Lead Allocation System - Attribute Driven Design (ADD)
PDF
The eMee Value Proposition
PPTX
Industry expectations from new recruits
PDF
Attribute Driven Styles: The Good, the Bad, and the Unknown (SassConf 2015 Di...
PDF
Software Design - Architectural Kata
KEY
Api anti patterns
DOCX
Designing and documenting software architecture unit 5
PDF
Bangalore Container Conference 2017 - Poster
Software Accessibility Siddhesh
eMee at HR Tech Europe, 26 March, London
Lead Allocation System's Attribute Driven Design (ADD)
Introduction to AntiPatterns & CodeSmells
Anti Patterns Siddhesh Lecture1 Of3
Refactoring for Software Architecture Smells - International Workshop on Refa...
Anti Patterns Siddhesh Lecture2 Of3
Anti Patterns
Anti Patterns Siddhesh Lecture3 Of3
Software Architecture Anti-Patterns
Anti patterns part 1
Lead Allocation System - Attribute Driven Design (ADD)
The eMee Value Proposition
Industry expectations from new recruits
Attribute Driven Styles: The Good, the Bad, and the Unknown (SassConf 2015 Di...
Software Design - Architectural Kata
Api anti patterns
Designing and documenting software architecture unit 5
Bangalore Container Conference 2017 - Poster
Ad

Similar to Software Architecture Erosion and Modernization (20)

PDF
Eclipse Summit 2009 Bernhard Merkle Stop The Software Architecture Erosion
PDF
BernhardMerkle_StopTheArchitectureErosion
PPT
02 architectures in_context
PDF
Architecture Extraction From Code
PDF
2 - Architetture Software - Software architecture
PPT
02archintro
PPTX
Software architecture styles families_research_gssi_nov2013
PDF
10 Hinweise für Architekten
PDF
Of Bugs and Men
PDF
Of Bugs and Men (and Plugins too)
PPTX
L02 Architecture
PDF
Ten Advices for Architects
PDF
Multi View Constructed Right
PPTX
PHX Session #5 : Architecture Without Big Design Up Front (Garibay)
PPT
Cs 1023 lec 3 architecture (week 1)
PPT
Cs 1023 lec 3 architecture (week 1)
PDF
Modern development paradigms
PDF
Essential Software Architecture - Chapter 1 Understanding Software Architectu...
PDF
Keynote de Mike Milinkovich
Eclipse Summit 2009 Bernhard Merkle Stop The Software Architecture Erosion
BernhardMerkle_StopTheArchitectureErosion
02 architectures in_context
Architecture Extraction From Code
2 - Architetture Software - Software architecture
02archintro
Software architecture styles families_research_gssi_nov2013
10 Hinweise für Architekten
Of Bugs and Men
Of Bugs and Men (and Plugins too)
L02 Architecture
Ten Advices for Architects
Multi View Constructed Right
PHX Session #5 : Architecture Without Big Design Up Front (Garibay)
Cs 1023 lec 3 architecture (week 1)
Cs 1023 lec 3 architecture (week 1)
Modern development paradigms
Essential Software Architecture - Chapter 1 Understanding Software Architectu...
Keynote de Mike Milinkovich

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
Teaching material agriculture food technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Modernizing your data center with Dell and AMD
PDF
KodekX | Application Modernization Development
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Big Data Technologies - Introduction.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
NewMind AI Monthly Chronicles - July 2025
Teaching material agriculture food technology
Unlocking AI with Model Context Protocol (MCP)
Modernizing your data center with Dell and AMD
KodekX | Application Modernization Development
“AI and Expert System Decision Support & Business Intelligence Systems”
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Review of recent advances in non-invasive hemoglobin estimation
Big Data Technologies - Introduction.pptx

Software Architecture Erosion and Modernization

  • 1. Stop the Software Architecture Erosion Bernhard Merkle Frederic Madiot R&D Software Products Manager SICK AG, Germany OBEO, France Contact us on linkedin.com or xing.com Page: 1
  • 2. Agenda – Software Architecture – Detect Architectural Erosion – Eclipse + Open Source Projects – Model-Driven Reverse-Engineering Page: 2
  • 4. Software-Architecture: Definitions IEEE 1471-2000: The fundamental organization of a system, embodied in its components, their relationship to each other and the environment, and the principles governing its design and evolution. Page: 7
  • 5. Architectural Erosion “Sometimes the developers manage to maintain this purity of design through the initial development and into the first release. More often something goes wrong. The software starts to rot like a piece of bad meat”. Uncle Bob: “Agile Software Development” Page: 9
  • 6. Architectural Erosion Why should we care ? – In (lots of) Projects, Architecture decay happens – We are not alone, as we‘ve some good representatives… ;-) There is/was a plan Page: 10
  • 8. Findbugs: the first years 0.7.2 0.8.6 (03/2004) (10/2004) Page: 12
  • 9. Findbugs: first erosion 0.8.7 (05/2005) Page: 13
  • 10. Tangle increase… 0.8.8 1.0.0 (05/2005) (06/2006) Page: 14
  • 11. Tangle increase… 1.3.0 Page: 15 (07/2007)
  • 12. ONE BIG Tangle… 1.3.8 (03/2009) Page: 16
  • 22. Tools for Architecture-Analysis – SotoArc SonarJ – Bauhaus Lattix – Structure101 Klocwork, Coverity – http://code.google.com/p/architecturerules/ – ODASA, CodeCrawler, Codecity, SeeSoft, XRadar, XDepend, SonarSource, Kalistick, Sqoring, … – Eclipse-Based: MoDisco (+Modernization of Applications) http://se-radio.net/ episode-115-architecture-analysis Page: 28
  • 23. Basic Approaches (Dependencies) – makedepend, jdepend – Eclipse (Java Build Path) – OSGI (Dependencies) Page: 29
  • 24. Basic Approaches PDE Dependency Visualization Page: 30
  • 25. Missing in basic approaches: Architecture Analysis (Deviation) Drill-Down + Aggregation Displaying results Monitoring changes, trends Rating of Architecture Requirements for Architectural Analysis Tools Page: 31
  • 26. Architecture Analysis (deviation) Requirements Architecture- Should- Design Architecture Comparison “Diff-” Actions Architecture Extraction Is- •Violations •Conformance Architecture Existing Code Page: 32
  • 28. Architecture: critical for OS-projects How to augment How to replace the development key people ? and support load ? Open-Source Project Marketplace How to maintain How to develop confidence with users? a market ? Page: 34
  • 29. Openess limits Erosion Developers expose their reputation Names are associated to the architecture Community can provide feedback Warnings, Recommendations, ... Page: 35
  • 30. Risks of Erosion in FOSS Contributors from several organizations Different cultures, processes, tools, … Lower pressure from management Indirect Business Hazardous funding Difficulties to calculate costs and benefits Page: 36
  • 32. Eclipse: 10 Years Legacy System Eclipse Helios = 33M lines of code Page: 38
  • 36. E3.4: Plattf:Ant JDT:* Page: 42
  • 37. E3.4: Plattf:Ant JDT:UI Page: 43
  • 38. Plattform: CVS Workb (internal) Page: 44
  • 40. Antipatterns Page: 46
  • 41. Dependent BaseClass – Type: • Design Problem – Problem: • one of more Methods shall implement different behavior, depending on the type, passed in – Context: • make “extensible” systems, frameworks – Forces: • Programming languages offer, instanceof/typeid funcs. – Antipattern: • Methods of the baseclass, depend on derived classes, e.g. accessing their members, doing switch/case depending on type information Page: 47
  • 42. AntiPatterns / Bad Smells: Metrics/1000 Classes Eclipse JDK Dependent Baseclass: 1 16 Multiple Interface Inher. 4 18 Abstractable Methods 80 60 Abstractable Attributes 45 170 Unused Classes 50 150 Unused Methods 950 2500 Unused Attributes 30 20 Page: 48
  • 43. Code Code Clones Clones Page: 49
  • 44. Code Clones – identical Files • E2.0 JDT,CDT – jdtdebuginternaluidialogfieldsListDialogField.java – cdtdebuginternaluidialogfieldsListDialogField.java • E3.4 CDT: identical packages – cdtdebuginternaluidialogfields, cdtdebugmiinternaluidialogfields – variation of former identical Files • E3.4 JDT,CDT – jdtdebuginternaluidialogfieldsListDialogField.java – cdtdebuginternaluidialogfieldsListDialogField.java Page: 50
  • 45. Rating Eclipse Architecture Minor Erosions, Code Duplication – large codebase, – OSGI helps a lot – API Police, – Guidelines – upcoming PDE tools – Processes and Tools Page: 51
  • 46. Architecture Council Recommend. •Architectural Recommendations •Community Practices • Be asynchronous • Engage your user community • Think API • Long-running operations should be cancelable •Software Development Practices • Separate policy and mechanism • Unit Test, Unit Test, Unit Test • Keep simple things simple • Continuous Integration • Create Unittests early • Integrate in small steps • Minimize plug-in dependencies • Be aware of the deployment context • Package coherence • Putting only related things together http://wiki.eclipse.org/Architecture_Council/Top_Ten_Project_Development_Practices http://wiki.eclipse.org/Architecture_Council/Top_Ten_Recommendations Page: 52
  • 47. Yearly Simultaneous Releases Rules Projects should leverage only published APIs of dependencies Version number ends with « qualifier » Source code must use ICU4J classes The project must contain an « about.html » file Packages name should start with the plug-in ID Plug-in must not contain JARs files Plug-in should contain only one « message.properties » and « Message.java » files Etc… http://www.eclipse.org/indigo/planning/EclipseSimultaneousRelease.php Page: 53
  • 48. New Eclipse projects … driving to new architectures Components that are more reusable + customizable Service-oriented programming model GUI represented by a model and configurable with CSS Enabling Javascript app to be executed by Eclipse runtime Framework to build SWT app declarativeley Ajax-enabled web applications by using a subset of RCP APIs Eclipse development model Plug-ins & Eclipse workbench extension points Widget toolkit using SWT API Browser-based tools to develop for the web, in the web Client: loosely coupled components written in JavaScript Server: services exposed via REST-oriented HTTP APIs Page: 54
  • 49. Manage architectural transition? ? Architecture A Architecture B Page: 55
  • 50. Evolution to e4 Backward Compatibility Layer • Eclipse 3.x plug-ins run on e4 Challenges • Not clean APIs usage? Refactoring • Using e4 development model? Migration • Single sourcing? Forward Compat. Layer (Session: Singlesourcing for Eclipse 4.x and Eclipse 3.x) Page: 56
  • 51. Evolution to RAP Single sourcing with RAP is not automatic • API differences • Missing extension points • Application startup and Activator scope • API Differences • Field validation Refactoring • SWT ressources • Singletons and Scopes • Jobs and background threads • Internationalization and localization (http://eclipsesource.com/fileadmin/doc/2009_product/single_sourcing_guide.pdf) Page: 57
  • 52. How to modernize existing Eclipse plug-ins? Page: 58
  • 53. Architectural Modernization Process Transformation Reference Tooling Tests Modernization Transformation Strategy & Integration Non-Regression Audit Tests Legacy Modernized Software Software System System Page: 59
  • 54. Anatomy of an Eclipse 3.x Plug-in folders files .project .classpath ! ity MANIFEST.MF e ne g Eclipse Plug-in build.properties te ro He plugin.xml plugin.properties Source code Page: 60
  • 56. MoDisco use Models to represent and manipulate artifacts of existing systems Discover ExistingUnderstand Transform Software System Software artifacts : - source code New Models Viewpoints - configuration files Software System - tests - database -… http://www.eclipse.org/MoDisco/ Page: 62
  • 57. MoDisco Architecture Supported Technologies Java JSP XML EclipsePlugin Metamodel Metamodel Metamodel Discoverer Discoverer Discoverer Metamodel Generator Generator Generator Discoverer Transfo. to KDM Discovery Model Customization OMG/ADM Manager Browser & Extensibility Standards Plug and orchestrate Navigation Definition of Pivot transformations through specific Metamodels complex models Viewpoints (SMM & KDM) Infrastructure Eclipse Modeling projects Page: 63
  • 58. Using EMF to describe a Plug-in folders Project’s structure (KDMSource) files .project (XML) .project .classpath (XML) .classpath it y! manifest e MANIFEST.MF en plugin build.properties og (eclipseplugin) om (XML) Eclipse Plug-in build.properties (KDMCore) Hextensions plugin.xml plugin.properties plugin.properties (KDMCore) Java source code Source code (Java) Page: 64
  • 59. Using EMF to describe a Plug-in Page: 65
  • 60. What can you do with the EMF model of a plug-in ? Page: 66
  • 61. Leverage Eclipse Modeling components Inspect Inspect (MoDisco Browser, EEF) (MoDisco Browser, EEF) Query Query (EMF Query) (EMF Query) Vizualize Vizualize (GMF, Graphiti) (GMF, Graphiti) EMF Model of an Eclipse plug-in Compare Compare (EMF Compare) (EMF Compare) Transform Transform (ATL, QVTo) (ATL, QVTo) Generate code Generate code (Acceleo, Xpand, Jet) (Acceleo, Xpand, Jet) Page: 67
  • 62. Architectural Modernization Process Transformation Transformation Reference Reference Tooling Tooling Tests Tests Modernization Modernization Transformation Transformation Strategy Strategy & Integration & Integration Non-Regression Non-Regression Audit Tests Tests • Quality Analysis • Volumetry • Cartography Legacy Legacy Modernized Modernized Software Software Software Software System System System System Page: 68
  • 63. Validation Page: 69
  • 64. Architecture Visualization GMF diagram created with ObeoDesigner • purple: EMF Model • green: UI Page: 70
  • 65. Architectural Modernization Process Transformation Reference Reference Tooling Tests Tests Modernization Modernization Transformation Transformation Strategy Strategy & Integration & Integration Non-Regression Non-Regression Audit Audit • Parsing Tests Tests • Transformation rules • Re-generation Legacy Legacy Modernized Modernized Software Software Software Software System System System System Page: 71
  • 66. Refactoring & Migration Model Model Existing of the existing Transformed of the migrated Plug-in Plug-in Plug-in Plug-in Transformation Rules What to change + How to change • Renaming • Changing code structure (inheritance, attributes, methods, etc) • Replacing method calls • Changing instructions order • Etc Page: 72
  • 67. Architectural Modernization Process Transformation Transformation Reference Tooling Tooling Tests Modernization Modernization Transformation Transformation Strategy Strategy & Integration & Integration • Tests coverage analysis Non-Regression Non-Regression Audit Audit Tests Tests Legacy Legacy Modernized Modernized Software Software Software Software System System System System Page: 73
  • 69. Architectural Modernization Process Transformation Transformation Reference Reference Tooling Tooling Tests Tests Modernization Modernization Transformation Strategy Strategy & Integration Non-Regression Non-Regression Audit Audit Tests Tests • Automatic transformation • Manual transformation • Build Legacy Legacy Modernized Modernized Software Software Software Software System System System System Page: 75
  • 70. Build IDM++ Research Project (ANR) -> Sept 2011 Plug-ins to build Model of plugins to build Team information (CVS, SVN, etc) constraints solver B3 Model (build configuration) Model of Update sites update sites content (p2) Build Strategies Page: 76
  • 71. Summary Stop the Software Architecture Erosion ? Analysis is Required – Evaluate the architectural situation – Take the right decisions at the right time Modernization is Required – Correct erosion consequences – Go with architectural Evolutions => Continuous Analysis + Modernization Page: 77
  • 72. Thank you ! Page: 78