© ThoughtWorks 2011 Technical Debt The ‘Silent’ Application Killer Tuesday, 8 November 11
May 12, 2015
© ThoughtWorks 2011
Technical DebtThe ‘Silent’ Application Killer
Tuesday, 8 November 11
© ThoughtWorks 2011
Graham Brookshttp://www.thoughtworks.com/blogs/current
http://www.grahambrooks.com/blog
@wookie870
Tuesday, 8 November 11
Outline
• Definition
• 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
Deliberate
Inadvertent What is layering?Now we know how we should
have built it
We must ship now and deal with the
consequences
We don’t have time for design
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
Time
Cos
t of
Cha
nge
No debt Management
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
Time
Cos
t of
cha
nge
Tuesday, 8 November 11
Teams like these get better at rewrites.
They don’t learn how to continuously deliver value indefinitely.....
Tuesday, 8 November 11
Time
Cos
t of
Cha
nge
No debt Management
Technical Debt Managed
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
Iteration
Velocity
Tuesday, 8 November 11
Iteration
Velocity
Tuesday, 8 November 11
Iteration
Velocity
Tuesday, 8 November 11
Iteration
Velocity
Tuesday, 8 November 11
Iteration
Velocity
Tuesday, 8 November 11
Iteration
Velocity
Tuesday, 8 November 11
Iteration
Velocity
Tracer Stories1 Point1 Point1 Point1 Point1 Point1 Point1 Point1 Point
Time
7h 5h 7h 10h
5-10 months
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_mTuesday, 8 November 11
Readability is a key
Tuesday, 8 November 11
How often features are used
0 12.5 25 37.5 50
Never
Rarely
Sometimes
Often
Always
Source: Standish Group
45%NEVER USED
Tuesday, 8 November 11
Remove Unused ‘stuff ’
• Unused features
• Unused files 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
!"
#!"
$!"
%!"
&!"
'!!"
'#!"
'$!"
'%!"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;<=>0
+340
569?-
**"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;50-:?-**"
()**
+,-./
012(340
5671
8,16
(5941:(>4,+@?2A"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(B*/
01C0
159.-5?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;50-:?A"
()**
+,-./
012(340
5671
8,16
(5941:(-01
D8(E40
5661
8,16
?-01
D8?F=+"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;<=>0
+340
569?A
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(B*/
01C0
159.-5?A"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C.+-4+.509?-**
"()**
+,-./
012(340
5671
8,16
(5941:(5625(G.:6D
+6?.="
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(7F*,9./0
1H.5.?-**"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C0
==01
?A"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(7F*,9./0
1H.5.?A"
()**
+,-./
012(340
5671
8,16
(5941:(*90I6-52(340
5671
8,16
J1,5K625(?-*90I6-5"
()**
+,-./
012(340
5671
8,16
(5941:(>4,+@?F=+"
()**
+,-./
012(340
5671
8,16
(5941:(*90I6-52(340
5671
8,16
J1,5K625(?*90I6-5"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;<=>0
+G.1.869?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6([email protected]?A"
()**
+,-./
012(340
5671
8,16
(5941:(*90I6-52(340
5671
8,16
(?-*90I6-5"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(G.:6D
+6?.="
()**
+,-./
012(340
5671
8,16
(5941:(5625(340
5671
8,16
J1,5K625(;50-:K625?-**
"()**
+,-./
012(340
5671
8,16
(5941:(5625(340
5671
8,16
J1,5K625(B*/
01C0
159.-5K625?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;50-:M.-509<?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;-9,*
5G.1.869?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(B*/
01C+.22?A"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(340
56C0
1590++69?-
**"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(B*/
01C+.22?-**"
()**
+,-./
012(340
5671
8,16
(5941:(@6*
+0<NO?F=
+"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;<=>0
+G.1.869?A"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(340
5671
8,16
;622,01?-**"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C+,615(3
4056C0
1590+?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C.+-4+.509?A"
()**
+,-./
012(340
5671
8,16
(5941:(-01
D8(3
405671
8,16
?-01
D8?F=+"
()**
+,-./
012(340
5671
8,16
(5941:(*90I6-52(340
5671
8,16
(?*90I6-5"
()**
+,-./
012(P,2:)++0-./0
1C+,615(5941:(29-(P,2:
)++0-./0
1C+,615?-2*90I"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C+,615(3
4056C0
1590+C+,615?-**
"()**
+,-./
012(340
5671
8,16
(5941:(2-9,*/1
8(2-9,*
52(M+<Q4
<(M+<Q
4<?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C+,615(G
R;C+,615?-**
"()**
+,-./
012(340
5671
8,16
(5941:(5625(340
5671
8,16
J1,5K625(R0
2,/01
C+,615K625?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C+,615(R02,/01
C+,615?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C+,615(3
4056C0
1D8C+,615?-**
"()**
+,-./
012(P,2:)++0-./0
1C+,615(5941:(29-(G
6@,.509?-
2"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(C+,615(C.+,>9./0
1C+,615?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(340
56C0
1590++69?A
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;<256=
G01
,509?-
**"
()**
+,-./
012(340
5671
8,16
(5941:(5625(340
5671
8,16
J1,5K625(MS;C.-A6
K625?-**
"()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(P6
2*01
26T.
1@+69?-
**"
()**
+,-./
012(340
5671
8,16
(5941:(204
9-6(;<=>0
+340
569S1
,/.+,U6
9?A"
()**
+,-./
012(340
5671
8,16
(5941:(5625(340
5671
8,16
J1,5K625(340
56C0
1590++69K625?-**
"()**
+,-./
012(P,2:)++0-./0
1C+,615(5941:(29-(M09=2(G.,1M09=?96
2F"
!"##$%&!"'(%&
C0==,5"C0415"
Volatility
Tuesday, 8 November 11
Toxicity
250 branches in a single class
Tuesday, 8 November 11
Clean Toxic
Volatile
Stable Leave alone Refactor later
!Refactor Now!Volatile
requirements?Monitor
Tuesday, 8 November 11
Time
Number of te
sts/feat
ures
Application LOC
Test LOC
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
It’s going to get worse before it gets better
Time
Productivity
Cost of Change
Current Situation
Desired State
Tuesday, 8 November 11
Closing Thoughts
Tuesday, 8 November 11
• Imagine you have joined a new team
• Run metrics
• Estimate debt
• Plan next steps
• Execute the plan
First Steps
Tuesday, 8 November 11
Things Change
New capabilities
Libraries
Frameworks
OS
Software Rusts
Tuesday, 8 November 11
Every modification 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
© ThoughtWorks 2008
Thank You!http://www.thoughtworks.com/blogs/current
http://www.grahambrooks.com/blog
@wookie870
Tuesday, 8 November 11