SlideShare a Scribd company logo
1 of 32
Download to read offline
Stop the Software
Architecture Erosion

Bernhard Merkle
Central Research & Development
Software-Engineering
SICK-AG Waldkirch
                   mailto: Bernhard.Merkle@gmail.com
                   Contact on linkedin.com or xing.com
                               Bernhard Merkle „Stop the Software Architecture Erosion“
                                                       Page: 1




Disclaimer

I am a              Guy

We will be X-raying Software

Do not shoot me,
this is a contribution,not criticism !

                               Bernhard Merkle „Stop the Software Architecture Erosion“
                                                       Page: 2
Bernhard Merkle „Stop the Software Architecture Erosion“
                        Page: 3




Bernhard Merkle „Stop the Software Architecture Erosion“
                        Page: 4
Google: Street View




                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 6




Introduction / Overview
Levels of Static Analysis
  – Code, Design, Architectural
  – Examples


Architectural Analysis
  – Use Cases
  – Tool Support
  – Examples
  – Pros/Cons

                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 7
Levels of Static Analysis:
Micro-Level
  – Code
  – =, ==, { }


Macro-Level
  – Class-Design, API-Design
  – by reference, Exception-Handling, equals/hashCode/op=


Architecture-Level:
  – Layers, Subsystems, Compoments, Interfaces
  – Coupling, Dependency, etc…
                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 8




Micro-Level: MISRA-C 2004




                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 9
Macro-Level: Design+Coding Guidelines




                                         Bernhard Merkle „Stop the Software Architecture Erosion“
                                                                 Page: 10




Samples for Effective Rules
C++
  –    Prefer const and inline to #define
  –    Use same form in corresponding uses of new and delete
  –    Declare cctor and assignment op for classes with dyn memory
  –    Strive for class interfaces that a minimal and complete
  –    Choose carefully betw. fuction overloading / parameter default
Java
  –    Eliminate obsolete object references
  –    Always override hashCode when you override equals
  –    Minimize mutability
  –    Favor composistion over inheritance
  –    Do not use raw types in new code

                                         Bernhard Merkle „Stop the Software Architecture Erosion“
                                                                 Page: 11
Tool Example Java: findbugs




                      Bernhard Merkle „Stop the Software Architecture Erosion“
                                              Page: 12




Software, Architecture, Erosion




                      Bernhard Merkle „Stop the Software Architecture Erosion“
                                              Page: 13
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.



Kruchten: captured in
  – Software Architecture Document
  – Software Design Guidelines


                                     Bernhard Merkle „Stop the Software Architecture Erosion“
                                                             Page: 14




Erosion always happens
– Prototypes become products
– Hacks/Workarounds
– Lack of understanding “should architecture”
– Time pressure



                                     Bernhard Merkle „Stop the Software Architecture Erosion“
                                                             Page: 15
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”
                                   Bernhard Merkle „Stop the Software Architecture Erosion“
                                                           Page: 16




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                Bernhard Merkle „Stop the Software Architecture Erosion“
                                                           Page: 17
X-raying Software…
Is there a architecture ?
Is there a erosion ?




Do AA-Tool work well ?
Do codelevel lints care about architecture ?
                                Bernhard Merkle „Stop the Software Architecture Erosion“
                                                        Page: 18




Findbugs: the first years




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


                                Bernhard Merkle „Stop the Software Architecture Erosion“
                                                        Page: 19
Findbugs: the first years




   0.8.6              0.8.7
   (10/2004)          (05/2005)


                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 20




Findbugs 0.8.7: Architectural Analysis




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 21
Tangle increase…




 0.8.8                1.0.0
 (05/2005)            (06/2006)
                   Bernhard Merkle „Stop the Software Architecture Erosion“
                                           Page: 22




Tangle increase…




                                    1.3.0
                   Bernhard Merkle „Stop the Software Architecture Erosion“
                                    (07/2007)
                                           Page: 23
ONE BIG Tangle…




                   1.3.8 (03/2009)
                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                          Page: 24




Still managable ?




                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                          Page: 25
Anti-Pattern: Findelkind (foundling)




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 26




Modeling Subsystems:




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 28
Fixing Architectural Violations




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 29




Fixing Architectural Violations




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 30
Fixing Architectural Violations




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 31




Fixing Architectural Violations




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 32
Fixing Architectural Violations




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 33




Fixing Architectural Violations




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 34
Fixing Architectural Violations




                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 35




Tools for Architecture-Analysis
  – Sotograph                    SonarJ
  – Bauhaus                      Lattix
  – Structure101                 Klocwork, Coverity

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

 http://se-radio.net/
 episode-115-architecture-analysis

                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 37
Basic Approaches
  –   Your makesystem…
  –   makedepend, jdepend
  –   Eclipse (Java Build Path)
  –   OSGI (Dependencies)




                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 38




Basic Approaches
PDE Dependency Visualization




                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 39
Missing in basic approaches:

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

   Requirements for Architectural Analysis Tools



                                        Bernhard Merkle „Stop the Software Architecture Erosion“
                                                                Page: 40




Architecture Analysis (deviation)

 Requirements



 Architecture-     Should-
    Design       Architecture

                                Comparison             “Diff-”                     Actions
                                                    Architecture
                     Is-                              •Violations
  Extraction                                          •Conformance
                 Architecture



 Existing Code

                                        Bernhard Merkle „Stop the Software Architecture Erosion“
                                                                Page: 41
Drill-Down + Aggregation:
Component     System    Package          Class              Src-Line




                             Bernhard Merkle „Stop the Software Architecture Erosion“
                                                     Page: 42




Displaying results:
Graphical and/or numerical




                             Bernhard Merkle „Stop the Software Architecture Erosion“
                                                     Page: 43
Monitoring changes, trends (QA)
New artefacts
  – Interface, Subsystem, Package, File, Class, Operation etc.
  – Dependencies
  – Architecture violations


Early, betimes correction of violations

Monitoring
  – Trendreports
  – “outsourcing” projects



                                     Bernhard Merkle „Stop the Software Architecture Erosion“
                                                             Page: 44




Rating of Architecture
NO Rating of external Requirements (Fullfillment)

Internal Quality:
  –   Cycles
  –   Coupling of Modules
  –   Stability of API
  –   Anti-Patterns, Bad Smells
  –   Reuse/Extract system parts




                                     Bernhard Merkle „Stop the Software Architecture Erosion“
                                                             Page: 45
Eclipse: Architectural Analysis
  – JDT




  – CDT

                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 46




Eclipse Architecture




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 47
Eclipse Architecture




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 48




Eclipse Architecture




                       Bernhard Merkle „Stop the Software Architecture Erosion“
                                               Page: 49
E3.4: Plattf:Ant   JDT:*




                      Bernhard Merkle „Stop the Software Architecture Erosion“
                                              Page: 50




E3.4: Plattf:Ant    JDT:UI




                      Bernhard Merkle „Stop the Software Architecture Erosion“
                                              Page: 51
Plattform: CVS   Workb (internal)




                   Bernhard Merkle „Stop the Software Architecture Erosion“
                                           Page: 52




Plattform: CVS   Workb (internal)




                   Bernhard Merkle „Stop the Software Architecture Erosion“
                                           Page: 53
Team-UI UI-workbench (internal)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=90582




                                          Bernhard Merkle „Stop the Software Architecture Erosion“
                                                                  Page: 54




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

                                          Bernhard Merkle „Stop the Software Architecture Erosion“
                                                                  Page: 56
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


                                                 Bernhard Merkle „Stop the Software Architecture Erosion“
                                                                         Page: 57




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




                                                 Bernhard Merkle „Stop the Software Architecture Erosion“
                                                                         Page: 59
Discover Architecture:
 Call-Relationships
                Using…                      Used by…




  •Business Modules                       •Utility Modules, Infrastructure
  •Public, exported Methods               •Private, internal Methods

                              Bernhard Merkle „Stop the Software Architecture Erosion“
                                                      Page: 60




Pros/Cons Architecture Analysis Tools
 Wood/Trees !                 API Design ?
 Internal Structure !         Additional aspects ?
 Metrics !                    Metrics ?
 Internal Quality !
 Clones !                     Functional Redundancy?
 Multiple Languages
 Monitoring Changes
 Virtual Refactoring


                              Bernhard Merkle „Stop the Software Architecture Erosion“
                                                      Page: 61
Rating of Architecture
1315 classes in 229 packages all depend on each other !!!
classes.zip, rt.jar (BIG BALL OF … ;-)
JDK^H^Hdecay




                                     Bernhard Merkle „Stop the Software Architecture Erosion“
                                                             Page: 62




Still manageable ?




                                     Bernhard Merkle „Stop the Software Architecture Erosion“
                                                             Page: 63
Rating Eclipse Architecture

Erosion not really dramatic, but happened/s

  – large codebase,
    structured in plugins

  – OSGI helps a lot

  – API Police, Guidelines
    upcoming PDE tools



                               Bernhard Merkle „Stop the Software Architecture Erosion“
                                                       Page: 64




Rating Eclipse Architecture:
  – Violations
      • Upper layers
      • Internal access
  – Small amount of
      • AntiPatterns
  – Some amount of
      • CodeClones


  – OSGI is not enough

     People AND Tools !



                               Bernhard Merkle „Stop the Software Architecture Erosion“
                                                       Page: 65
URLs, References:
http://se-radio.net/podcast/2008-10/episode-115-
architecture-analysis

Thanks to:
  – Headways: Structure101:
      • Ian Sutton
      • Paul Hickey
  – hello2morrow: SotoArc
      • Thomas Schoen
      • Norman Wenzel
      • Heinrich Rust



                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 66




Pictures under CC license from flickr:
1191285966_d701fcb1c3_b_flickr_bluemeat.jpg
3425532267_bd74526b23_b_flickr_tiwo.jpg
1813471845_5a4be999dc_o_flickr_thatcanadiangrrl.jpg
2401122677_c25dea1233_b_flickr_EnglishGirlAbroad.jpg
501709581_f3729ceaeb_b_flickr.jpg




                                  Bernhard Merkle „Stop the Software Architecture Erosion“
                                                          Page: 67
Stop the Software
Architecture Erosion

Bernhard Merkle
Central Research & Development
Software-Engineering
SICK-AG Waldkirch
                   mailto: Bernhard.Merkle@gmail.com
                   Contact on linkedin.com or xing.com
                               Bernhard Merkle „Stop the Software Architecture Erosion“
                                                       Page: 68

More Related Content

Viewers also liked

Емейл-маркетинг в финансовой цепочке монетизации лида
Емейл-маркетинг в финансовой цепочке монетизации лидаЕмейл-маркетинг в финансовой цепочке монетизации лида
Емейл-маркетинг в финансовой цепочке монетизации лидаEMAILMATRIX
 
Brass and Cello
Brass and CelloBrass and Cello
Brass and Cellojohn925
 
Soudaljobdag20110326
Soudaljobdag20110326Soudaljobdag20110326
Soudaljobdag20110326JeroenLevens
 
слёт лидер
слёт лидерслёт лидер
слёт лидерElenaSam
 
NickKallen_DataArchitectureAtTwitterScale
NickKallen_DataArchitectureAtTwitterScaleNickKallen_DataArchitectureAtTwitterScale
NickKallen_DataArchitectureAtTwitterScaleKostas Mavridis
 
лосиный остров
лосиный островлосиный остров
лосиный островLilia Ayatskova
 
хогвардс 166
хогвардс 166хогвардс 166
хогвардс 166ElenaSam
 
Lesson plans primary practicum period
Lesson plans primary practicum periodLesson plans primary practicum period
Lesson plans primary practicum periodMarisa Knye
 
Korčulanska Liga - Čara
Korčulanska Liga - ČaraKorčulanska Liga - Čara
Korčulanska Liga - Čarakorculanskaliga
 
Доставляемость–2015! Новые условия успешного попадания в INBOX
Доставляемость–2015! Новые условия успешного попадания в INBOXДоставляемость–2015! Новые условия успешного попадания в INBOX
Доставляемость–2015! Новые условия успешного попадания в INBOXEMAILMATRIX
 
Cfi es
Cfi es Cfi es
Cfi es S&M
 
грипп план
грипп плангрипп план
грипп планElenaSam
 
к конференции
к конференциик конференции
к конференцииElenaSam
 

Viewers also liked (20)

Our favourites.
Our favourites.Our favourites.
Our favourites.
 
Емейл-маркетинг в финансовой цепочке монетизации лида
Емейл-маркетинг в финансовой цепочке монетизации лидаЕмейл-маркетинг в финансовой цепочке монетизации лида
Емейл-маркетинг в финансовой цепочке монетизации лида
 
Brass and Cello
Brass and CelloBrass and Cello
Brass and Cello
 
Diatrabajo
DiatrabajoDiatrabajo
Diatrabajo
 
Presentation
PresentationPresentation
Presentation
 
Designs
DesignsDesigns
Designs
 
Soudaljobdag20110326
Soudaljobdag20110326Soudaljobdag20110326
Soudaljobdag20110326
 
слёт лидер
слёт лидерслёт лидер
слёт лидер
 
Fotosondag
FotosondagFotosondag
Fotosondag
 
NickKallen_DataArchitectureAtTwitterScale
NickKallen_DataArchitectureAtTwitterScaleNickKallen_DataArchitectureAtTwitterScale
NickKallen_DataArchitectureAtTwitterScale
 
лосиный остров
лосиный островлосиный остров
лосиный остров
 
хогвардс 166
хогвардс 166хогвардс 166
хогвардс 166
 
Media doc
Media docMedia doc
Media doc
 
Lesson plans primary practicum period
Lesson plans primary practicum periodLesson plans primary practicum period
Lesson plans primary practicum period
 
Korčulanska Liga - Čara
Korčulanska Liga - ČaraKorčulanska Liga - Čara
Korčulanska Liga - Čara
 
Доставляемость–2015! Новые условия успешного попадания в INBOX
Доставляемость–2015! Новые условия успешного попадания в INBOXДоставляемость–2015! Новые условия успешного попадания в INBOX
Доставляемость–2015! Новые условия успешного попадания в INBOX
 
Cfi es
Cfi es Cfi es
Cfi es
 
9 мая
9 мая9 мая
9 мая
 
грипп план
грипп плангрипп план
грипп план
 
к конференции
к конференциик конференции
к конференции
 

Similar to BernhardMerkle_StopTheArchitectureErosion

Software Architecture Erosion and Modernization
Software Architecture Erosion and ModernizationSoftware Architecture Erosion and Modernization
Software Architecture Erosion and Modernizationbmerkle
 
Hatii seminar 2014 - The emerging needs and the long standing issues curating...
Hatii seminar 2014 - The emerging needs and the long standing issues curating...Hatii seminar 2014 - The emerging needs and the long standing issues curating...
Hatii seminar 2014 - The emerging needs and the long standing issues curating...Ruggero Lancia
 
Introdução à Arquitetura de Software
Introdução à Arquitetura de SoftwareIntrodução à Arquitetura de Software
Introdução à Arquitetura de SoftwareRodrigo Veiga
 
HCI 2015 (3/10) Design Methodologies
HCI 2015 (3/10) Design MethodologiesHCI 2015 (3/10) Design Methodologies
HCI 2015 (3/10) Design MethodologiesSabin Buraga
 
Hci03 designmethodologies-150910103121-lva1-app6892
Hci03 designmethodologies-150910103121-lva1-app6892Hci03 designmethodologies-150910103121-lva1-app6892
Hci03 designmethodologies-150910103121-lva1-app6892Ștefan Gordîn
 
We're Agile, we don't do documentation - Birgitta Boeckeler - Codemotion Amst...
We're Agile, we don't do documentation - Birgitta Boeckeler - Codemotion Amst...We're Agile, we don't do documentation - Birgitta Boeckeler - Codemotion Amst...
We're Agile, we don't do documentation - Birgitta Boeckeler - Codemotion Amst...Codemotion
 
Design & Technology
Design & TechnologyDesign & Technology
Design & TechnologyLuca Galli
 
What a Good Software Architect Does
What a Good Software Architect DoesWhat a Good Software Architect Does
What a Good Software Architect DoesEberhard Wolff
 
HCI 2014 (3 of 10): Design Models and Methodologies
HCI 2014 (3 of 10): Design Models and MethodologiesHCI 2014 (3 of 10): Design Models and Methodologies
HCI 2014 (3 of 10): Design Models and MethodologiesSabin Buraga
 
Computer education presentation - ARCH 383
Computer education presentation - ARCH 383Computer education presentation - ARCH 383
Computer education presentation - ARCH 383LipikaPandey
 
SE2_Lec 19_Design Principles and Design Patterns
SE2_Lec 19_Design Principles and Design PatternsSE2_Lec 19_Design Principles and Design Patterns
SE2_Lec 19_Design Principles and Design PatternsAmr E. Mohamed
 
Keynote: WDBE 2018 in Helsinki - Top 8 Insights on Tech, Innovation, & Disru...
Keynote:  WDBE 2018 in Helsinki - Top 8 Insights on Tech, Innovation, & Disru...Keynote:  WDBE 2018 in Helsinki - Top 8 Insights on Tech, Innovation, & Disru...
Keynote: WDBE 2018 in Helsinki - Top 8 Insights on Tech, Innovation, & Disru...Brett Young
 
2017 jan-19 meetup-unikernels
2017 jan-19 meetup-unikernels2017 jan-19 meetup-unikernels
2017 jan-19 meetup-unikernelsMichael Bright
 
SE2018_Lec 18_ Design Principles and Design Patterns
SE2018_Lec 18_ Design Principles and Design PatternsSE2018_Lec 18_ Design Principles and Design Patterns
SE2018_Lec 18_ Design Principles and Design PatternsAmr E. Mohamed
 
Advance technology’s
Advance technology’sAdvance technology’s
Advance technology’sakt81198
 

Similar to BernhardMerkle_StopTheArchitectureErosion (20)

Software Architecture Erosion and Modernization
Software Architecture Erosion and ModernizationSoftware Architecture Erosion and Modernization
Software Architecture Erosion and Modernization
 
E engineering
E engineeringE engineering
E engineering
 
Hatii seminar 2014 - The emerging needs and the long standing issues curating...
Hatii seminar 2014 - The emerging needs and the long standing issues curating...Hatii seminar 2014 - The emerging needs and the long standing issues curating...
Hatii seminar 2014 - The emerging needs and the long standing issues curating...
 
Introdução à Arquitetura de Software
Introdução à Arquitetura de SoftwareIntrodução à Arquitetura de Software
Introdução à Arquitetura de Software
 
Explicit architecture
Explicit architectureExplicit architecture
Explicit architecture
 
HCI 2015 (3/10) Design Methodologies
HCI 2015 (3/10) Design MethodologiesHCI 2015 (3/10) Design Methodologies
HCI 2015 (3/10) Design Methodologies
 
Hci03 designmethodologies-150910103121-lva1-app6892
Hci03 designmethodologies-150910103121-lva1-app6892Hci03 designmethodologies-150910103121-lva1-app6892
Hci03 designmethodologies-150910103121-lva1-app6892
 
SS2
SS2SS2
SS2
 
We're Agile, we don't do documentation - Birgitta Boeckeler - Codemotion Amst...
We're Agile, we don't do documentation - Birgitta Boeckeler - Codemotion Amst...We're Agile, we don't do documentation - Birgitta Boeckeler - Codemotion Amst...
We're Agile, we don't do documentation - Birgitta Boeckeler - Codemotion Amst...
 
Design & Technology
Design & TechnologyDesign & Technology
Design & Technology
 
What a Good Software Architect Does
What a Good Software Architect DoesWhat a Good Software Architect Does
What a Good Software Architect Does
 
HCI 2014 (3 of 10): Design Models and Methodologies
HCI 2014 (3 of 10): Design Models and MethodologiesHCI 2014 (3 of 10): Design Models and Methodologies
HCI 2014 (3 of 10): Design Models and Methodologies
 
Computer education presentation - ARCH 383
Computer education presentation - ARCH 383Computer education presentation - ARCH 383
Computer education presentation - ARCH 383
 
SE2_Lec 19_Design Principles and Design Patterns
SE2_Lec 19_Design Principles and Design PatternsSE2_Lec 19_Design Principles and Design Patterns
SE2_Lec 19_Design Principles and Design Patterns
 
Keynote: WDBE 2018 in Helsinki - Top 8 Insights on Tech, Innovation, & Disru...
Keynote:  WDBE 2018 in Helsinki - Top 8 Insights on Tech, Innovation, & Disru...Keynote:  WDBE 2018 in Helsinki - Top 8 Insights on Tech, Innovation, & Disru...
Keynote: WDBE 2018 in Helsinki - Top 8 Insights on Tech, Innovation, & Disru...
 
2017 jan-19 meetup-unikernels
2017 jan-19 meetup-unikernels2017 jan-19 meetup-unikernels
2017 jan-19 meetup-unikernels
 
SE2018_Lec 18_ Design Principles and Design Patterns
SE2018_Lec 18_ Design Principles and Design PatternsSE2018_Lec 18_ Design Principles and Design Patterns
SE2018_Lec 18_ Design Principles and Design Patterns
 
Advance technology’s
Advance technology’sAdvance technology’s
Advance technology’s
 
Product Development Brochure
Product Development BrochureProduct Development Brochure
Product Development Brochure
 
Software Design
Software DesignSoftware Design
Software Design
 

More from Kostas Mavridis

GlennVanderburg_CraftAndSoftwareEngineering
GlennVanderburg_CraftAndSoftwareEngineeringGlennVanderburg_CraftAndSoftwareEngineering
GlennVanderburg_CraftAndSoftwareEngineeringKostas Mavridis
 
RoyOsherove_TeamLeadershipInTheAgeOfAgile
RoyOsherove_TeamLeadershipInTheAgeOfAgileRoyOsherove_TeamLeadershipInTheAgeOfAgile
RoyOsherove_TeamLeadershipInTheAgeOfAgileKostas Mavridis
 
PatrickKua_TheBeginnersMind
PatrickKua_TheBeginnersMindPatrickKua_TheBeginnersMind
PatrickKua_TheBeginnersMindKostas Mavridis
 
DanNorth_FromMonthsToMinutesUppingTheStakes
DanNorth_FromMonthsToMinutesUppingTheStakesDanNorth_FromMonthsToMinutesUppingTheStakes
DanNorth_FromMonthsToMinutesUppingTheStakesKostas Mavridis
 
KevlinHenney_PuttingThereIntoArchitecture
KevlinHenney_PuttingThereIntoArchitectureKevlinHenney_PuttingThereIntoArchitecture
KevlinHenney_PuttingThereIntoArchitectureKostas Mavridis
 
EoinWoods_WhereDidMyArchitectureGoPreservingSoftwareArchitectureInItsImplemen...
EoinWoods_WhereDidMyArchitectureGoPreservingSoftwareArchitectureInItsImplemen...EoinWoods_WhereDidMyArchitectureGoPreservingSoftwareArchitectureInItsImplemen...
EoinWoods_WhereDidMyArchitectureGoPreservingSoftwareArchitectureInItsImplemen...Kostas Mavridis
 
MarkLittle_EnterpriseMiddlewareForThe21stCentury
MarkLittle_EnterpriseMiddlewareForThe21stCenturyMarkLittle_EnterpriseMiddlewareForThe21stCentury
MarkLittle_EnterpriseMiddlewareForThe21stCenturyKostas Mavridis
 
fuser interface-development-using-jquery
fuser interface-development-using-jqueryfuser interface-development-using-jquery
fuser interface-development-using-jqueryKostas Mavridis
 
SiddharthAnand_NetflixsCloudDataArchitecture
SiddharthAnand_NetflixsCloudDataArchitectureSiddharthAnand_NetflixsCloudDataArchitecture
SiddharthAnand_NetflixsCloudDataArchitectureKostas Mavridis
 

More from Kostas Mavridis (9)

GlennVanderburg_CraftAndSoftwareEngineering
GlennVanderburg_CraftAndSoftwareEngineeringGlennVanderburg_CraftAndSoftwareEngineering
GlennVanderburg_CraftAndSoftwareEngineering
 
RoyOsherove_TeamLeadershipInTheAgeOfAgile
RoyOsherove_TeamLeadershipInTheAgeOfAgileRoyOsherove_TeamLeadershipInTheAgeOfAgile
RoyOsherove_TeamLeadershipInTheAgeOfAgile
 
PatrickKua_TheBeginnersMind
PatrickKua_TheBeginnersMindPatrickKua_TheBeginnersMind
PatrickKua_TheBeginnersMind
 
DanNorth_FromMonthsToMinutesUppingTheStakes
DanNorth_FromMonthsToMinutesUppingTheStakesDanNorth_FromMonthsToMinutesUppingTheStakes
DanNorth_FromMonthsToMinutesUppingTheStakes
 
KevlinHenney_PuttingThereIntoArchitecture
KevlinHenney_PuttingThereIntoArchitectureKevlinHenney_PuttingThereIntoArchitecture
KevlinHenney_PuttingThereIntoArchitecture
 
EoinWoods_WhereDidMyArchitectureGoPreservingSoftwareArchitectureInItsImplemen...
EoinWoods_WhereDidMyArchitectureGoPreservingSoftwareArchitectureInItsImplemen...EoinWoods_WhereDidMyArchitectureGoPreservingSoftwareArchitectureInItsImplemen...
EoinWoods_WhereDidMyArchitectureGoPreservingSoftwareArchitectureInItsImplemen...
 
MarkLittle_EnterpriseMiddlewareForThe21stCentury
MarkLittle_EnterpriseMiddlewareForThe21stCenturyMarkLittle_EnterpriseMiddlewareForThe21stCentury
MarkLittle_EnterpriseMiddlewareForThe21stCentury
 
fuser interface-development-using-jquery
fuser interface-development-using-jqueryfuser interface-development-using-jquery
fuser interface-development-using-jquery
 
SiddharthAnand_NetflixsCloudDataArchitecture
SiddharthAnand_NetflixsCloudDataArchitectureSiddharthAnand_NetflixsCloudDataArchitecture
SiddharthAnand_NetflixsCloudDataArchitecture
 

BernhardMerkle_StopTheArchitectureErosion

  • 1. Stop the Software Architecture Erosion Bernhard Merkle Central Research & Development Software-Engineering SICK-AG Waldkirch mailto: Bernhard.Merkle@gmail.com Contact on linkedin.com or xing.com Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 1 Disclaimer I am a Guy We will be X-raying Software Do not shoot me, this is a contribution,not criticism ! Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 2
  • 2. Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 3 Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 4
  • 3. Google: Street View Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 6 Introduction / Overview Levels of Static Analysis – Code, Design, Architectural – Examples Architectural Analysis – Use Cases – Tool Support – Examples – Pros/Cons Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 7
  • 4. Levels of Static Analysis: Micro-Level – Code – =, ==, { } Macro-Level – Class-Design, API-Design – by reference, Exception-Handling, equals/hashCode/op= Architecture-Level: – Layers, Subsystems, Compoments, Interfaces – Coupling, Dependency, etc… Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 8 Micro-Level: MISRA-C 2004 Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 9
  • 5. Macro-Level: Design+Coding Guidelines Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 10 Samples for Effective Rules C++ – Prefer const and inline to #define – Use same form in corresponding uses of new and delete – Declare cctor and assignment op for classes with dyn memory – Strive for class interfaces that a minimal and complete – Choose carefully betw. fuction overloading / parameter default Java – Eliminate obsolete object references – Always override hashCode when you override equals – Minimize mutability – Favor composistion over inheritance – Do not use raw types in new code Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 11
  • 6. Tool Example Java: findbugs Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 12 Software, Architecture, Erosion Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 13
  • 7. 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. Kruchten: captured in – Software Architecture Document – Software Design Guidelines Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 14 Erosion always happens – Prototypes become products – Hacks/Workarounds – Lack of understanding “should architecture” – Time pressure Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 15
  • 8. 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” Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 16 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 Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 17
  • 9. X-raying Software… Is there a architecture ? Is there a erosion ? Do AA-Tool work well ? Do codelevel lints care about architecture ? Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 18 Findbugs: the first years 0.7.2 0.8.6 (03/2004) (10/2004) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 19
  • 10. Findbugs: the first years 0.8.6 0.8.7 (10/2004) (05/2005) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 20 Findbugs 0.8.7: Architectural Analysis Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 21
  • 11. Tangle increase… 0.8.8 1.0.0 (05/2005) (06/2006) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 22 Tangle increase… 1.3.0 Bernhard Merkle „Stop the Software Architecture Erosion“ (07/2007) Page: 23
  • 12. ONE BIG Tangle… 1.3.8 (03/2009) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 24 Still managable ? Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 25
  • 13. Anti-Pattern: Findelkind (foundling) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 26 Modeling Subsystems: Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 28
  • 14. Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 29 Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 30
  • 15. Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 31 Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 32
  • 16. Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 33 Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 34
  • 17. Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 35 Tools for Architecture-Analysis – Sotograph SonarJ – Bauhaus Lattix – Structure101 Klocwork, Coverity – http://code.google.com/p/architecturerules/ – ODASA, CodeCrawler, Codecity, SeeSoft, XRadar, XDepend, SonarSource, Kalistick, Sqoring, … http://se-radio.net/ episode-115-architecture-analysis Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 37
  • 18. Basic Approaches – Your makesystem… – makedepend, jdepend – Eclipse (Java Build Path) – OSGI (Dependencies) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 38 Basic Approaches PDE Dependency Visualization Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 39
  • 19. Missing in basic approaches: Architecture Analysis (Deviation) Drill-Down + Aggregation Displaying results Monitoring changes, trends Rating of Architecture Requirements for Architectural Analysis Tools Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 40 Architecture Analysis (deviation) Requirements Architecture- Should- Design Architecture Comparison “Diff-” Actions Architecture Is- •Violations Extraction •Conformance Architecture Existing Code Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 41
  • 20. Drill-Down + Aggregation: Component System Package Class Src-Line Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 42 Displaying results: Graphical and/or numerical Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 43
  • 21. Monitoring changes, trends (QA) New artefacts – Interface, Subsystem, Package, File, Class, Operation etc. – Dependencies – Architecture violations Early, betimes correction of violations Monitoring – Trendreports – “outsourcing” projects Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 44 Rating of Architecture NO Rating of external Requirements (Fullfillment) Internal Quality: – Cycles – Coupling of Modules – Stability of API – Anti-Patterns, Bad Smells – Reuse/Extract system parts Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 45
  • 22. Eclipse: Architectural Analysis – JDT – CDT Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 46 Eclipse Architecture Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 47
  • 23. Eclipse Architecture Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 48 Eclipse Architecture Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 49
  • 24. E3.4: Plattf:Ant JDT:* Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 50 E3.4: Plattf:Ant JDT:UI Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 51
  • 25. Plattform: CVS Workb (internal) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 52 Plattform: CVS Workb (internal) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 53
  • 26. Team-UI UI-workbench (internal) https://bugs.eclipse.org/bugs/show_bug.cgi?id=90582 Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 54 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 Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 56
  • 27. 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 Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 57 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 Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 59
  • 28. Discover Architecture: Call-Relationships Using… Used by… •Business Modules •Utility Modules, Infrastructure •Public, exported Methods •Private, internal Methods Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 60 Pros/Cons Architecture Analysis Tools Wood/Trees ! API Design ? Internal Structure ! Additional aspects ? Metrics ! Metrics ? Internal Quality ! Clones ! Functional Redundancy? Multiple Languages Monitoring Changes Virtual Refactoring Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 61
  • 29. Rating of Architecture 1315 classes in 229 packages all depend on each other !!! classes.zip, rt.jar (BIG BALL OF … ;-) JDK^H^Hdecay Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 62 Still manageable ? Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 63
  • 30. Rating Eclipse Architecture Erosion not really dramatic, but happened/s – large codebase, structured in plugins – OSGI helps a lot – API Police, Guidelines upcoming PDE tools Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 64 Rating Eclipse Architecture: – Violations • Upper layers • Internal access – Small amount of • AntiPatterns – Some amount of • CodeClones – OSGI is not enough People AND Tools ! Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 65
  • 31. URLs, References: http://se-radio.net/podcast/2008-10/episode-115- architecture-analysis Thanks to: – Headways: Structure101: • Ian Sutton • Paul Hickey – hello2morrow: SotoArc • Thomas Schoen • Norman Wenzel • Heinrich Rust Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 66 Pictures under CC license from flickr: 1191285966_d701fcb1c3_b_flickr_bluemeat.jpg 3425532267_bd74526b23_b_flickr_tiwo.jpg 1813471845_5a4be999dc_o_flickr_thatcanadiangrrl.jpg 2401122677_c25dea1233_b_flickr_EnglishGirlAbroad.jpg 501709581_f3729ceaeb_b_flickr.jpg Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 67
  • 32. Stop the Software Architecture Erosion Bernhard Merkle Central Research & Development Software-Engineering SICK-AG Waldkirch mailto: Bernhard.Merkle@gmail.com Contact on linkedin.com or xing.com Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 68