technical debt

47
© ThoughtWorks 2011 Technical Debt The ‘Silent’ Application Killer Tuesday, 8 November 11

Upload: kmanthei

Post on 12-May-2015

635 views

Category:

Economy & Finance


4 download

DESCRIPTION

Graham Brooks - Agile East 2011

TRANSCRIPT

Page 1: Technical Debt

© ThoughtWorks 2011

Technical DebtThe ‘Silent’ Application Killer

Tuesday, 8 November 11

Page 2: Technical Debt

© ThoughtWorks 2011

Graham Brookshttp://www.thoughtworks.com/blogs/current

http://www.grahambrooks.com/blog

@wookie870

Tuesday, 8 November 11

Page 3: Technical Debt

Outline

• Definition

• Why is it important?

• Symptoms and signs

• Debt resolution strategies

Tuesday, 8 November 11

Page 4: Technical Debt

Technical Debt

Tuesday, 8 November 11

Page 5: Technical Debt

Technical Debt

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

Tuesday, 8 November 11

Page 6: Technical Debt

Consciously taking on debt might allow you to get something sooner

Tuesday, 8 November 11

Page 7: Technical Debt

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

Page 8: Technical Debt

Some might see this as an excuse to write poor code.

Never write poor code

Tuesday, 8 November 11

Page 9: Technical Debt

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

Page 10: Technical Debt

Evidence is anecdotal and based on personal experience of many projects

Tuesday, 8 November 11

Page 11: Technical Debt

Time

Cos

t of

Cha

nge

No debt Management

Tuesday, 8 November 11

Page 12: Technical Debt

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

Page 13: Technical Debt

Time

Cos

t of

cha

nge

Tuesday, 8 November 11

Page 14: Technical Debt

Teams like these get better at rewrites.

They don’t learn how to continuously deliver value indefinitely.....

Tuesday, 8 November 11

Page 15: Technical Debt

Time

Cos

t of

Cha

nge

No debt Management

Technical Debt Managed

Tuesday, 8 November 11

Page 16: Technical Debt

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

Page 17: Technical Debt

Symptoms and Signs

Tuesday, 8 November 11

Page 18: Technical Debt

Productivity

Tuesday, 8 November 11

Page 19: Technical Debt

Iteration

Velocity

Tuesday, 8 November 11

Page 20: Technical Debt

Iteration

Velocity

Tuesday, 8 November 11

Page 21: Technical Debt

Iteration

Velocity

Tuesday, 8 November 11

Page 22: Technical Debt

Iteration

Velocity

Tuesday, 8 November 11

Page 23: Technical Debt

Iteration

Velocity

Tuesday, 8 November 11

Page 24: Technical Debt

Iteration

Velocity

Tuesday, 8 November 11

Page 25: Technical Debt

Iteration

Velocity

Tracer Stories1 Point1 Point1 Point1 Point1 Point1 Point1 Point1 Point

Time

7h 5h 7h 10h

5-10 months

Tuesday, 8 November 11

Page 26: Technical Debt

Code

Tuesday, 8 November 11

Page 27: Technical Debt

Code Review

Tuesday, 8 November 11

Page 28: Technical Debt

“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

Page 29: Technical Debt

http://www.osnews.com/story/19266/WTFs_mTuesday, 8 November 11

Page 30: Technical Debt

Readability is a key

Tuesday, 8 November 11

Page 31: Technical Debt

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

Page 32: Technical Debt

Remove Unused ‘stuff ’

• Unused features

• Unused files and tools

• Unused classes

• Unused methods

• Unused lines

Tuesday, 8 November 11

Page 33: Technical Debt

Duplication

Direct duplication

Exact Code copies

Aggressive

Algorithmically Equivolent

Tool tip: Simian

Tuesday, 8 November 11

Page 34: Technical Debt

!"

#!"

$!"

%!"

&!"

'!!"

'#!"

'$!"

'%!"

()**

+,-./

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

Page 35: Technical Debt

Toxicity

250 branches in a single class

Tuesday, 8 November 11

Page 36: Technical Debt

Clean Toxic

Volatile

Stable Leave alone Refactor later

!Refactor Now!Volatile

requirements?Monitor

Tuesday, 8 November 11

Page 37: Technical Debt

Time

Number of te

sts/feat

ures

Application LOC

Test LOC

Tuesday, 8 November 11

Page 38: Technical Debt

Debt resolution strategies

Tuesday, 8 November 11

Page 39: Technical Debt

Stop the Line

• Works for major changes

• Challenging to implement

• Smells of a rewrite

• Short

Tuesday, 8 November 11

Page 40: Technical Debt

Little and often

• Make improvement part of the process:

• “Improvement as part of every change”

• Stangler pattern

Tuesday, 8 November 11

Page 41: Technical Debt

It’s going to get worse before it gets better

Time

Productivity

Cost of Change

Current Situation

Desired State

Tuesday, 8 November 11

Page 42: Technical Debt

Closing Thoughts

Tuesday, 8 November 11

Page 43: Technical Debt

• Imagine you have joined a new team

• Run metrics

• Estimate debt

• Plan next steps

• Execute the plan

First Steps

Tuesday, 8 November 11

Page 44: Technical Debt

Things Change

New capabilities

Libraries

Frameworks

OS

Software Rusts

Tuesday, 8 November 11

Page 45: Technical Debt

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

Page 46: Technical Debt

Questions?

Tuesday, 8 November 11

Page 47: Technical Debt

© ThoughtWorks 2008

Thank You!http://www.thoughtworks.com/blogs/current

http://www.grahambrooks.com/blog

@wookie870

[email protected]

Tuesday, 8 November 11