1 / 47

Managing Technical Debt

Managing Technical Debt. Pierre G. Boutquin. Welcome!. Welcome to the Toronto ALM User Group “TALMUG”. Thank You, Sponsors!. Agenda or Summary Layout. Intro. Part I. Part II. Choosing or Not Choosing Technical Debt. A second line of text could go here. Agenda; TALMUG; Me.

davin
Télécharger la présentation

Managing Technical Debt

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Managing Technical Debt Pierre G. Boutquin

  2. Welcome! Welcome to the Toronto ALM User Group“TALMUG”

  3. Thank You, Sponsors!

  4. Agenda or Summary Layout Intro Part I Part II Choosing or Not Choosing Technical Debt A second line of text could go here Agenda; TALMUG; Me Debt Characteristics Discovering and Preventing Technical Debt Discussion Part III End ???

  5. About Me Work Experience

  6. About Me Programming Experience

  7. About Me Author

  8. Under Promising… About today’s talk…

  9. History of a Metaphor 1992 Ward Cunningham

  10. Part I: Debt Characteristics

  11. Debt: Good or Bad? Depends… • Deliberate vs. Inadvertent • Prudent vs. Reckless http://martinfowler.com/bliki/TechnicalDebtQuadrant.html

  12. Why Debt? Trade-Off… • Faster Short Term Benefit • Extra Cost

  13. Debt Drawback Principal/Interest • Extra Cost (Interest) • As Long as Debt (Principal) NOT Paid Off

  14. Unmanaged Debt Aka My Credit Card • Perpetual Debt • Growing Interest

  15. Incurring Debt Reckless vs. Prudent • Deliberate Trade-Off: Maybe Prudent • Inadvertent Debt: Likely Reckless

  16. Deliberate Debt When Prudent? • Benefits Outweigh Extra Costs • Affordable Repayment Plan

  17. Acceptable Debt 4 Criteria: • Deliberate Decision • Positive Cost/Benefit • Planned, Affordable Repayment • Prudent Total Debt

  18. Unwise Debt 4 Tell-Tale Signs • Inadvertent Decision • Negative or Small Cost/Benefit • Repayment Not Planned/Too High • Reckless Total Debt

  19. PART I - Conclusion Debt Criteria: • Total Level of Deliberateness • Size of Cost/Benefit • Affordability of Repayment • Total Debt Load

  20. Part II: Deliberate Technical Debt Choosing or Not Choosing Debt…

  21. Deliberate Technical Debt Why??? • Good: Deliver Early/On Time • Bad: Detestable Code • Ugly: The Spike

  22. Deliberate Technical Debt Avoidable? • Maybe: Date Driven Development • Yes: Feature Driven Development

  23. Deliberate Technical Debt Date-Driven Project • Shipping Date is Fixed • Features Are Negotiable • Often Less Desirable

  24. Deliberate Technical Debt Feature-Driven Project • Features Are Fixed • Shipping Date Is Negotiable • Often More Desirable

  25. The MVP Concept “Minimal Viable Product” • Release Planning Tool • Combines Well With Prioritization

  26. Prioritization Sometimes…

  27. Prioritization Key: By Business Value • Agile/Scrum: Backlog • Traditional: Prioritization Needs Forethought

  28. MoSCoW Prioritization • MUST: Part of MVP • SHOULD: High-Priority • COULD: Nice to Have • WOULD: Maybe Later

  29. Part III: Minimizing Inadvertent Debt Discovering and Preventing Debt…

  30. Minimizing: How? 2 Angles: • Process • Tools

  31. Minimizing: How? Process vs. process • Process: SDLC • process: Engineering Practices • Test First Development

  32. Minimizing: Type of Tools 2 Objectives: • Communications • Technical Excellence

  33. Minimizing: Communication Tools Tools We Use: • Standup Meeting • Shared SME • Design Reviews • Code Reviews

  34. Minimizing: Technical Tools Tools We Use: • Unit Tests • Code Contracts • Static Code Analysis • Adherence to Coding Standard • Good Coding Practices • Code Metrics

  35. Tool: Unit Tests Recommended Book: “The Art of Unit Testing” http://www.manning.com/osherove2/

  36. Tool: Unit Tests Roy Osherove’s Definition: • A Unit Test is an automated piece of code that invokes the unit of work being tested and then checks some assumptions about a single end result of that unit. • A unit test is almost always written using a unit-testing framework. It can be written easily and runs quickly.

  37. Tool: Unit Tests Roy Osherove’s Definition (cont’d): • A Unit Test is trustworthy, readable and maintainable. It is consistent in its results as long as the production code has not changed.

  38. Unit Test Tips: Naming Convention [UnitOfWork]_[Condition]_[ExpectedResult] • /// <summary> • /// This test demonstrates that constructor of • /// the <see cref="VenomSender" /> class is creating a topic session • /// when it is being given valid configuration. • /// </summary> • [TestMethod] • public voidConstructor_ValidTibcoConfig_ReturnsNonNullTopicSession() • { • // ARRANGE • var tibcoConfig = TestUtils.CreateValidTibcoConfig(); • // ACT • var venomSender = new VenomSender(tibcoConfig); • // ASSERT • Assert.IsNotNull(venomSender.TopicSession); • }

  39. Unit Test Tips: Design Pattern Design Pattern: AAA • /// <summary> • /// This test demonstrates that constructor of • /// the <see cref="VenomSender" /> class is creating a topic session • /// when it is being given valid configuration. • /// </summary> • [TestMethod] • public voidConstructor_ValidTibcoConfig_ReturnsNonNullTopicSession() • { • // ARRANGE • var tibcoConfig = TestUtils.CreateValidTibcoConfig(); • // ACT • var venomSender = new VenomSender(tibcoConfig); • // ASSERT • Assert.IsNotNull(venomSender.TopicSession); • }

  40. Unit Test Tips: Sad Paths Maintainability Tip: • Use Happy Path Factory Helper • Then, Create Single Sad Path • Test Both Exception Type & Message

  41. Unit Test Tips: Sad Path Design Pattern: • /// <summary> • /// This test demonstrates that constructor of • /// the <see cref="VenomSender" /> class is throwing an exception • /// when it is being passed a null SslCertStoreName. • /// </summary> • [TestMethod] • public voidConstructor_nullSslCertStoreName_ThrowsException() • { • // ARRANGE • var tibcoConfig = TestUtils.CreateValidTibcoConfig(); • tibcoConfig.SslCertStoreName = null; • // ACT • var venomSender = new VenomSender(tibcoConfig); • // ASSERT • // etc, • }

  42. Code Metrics Cyclomatic Complexity • Method-Level Measure • Calculated from Control Flow Graph • Smaller Values Better • <= 25 Acceptable

  43. Code Metrics Maintainability Index • Synthesis of Three Metrics • Cyclomatic Complexity • Lines of Code • Computational Complexity • Icons Color-Coded • GREEN (>20) • YELLOW (10-20) • RED (<10) • Not Expressed in Units!

  44. Code Contracts Now Part of .NET! • New to Me • No Best Practices To Share Yet…

  45. Coding Standard The Final Word… • Partially Matter of Opinion • Let Tool Decide • StyleCop • ReSharper

  46. Managing Technical Debt

  47. Questions?

More Related