This is a version of the talk given at Dev Bootcamp in Chicago.
Technical Debt has become a catch-all phrase for any code that needs to be re-worked. Much like Refactoring has become a catch-all phrase for any activity that involves changing code. These fundamental misunderstandings and comfortable yet mis-applied metaphors have resulted in a plethora of poor decisions. What is technical debt? What is not technical debt? Why should we care? What is the cost of misunderstanding? What do we do about it? Doc discusses the origins of the metaphor, what it means today, and how we properly identify and manage technical debt.
5. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
Shipping first time code is like
going into debt. A little debt
speeds development so long as
it is paid back promptly with a
rewrite.
– Ward Cunningham
OOPSLA ‘92
6. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
Shipping first time code is like
going into debt. A little debt
speeds development so long as
it is paid back promptly with a
rewrite.
The danger occurs when the
debt is not repaid. Every minute
spent on not-quite-right code
counts as interest on that debt.
– Ward Cunningham
OOPSLA ‘92
7. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
The danger occurs
when the debt is not
repaid. Every minute
spent on not-quite-
right code counts as
interest on that debt.
– Ward Cunningham
OOPSLA ‘92
8. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
The danger occurs
when the debt is not
repaid. Every minute
spent on not-quite-
right code counts as
interest on that debt.
– Ward Cunningham
OOPSLA ‘92
18. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
metaphors rock
we reason by analogy
Building on a
weak foundation
Puts pressure on our design
Can’t keep running at this pace
It’s raining men
(hallelujah)
19. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
metaphorphosis
when metaphors go wrong
Credit CardSHORT-TERM
Long-Term
Return on
Investment
OPERATIONALHOME LOAN
Loan Shark
PRAGMATIC
LEVERAGE
Intentional AUTO LOAN
FRAUDULENT
VOLUNTARY
PYRAMID SCHEME
Prudent
Student Loan
HIGH INTEREST
INADVERTENT
RECKLESS DEBT IN
THE THIRD
QUADRANT
20. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
metaphorphosis
when metaphors go wrong
“quick and dirty”
- Martin Fowler
“sloppy”
- David Laribee
“just hack it in”
- Steve McConnell
“CUT A LOT OF CORNERS”
- James Shore
21. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt quadrant
Reckless
Inadvertent
Prudent
Deliberate
“We don’t have time
for design”
“We must ship now and
deal with
consequences”
“Now we know how we
should have done it”
“What’s Layering?”
22. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
– Ward Cunningham
Youtube ‘09
[Many] have explained
the debt metaphor and
confused it with the
idea that you could
write code poorly with
the intention of doing a
good job later.
23. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
– Ward Cunningham
Youtube ‘09
confused the
debt metaphor
with the idea that
you could write
code poorly
24. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
– Ward Cunningham
Youtube ‘09
The ability to pay back
debt [...] depends upon
you writing code that is
clean enough to be
able to refactor as you
come to understand
your problem.
25. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
– Ward Cunningham
Youtube ‘09
The ability to pay back
debt [...] depends upon
you writing code that is
clean enough to be
able to refactor as you
come to understand
your problem.
26. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
– Ward Cunningham
twitter ‘09
Dirty code is to
technical debt as the
pawn broker is to
financial debt.
27. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
– Ward Cunningham
twitter ‘09
Dirty code is to
technical debt as the
pawn broker is to
financial debt.
Don’t think you are
ever going to get your
code back.
29. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt?
Ask yourself…
• Is the code clean?
• Is the code tested?
• Is there a learning objective or event?
• Is there a plan for payback?
• Is the business truly informed?
30. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt?
If you say no to even one…
• Is the code clean?
• Is the code tested?
• Is there a learning objective or event?
• Is there a plan for payback?
• Is the business truly informed?
31. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt?
If you say no to even one…
• Is the code clean?
• Is the code tested?
• Is there a learning objective or event?
• Is there a plan for payback?
• Is the business truly informed?
... then you don’t have Technical Debt
33. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
mess (noun)
• Disorderly accumulation, heap, or jumble
• A state of embarrassing confusion
• An unpleasant or difficult situation
35. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
cruft (noun)
• An unpleasant substance
• The result of shoddy construction
• Redundant, old or improperly written code
42. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt quadrant
Reckless
Inadvertent
Prudent
Deliberate
“We don’t have time
for design”
“We must ship now and
deal with
consequences”
“Now we know how we
should have done it”
“What’s Layering?”
43. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt quadrant
Reckless
Inadvertent
Prudent
Deliberate
“We don’t have time
for design”
“Let’s deploy and
gather more
information”
“Now we know how we
should have done it”
“What’s Layering?”
51. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
RECKLESS AND DELIBERATE
RECKLESS AND DELIBERATE
RECKLESS AND INADVERTENT
technical debt in other fields
52. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt quadrant
Reckless
Inadvertent
Prudent
Deliberate
“We don’t have time
for design”
“Let’s deploy and
gather more
information”
“Now we know how we
should have done it”
“What’s Layering?”
53. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt quadrant
Reckless
Inadvertent
Prudent
Deliberate
“We don’t have time
for design”
“Let’s deploy and
gather more
information”
“Now we know how we
should have done it”
“What’s Layering?”
IRRESPONSIBLE
54. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt quadrant
Reckless
Inadvertent
Prudent
Deliberate
“We don’t have time
for design”
“Let’s deploy and
gather more
information”
“Now we know how we
should have done it”
“What’s Layering?”
IRRESPONSIBLE
INCOMPETENT
55. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
technical debt quadrant
Reckless
Inadvertent
Prudent
Deliberate
“We don’t have time
for design”
“Let’s deploy and
gather more
information”
“Now we know how we
should have done it”
“What’s Layering?”
IRRESPONSIBLE
INCOMPETENT
TECHNICAL
DEBT
66. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
double getSpeed() {
switch (_type) {
case EUROPEAN:
return getBaseSpeed();
case AFRICAN:
return getBaseSpeed() - getLoadFactor() * _numberOfCoconuts;
case NORWEGIAN_BLUE:
return (_isNailed) ? 0 : getBaseSpeed(_voltage);
}
throw new RuntimeException ("Should be unreachable");
}
http://www.refactoring.com/catalog/replaceConditionalWithPolymorphism.html
cruft or debt?
67. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
class Swallow ...
double getSpeed() { return getBaseSpeed(); }
end class
class EuropeanSwallow ...
end class
class AfricanSwallow ...
double getSpeed() { return super.getSpeed - coconutLoad(); }
double coconutLoad() { return getLoadFactor() * _numberOfCoconuts; }
end class
class NorwegianSwallow ...
double getSpeed() { return (_isNailed) ? 0 : getBaseSpeed(_voltage); }
end class
69. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
cruft is a bad decision
• You are a professional developer
• You’re going to create unintentional cruft
• You have to clean up the existing cruft
71. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
The Trap
• Precedent for speed over quality
• Expectation of increased velocity
• Cruft slows you down
• Must write more cruft to keep up
• Ask permission to do your job correctly
76. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
winning strategy
Clean Constantly
• Never make an intentional mess
• Monitor your “Technical Debt”
• Follow the Boy Scout Rule
• Remember quality is your responsibility
77. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
winning strategy
Clean Constantly
• Never make an intentional mess
• Monitor your “Technical Debt”
• Follow the Boy Scout Rule
• Remember quality is your responsibility
• NEVER ask permission to do your job correctly
81. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
review
Technical Debt
• A strategic design decision
• Requires business to be informed
• Includes a pay-back plan
Cruft
• Happens
• Needs to be monitored and cleaned
• Is NOT Technical Debt
82. #DevBootcamp / #TechnicalDebtTrap / @DocOnDev
review
Technical Debt
• A strategic design decision
• Requires business to be informed
• Includes a pay-back plan
Cruft
• Happens
• Needs to be monitored and cleaned
• Is NOT Technical Debt
NEVER
ask
perm
issio
n
to
do
yo
ur
jo
b
co
rrectly