technical debt - phpbenelux

65
Elizabeth Naramore PHPBenelux January 28, 2011 Technical Debt 1

Upload: enaramore

Post on 20-Jan-2015

3.535 views

Category:

Technology


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Technical Debt - PHPBenelux

Elizabeth NaramorePHPBenelux

January 28, 2011

Technical Debt

1

Page 2: Technical Debt - PHPBenelux

Technical Debt:

What is it?

2

Page 3: Technical Debt - PHPBenelux

Technical Debt:

Why should we care?

3

Page 4: Technical Debt - PHPBenelux

"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 non-quite-right code counts as interest on that debt.

--Ward Cunningham, 1992

4

Page 5: Technical Debt - PHPBenelux

"I think that there were plenty of cases where people would rush software out the door and learn things but never put

that learning back into the program, and that by analogy, was borrowing money

thinking that you never had to pay it back.... eventually all your income

goes to interest and your purchasing power goes to zero."

5

Page 6: Technical Debt - PHPBenelux

Code or practicesthat will hinder your progressin the future.

What is technical debt?

6

Page 7: Technical Debt - PHPBenelux

Too much technical debtcan cripple your teamor organization.

Why should we care?

7

Page 8: Technical Debt - PHPBenelux

lack of documentationuntested codesuppressed errorsunshared knowledge between teams or peopleconfusing code, inconsistencies, "workarounds"local changes you've not committed

You have technical debt if you have:

8

Page 9: Technical Debt - PHPBenelux

code that doesn't follow coding standardsnon-existent or improperly used version controlunstable deployment processduplicate code blocksindividual code ownership3rd party software that needs updated or patched

Or, if you have:

9

Page 10: Technical Debt - PHPBenelux

Guess what?

10

Page 11: Technical Debt - PHPBenelux

We all have it.

11

Page 12: Technical Debt - PHPBenelux

Don't panic.

12

Page 13: Technical Debt - PHPBenelux

Some technical debtis ok.

13

Page 14: Technical Debt - PHPBenelux

It lets you hit a deadlineIt lets you test an experimental featureThe code is rarely touchedYou are coding based on reasonable expectations It allows you to extend startup moneyYour code is at the end of the life-cycle

It might make sense if:

14

Page 15: Technical Debt - PHPBenelux

This is also known asprudent

technical debt.

15

Page 16: Technical Debt - PHPBenelux

So when istechnical debt

not ok?

16

Page 17: Technical Debt - PHPBenelux

So when istechnical debt

not ok?

All the other times.

17

Page 18: Technical Debt - PHPBenelux

This is also known asreckless

technical debt.

18

Page 19: Technical Debt - PHPBenelux

Sometimes we knowwe are taking shortcuts,

but we do it anyway.

19

Page 20: Technical Debt - PHPBenelux

This is also known asdeliberate

technical debt.

20

Page 21: Technical Debt - PHPBenelux

Sometimes we don't know any better, or

the debt is not our fault.

21

Page 22: Technical Debt - PHPBenelux

inexperienced team memberschanging project requirementspost-release retrospectivessecurity patches or updates from 3rd parties

This debt could come from:

22

Page 23: Technical Debt - PHPBenelux

This is also known asinadvertent

technical debt.

23

Page 24: Technical Debt - PHPBenelux

4 ways to classifytechnical debt:

Prudent vs. RecklessDeliberate vs. Inadvertent

24

Page 25: Technical Debt - PHPBenelux

Martin Fowler's Quadrant

25

Page 26: Technical Debt - PHPBenelux

Martin Fowler's Quadrant

26

Page 27: Technical Debt - PHPBenelux

By minimizingdeliberate debt,

you make it easierto handle

inadvertent debt.

27

Page 28: Technical Debt - PHPBenelux

So now that we knowwhat it is,

what do we do with it?

28

Page 29: Technical Debt - PHPBenelux

We tackle our debtwith

D.E.B.T.

(see what I did there?)29

Page 30: Technical Debt - PHPBenelux

DiscoverEstimateBreak DownTask & Track

30

Page 31: Technical Debt - PHPBenelux

Where is our technical debt?

Discover

31

Page 32: Technical Debt - PHPBenelux

Where is our technical debt?

Ask the developers on your team Use the checklist mentioned earlier Use software like PHPUnderControl or Sonar

Discover

32

Page 33: Technical Debt - PHPBenelux

lack of documentationuntested codesuppressed errorsunshared knowledge between teams or peopleconfusing code, inconsistencies, "workarounds"local changes you've not committed

Discover

33

Page 34: Technical Debt - PHPBenelux

code that doesn't follow coding standardsnon-existent or improperly used version controlunstable deployment processduplicate code blocksindividual code ownership3rd party software that needs updated or patched

Discover

34

Page 35: Technical Debt - PHPBenelux

Where is our technical debt?

Ask the developers on your team Use the checklist mentioned earlier Use software like PHPUnderControl or Sonar

Discover

35

Page 36: Technical Debt - PHPBenelux

http://phpundercontrol.org/

Discover

36

Page 37: Technical Debt - PHPBenelux

PhpUnderControl uses:- PHPUnit- phpDocumentor- PHP_CodeSniffer

Discover

37

Page 38: Technical Debt - PHPBenelux

http://sonarsource.com

Discover

38

Page 39: Technical Debt - PHPBenelux

Sonar uses:- PHPUnit- PHP_CodeSniffer- PHPDepend- PHPMD- phpcpd

Discover

39

Page 40: Technical Debt - PHPBenelux

What will it take to pay it off?

How badly is it hurting us?

Estimate

40

Page 41: Technical Debt - PHPBenelux

The Sonar Formula

Debt(in man days)= cost_to_fix_duplications +cost_to_fix_violations +

cost_to_comment_public_API +cost_to_fix_uncovered_complexity +

cost_to_bring_complexity_below_threshold +cost_to_cut_cycles_at_package_level

Estimate

41

Page 42: Technical Debt - PHPBenelux

The Sonar Formula

Estimate

42

Page 43: Technical Debt - PHPBenelux

http://nemo.sonarsource.org

Estimate

43

Page 44: Technical Debt - PHPBenelux

Estimate

44

Page 45: Technical Debt - PHPBenelux

But how much is it costing us?

The Simple-ish Formula

Amount of the “loan” = cost to fix“Interest Rate” = Adverse impact on development

Estimate

45

Page 46: Technical Debt - PHPBenelux

Quantifying is hard.

OK to use other techniques to generalizethe interest rate.

Estimate

46

Page 47: Technical Debt - PHPBenelux

Use estimation technique that works for youGet input and buy-in from the team

Estimate

47

Page 48: Technical Debt - PHPBenelux

What do we do with it?

Break it Down

48

Page 49: Technical Debt - PHPBenelux

What do we do with it?

Every task breaks down into 2 categories:1. Debts where we continue paying interest2. Debts where we pay the principal

Break Down

49

Page 50: Technical Debt - PHPBenelux

How can we make it visible?

Task and Track

50

Page 51: Technical Debt - PHPBenelux

How can we make it visible?

Add it to bug tracker, task board, etc.

Task and Track

51

Page 52: Technical Debt - PHPBenelux

Paying it Off

52

Page 53: Technical Debt - PHPBenelux

Focus on higher interest rate items first

OR

Focus on small ticket items first.

Paying it Off

53

Page 54: Technical Debt - PHPBenelux

Dedicate time for technical debt reduction.

● Use time right after a release● Tech debt iteration ● Time each day for tech debt● Refactor as you go● Use off-season time

Paying it Off

54

Page 55: Technical Debt - PHPBenelux

Keep track of your progress.

Paying it Off

55

Page 56: Technical Debt - PHPBenelux

● Break past habits ● Group consensus & commitment● Teach your “children” well● Never file for bankruptcy● Live within your means● Anticipate your needs

Preventing Technical Debt

56

Page 57: Technical Debt - PHPBenelux

CHANGE MANAGEMENT

A Few Words About

57

Page 58: Technical Debt - PHPBenelux

Change Management

58

Page 59: Technical Debt - PHPBenelux

Change Management

59

Page 60: Technical Debt - PHPBenelux

1. Direct the Rider

Change Management

60

Page 61: Technical Debt - PHPBenelux

2. Motivate the Elephant

Change Management

61

Page 62: Technical Debt - PHPBenelux

3. Shape the Path

Change Management

62

Page 63: Technical Debt - PHPBenelux

PHP UnderControl: http://phpundercontrol.org

Sonar: http://www.sonarsource.com/(plus tech debt plugin)

Make sure to see:

63

Page 64: Technical Debt - PHPBenelux

http://joind.in/talk/view/2418

64

Page 65: Technical Debt - PHPBenelux

Want to contact me?

http://naramore.net/blog@ElizabethN

[email protected] IRC: ElizabethN

THANKS!

Image used with permission from Martin Fowler

65