You cant be agile if your code sucks

83
You can’t be Agile if your code sucks Peter Gfader twitter.com/peitor Start the convers

description

What is "Agile"? Why would someone like to be agile? What are the 3 pillars for agile software development? How can you achieve technical excellence in your software teams? Are developer skills more important than languages, methods or frameworks?

Transcript of You cant be agile if your code sucks

Page 1: You cant be agile if your code sucks

You can’t be Agile if your code sucks

Peter Gfadertwitter.com/peitor

Start

the

convers

ation

Page 2: You cant be agile if your code sucks

My Mission

#1 Agile??

#2 Code & Craftmanship

Page 3: You cant be agile if your code sucks

About me

Page 4: You cant be agile if your code sucks

Peter Gfader

[email protected]://blog.gfader.comtwitter.com/peitor

Page 5: You cant be agile if your code sucks

Agile

Page 6: You cant be agile if your code sucks

What is Agile for you?

Page 7: You cant be agile if your code sucks

http://agilemanifesto.org/

Page 8: You cant be agile if your code sucks
Page 9: You cant be agile if your code sucks

„And we

really mean

it“

Page 10: You cant be agile if your code sucks

The Agile Manifesto invites wimpy-ness"… Individuals and interactions over processes & tools…"

Yayy!! I don't have to follow those stupid processes any more!

"… Working software over comprehensive documentation…"W00t!! Dump the documentation! I LOVE this agile stuff!

"… Customer collaboration over contract negotiations…"I'm done when I'm done and I never have to say when!

"… Responding to change over following a plan…"No plans! No project managers! No architects!

Where do I sign up?© Alistair Cockburn

Warmduscher

Page 11: You cant be agile if your code sucks

What is Agile for you?

Page 12: You cant be agile if your code sucks

Lean

XPScrum

Agile

RUP

Kanban SAFe

What is all this stuff?

Enterprise

ScrumCrystal

DSDM

© Henrik Knieberg

Page 13: You cant be agile if your code sucks

Pair programming

Product Owner role

Physical tools

Process toolsa.k.a. ”organizational patterns”

Thinking toolsa.k.a. ”mindsets” or ”philosophies”

Lean AgileToolkitsa.k.a. ”frameworks”

Scrum XP

Visualize the workflowTo do Dev Release

H C

2Test

35Done!

3

D

G

K

A

B

FLOW

Kanban

Systems ThinkingTheory of Constraints

RUP

Tool”anything used as a means of accomplishing a task or purpose.”- dictionary.com

© Henrik Knieberg

Page 14: You cant be agile if your code sucks

© Henrik Knieberg

Page 15: You cant be agile if your code sucks

The illusion of a ”bad tool”

The old toolwas better!

Don’t blamethe tool!

© Henrik Knieberg

Page 16: You cant be agile if your code sucks

KeypointCompare for

understanding, not judgement

© Henrik Knieberg

Page 17: You cant be agile if your code sucks

KeypointCompare for

understanding, not judgement

Tools can be combined

© Henrik Knieberg

Page 18: You cant be agile if your code sucks

• Know your Goalo Why

• Agile/Lean are tools, not goals• Don’t limit yourself to one tool• Experiment & enjoy the rideoDon’t worry about getting it right

from start•We won’t

Take-away points

© Henrik Knieberg

Page 19: You cant be agile if your code sucks

Lean

XPScrum

Agile

RUP

Kanban SAFe

Enterprise

ScrumCrystal

DSDM

© Henrik Knieberg

Page 20: You cant be agile if your code sucks

The important thing isn’t the

process.

© Henrik Knieberg

Page 21: You cant be agile if your code sucks

The important thing isn’t the

process.

The important thing is the process

for improving your process.

© Henrik Knieberg

Page 22: You cant be agile if your code sucks

The important thing isn’t the

process.

The important thing is the process

for improving your process.

Continuous Improvement© Henrik Knieberg

Page 23: You cant be agile if your code sucks

3 essential skills neededregardless of process

Software craftsmanship

Splitting the system into useful pieces

Retrospectives

As a buyerI want to save my shopping cartso that I can continue shopping later

© Henrik Knieberg

Page 24: You cant be agile if your code sucks

3 essential skills neededregardless of process

Software craftsmanship

Splitting the system into useful pieces

Retrospectives

As a buyerI want to save my shopping cartso that I can continue shopping later

+ Communication Skills

+ Facilitator / ScrumMaster

+ Vision

Page 25: You cant be agile if your code sucks

3 essential skills neededregardless of process

Software craftsmanship

Splitting the system into useful pieces

Retrospectives

As a buyerI want to save my shopping cartso that I can continue shopping later

Page 26: You cant be agile if your code sucks

Essential Skill:

Software craftsmanship

Page 27: You cant be agile if your code sucks

1) Software is never written once and never

changed

Page 28: You cant be agile if your code sucks

[LARM03]

Page 29: You cant be agile if your code sucks

2) How to slow down your project?

Page 30: You cant be agile if your code sucks
Page 31: You cant be agile if your code sucks

Write crappy code

Page 32: You cant be agile if your code sucks

Write crappy code Make code easier to read

Page 33: You cant be agile if your code sucks

Easy code to read Easy code to change

maintain

Page 34: You cant be agile if your code sucks

Why do you write bad code?

Page 35: You cant be agile if your code sucks

#1 reason for Bad code

We write bad code, because we read bad code

Page 36: You cant be agile if your code sucks

Code Readings?• Code Reviews• Peer Reviews• Pair Programming• Open source

Page 37: You cant be agile if your code sucks

Good code is like a joke!

No need for explanation

Page 39: You cant be agile if your code sucks

#TODO: Review Code• In your team• With 1 peer• Open source• Brown bags – Lunch time

discussion

Page 40: You cant be agile if your code sucks

Code Reviews• Code, !Person• Constructively propose changes

Questions!

Page 41: You cant be agile if your code sucks

Code Reviews• Code, !Person• Constructively propose changes

Questions!

• Review not only codeo Testso Build processo ..

Page 42: You cant be agile if your code sucks

Code Reviews• Code, !Person• Constructively propose changes

Questions!

• Review not only codeo Testso Build processo ..

Grow as a team

Page 43: You cant be agile if your code sucks

Instead of“That lousy long method”

“I reviewed your code and found 1,2,3 things to change”

“If you don’t want to do it. I do it”

“Why don’t you split that method”

“Can you help me?”

“Can I help you with this? I think we can improve it”

Say

Page 44: You cant be agile if your code sucks

#2 reason for Bad codeNobody can write good code in 1 sit-in

-> Refactoringit’s an art of designing code

Page 45: You cant be agile if your code sucks

#TODO Refactoring

https://github.com/NotMyself/GildedRose

https://github.com/jcbozonier/Refactoring-Katas

Page 46: You cant be agile if your code sucks

The little issue with Refactoring?

Page 47: You cant be agile if your code sucks

• Don’t know our own quality

• Unclear what works and what doesn't

• Unintended consequences of changes remain hidden

• We are never done

• Change and refactor without fear

• Add new features faster

• Confidence that we didn't break anything

• We can actually be doneDone = Tested!

Development With and Without TestingWithout Tests With Tests

Page 48: You cant be agile if your code sucks

Refactoring+

Tests=?

Page 49: You cant be agile if your code sucks

Refactoring+

Tests=

Waste?? Overhead??

Page 50: You cant be agile if your code sucks

• Writing tests prior to writing the production code

• Test-Driven Development iso A design practiceo A powerful way to avoid defects in softwareo A feedback loop for validating code changeso A way to write tests

Test-Driven Development (TDD)

REFACTOR GREEN

RED

Page 51: You cant be agile if your code sucks

Goal is not to write tests but to write good code

Test-Driven Development (TDD)

REFACTOR GREEN

RED

Page 52: You cant be agile if your code sucks

What is Quality

Page 53: You cant be agile if your code sucks

“Why should I care?We have a QA department!”

Page 54: You cant be agile if your code sucks

**** ADD PIC ****

Page 55: You cant be agile if your code sucks

How do you measure Quality?

Page 56: You cant be agile if your code sucks
Page 57: You cant be agile if your code sucks

First Law of Programming

“Lowering Quality Lengthens Development

Time”

http://c2.com/cgi/wiki?FirstLawOfProgramming

Page 58: You cant be agile if your code sucks

Only Quality lets us go faster!

Page 59: You cant be agile if your code sucks

http://manifesto.softwarecraftsmanship.org/

Page 60: You cant be agile if your code sucks

Who?

Page 61: You cant be agile if your code sucks

Quality?• Measure of how well the software

is designed and implemented• Subjective

Page 62: You cant be agile if your code sucks

Quality?• LOC• Code Coverage• Class Coupling• Cohesion• Code Duplication• Cyclomatic Complexity

Page 63: You cant be agile if your code sucks

Quality: How to measure?• Highly subjective• Highly qualitative• Is the code readable, understandable?• Is the code verbose?• Variable/method names that are

meaningful• Simple code that works• Does it have tests? What’s the coverage?

Page 64: You cant be agile if your code sucks

Quality: How to measure?• Trends

Page 65: You cant be agile if your code sucks

Quality: How to measure?• Trends• “Output” over time

o Velocity - Trendo Business Value - Trendo Bug – Trends

• #TODO: How do you measure Business value?

Page 66: You cant be agile if your code sucks

Ways to Improve Quality• Avoid Silo Thinking

o Its not “us” vs “them”

• Start early• Don’t Compromise• Schedule time to lower your technical debt• Make it work; make it right (right away)• Requires monitoring and changing behavior• Be willing to help and be helped• Devise lightweight non-bureaucratic measures

Page 67: You cant be agile if your code sucks

Simple Design == High Quality?

• Passes its tests• Minimizes duplication• Maximizes clarity• Has fewer elements

http://c2.com/cgi/wiki?XpSimplicityRules

Page 68: You cant be agile if your code sucks

#TODO Visualize• Bug Trends• Build Status• Performance Report• Technical Debt• Code Quality

Page 69: You cant be agile if your code sucks

Visualize Technical Debt

http://verraes.net/2013/07/managed-technical-debt/

Page 70: You cant be agile if your code sucks

Build Monitor

Page 71: You cant be agile if your code sucks

Checkin Frequently• Focus your work on small tasks• Easier to describe what you did in your check-in

comment• Clear code history• Easier merging -> if you really need to branch and merge

• Fast code reviews• Never get merge hell -> only give it :-)

http://blog.gfader.com/2011/12/tfs-see-your-application-grow-like.html

Page 72: You cant be agile if your code sucks

Team Efforts• Avoid Shortcuts• Take collective ownership

Team should own the code• Promote positive interaction• Provide constructive feedback• Constant code review

Page 73: You cant be agile if your code sucks

Guantanamo Code Tool• All code is guilty until tested

innocent

• Do you have problems maintaining high test coverage?

• Send the untested code to Guantanamo!http://docs.codehaus.org/display/ASH/Guantanamo

Page 74: You cant be agile if your code sucks

Agile – the bar is rising

http://blog.gfader.com/2013/05/the-1st-principle-of-agile-manifesto-30.html

Page 75: You cant be agile if your code sucks

Our highest priority is to satisfy the

customer

through early and continuous delivery

of valuable software

1st principle of the Agile Manifesto

Page 76: You cant be agile if your code sucks

Our highest priority is to satisfy the

customer

through early and continuous delivery

of valuable software1st principle of the Agile Manifesto

delight the customer

Page 77: You cant be agile if your code sucks

Recap

Page 78: You cant be agile if your code sucks

The important thing isn’t the

process

The important thing is the process

for improving your process

Page 79: You cant be agile if your code sucks

Essential skills neededregardless of process

Software craftsmanship

Splitting the system into useful pieces

Retrospectives

As a buyerI want to save my shopping cartso that I can continue shopping later

Page 80: You cant be agile if your code sucks

#TODO TO READE. Goldratt “The Goal” S.Freeman, N.Price GOOS

Page 81: You cant be agile if your code sucks

#TODO References• Pragmatics of Agile Development

http://www.agiledeveloper.com/presentations/pragmatics_of_agile_development.pdf

• Kanban VS Scrumhttp://www.infoq.com/minibooks/kanban-scrum-minibook

• Agile Software Developmenthttp://www.agiledeveloper.com/presentations/AgileSoftwareDevelopment.zip

• A Thinking Tool called Agilehttps://sites.google.com/site/leanagileandscrum/lean-agile-scrum-conference-2010/presentations-las-2010/00_Kniberg_Keynote.pdf?attredirects=0&d=1

• The Four Elements of Simple Designhttp://www.jbrains.ca/permalink/the-four-elements-of-simple-design

• http://agilemanifesto.org/• http://manifesto.softwarecraftsmanship.org/

Page 82: You cant be agile if your code sucks

Now you1. Download presentation2. Search for #TODO3. Get it done4. Send me a tweet “I’m done”

Page 83: You cant be agile if your code sucks

Continue the conversation

[email protected]/peitor

http://blog.gfader.com