83
Making the Case for Refactoring to Non-Technical Managers Adam Juda TapRun, LLC

Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 2: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:
Page 3: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:
Page 4: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Who am I?

Adam Juda, MSE, MBA, PMP

● Programmer● Project Manager● Consultant ( TapRun, LLC )

Page 5: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Outline

● What's technical debt?● How to ask● Whom to ask● When to ask● Q&A

Page 6: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

What is technical debt?

Page 7: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Bad software

Page 8: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

No coherent design Bad documentation Slow build process

Broken tests Huge classes High cyclomatic complexity

Huge method signatures Duplicated code Not following style guide

Large methods Tight coupling Low cohesion

Low maintainability Low reliability Low scalability

How is it bad?

Page 9: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Traditional view of technical debt

Behind Schedule

Page 10: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Traditional view of technical debt

Behind Schedule Incur Debt

Page 11: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Traditional view of technical debt

Behind Schedule Incur Debt

Reduced Productivity

Page 12: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Traditional view of technical debt

Behind Schedule Incur Debt

Not Enough Time

Reduced Productivity

Page 13: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Traditional view of technical debt

Behind Schedule Incur Debt

Not Enough Time

Reduced Productivity

Page 14: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Traditional view of technical debt

Behind Schedule Incur Debt

Not Enough Time

Reduced Productivity

Page 15: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Seven common approaches

Page 16: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Approach #0: I wanna (aka the mountain)

Page 17: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

No.

Page 18: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Approach #1: Complaining

● It's painful to work with.● We gotta, it's gross!● The code smells...

Page 19: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Stop whining.

Page 20: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Approach #2: Begging

Please! I'll work extra hard for you.Let me fix the code!

Page 21: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

A favor? Hmm...

Page 22: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Approach #3: Making analogies

● A car that hasn't had an oil change● A fishtank that hasn't been filtered● A litter box that hasn't been emptied

Page 23: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

An employee who wants to get fired

Page 24: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Approach #4: Quantitative analysis

The code has a cyclomatic complexity of 40!

Page 25: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

...

Page 26: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Húsið er á eldinn!

Page 27: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Your house is on fire!

Page 28: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Approach #5: Hypotheticals

● Morale might go down● Our software might crash● We might be late

Page 29: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Everything might be fine.

Page 30: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Approach #6: Be a ninja!

AKA "Be a Professional"

Page 31: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

What would you say you do here?

Page 32: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Technical debt: Another definition

A trade-off made in order to meet a business objective

Page 33: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

"If you are involved in a game, everything ends up being a set of

trade-offs."-- Gabe Newell

(co-founder of Valve)

Page 34: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

$field1 = '/^def*re+o?/';

preg_match($field1, $field2, $field3, PREG_OFFSET_CAPTURE, 3);

$field3 == $non_field + $field_field ? 7 : 3;

$ro->sn($field3 . $field1).extt(4, $pep);

Page 35: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:
Page 36: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

"Business staff thinks we can load up technical debt because they never truly see the

consequences."

-- Steve McConnell

Page 37: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

"But those consequences are there… they are just never expressed in a way that the business

staff can engage with."

-- Steve McConnell

Page 38: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

$ $$$Refactor

Page 39: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

But I'm just a programmer!

Page 40: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

http://xkcd.com/303/

Page 41: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Step #1: Gather information

● Labor - $200/hr● Build process - 2 hrs● Builds / year - 100● Time to rewrite: 40 hrs

Page 42: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Step #2: Calculate the costs

Cost to fix = $200 * 40 hours

= $8,000

Page 43: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Refactor$8K ?

Page 44: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Step #3: Calculate the benefits

Savings = $200 * 2 hrs * 100 builds

= $40,000

Page 45: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Refactor$8K $40K

Page 46: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Dollarize when possible

● Labor● Server time● Risk of rework● Employee morale?

Page 47: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

DebtThe Scrum ^ Backlog

Page 48: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

The case for debt

● Debt Name: ____________________● Date: _________________________● Short Term Savings: _____________● Long Term Cost: _________________● Cost to Repair: __________________● Notes: _________________________

Page 49: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

There's an unexpected benefit...

Page 50: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Under 3 minutes?

Just do it.

Page 51: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Whom should you ask?

Page 52: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:
Page 53: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Whom should you ask?

● Controls resources● Will receive substantial value

Page 54: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:
Page 55: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Let's do some more math...

● $25,000 extra to each project● 100 projects use it● $75,000 to refactor

Page 56: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Cost to fix: $75,000

Savings: $25,000 * 100 == $2.5 million

Page 57: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Refactor$75K $2.5M

Page 58: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Refactor$75K $2.5M

Page 59: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

● $25,000 extra to each project● 100 projects use it● $75,000 to refactor

Page 60: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Refactor$75K $25K

Page 61: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Project managers vs product owners...

● Productivity?● Morale?● Maintenance costs?● User satisfaction?● Long-term strategy?● Long-term risk?

Page 62: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

When should you ask?

Page 63: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

What others say...

● At the beginning of a project● At the end of a project● When technical debt is highest

Page 64: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

What I say

● When payback time is smallest● When payback will be obvious● When ROI is largest

Page 65: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

ROI

Flagship software Discontinued

software

Page 66: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:
Page 67: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

For some values of $1:$1 != $1

Page 68: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Traditional view of technical debt

Behind Schedule Incur Debt

Not Enough Time

Reduced Productivity

Page 69: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Improved view of technical debt

Debt Worth it? Incur Debt

Pay Debt(if worth it)

Increased Successes

Page 70: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

This won't work well if...

● Lack of trust / honesty● Arbitrary constraints● Unwillingness to improve● Incentive not to improve

Page 71: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

The five levels of debt monetization

Level 0: Establish open communication

Level 1: Communicate business goals

Level 2: Present options

Level 3: Dollarize options

Level 4: Groom & optimize

Page 72: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Summary

Page 73: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

● Technical debt isn't always bad● Find the right section of code● Find the right person● Speak to his incentives● Speak at the right time

Page 74: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Adam Juda - TapRun, LLC

[email protected]● https://TapRun.com

Contact Me

Page 75: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Backup Slides

Page 76: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Martin Fowler's types of debt

Reckless

Deliberate

Prudent

Inadvertent

No time for design

The consequences are worth it

What's layering?

Only now do we understand it

Page 77: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Martin Fowler's types of debt

Reckless

Deliberate

Prudent

Inadvertent

No time for design

The consequences are worth it

What's layering?

Only now do we understand it

Page 78: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

No Silver Bullet: Essence and Accidents of Software Engineering

Page 79: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

In a matrix environment...

You can tax the projects

Page 80: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

ROI

Cost

Worthwhile

Not worthwhile

Page 81: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Debt Removal

Added Value

Page 82: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Debt Removal

New Functionality

Page 83: Making the Case for Refactoring to Non-Technical ManagersLet's do some more math... $25,000 extra to each project 100 projects use it $75,000 to refactor. Cost to fix: $75,000 Savings:

Estimating with uncertainty

(optimistic +

4* average +

pessimistic) / 6