24
Tech debt will kill us Managing technical debt at enterprise scale with Sonarqube by Julian Warszawski

Tech debt will kill us

Embed Size (px)

Citation preview

Page 1: Tech debt will kill us

Tech debt will kill us

Managing technical debt at enterprise scale with Sonarqube

by Julian Warszawski

Page 2: Tech debt will kill us

What is tech debt

• Abstract term

• Lots of definitions

• Not useful

Page 3: Tech debt will kill us

Which terms associate with tech debt?

pressure

long term goals

short term goals

clean code

hack

accidental design

automation

workaround

Page 4: Tech debt will kill us

What is tech debt

forget code quality

forget bug count

forget engineers morale

Delivery Speed ~ 1/Tech Debt

Only thing to know about effects of tech debt

Page 5: Tech debt will kill us

Why will it kill us

It takes 2 months for anyone to ramp

up on this codebase

It used to take 5 people to keep

up. Now it is 25.

95% of the team is fixing

bugs

It will be easier to rewrite this

component than extend it.

Page 6: Tech debt will kill us

Why delivery speed drops?

• Designing from scratch is super fast

• After first sprint you don’t design from scratch

• Existing complexity slows down further design

• Complexity ALWAYS grows

• There is domain complexity and accidental complexity

• You CAN control accidental complexity

Page 7: Tech debt will kill us

What can we do

src: sixsigmadaily.com

Page 8: Tech debt will kill us

Define

Accidental complexity

Untested code

Tangled packagesLack of cohesion

Copy-paste code

not following best practices

Page 9: Tech debt will kill us

Measure

• Java: checkstyle, pmd, jacoco, pitest, …

• Python: Pylint

• C++: cppcheck, gcov, custom plugins.

• Other languages: C#, SQL, PHP, Flex, XML, Groovy and others

Page 10: Tech debt will kill us

Analyze

Page 11: Tech debt will kill us

Improve

Page 12: Tech debt will kill us

Control

compile

unit testing

integration testing

quality gate

functional testing

ship it

Page 13: Tech debt will kill us

Sonarqube

sonar dashboard sonar runner

source repo

CI Servercommit pull

run

publish

Page 14: Tech debt will kill us

DEMO

demo

Page 15: Tech debt will kill us

What’s in it for DEV

Less tech debt

More time for features

better software

Ambitious DEVMy code will

be PROLazy DEVLess possibility for something to break. No

STRESS

Page 16: Tech debt will kill us

What’s in it for PM

Less tech debt

More time for features

predictability

Agile PMWe can deliver

fasterWaterfall PMFinally

everything goes according

to PLAN

Page 17: Tech debt will kill us

What’s in it for CEO

Less tech debt

More time for features

improved delivery

capabilities

Fresh CEOI don’t have to worry about

BAU, can focus on strategy

Retiring CEOClients are

happy, stocks are up

Page 18: Tech debt will kill us

Doubts

• This does not present REAL design debt. It hides the real design debt.

• Yet another step in our build pipeline. Can we afford it?

• Focus will be shifted from delivering products to improving sonar metrics.

Page 19: Tech debt will kill us

This is not REAL design debt

• Accidental complexity is real design debt

• Untested code is real design debt

• Accurate correlates of design problems

• Degradation: correlate of process problems

• By observing symptoms, you can be proactive

Page 20: Tech debt will kill us

Another step in the pipeline

• No, if set up correctly

• Quality gates – warnings and fails

• Does not have to monitor every commit (nightly checks)

• Do not block the pipeline, allow fast reverts

• Focus on prevention

Page 21: Tech debt will kill us

Focus shifted to improving metrics

• These metrics are symptoms, not the essence

• You don’t fix tech debt by just fixing compiler warnings, test coverage or static violations

• Do not compete for grades

• DO NOT MANDATE THRESHOLDS!!!

Page 22: Tech debt will kill us

DO NOT MANDATE THRESHOLDS

• People should work 8 hours a day

• Do you have alerts if they leave job too early?

• Thresholds promote ignorance

• E. g. it is more important to write good tests than achieving the coverage goal

• Boy scout rule: Leave the code simpler and cleaner than it was when you saw it.

Page 23: Tech debt will kill us

Who benefits more

Game DevelopmentFire and forgetSales POCDelivering in 1 month more critical than future-proofing

Codebase is representing a core productProduct addresses long term strategyProduct will be extended for years

little value lots of value

Page 24: Tech debt will kill us

QUESTIONS

any