Technical Debt - osbridge

82
Technical Debt Elizabeth Naramore Open Source Bridge June 2011

description

Technical debt is something that most project teams or independent developers have to deal with – we take shortcuts to push out releases, deadlines need to be met, quick fixes slowly become the standard. In this talk, we will discuss what technical debt is, when it is acceptable and when it isn’t, and strategies for effectively managing it, both on an independent and team level.

Transcript of Technical Debt - osbridge

Page 1: Technical Debt - osbridge

Technical DebtElizabeth NaramoreOpen Source Bridge

June 2011

Page 2: Technical Debt - osbridge

(Me.)

Page 3: Technical Debt - osbridge

Technical Debt

1. What is it?

Page 4: Technical Debt - osbridge

Technical Debt

2. Why should we care?

Page 5: Technical Debt - osbridge

Technical Debt

3. What do we do about it?

Page 6: Technical Debt - osbridge

“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

Page 7: Technical Debt - osbridge

“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

Page 8: Technical Debt - osbridge

“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.”

--Ward Cunningham, 1992

Page 9: Technical Debt - osbridge

“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.”

--Ward Cunningham, 1992

Page 10: Technical Debt - osbridge

1. What is Technical Debt?

Code or practicesthat will hinder your progressin the future.

Page 11: Technical Debt - osbridge

1. What is Technical Debt?

Code or practicesthat will hinder your progressin the future.

Page 12: Technical Debt - osbridge

2. Why should we care?

Too much technical debtcan cripple your teamor organization.

Page 13: Technical Debt - osbridge

2. Why should we care?

Too much technical debtcan cripple your teamor organization.

Page 14: Technical Debt - osbridge

3. What can we do about it?

Easy there, tiger. We’ll get to that.

Page 15: Technical Debt - osbridge

Where do wefind it?

Page 16: Technical Debt - osbridge

In our own code.

For example...

Page 17: Technical Debt - osbridge

Untested code.

You have technical debt if you have...

Page 18: Technical Debt - osbridge

Untested code.

How much time is wasted when changes break stuff and create more bugs?

You have technical debt if you have...

Page 19: Technical Debt - osbridge

Suppressed errors.

You have technical debt if you have...

Page 20: Technical Debt - osbridge

Suppressed errors.

(Psst. This doesn’t really make the error go away. I’ve tried.)

You have technical debt if you have...

Page 21: Technical Debt - osbridge

Confusing code, inconsistencies & workarounds

You have technical debt if you have...

Page 22: Technical Debt - osbridge

Confusing code, inconsistencies & workarounds

How much time has been wasted trying to sort through spaghetti code?

You have technical debt if you have...

Page 23: Technical Debt - osbridge

Legacy code

You have technical debt if you have...

Page 24: Technical Debt - osbridge

Legacy code.

How much time has been wasted trying to sift through cruft?

You have technical debt if you have...

Page 25: Technical Debt - osbridge

Code that doesn’t follow standards.

You have technical debt if you have...

Page 26: Technical Debt - osbridge

Code that doesn’t follow standards.

Code that is hard to read takes time to read.

You have technical debt if you have...

Page 27: Technical Debt - osbridge

Duplicate code blocks.

You have technical debt if you have...

Page 28: Technical Debt - osbridge

Duplicate code blocks.

Good for quilts. Not so good for fixing mistakes in code.

You have technical debt if you have...

Page 29: Technical Debt - osbridge

In things that affect our code.

For example...

Page 30: Technical Debt - osbridge

•Non-existent or improperly used VCS.•Unstable deployment process.•Individual code ownership.•Lack of documentation.•Unshared knowledge.•Third party code that needs updated/patched

You have technical debt if you have...

Page 31: Technical Debt - osbridge

Guess what?

Page 32: Technical Debt - osbridge

We all have it.

Page 33: Technical Debt - osbridge

Don’t panic.

Page 34: Technical Debt - osbridge

Sometechnical debt

is ok.

Page 35: Technical Debt - osbridge

It allows you to hit a deadline.

It might make sense if...

Page 36: Technical Debt - osbridge

It allows you to experiment.

It might make sense if...

Page 37: Technical Debt - osbridge

The code is rarely touched.

It might make sense if...

Page 38: Technical Debt - osbridge

You are coding for reasonable expectations.

It might make sense if...

Page 39: Technical Debt - osbridge

Your code is at the end of the life cycle.

It might make sense if...

Page 40: Technical Debt - osbridge

This kind of debtis known as

prudenttechnical debt.

Page 41: Technical Debt - osbridge

So when is debtnot ok?

Page 42: Technical Debt - osbridge

All the other times.

Page 43: Technical Debt - osbridge

This kind of debtis known as

recklesstechnical debt.

Page 44: Technical Debt - osbridge

Sometimes we knowwe are taking

shortcuts,but we do it anyway.

Page 45: Technical Debt - osbridge

This kind of debtis known asdeliberate

technical debt.

Page 46: Technical Debt - osbridge

Sometimes we don’t know any better,

or the debt is not our fault.

Page 47: Technical Debt - osbridge

This could come from:

•inexperienced team members•changing project requirements•post-release retrospectives•security patches or updates from third parties

Page 48: Technical Debt - osbridge

This kind of debtis known asinadvertent

technical debt.

Page 49: Technical Debt - osbridge

4 ways to classifytechnical debt:

prudent vs. recklessdeliberate vs. inadvertent

Page 50: Technical Debt - osbridge

Martin Fowler’s Quadrant

Page 51: Technical Debt - osbridge

Martin Fowler’s Quadrant

Page 52: Technical Debt - osbridge

By minimizing deliberate debt, we can better handle

inadvertent debt.

Page 53: Technical Debt - osbridge

So now that we know what it is, let’s move on.

3. What can we do about it?

Page 54: Technical Debt - osbridge

We tackle our debt with

D.E.B.T.(see what I did there?)

Page 55: Technical Debt - osbridge

Discover

Where is our technical debt?

Page 56: Technical Debt - osbridge

•Ask your developers•Use the list mentioned before•Use software like Sonar

Where is our technical debt?

Page 57: Technical Debt - osbridge

Estimatehttp://sonarsource.org

Page 58: Technical Debt - osbridge

Sonar

Page 59: Technical Debt - osbridge

Sonar

http://nemo.sonarsource.org

Page 60: Technical Debt - osbridge

SonarApache Jackrabbit:

Page 61: Technical Debt - osbridge

Sonar

Sonar + Technical Debt Plugin

Page 62: Technical Debt - osbridge

EstimateHow much is it costing us?

The Simple-ish Formula

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

development

Page 63: Technical Debt - osbridge

EstimateHow much is it costing us?

Determining the “interest rate” is hard.

Use estimation techniques that work for you.

Page 64: Technical Debt - osbridge

Break Down

Page 65: Technical Debt - osbridge

Break DownWhat do we do with this mass of technical debt?

All debt breaks down into 2 categories:

1. Debts where we continue to pay interest.2. Debts where we pay on the principal.

Page 66: Technical Debt - osbridge

Task and Track

Page 67: Technical Debt - osbridge

Task and Track

The key is making it visible.

Page 68: Technical Debt - osbridge

Task and Track

The key is making it visible.

Page 69: Technical Debt - osbridge

Task and Track

Add tasks to bug trackerAdd to task board

Show progress to all

Page 70: Technical Debt - osbridge

Paying it Off

Page 71: Technical Debt - osbridge

Paying it Off

Focus on high interest items

OR

Focus on small tickets

Page 72: Technical Debt - osbridge

Paying it OffDedicate time.

• Use time right after a release• Tech debt iteration/sprint• Time each day for tech debt• Refactor as you go• Use off-season time• Designated Debt Payer

Page 73: Technical Debt - osbridge

Paying it Off

Keep track of your progress

AND

communicate to all.

Page 74: Technical Debt - osbridge

Prevention

Page 75: Technical Debt - osbridge

Prevention

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

Page 76: Technical Debt - osbridge

A few words aboutchange

management.

Page 77: Technical Debt - osbridge

You should read this.

Page 78: Technical Debt - osbridge

Change Management

Page 79: Technical Debt - osbridge

Change Management

1. Direct the rider.

Page 80: Technical Debt - osbridge

Change Management

2. Motivate the elephant.

Page 81: Technical Debt - osbridge

Change Management

3. Shape the path.

Page 82: Technical Debt - osbridge

Want to contact me?

http://naramore.net/blog@ElizabethN

[email protected] IRC: ElizabethN

THANKS!

Image used with permission from Martin Fowler