際際滷

際際滷Share a Scribd company logo
Technical Debt
                          The Silent Application Killer




                                      息 ThoughtWorks 2011


Tuesday, 8 November 11
Graham Brooks
                          http://www.thoughtworks.com/blogs/current
                          http://www.grahambrooks.com/blog
                          @wookie870




                              息 ThoughtWorks 2011


Tuesday, 8 November 11
Outline

                    De鍖nition
                    Why is it important?
                    Symptoms and signs
                    Debt resolution strategies

Tuesday, 8 November 11
Technical Debt



Tuesday, 8 November 11
Technical Debt


                         Metaphor coined by Ward Cunningham to
                         explain the misalignment between code and
                         current understanding




Tuesday, 8 November 11
Consciously taking on debt might allow
                         you to get something sooner




Tuesday, 8 November 11
Burden

                    Not paying off - borrowing without paying
                         it back
                          Spending power goes to 0
                          All your money goes into paying interest


Tuesday, 8 November 11
Some might see this as an excuse to write
                         poor code.

                              Never write poor code




Tuesday, 8 November 11
Reckless                                Prudent
                                                            We must ship now
                          We dont
Deliberate                                                  and deal with the
                          have time
                                                              consequences
                          for design



                                                               Now we know
Inadvertent              What is layering?                     how we should
                                                                have built it

source: http://martinfowler.com/bliki/TechnicalDebtQuadrant.html

Tuesday, 8 November 11
Evidence is anecdotal and based on personal
                         experience of many projects




Tuesday, 8 November 11
No debt Management
Cost of Change




                               Time
      Tuesday, 8 November 11
A re-write will...
                    Solve all our problems
                     If we use language X
                     The latest framework
                     A new code generator
                     A new database
                     .....
Tuesday, 8 November 11
Cost of change




                         Time
Tuesday, 8 November 11
Teams like these get better at rewrites.

                         They dont learn how to continuously
                         deliver value inde鍖nitely.....




Tuesday, 8 November 11
No debt Management
Cost of Change




                                     Technical Debt Managed



                              Time
     Tuesday, 8 November 11
Your codebase can never be in Credit

                         For commercial projects technical debt is a
                         fact of life

                              You either have enough or too much




Tuesday, 8 November 11
Symptoms and Signs



Tuesday, 8 November 11
Productivity



Tuesday, 8 November 11
Velocity




                           Iteration




  Tuesday, 8 November 11
Velocity




                           Iteration




  Tuesday, 8 November 11
Velocity




                           Iteration




  Tuesday, 8 November 11
Velocity




                           Iteration




  Tuesday, 8 November 11
Velocity




                           Iteration




  Tuesday, 8 November 11
Velocity




                           Iteration




  Tuesday, 8 November 11
Tracer Stories
                  11Point
                     Point
                    11Point
                       Point
                      11Point
                         Point
                        11Point
                           Point
   Velocity




                     7h            5h                7h       10h
                                        Time              5-10 months
                                         Iteration




Tuesday, 8 November 11
Code



Tuesday, 8 November 11
Code Review



Tuesday, 8 November 11
You know you are working on clean code
                          when each routine you read turns out to be
                          pretty much what you expected.You can call
                         it beautiful code when the code also makes it
                             look like the language was made for the
                                             problem

                                                   Ward Cunningham
                                                   Clean Code by Robert C Martin




Tuesday, 8 November 11
http://www.osnews.com/story/19266/WTFs_m
Tuesday, 8 November 11
Readability is a key



Tuesday, 8 November 11
How often features are
                         used
                   Never


                  Rarely


          Sometimes

                                              45%
                 Often                     NEVER USED

               Always


                           0   12.5   25   37.5         50
                                                  Source: Standish Group


Tuesday, 8 November 11
Remove Unused stuff

                    Unused features
                    Unused 鍖les and tools
                    Unused classes
                    Unused methods
                    Unused lines

Tuesday, 8 November 11
Duplication

                         Direct duplication
                           Exact Code copies
                         Aggressive
                           Algorithmically Equivolent


    Tool tip: Simian
Tuesday, 8 November 11
!"
                                               #!"
                                                     $!"
                                                           %!"
                                                                 &!"
                                                                       '!!"
                                                                              '#!"
                                                                                     '$!"
                                                                                            '%!"
  0569?-**"
 50-:?-**"
 (>4,+@?2A"
59.-5?-**"
  (;50-:?A"
01D8?F=+"




 Tuesday, 8 November 11
340569?A"
0159.-5?A"
+.509?-**"
:6D+6?.="
H.5.?-**"
  ==01?A"
01H.5.?A"
 ?-*90I6-5"
>4,+@?F=+"
 (?*90I6-5"
 .869?-**"
(25@.LF?A"
 ?-*90I6-5"
:6D+6?.="
  K625?-**"
5K625?-**"
  509<?-**"
 .869?-**"
  1C+.22?A"
 0++69?-**"
C+.22?-**"
0<NO?F=+"
 .1.869?A"
22,01?-**"
1590+?-**"
                                                                                                   !"##$%&!"'(%&




-4+.509?A"
01D8?F=+"
 (?*90I6-5"
 15?-2*90I"
                                                                                                                   Volatility




 +,615?-**"
<Q4<?-**"
 +,615?-**"
5K625?-**"
 +,615?-**"
 +,615?-**"
 @,.509?-2"
 +,615?-**"
  590++69?A"
1,509?-**"
  K625?-**"
  @+69?-**"
,/.+,U69?A"
9K625?-**"
 09=?962F"
                               C0==,5"C0415"
Toxicity


                         250 branches in a single class




Tuesday, 8 November 11
Clean               Toxic

                            Volatile
    Volatile             requirements?   !Refactor Now!
                            Monitor




       Stable             Leave alone     Refactor later




Tuesday, 8 November 11
ures
                                              /feat
                                      te   sts
                                 r of               O C
                           m be               on
                                                 L
                          u                ti
                         N
                                     pl ica
                                  Ap             C
                                             LO
                                      Te  st



                          Time


Tuesday, 8 November 11
Debt resolution
                           strategies


Tuesday, 8 November 11
Stop the Line

                    Works for major changes
                    Challenging to implement
                    Smells of a rewrite
                    Short

Tuesday, 8 November 11
Little and often

                    Make improvement part of the process:
                    Improvement as part of every change
                    Stangler pattern


Tuesday, 8 November 11
Its going to get worse
                                 before it gets better
                                                                             Desired State
                 Productivity




                                 Current Situation


                                                     Cost of Change




                                                                      Time


Tuesday, 8 November 11
Closing Thoughts



Tuesday, 8 November 11
First Steps

                    Imagine you have joined a new team
                     Run metrics
                     Estimate debt
                     Plan next steps
                     Execute the plan

Tuesday, 8 November 11
Software Rusts
                         Things Change
                            New capabilities
                            Libraries
                            Frameworks
                            OS



Tuesday, 8 November 11
Every modi鍖cation of a system might incur
                         technical debt unless it is accompanied by
                         some effort to bring the design into line with
                         the requirements.




Tuesday, 8 November 11
Questions?



Tuesday, 8 November 11
Thank You!
           http://www.thoughtworks.com/blogs/current
           http://www.grahambrooks.com/blog
           @wookie870
           gbrooks@thoughtworks.com
                                         息 ThoughtWorks 2008


Tuesday, 8 November 11

More Related Content

Technical Debt

  • 1. Technical Debt The Silent Application Killer 息 ThoughtWorks 2011 Tuesday, 8 November 11
  • 2. Graham Brooks http://www.thoughtworks.com/blogs/current http://www.grahambrooks.com/blog @wookie870 息 ThoughtWorks 2011 Tuesday, 8 November 11
  • 3. Outline De鍖nition Why is it important? Symptoms and signs Debt resolution strategies Tuesday, 8 November 11
  • 5. Technical Debt Metaphor coined by Ward Cunningham to explain the misalignment between code and current understanding Tuesday, 8 November 11
  • 6. Consciously taking on debt might allow you to get something sooner Tuesday, 8 November 11
  • 7. Burden Not paying off - borrowing without paying it back Spending power goes to 0 All your money goes into paying interest Tuesday, 8 November 11
  • 8. Some might see this as an excuse to write poor code. Never write poor code Tuesday, 8 November 11
  • 9. Reckless Prudent We must ship now We dont Deliberate and deal with the have time consequences for design Now we know Inadvertent What is layering? how we should have built it source: http://martinfowler.com/bliki/TechnicalDebtQuadrant.html Tuesday, 8 November 11
  • 10. Evidence is anecdotal and based on personal experience of many projects Tuesday, 8 November 11
  • 11. No debt Management Cost of Change Time Tuesday, 8 November 11
  • 12. A re-write will... Solve all our problems If we use language X The latest framework A new code generator A new database ..... Tuesday, 8 November 11
  • 13. Cost of change Time Tuesday, 8 November 11
  • 14. Teams like these get better at rewrites. They dont learn how to continuously deliver value inde鍖nitely..... Tuesday, 8 November 11
  • 15. No debt Management Cost of Change Technical Debt Managed Time Tuesday, 8 November 11
  • 16. Your codebase can never be in Credit For commercial projects technical debt is a fact of life You either have enough or too much Tuesday, 8 November 11
  • 19. Velocity Iteration Tuesday, 8 November 11
  • 20. Velocity Iteration Tuesday, 8 November 11
  • 21. Velocity Iteration Tuesday, 8 November 11
  • 22. Velocity Iteration Tuesday, 8 November 11
  • 23. Velocity Iteration Tuesday, 8 November 11
  • 24. Velocity Iteration Tuesday, 8 November 11
  • 25. Tracer Stories 11Point Point 11Point Point 11Point Point 11Point Point Velocity 7h 5h 7h 10h Time 5-10 months Iteration Tuesday, 8 November 11
  • 27. Code Review Tuesday, 8 November 11
  • 28. You know you are working on clean code when each routine you read turns out to be pretty much what you expected.You can call it beautiful code when the code also makes it look like the language was made for the problem Ward Cunningham Clean Code by Robert C Martin Tuesday, 8 November 11
  • 30. Readability is a key Tuesday, 8 November 11
  • 31. How often features are used Never Rarely Sometimes 45% Often NEVER USED Always 0 12.5 25 37.5 50 Source: Standish Group Tuesday, 8 November 11
  • 32. Remove Unused stuff Unused features Unused 鍖les and tools Unused classes Unused methods Unused lines Tuesday, 8 November 11
  • 33. Duplication Direct duplication Exact Code copies Aggressive Algorithmically Equivolent Tool tip: Simian Tuesday, 8 November 11
  • 34. !" #!" $!" %!" &!" '!!" '#!" '$!" '%!" 0569?-**" 50-:?-**" (>4,+@?2A" 59.-5?-**" (;50-:?A" 01D8?F=+" Tuesday, 8 November 11 340569?A" 0159.-5?A" +.509?-**" :6D+6?.=" H.5.?-**" ==01?A" 01H.5.?A" ?-*90I6-5" >4,+@?F=+" (?*90I6-5" .869?-**" (25@.LF?A" ?-*90I6-5" :6D+6?.=" K625?-**" 5K625?-**" 509<?-**" .869?-**" 1C+.22?A" 0++69?-**" C+.22?-**" 0<NO?F=+" .1.869?A" 22,01?-**" 1590+?-**" !"##$%&!"'(%& -4+.509?A" 01D8?F=+" (?*90I6-5" 15?-2*90I" Volatility +,615?-**" <Q4<?-**" +,615?-**" 5K625?-**" +,615?-**" +,615?-**" @,.509?-2" +,615?-**" 590++69?A" 1,509?-**" K625?-**" @+69?-**" ,/.+,U69?A" 9K625?-**" 09=?962F" C0==,5"C0415"
  • 35. Toxicity 250 branches in a single class Tuesday, 8 November 11
  • 36. Clean Toxic Volatile Volatile requirements? !Refactor Now! Monitor Stable Leave alone Refactor later Tuesday, 8 November 11
  • 37. ures /feat te sts r of O C m be on L u ti N pl ica Ap C LO Te st Time Tuesday, 8 November 11
  • 38. Debt resolution strategies Tuesday, 8 November 11
  • 39. Stop the Line Works for major changes Challenging to implement Smells of a rewrite Short Tuesday, 8 November 11
  • 40. Little and often Make improvement part of the process: Improvement as part of every change Stangler pattern Tuesday, 8 November 11
  • 41. Its going to get worse before it gets better Desired State Productivity Current Situation Cost of Change Time Tuesday, 8 November 11
  • 43. First Steps Imagine you have joined a new team Run metrics Estimate debt Plan next steps Execute the plan Tuesday, 8 November 11
  • 44. Software Rusts Things Change New capabilities Libraries Frameworks OS Tuesday, 8 November 11
  • 45. Every modi鍖cation of a system might incur technical debt unless it is accompanied by some effort to bring the design into line with the requirements. Tuesday, 8 November 11
  • 47. Thank You! http://www.thoughtworks.com/blogs/current http://www.grahambrooks.com/blog @wookie870 gbrooks@thoughtworks.com 息 ThoughtWorks 2008 Tuesday, 8 November 11