Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Release your refactoring superpower

Legacy applications are full of supervillains scheming to halt modernizing efforts. But deprecated versions of PHP, frameworks, libraries, and more drive a never-ending battle to keep applications up to date, supported, and secure. This can leave any would be superhero seeking how, what, when, and why.

Join me as we consider real-life case studies of modernizations from various large legacy applications, and will share common evil-doers, ways to foil their plans, and how to eliminate vulnerabilities in the first place. See how to make refactoring your super power!

  • Soyez le premier à commenter

Release your refactoring superpower

  1. 1. Release Your Refactoring Superpower By: Adam Culp Twitter: @adamculp
  2. 2. 2 Release Your Refactoring Superpower ● About me – OSS Contributor – PHP Certified – Zend Certification Advisory Board – PHP-Fig voting member (IBM i Toolkit) – Consultant at Zend Technologies – Organizer SoFloPHP (South Florida) – Organizer SunshinePHP (Miami) – Long distance (ultra) runner – Photography Enthusiast – Judo Black Belt Instructor
  3. 3. 3 Release Your Refactoring Superpower ● About me – OSS Contributor – PHP Certified – Zend Certification Advisory Board – PHP-Fig voting member (IBM i Toolkit) – Consultant at Zend Technologies – Organizer SoFloPHP (South Florida) – Organizer SunshinePHP (Miami) – Long distance (ultra) runner – Photography Enthusiast – Judo Black Belt Instructor I am the PHP Ninja!!!
  4. 4. 4 Release Your Refactoring Superpower ● Fan of iteration – Pretty much everything requires iteration to do well: ● Long distance running ● Judo ● Development ● Evading project managers ● Refactoring!
  5. 5. 5 Release Your Refactoring Superpower ● What Can I Do? – Estimation
  6. 6. 6 Release Your Refactoring Superpower ● What Can I Do? – Estimation – Coding (actual refactoring)
  7. 7. 7 Release Your Refactoring Superpower ● What Can I Do? – Estimation – Coding (actual refactoring) – Algorithms
  8. 8. 8 Release Your Refactoring Superpower ● What Can I Do? – Estimation – Coding (actual refactoring) – Algorithms – Convince Business
  9. 9. 9 Release Your Refactoring Superpower ● What Can I Do? – Estimation – Coding (actual refactoring) – Algorithms – Convince Business – Silver Bullet
  10. 10. 10 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.)
  11. 11. 11 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries
  12. 12. 12 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language
  13. 13. 13 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language ● New DB
  14. 14. 14 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language ● New DB – Why? ● Desire
  15. 15. 15 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language ● New DB – Why? ● Desire ● Bored
  16. 16. 16 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language ● New DB – Why? ● Desire ● Bored ● Perceived need
  17. 17. 17 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language ● New DB – Why? ● Desire ● Bored ● Perceived need ● To gain something – Speed – Functionality
  18. 18. 18 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language ● New DB – Why? ● Desire ● Bored ● Perceived need ● To gain something – Speed – Functionality – When? ● Next 6 months, year(s), decade
  19. 19. 19 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language ● New DB – Why? ● Desire ● Bored ● Perceived need ● To gain something – Speed – Functionality – When? ● Next 6 months, year(s), decade ● Realistic time
  20. 20. 20 Release Your Refactoring Superpower ● Modernization? – How? ● New infrastructure (servers, technology, etc.) ● New frameworks or libraries ● New programming language ● New DB – Why? ● Desire ● Bored ● Perceived need ● To gain something – Speed – Functionality – When? ● Next 6 months, year(s), decade ● Realistic time ● NOW!
  21. 21. 21 Release Your Refactoring Superpower ● Rewrite FTW!
  22. 22. 22 Release Your Refactoring Superpower ● Typical Loop – Business Responses ● No time
  23. 23. 23 Release Your Refactoring Superpower ● Typical Loop – Business Responses ● No time ● No money
  24. 24. 24 Release Your Refactoring Superpower ● Typical Loop – Business Responses ● No time ● No money ● No need
  25. 25. 25 Release Your Refactoring Superpower ● Typical Loop – Business Responses ● No time ● No money ● No need ● Things are “good enough”
  26. 26. 26 Release Your Refactoring Superpower ● The Fix
  27. 27. 27 Release Your Refactoring Superpower ● Case Study – Managing legacy system costs: A case study of a meta-assessment model to identify solutions in a large financial services company – 2017 (by James Crotty, Ivan Horrocks) - https://www.sciencedirect.com/science/article/pii/S221083271630126 0#b0025 ● 2001 Brooke and Ramage defined legacy as: – Old information system remaining in operation within an Organization
  28. 28. 28 Release Your Refactoring Superpower ● Case Study – Managing legacy system costs: A case study of a meta-assessment model to identify solutions in a large financial services company – 2017 (by James Crotty, Ivan Horrocks) - https://www.sciencedirect.com/science/article/pii/S221083271630126 0#b0025 ● 2001 Brooke and Ramage defined legacy as: – Old information system remaining in operation within an Organization – Business critical, resisting modification as failure would cause significant impact on business
  29. 29. 29 Release Your Refactoring Superpower ● Case Study – Managing legacy system costs: A case study of a meta-assessment model to identify solutions in a large financial services company – 2017 (by James Crotty, Ivan Horrocks) - https://www.sciencedirect.com/science/article/pii/S221083271630126 0#b0025 ● 2001 Brooke and Ramage defined legacy as: – Old information system remaining in operation within an Organization – Business critical, resisting modification as failure would cause significant impact on business – Based on outdated technology but critical day-to-day operations
  30. 30. 30 Release Your Refactoring Superpower ● Case Study – Managing legacy system costs: A case study of a meta-assessment model to identify solutions in a large financial services company – 2017 (by James Crotty, Ivan Horrocks) - https://www.sciencedirect.com/science/article/pii/S221083271630126 0#b0025 ● 2001 Brooke and Ramage defined legacy as: – Old information system remaining in operation within an Organization – Business critical, resisting modification as failure would cause significant impact on business – Based on outdated technology but critical day-to-day operations – Built when processing and storage was much more expensive
  31. 31. 31 Release Your Refactoring Superpower ● Case Study – Managing legacy system costs: A case study of a meta-assessment model to identify solutions in a large financial services company – 2017 (by James Crotty, Ivan Horrocks) - https://www.sciencedirect.com/science/article/pii/S221083271630126 0#b0025 ● 2001 Brooke and Ramage defined legacy as: – Old information system remaining in operation within an Organization – Business critical, resisting modification as failure would cause significant impact on business – Based on outdated technology but critical day-to-day operations – Built when processing and storage was much more expensive – Poorly documented
  32. 32. 32 Release Your Refactoring Superpower ● Case Study – Managing legacy system costs: A case study of a meta-assessment model to identify solutions in a large financial services company – 2017 (by James Crotty, Ivan Horrocks) - https://www.sciencedirect.com/science/article/pii/S221083271630126 0#b0025 ● 2001 Brooke and Ramage defined legacy as: – Old information system remaining in operation within an Organization – Business critical, resisting modification as failure would cause significant impact on business – Based on outdated technology but critical day-to-day operations – Built when processing and storage was much more expensive – Poorly documented – Lack of design
  33. 33. 33 Release Your Refactoring Superpower ● Case Study – Modernization Drivers ● Skillset shortages (old technologies)
  34. 34. 34 Release Your Refactoring Superpower ● Case Study – Modernization Drivers ● Skillset shortages (old technologies) ● Technical needs
  35. 35. 35 Release Your Refactoring Superpower ● Case Study – Modernization Drivers ● Skillset shortages (old technologies) ● Technical needs ● Business needs
  36. 36. 36 Release Your Refactoring Superpower ● Case Study – Modernization Drivers ● Skillset shortages (old technologies) ● Technical needs ● Business needs ● Personal bias
  37. 37. 37 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance
  38. 38. 38 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering
  39. 39. 39 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring
  40. 40. 40 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring ● Re-engineering
  41. 41. 41 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring ● Re-engineering ● Migration
  42. 42. 42 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring ● Re-engineering ● Migration ● Discard
  43. 43. 43 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring ● Re-engineering ● Migration ● Discard ● Wrapping
  44. 44. 44 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring ● Re-engineering ● Migration ● Discard ● Wrapping ● Outsource?
  45. 45. 45 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring ● Re-engineering ● Migration ● Discard ● Wrapping ● Outsource? ● Freeze
  46. 46. 46 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring ● Re-engineering ● Migration ● Discard ● Wrapping ● Outsource? ● Freeze ● Carry On
  47. 47. 47 Release Your Refactoring Superpower ● Case Study – Cost Reduction Strategies ● Ordinary maintenance ● Reverse engineering ● Restructuring ● Re-engineering ● Migration ● Discard ● Wrapping ● Outsource? ● Freeze ● Carry On ● Replacement with commercial off-the-shelf software and discarding
  48. 48. 48 Release Your Refactoring Superpower ● How Do We Know? – Measurement ● A Method for Assessing Legacy Systems for Evolution – 1998 (by Jane Ransom, Ian Sommerville, and Ian Warren) - http://citeseerx.ist.psu.edu/viewdoc/download? doi=10.1.1.128.9889&rep=rep1&type=pdf – Legacy = business critical = cost not justifiable
  49. 49. 49 Release Your Refactoring Superpower ● How Do We Know? – Measurement ● A Method for Assessing Legacy Systems for Evolution – 1998 (by Jane Ransom, Ian Sommerville, and Ian Warren) - http://citeseerx.ist.psu.edu/viewdoc/download? doi=10.1.1.128.9889&rep=rep1&type=pdf – Legacy = business critical = cost not justifiable – Company and project specific
  50. 50. 50 Release Your Refactoring Superpower ● How Do We Know? – Measurement ● A Method for Assessing Legacy Systems for Evolution – 1998 (by Jane Ransom, Ian Sommerville, and Ian Warren) - http://citeseerx.ist.psu.edu/viewdoc/download? doi=10.1.1.128.9889&rep=rep1&type=pdf – Legacy = business critical = cost not justifiable – Company and project specific – Continuously refined
  51. 51. 51 Release Your Refactoring Superpower ● How Do We Know? – Measurement ● A Method for Assessing Legacy Systems for Evolution – 1998 (by Jane Ransom, Ian Sommerville, and Ian Warren) - http://citeseerx.ist.psu.edu/viewdoc/download? doi=10.1.1.128.9889&rep=rep1&type=pdf – Legacy = business critical = cost not justifiable – Company and project specific – Continuously refined – Gains depth of understanding of business
  52. 52. 52 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis
  53. 53. 53 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis ● Vision: global summary of the unit
  54. 54. 54 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis ● Vision: global summary of the unit ● Logic: rationale for vision
  55. 55. 55 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis ● Vision: global summary of the unit ● Logic: rationale for vision ● Structure: of the organisation
  56. 56. 56 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis ● Vision: global summary of the unit ● Logic: rationale for vision ● Structure: of the organisation ● Roles: organizational roles of people
  57. 57. 57 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis ● Vision: global summary of the unit ● Logic: rationale for vision ● Structure: of the organisation ● Roles: organizational roles of people ● View of information: resource analysis
  58. 58. 58 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis ● Vision: global summary of the unit ● Logic: rationale for vision ● Structure: of the organisation ● Roles: organizational roles of people ● View of information: resource analysis ● Costs: major costs, both financial and nonfinancial
  59. 59. 59 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis ● Vision: global summary of the unit ● Logic: rationale for vision ● Structure: of the organisation ● Roles: organizational roles of people ● View of information: resource analysis ● Costs: major costs, both financial and nonfinancial ● Benefits: both financial and nonfinancial
  60. 60. 60 Release Your Refactoring Superpower ● How Do We Know? – Criteria ● Decision Model for Legacy Systems - 1999 (by . H. Bennett, M. Ramage, and M. Munro) - ftp://ftp.inf.puc- rio.br/pub/docs/FomularioSolicitacoes/mariliaGFerreira-09-13-7.pdf – Based more upon organizational points ● Boundary: the unit of analysis ● Vision: global summary of the unit ● Logic: rationale for vision ● Structure: of the organisation ● Roles: organizational roles of people ● View of information: resource analysis ● Costs: major costs, both financial and nonfinancial ● Benefits: both financial and nonfinancial ● Risks: major sources of risk
  61. 61. 61 Release Your Refactoring Superpower ● How Do We Know? – Structure ● A Framework to Assess Legacy Software Systems - 2014 (by Basem Y. Alkazemi) - https://pdfs.semanticscholar.org/da50/7665a6c3bacb5559996bd436a9f76aa 4e5a7.pdf – Strategies ● Replacing
  62. 62. 62 Release Your Refactoring Superpower ● How Do We Know? – Structure ● A Framework to Assess Legacy Software Systems - 2014 (by Basem Y. Alkazemi) - https://pdfs.semanticscholar.org/da50/7665a6c3bacb5559996bd436a9f76aa 4e5a7.pdf – Strategies ● Replacing ● Maintaining
  63. 63. 63 Release Your Refactoring Superpower ● How Do We Know? – Structure ● A Framework to Assess Legacy Software Systems - 2014 (by Basem Y. Alkazemi) - https://pdfs.semanticscholar.org/da50/7665a6c3bacb5559996bd436a9f76aa 4e5a7.pdf – Strategies ● Replacing ● Maintaining ● Re-architecting
  64. 64. 64 Release Your Refactoring Superpower ● How Do We Know? – Structure ● A Framework to Assess Legacy Software Systems - 2014 (by Basem Y. Alkazemi) - https://pdfs.semanticscholar.org/da50/7665a6c3bacb5559996bd436a9f76aa 4e5a7.pdf – Strategies ● Replacing ● Maintaining ● Re-architecting ● Extending by wrapping
  65. 65. 65 Release Your Refactoring Superpower ● How Do We Know? – Application ● A Decisional Framework to Measure System Dimensions of Legacy Application for Rejuvenation through Reengineering - 2011 (by Er. Anand Rajavat, Dr. (Mrs.) Vrinda Tokekar) - https://www.ijcaonline.org/volume16/number2/pxc3872674.pdf – System domain ● Customer requirements ● Orgs strategic goals ● Operational env ● Risk management i. Organizational ii. Resource iii.Development iv.Personal v. User Requirement vi.Specialization vii.Team viii.Communication
  66. 66. 66 Release Your Refactoring Superpower -
  67. 67. 67 Release Your Refactoring Superpower -
  68. 68. 68 Release Your Refactoring Superpower ● Case Study – Example Assessment ● Step #1 - Does application meet or exceed definition of “Legacy”? ● Answers: Yes, No, Maybe, Don’t know – Business Critical – Old – Changed to meet organizational needs – Degrades as changes made – Maintenance cost increase as changes made – Obsolete languages – Poor, if any, documentation – Inadequate data management – Limited support capability – Limited support capacity – Lacks architecture to evolve to meet emerging requirements
  69. 69. 69 Release Your Refactoring Superpower ● Case Study – Example Assessment ● Step #1 – Technical value attribute assessment ● Answers: Yes, No, Don’t know – Maintainability ● LOC ● Control Flow ● Cyclomatic complexity ● Dead code fate – Decompostability/Architecture ● Modularity ● % of modules with separation of concerns ● Consumption ● Extensibility ● Style ● Interoperability
  70. 70. 70 Release Your Refactoring Superpower ● Case Study – Example Assessment ● Step #1 – Cont’d ● Answers: Yes, No, Don’t know – Deterioration ● Backlog increase ● Defect rate increase ● Response-time increase ● Maintanance time per request increase – Obsolescence ● System age ● Operating system version ● Hardware version ● Technical support availability ● Security ● Legality ● System evolution required for business goals?
  71. 71. 71 Release Your Refactoring Superpower ● Case Study – Example Assessment ● Step #2 – Business value attribute assessment ● Answers: Yes, No, Don’t know – Economic value ● Market value ● Profitability index ● IRR – Data value ● % of mission critical archives ● % of application dependent archives – Utility ● Business function coverage rate ● Actual usage frequency ● Customer/user satisfaction metric – Specialization ● % of highly specialized functions ● % of generic functions
  72. 72. 72 Release Your Refactoring Superpower ● Case Study – Example Assessment ● Step #3 – Organizational infrastructure attribute assessment ● Answers: Yes, No, Don’t know – Development & maintenance internal or outsourced? – Technical maturity – Commitment to training – Skill level of system support – Response to change
  73. 73. 73 Release Your Refactoring Superpower ● Case Study – Example Assessment ● Step #4 – Calculations – Calculate all responses to 1 – 5 values (don’t know = 0) – To easily plot on decisional matrix
  74. 74. 74 Release Your Refactoring Superpower ● Case Study – Example Assessment ● Step #5 – Conversion – Convert Y, N, DK to numeric values and Avg %
  75. 75. 75 Release Your Refactoring Superpower ● Case Study – Example Assessment ● Step #6 – Plotting – Display points on the decisional matrix
  76. 76. 76 Release Your Refactoring Superpower ● Superhero – Status Granted ● It’s YOU!
  77. 77. 77 Release Your Refactoring Superpower ● Supervillain – Professor LOC ● Fighting tools – PHPLoc – PHPmd (codesize)
  78. 78. 78 Release Your Refactoring Superpower ● The Data – PHPLoc
  79. 79. 79 Release Your Refactoring Superpower ● The Data – PHPmd
  80. 80. 80 Release Your Refactoring Superpower ● Ray Gun – Docker Images
  81. 81. 81 Release Your Refactoring Superpower ● Arsenal – 1 million commits ● Rename Variable/Method/Class 77% ● Extract Constant ● Make Type Global ● Rename Refactoring Command ● Move/Extract Class 1% ● Move/Extract Method 13% ● Modify Method Parameters
  82. 82. ● Thank you! – Code: https://github.com/adamculp/ Adam Culp http://www.geekyboy.com http://RunGeekRadio.com Twitter @adamculp Questions?

×