Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Congratulations! Technical Debt GURU level unlocked!

Congratulations! Technical Debt GURU level unlocked!

As Software Engineers we know that Technical Debt and Legacy Code are familiar concepts we have to live with in our day to day life.

We are also aware that our software, in general terms, is terrible and that does not make it any especial.

Code base healthiness and maintenance are challenging, so in this quick journey we are going to walk together through a bunch of tips and techniques on how to effectively address this problem.

Fernando Cejas

April 29, 2019
Tweet

More Decks by Fernando Cejas

Other Decks in Programming

Transcript

  1. @fernando_cejas
    TECHNICAL DEBT
    GURU LEVEL

    View full-size slide

  2. I am Fernando Cejas
    I am here because I love to share
    experiences and disasters I have
    made in my professional life.
    × Twitter: @fernando_cejas
    × Github: @android10
    × Blog: fernandocejas.com
    Hello!

    View full-size slide

  3. “BAD CODE IS
    ALWAYS
    imprudent”

    View full-size slide

  4. In an ideal world...every project...
    Finished
    on time
    Clean
    code
    On
    budget

    View full-size slide

  5. Even better… our perfect project...
    Additional
    features
    Tested
    twice
    ???

    View full-size slide

  6. FACT: OUR SOFTWARE
    IS TERRIBLE!!!
    And that does not make it special.
    All software is terrible, and yes, we know
    it is definitely TRUE

    View full-size slide

  7. WHAT IS LEGACY CODE?

    View full-size slide

  8. Code without tests
    Code that someone else has written
    ANTI-PATTERNS
    No separation of concerns
    Code difficult to change
    Difficult to understand

    View full-size slide

  9. WHAT IS RECKLESS DEBT?

    View full-size slide

  10. Code that violates
    design principles
    Without even a short term payoff

    View full-size slide

  11. WHAT IS TECHNICAL DEBT?

    View full-size slide

  12. It is a metaphor
    doing things the quick and dirty way sets us up with a
    technical debt
    Incurs INTEREST PAYMENT
    which come in the form of the extra effort that we have
    to do in future development because of the quick and
    dirty design choice.

    View full-size slide

  13. Technical debt is the
    additional effort and
    work REQUIRED to
    complete any software
    development.

    View full-size slide

  14. “TEchnical debt
    is reflected on
    legacy code”

    View full-size slide

  15. Real case scenario:
    ADDING A NEW
    FEATURE

    View full-size slide

  16. THE “EASY”
    WAY:
    Built up with messy
    design and code, will
    get you there faster.

    View full-size slide

  17. THE “HARD”
    WAY:
    Built up with cleaner
    design and code, that
    takes a lot more time

    View full-size slide

  18. “Accept some
    technical debt
    for tactical
    reasons”

    View full-size slide

  19. DETECTING
    TECHNICAL DEBT

    View full-size slide

  20. STATIC CODE
    ANALYSIS

    View full-size slide

  21. Static CODE ANALYSIS: CODE METRICS
    Cyclomatic
    complexity
    complexity of classes and
    methods by analyzing the
    number of functional paths in
    the code
    Code coverage
    A lack of unit tests is a source
    of technical debt. This is the
    amount of code covered by
    unit tests.
    Bug count
    As technical debt increases,
    quality of the software
    decreases. The number of bugs
    will likely grow.
    Number of rule
    violations
    Number of rules violated from a
    given set of coding
    conventions.
    SQALE-rating
    Broad evaluation of software
    quality. The scale goes from A
    to E, with A being the highest
    quality.

    View full-size slide

  22. TECH DEBT
    RADAR

    View full-size slide

  23. TECH
    DEBT
    RADAR
    +PAIN
    -PAIN
    +Dev TIME
    -Dev TIME
    DI
    Login
    Player
    UI
    Layer
    Photos
    Share
    Data
    Layer
    Search

    View full-size slide

  24. BEHAVIORAL CODE
    ANALYSIS

    View full-size slide

  25. “TEchnical debt
    is reflected on
    legacy code”

    View full-size slide

  26. “TEchnical debt
    is NOT ONLY
    reflected on
    legacy code”

    View full-size slide

  27. BEHAVIORAL CODE ANALYSIS:
    1. Consider the organization and people side of the system.
    2. This gives you valuable information that is invisible in the
    source code itself, such as measures of team autonomy and
    off-boarding risks.
    3. How developers interact with the code.

    View full-size slide

  28. behavioral CODE ANALYSIS: METRICS
    Hotspots
    Hotspots identify the modules with
    most development activity -- often
    technical debt.
    Code biomarkers
    Code Biomarkers aim to indicate
    specific properties at very low code
    level.
    Refactoring Targets
    Prioritize improvements to these files
    since they have the highest technical
    debt interest rate.
    Change coupling
    Change coupling helps us
    uncover implicit change
    patterns in our code.

    View full-size slide

  29. EXTRA BALL!!

    View full-size slide

  30. PAYING
    TECHNICAL DEBT

    View full-size slide

  31. Paying debt at team level:
    1. Prioritize and keep track of it.
    2. Allocate time to address it.
    3. Technical Debt days.

    View full-size slide

  32. Paying debt at COMPANY level:
    1. Educate people about its existence.
    2. Make it transparent.
    3. Communicate it properly.

    View full-size slide

  33. Paying debt at COMPANY level:
    COST OF DELAY
    This (mostly manual) metric helps to make visible
    how much time a team loses due to technical
    debt.

    View full-size slide

  34. SOME DAYS YOU CANNOT GET RID
    OF A BOMB...

    View full-size slide

  35. THANKS!
    Any questions?
    You can find me at @fernando_cejas (twitter) & @android10 (github)

    View full-size slide

  36. Credits
    Special thanks to all the people who made and
    released these awesome resources for free:
    × Presentation template by SlidesCarnival
    × Photographs by Startupstockphotos

    View full-size slide