Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Reducing technical debt in php

974 views

Published on

Almost every software system is created in difficult conditions and thus from the beginning burdened with quality problems. The most common difficulties are: deadlines forcing us to program hacks; divergent development skills in the team resulting in code of different quality; or old code, that is clumsy, tangled and without unit tests, putting a spoke in our wheel. All these bits and pieces of bad code will raise development costs in the futures that is why they are called technical debt.
In this talk you will see, which principles you should apply to your source code to prevent technical debt growing unrestricted. With the proper tool support refactorings for bad code can quickly be found and eliminated. I will present to you the tool Sotograph which allows us to inspect PHP code on a structural level and try out the effects of refactorings.

Published in: Software
  • Be the first to comment

Reducing technical debt in php

  1. 1. WPS - Workplace Solutions GmbH //// Hans-Henny-Jahnn-Weg 29 //// 22085 HAMBURG Reducing technical debts in PHP Dr. Carola Lilienthal Carola.Lilienthal@wps.de, @cairolali www.wps.de Wolfgang Strunk Wolfgang.Strunk@sixt.com Sixt Leasing AG
  2. 2. 2 Mobility services provider with highly attractive and customer centric product offering Mid-sized and large corporates Private and business customersCustomer focus Full Service Leasing Fleet Management Leasing / Vario Financing + Services Key products ~50k(2) ~31k ~16k(2)# of contracts 2014 Total: ~97k(1) Value proposition One-Stop-Online-Shop for >30 OEMs • Price • Transparency • Convenience OEM independent optimization of Total Cost of Ownership (TCO) • Know-how • Buying power • Outsourcing Sixt Leasing AG (1) Each Sixt Leasing vehicle is linked to one contract. However, not all contracts refer to a Sixt Leasing vehicle (e.g. Fleet Management). Hence, the total number of vehicles (~54k in 2014) is typically lower than the total number of contracts (2) The contracts include new contracts (order book) for which the leased vehicle has not yet been delivered to the customer and pure service contracts Contract CAGR 2012-2014 2% 111% 54% Fleet Leasing Fleet Management Online Retail
  3. 3. 26.04.2016 //// Seite 3WPS - Workplace Solutions GmbH Software Architecture Requirement Engineering Control Room and Interaction Software Development Business software, for joyfull work! WPS – Workplace Solutions GmbH
  4. 4. 4 Proprietary data and software development across the value chain as key competitive advantage Quote Procurement Contract Length ReturnProcess Level 1 Process Level 2 Tender & Implementation Vehicle Order Vehicle Logistics Vehicle Handover Final Invoices Quotes Vehicle Return Invoices Vehicle Disposal Customer Service User Service Order configuration Vehicle transport Delivery station Registration Fuel invoicing Lease- & full service invoiceParking ticket management Driver license check Contract adjustment Early return Order management Handover to the station Validity check Customer/ User change Delivery date coordination Order changes Reference calculation Cancellation Incoming invoices (Check & enter, debit) Pricing Quotation negotiations Breakdown service Return to retailer Self-marketingAppraisalHandover to the retailer Delivery Collective invoicing Return logistics Return damage invoice Final invoicing Vehicle invoices Fuel card service Contract changes Maintenance& attrition Damage processing Tire change & replacement Residual value factors Order checks Work shop routing Preliminary rental vehicle Implementation Damage invoicingActivation of contract Return letter Leasing request & contract check Web portal & parameter keeping Reports & analyses (Customer demands) Resignation from contract Cancellation by customerPurchasing Software Modules Customer facing Internal Source: Company information
  5. 5. 26.04.2016 //// Seite 5WPS - Workplace Solutions GmbH
  6. 6. 26.04.2016 //// Seite 6WPS - Workplace Solutions GmbH Technical Debts ≠ Long-living
  7. 7. 26.04.2016 //// Seite 7WPS - Workplace Solutions GmbH Measures against technical debts Regular architecture discussions Qualification for developers and architects Automated tests and continuously refactoring Regular architecture analysis and renovation
  8. 8. 26.04.2016 //// Seite 8WPS - Workplace Solutions GmbH Architektur analysis: What is this?
  9. 9. 26.04.2016 //// Seite 9WPS - Workplace Solutions GmbH Architecture renovation: how do we do that? Refactorings Analysis + Discussion Determination f measures Implemented Architecture Reconstruction Source- Code Planned Architecture Architecture Alternatives Violations
  10. 10. 26.04.2016 //// Seite 10WPS - Workplace Solutions GmbH Sotograph Plattform for Architecture Renovation Commercial product since 2002 Many customers, e.g. Siemens, Lufthansa, HHLA, Kühne&Nagel, Daimler, Infineon Analyses Java, C++, C#, ABAP, PHP and offers an open interface for other parsers www.hello2morrow.de
  11. 11. 26.04.2016 //// Seite 11WPS - Workplace Solutions GmbH Components of sotograph Java Parser Soto Reposi- tory C# Parser Code- Checker C/C++ Parser Sotoweb Sotoarc Sotograph Sotoreport ABAP Parser PHP Parser
  12. 12. 26.04.2016 //// Seite 12WPS - Workplace Solutions GmbH Two goals for long-livingness 1) Maintainability • Finding bugs quickly • Make quick changes • Understand and analyses quickly • Reduction of complexity 2) Flexibility • Variants of business processes • Changing requirements • Service orientation and scalability • Modularity (Baukastenprinzip)
  13. 13. 26.04.2016 //// Seite 13WPS - Workplace Solutions GmbH 70% 20% 10% Code verstehen Problem lösen Code schreiben How do we spend our time when programming? Code comprehension Problem solving Writing code
  14. 14. @ www.tomfreudenthal.de
  15. 15. 26.04.2016 //// Seite 15WPS - Workplace Solutions GmbH Well-formed complex structures = saving time! Cognitive Mechanisms HierarchiesChunking Schemata
  16. 16. 26.04.2016 //// Seite 16WPS - Workplace Solutions GmbH
  17. 17. @ naturfotographen-forum.de Marion Meixner
  18. 18. Zusammenhängende Einheiten @ www.fotocommunity.de Jan Schwensweger
  19. 19. Well-formed complex structures = saving time! Cognitive Mechanisms HierarchiesChunking Schemata Well-formed architecture Modularity
  20. 20. 26.04.2016 //// Seite 20WPS - Workplace Solutions GmbH Modularity High Cohesion and lose Coupling Responsibility Driven Design Separation of Concerns Single Responsibility Principle
  21. 21. 26.04.2016 //// Seite 21WPS - Workplace Solutions GmbH Well-formed complex structures = saving time! Cognitive Mechanisms HierarchiesChunking Schemata Well-formed architecture Modularity
  22. 22. 26.04.2016 //// Seite 22WPS - Workplace Solutions GmbH Hierarchies
  23. 23. Well-formed complex structures = saving time! Cognitive Mechanisms HierarchiesChunking Schemata Well-formed architecture Modularity Hierarchical Layerng
  24. 24. 26.04.2016 //// Seite 25WPS - Workplace Solutions GmbH
  25. 25. 26.04.2016 //// Seite 26WPS - Workplace Solutions GmbH
  26. 26. 26.04.2016 //// Seite 3WPS - Workplace Solutions GmbH Software Architecture Requirement Engineering Control Room and Interaction Software Development Business software, for joyfull work! WPS – Workplace Solutions GmbH
  27. 27. 26.04.2016 //// Seite 28WPS - Workplace Solutions GmbH
  28. 28. 26.04.2016 //// Seite 29WPS - Workplace Solutions GmbH Well-formed complex structures = saving time! Cognitive Mechanisms HierarchiesChunking Schemata Well-formed architecture Modularity Hierarchical Layerng Pattern Consistency
  29. 29. 30 Hierarchies on the architectural level: layers and modules TechnicalLayering Domain Layering Presentation BP & Activity Domain Data
  30. 30. 26.04.2016 //// Seite 31WPS - Workplace Solutions GmbH Two dimensions in on architecture Technical layering Domain layering Tree violations that are easy to resolve Difficult violations One component cuasing several problems One component causing a problem
  31. 31. 26.04.2016 //// Seite 32WPS - Workplace Solutions GmbH Domain layering is missing Technical layering No domain layering Some violations of the technical layering Allmost all domain components need each other
  32. 32. 26.04.2016 //// Seite 33WPS - Workplace Solutions GmbH Hierarchies on class level Influences: maintainability reusability testability modularisation Pattern conformity
  33. 33. 26.04.2016 //// Seite 38WPS - Workplace Solutions GmbH 119 classes from 4 components + 28 other classes
  34. 34. 26.04.2016 //// Seite 39WPS - Workplace Solutions GmbH 327 classes from 8 components That all need each other
  35. 35. 26.04.2016 //// Seite 40WPS - Workplace Solutions GmbH Well-formed complex structures = saving time! Cognitive Mechanisms HierarchiesChunking Schemata Well-formed architecture Modularity Hierarchical Layerng Pattern Consistency
  36. 36. 26.04.2016 //// Seite 41WPS - Workplace Solutions GmbH Uneven Modules One big Monolith with several little satellites 950.860 LOC 84.808 LOC
  37. 37. 26.04.2016 //// Seite 42WPS - Workplace Solutions GmbH Uneven Modules 9 Components = 17 Subsystems
  38. 38. 26.04.2016 //// Seite 47WPS - Workplace Solutions GmbH Well-formed complex structures = saving time! Cognitive Mechanisms HierarchiesChunking Schemata Well-formed architecture Modularity Hierarchical Layerng Pattern Consistency
  39. 39. 26.04.2016 //// Seite 48WPS - Workplace Solutions GmbH Pattern on the architectural level: four modules Module green Module purple Module orange Module blue
  40. 40. 26.04.2016 //// Seite 49WPS - Workplace Solutions GmbH Pattern conformity: Bad example
  41. 41. 26.04.2016 //// Seite 50WPS - Workplace Solutions GmbH Pattern conformity: Good example
  42. 42. 26.04.2016 //// Seite 51WPS - Workplace Solutions GmbH Pattern on class level: design pattern and pattern languages User Interface Domain Application Domain ModuleDomain Module Window GUI Model View C o n t r o l ValueObject Service BusinessObject SchichtungdurchMuster
  43. 43. 26.04.2016 //// Seite 52WPS - Workplace Solutions GmbH Pattern conformity: Good example ☺ 90% of the source code can be assigned to pattern ☺ 0,1% violations between the pattern
  44. 44. 26.04.2016 //// Seite 53WPS - Workplace Solutions GmbH Pattern conformity: the discovery of a pattern language ☺ 80% of the source code can be assigned to 23 pattern ☺ 4% violations between the pattern
  45. 45. 26.04.2016 //// Seite 54WPS - Workplace Solutions GmbH Well-formed complex structures = saving time! Cognitive Mechanisms HierarchiesChunking Schemata Modularity Hierarchical Layerng Pattern Consistency Consistent and integrated pattern Use a pattern language No cycles neither on architectural level nor on class level responsibility coupling size interfaces
  46. 46. 26.04.2016 //// Seite 55WPS - Workplace Solutions GmbH Process of analyses and renovation of architecture
  47. 47. Thank you for your attention! www.langlebige-softwarearchitektur.de Dr. Carola Lilienthal Mitglied der Geschäftsleitung cl@wps.de www.wps.de +49 170 184 77 11 Diplom-Informatikerin @cairolali

×