from technical debt to technical health

48
debt to technical health Copyright © 2016 Declan Whelan Declan Whelan Agile coach, developer

Upload: declan-whelan

Post on 16-Apr-2017

571 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: From Technical Debt to Technical Health

From technical debt to technical

health

Copyright © 2016 Declan Whelan

Declan Whelan Agile coach, developer

Page 2: From Technical Debt to Technical Health

From technical debt to technical

health

Copyright © 2016 Declan Whelan

Declan Whelan Agile coach, developer

Page 3: From Technical Debt to Technical Health

Tom GrantSenior consultant,

Net Objectives

Thanks Tom!

Page 4: From Technical Debt to Technical Health

Technical debt is the temptation built into software innovation

Page 5: From Technical Debt to Technical Health

The good newsSoftware development encountersfewer constraints than other forms of invention:

• No physical constraints

• Lower material costs

• Fewer regulations

• Near instantaneous market delivery

Page 6: From Technical Debt to Technical Health

The bad newsSoftware development encountersfewer constraints than otherforms of invention:

• It’s easy to cut corners

• The incremental cost of cutting corners is low

• Hard to go back and do the work the right way

• Cutting corners imposes a rising cost on innovation

Page 7: From Technical Debt to Technical Health

We’re tempted to cut cornersAnd we eventually pay for our sins

Page 8: From Technical Debt to Technical Health

What is technical debt?

D

Page 9: From Technical Debt to Technical Health

“Shipping first-time code is like going into debt.

A little debt speeds development so long as it is paid back promptly with refactoring.

The danger occurs when the debt is not repaid. Every minute spent on code that is not quite right for the programming task of the moment counts as interest on that debt.

Entire engineering organizations can be brought to a stand-still under the debt load of an unfactored implementation…”

Ward Cunningham

What Ward said …

Page 10: From Technical Debt to Technical Health

A textbook definitionThe increased difficulty in writing new code, or maintaining code, that is the natural result of…

• Shortcuts• Bad coding practices• Hacks• Other times when we wish, in

hindsight, we had coded more carefully

Page 11: From Technical Debt to Technical Health

From Brian Foote:

A BIG BALL OF MUD …

a haphazardly structured, sprawling, sloppy, duct-tape and

bailing wire, spaghetti code jungle.

http://www.laputan.org/mud/

Page 12: From Technical Debt to Technical Health

A practical definition

Stuff in the code that slows us down!

Page 13: From Technical Debt to Technical Health

You now Future you

I’M GETTING TONS OF CODING DONE!

WHEEEEEE!

Changing the code takes

sooo loooong…

Page 14: From Technical Debt to Technical Health

How do we create it?Very easily, and here are a few common examples:

• Gotta get this out now!

• I don’t have the time to <some good practice>…

• It’s just a small thing, we’ll fix it after we ship.

• No code reviews

T

Page 15: From Technical Debt to Technical Health

What TD is notQUALITY DEBT Unidentified defects, unknown defect trends or

levels, lack of clarity about quality targets.

PROCESS DEBT Poor processes within the team, value stream, and larger organization.

FEATURE DEBT Missing capabilities in the code that lower its value.

UX DEBT A poor user experience, lowering the code’s value.

SKILL DEBT Missing or weak skills within the team.

TD may contribute to these problems.These problems may contribute to TD.

Page 16: From Technical Debt to Technical Health

What is the impact of technical debt?

D

Page 17: From Technical Debt to Technical Health

On the individual• Harder to add new software

value• Harder to fix problems• Harder to work in any part of

the code• Harder to get motivated

about working in the code• I hear Company X is hiring…• Is this the career I wanted?

Page 18: From Technical Debt to Technical Health

On the team• Lower velocity• Greater variance in velocity• Harder to break down stories• Less fluidity in task assignment• Less flow within the team• Harder to make reliable plans• Lower team morale, higher

turnover

Page 19: From Technical Debt to Technical Health

On the organization• Reduced value of software assets• Harder to manage the portfolio of these

assets• Harder to change team or team

membership• Reduced flow in the software value

stream• Slower and less reliable responsiveness

to critical problems• Greater friction between team and

other groups

Page 20: From Technical Debt to Technical Health

What makes it so hard to control technical debt?

T

Page 21: From Technical Debt to Technical Health

Technical debt gets out of control quicklyDeadline pressures and uncontrolled demand

• Creates incentives for cutting corners

• Don’t think through decisions

Page 22: From Technical Debt to Technical Health

Technical debt gets out of control quickly

Unmeasured impact

• Hard for non-technical people to grasp importance

• If no time to avoid technical debt, there’s no time to assess it

• Often lack data, especially about deep patterns

Page 23: From Technical Debt to Technical Health

Technical debt gets out of control quickly

Lack of experience

• Unaware of agile engineering practices

• Unaware of the level of risk

• Unaware of the sources of risk

Page 24: From Technical Debt to Technical Health

Technical debt gets out of control quickly

No awareness among stake holders and executives

• Don’t know or see how they contribute

• Easier to blame the people than it is to address the problem

Page 25: From Technical Debt to Technical Health

What’s really bad about TDChances are, someone else left it for you

Page 26: From Technical Debt to Technical Health

What can we do about technical debt?

Page 27: From Technical Debt to Technical Health

Exercise: Dice of Debt GamePlay the game

• Get into groups

• Play for about 20 minutes

• Please leave us the score sheet, dice and rules at the end

• Please take the chart with you

Page 28: From Technical Debt to Technical Health

Discuss with people at your table• Based on the game, what is the best

strategy for dealing with technical debt?

• Is the strategy you used in the game at all similar to the strategy you follow in real life?

• Do you have a better strategy?• What is standing in your way?

D

Page 29: From Technical Debt to Technical Health

How can we do move to technical health?

Page 30: From Technical Debt to Technical Health

The OODA Loop – John Boyd

https://en.wikipedia.org/wiki/OODA_loop

Page 31: From Technical Debt to Technical Health

Observe: You can’t manage what you don’t measure

Page 32: From Technical Debt to Technical Health

Observe: Measure technical debt

• Individual sources: the code• Cyclomatic complexity• Duplicate code• Size of methods and classes

• Aggregate effects: team & organization

• Velocity• Team happiness • % of capacity lost to TD

Page 33: From Technical Debt to Technical Health

Observe: Find the measures that work for your team

Approaches like the SQALE model help assess amount and impact

Page 34: From Technical Debt to Technical Health

Orient: yourself to the crime scene

• Orient your team and the organization to the overall impact

• Look for code that changes the most

• Automate the measures• Make the measures visible!

Page 35: From Technical Debt to Technical Health

Decide: to stop writing crappy codeInclude something in your team working agreement about technical debt.

At an organizational level support and respect team agreements.

http://blog.crisp.se/2013/07/12/henrikkniberg/the-solution-to-technical-debt

Page 36: From Technical Debt to Technical Health

Decide: to start cleaning up old crapInclude something in your team working agreement about legacy code.

http://blog.crisp.se/2013/07/12/henrikkniberg/the-solution-to-technical-debt

Page 37: From Technical Debt to Technical Health

Decide: the teamSome examples …

• Make code review part of the done criteria

• Dedicate capacity to TD reduction and prevention

• Do static code analysis• Follow the Boy Scout Rule!

Page 38: From Technical Debt to Technical Health

Decide: Make TD impact part of planning

• Portfolio• What investments are we willing to make?• How far are we willing to pursue them?

• Project/product• What effect is TD having on…

• Release planning?• Sprint planning?• Re-planning?

• What are the rules for deliberately assuming TD?• Risks of taking on TD• Risks of not taking on TD

• How is TD prevention and reduction built into our plans?

Page 39: From Technical Debt to Technical Health

Act: Fix the codeName

Good practice Affects Rationale Remediation

Tested-CCOVA file has an acceptable level of code coverage.

ReliabilityUnit tests verify that the code performs as expected without errors.

Write tests in order to cover uncovered lines. Test variable values.

Clear-INVLA "for" loop iterator is not modified in the body of the loop.

Reliability

Modifying the loop iterator inside the loop may lead to unreliable behavior. Code is also more difficult to understand.

Restructure the code.

Clear-DEST

All "if"/"for"/"while" structures are delimited by curly braces.

ChangeabilityUsing curly braces for control structures helps to better understand the code.

Enclose the core of the structure with curly braces.

Clear-CLDOPublic classes and public methods are documented.

Maintainability Code is easier to

understand

Identify public classes and public methods without documentation.Write additional meaningful comments.

Agile Alliance Debt Analysis Model (A2DAM)

Page 40: From Technical Debt to Technical Health

Act: Start automatingIdentify manual steps and automate! Automate tests.

Automate build scripts.

Page 41: From Technical Debt to Technical Health

Act: Start agile engineering practicesTest driven development

Refactoring

Simple Design

Pair/Mob Programming

Page 42: From Technical Debt to Technical Health

Systems Thinking

94% of the belong to the system (responsibility of management), 6% are special cause.

— W. Edwards Deming

Page 43: From Technical Debt to Technical Health

Apply Systems Thinking

Page 44: From Technical Debt to Technical Health

Apply Systems Thinking (5 minutes)• At your table brainstorm factors that contribute to

technical debt. Some things to consider:

• Hiring practices• Outsourcing• Staffing up for projects• Project deadlines• Etc.

• Rank then from biggest to smallest impact.

Page 45: From Technical Debt to Technical Health

Apply Systems ThinkingAt your table brainstorm actions that would help move towards technical health:

• Observe: what measures could you make?

• Orient: how could you make that information relevant?

• Decide: how can you make better decisions supporting technical health?

• Act: what can you actually do in the next 2 weeks?

Page 46: From Technical Debt to Technical Health

The conclusion should be obvious

Short-term investment in technical debt reduction and prevention allows for increased productivity in the future

Technical debt just keeps accumulating. Our productivity plummets.

D

Technical Health!

Page 47: From Technical Debt to Technical Health

The Agile Alliance can help!

https://www.agilealliance.org/resources/initiatives/technical-debt/

GENERAL INFO White paper

CODE A2ADAM spreadsheet

TEAMProject

management white paper

JUSTIFICATION Dice Of Debt game

Understand the nature of technical debt

Assess the sources and burden of technical debt

Take steps proven to be effective

Educate people about the importance of dealing with

technical debt

Page 48: From Technical Debt to Technical Health

QUESTIONS?