• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
BernhardMerkle_StopTheArchitectureErosion
 

BernhardMerkle_StopTheArchitectureErosion

on

  • 531 views

 

Statistics

Views

Total Views
531
Views on SlideShare
531
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    BernhardMerkle_StopTheArchitectureErosion BernhardMerkle_StopTheArchitectureErosion Document Transcript

    • Stop the SoftwareArchitecture ErosionBernhard MerkleCentral Research & DevelopmentSoftware-EngineeringSICK-AG Waldkirch mailto: Bernhard.Merkle@gmail.com Contact on linkedin.com or xing.com Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 1DisclaimerI am a GuyWe will be X-raying SoftwareDo 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: 3Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 4
    • Google: Street View Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 6Introduction / OverviewLevels of Static Analysis – Code, Design, Architectural – ExamplesArchitectural 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: 8Micro-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: 10Samples for Effective RulesC++ – 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 defaultJava – 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: 12Software, Architecture, Erosion Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 13
    • Software-Architecture: DefinitionsIEEE 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: 14Erosion 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 tomaintain this purity of design through theinitial development and into the first release.More often something goes wrong.The software starts to rot like apiece of bad meat”.Uncle Bob: “Agile Software Development” Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 16Architectural ErosionWhy 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: 18Findbugs: 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: 20Findbugs 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: 22Tangle 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: 24Still managable ? Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 25
    • Anti-Pattern: Findelkind (foundling) Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 26Modeling Subsystems: Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 28
    • Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 29Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 30
    • Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 31Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 32
    • Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 33Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 34
    • Fixing Architectural Violations Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 35Tools 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: 38Basic ApproachesPDE Dependency Visualization Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 39
    • Missing in basic approaches:Architecture Analysis (Deviation)Drill-Down + AggregationDisplaying resultsMonitoring changes, trendsRating of Architecture Requirements for Architectural Analysis Tools Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 40Architecture 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: 42Displaying 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 violationsEarly, betimes correction of violationsMonitoring – Trendreports – “outsourcing” projects Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 44Rating of ArchitectureNO 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: 46Eclipse Architecture Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 47
    • Eclipse Architecture Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 48Eclipse Architecture Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 49
    • E3.4: Plattf:Ant JDT:* Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 50E3.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: 52Plattform: 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: 54Dependent 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 JDKDependent Baseclass: 1 16Multiple Interface Inher. 4 18Abstractable Methods 80 60Abstractable Attributes 45 170Unused Classes 50 150Unused Methods 950 2500Unused Attributes 30 20 Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 57Code 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: 60Pros/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 Architecture1315 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: 62Still manageable ? Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 63
    • Rating Eclipse ArchitectureErosion 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: 64Rating 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-analysisThanks to: – Headways: Structure101: • Ian Sutton • Paul Hickey – hello2morrow: SotoArc • Thomas Schoen • Norman Wenzel • Heinrich Rust Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 66Pictures under CC license from flickr:1191285966_d701fcb1c3_b_flickr_bluemeat.jpg3425532267_bd74526b23_b_flickr_tiwo.jpg1813471845_5a4be999dc_o_flickr_thatcanadiangrrl.jpg2401122677_c25dea1233_b_flickr_EnglishGirlAbroad.jpg501709581_f3729ceaeb_b_flickr.jpg Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 67
    • Stop the SoftwareArchitecture ErosionBernhard MerkleCentral Research & DevelopmentSoftware-EngineeringSICK-AG Waldkirch mailto: Bernhard.Merkle@gmail.com Contact on linkedin.com or xing.com Bernhard Merkle „Stop the Software Architecture Erosion“ Page: 68