pair and mob programming · pair and mob programming secret weapon for agile and continuous...

75
Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Upload: others

Post on 26-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Pair and Mob ProgrammingSecret weapon for agile and continuous software development

Thomas Much @thmuch#JAXLondon

Page 2: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Thomas Much

Freelancer, Hamburg

Agile Developer Coach

Software Developer (Java et al.)

About…

@thmuch #JAXLondon

Page 3: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

A long time ago in a galaxy far, far away….

Page 4: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

The other day, in a cubicle next to you….some coworking space

Page 5: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

“Woah, who’s supposed to maintain this crap?”

“Who wrote that code?”

“Oh. That was me.”

Page 6: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

“Leave that to <insert name here>, he wrote that in his #!@%&$!? coding style.”

Page 7: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Problem: Readability• We read code a lot more often than we write it

• Understanding code is essential for product care and maintenance!

• We developers tend to write sloppy code – or too “clever” code

• Who’s going to give us feedback – before it’s too late?

solve problemwrite coderead existing code

https://www.slideshare.net/cairolali/langlebige-architekturen

Page 8: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

– Brian Kernighan

“Everyone knows that debugging is twice as hard as writing a program in the first place.

So if you're as clever as you can be when you write it, how will you ever debug it?”

Problem: Simplicity

Who protects us from being too “clever”?

Page 9: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

“We’ve got a mandatory code review process!”

Page 10: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Code reviews?

Honesty of reviews questionable (for systemic reasons).

Wrong incentives.

Feedback too late.

Who’s really going to make major changes then?

Page 11: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

“Developer A is on vacation, we’ll get the urgent bugfix afterwards.”

“Developer B has left the company,we’ll have to rewrite his apps from scratch.”

“It will take months before newly-hired developer C fully understands our project and code.”

Page 12: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Problem: Know-how transfer

Missing know-how transfer.

No collective code product ownership.

How? Documentation, workshops, trainings …

Are we working together as a team on our product / code?

Page 13: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

“But we are a team?!”

Page 14: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

“Team”work

Task 1

Task 2

A

B

Page 15: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Solution! “Let’s become agile.”To Do In Progress Done

Story 1

Story 2

A

B

Page 16: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

– Tim Ottinger

“If your agile Team has individual work assignments, I suspect it is neither agile nor team.”

Page 17: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Real team collaborationTo Do In Progress Done

Story 1

Story 2

A

C

B

D

Page 18: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Problem: Collaboration

How can we really work together

instead of just next to each other?

Page 19: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Problems!?

Readability / Simplicity / Intelligibility

Maintainability

Know-how transfer / Collaboration

Page 20: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

What do we want to achieve?

Getting things “done” quickly?

(“devil-may-care”, release & run)

Or rather develop maintainable software?

Page 21: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Maintainable software

In “my” projects:Clients have to / want to maintain software themselves.

Our goal:Develop maintainable software.

Supported by pair programming.

Page 22: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Pair programming coachingIdea: Actively promote pair programming.

Since 2013: Numerous teams supported by coaching.

E-commerce, BI, traditional enterprise back-ends.

Coach accompanies team for 1-2 sprints (2-4 weeks).

Coach works as a developer wherever possible.

Page 23: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

TimetableKickoff

1-2 weeks of coaching

Status1-2 weeks of

coachingRetrospective

Kickoff

1-2 weeks of coaching

Status1-2 weeks of

coachingRetrospective

{½ or 1 sprint

Coach codes together with

the team

Page 24: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Pair programming in a nutshell

1 task

Page 25: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Driver & navigator

https://commons.wikimedia.org/wiki/File:FORD_Taunus_17M_P2_deLuxe_Steering_wheel.jpg http://www.marcusvenzke.de/HamburgKarte/

Page 26: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Variants

Page 27: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Pair programming – our salvation

Know-how transfer

Collective code product ownership

Clean code

Maintainability

Quality

Yeah, well …

Page 28: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Nothing new

Pair programming – ca. 1992? .. 2000 …

Extreme programming (XP) – ca. 1996 .. 2000 …

“Flaccid Scrum” (Fowler 2009): Scrum = XP - practices !

Page 29: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Pair programming is “in”

Boss:“We’re doing pair programming now.

You’ll sit in pairs in front of your computers!”

Developer A: “Finally!”Developer B: “No. Not really. Not again.” Developer C: “???”

Page 30: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

“The other one’s way too fast.”

“The other one’s way too slow and just doesn’t get it.”

“I’m exhausted. Every. Single. Evening.”

“I’d rather work alone.”

Page 31: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Anti-patterns

Fixed pair works a story.

That story takes 4 weeks or more.

Basically one developer owns the keyboard.

Variation, relief & creativity are missing completely!

Page 32: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Small print

Page 33: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

We can’t do without exercisesappropriate communication

switching roles

taking breaks efficiently

pair rotation

how to deal with different levels of knowledge

preparation of stories & tasks

Page 34: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Appropriate communicationsilence ⟷ too much talking

As engineers we have to practice communicating with people…

Driver explains “why”, not “how”.

Navigator does not criticise details.

Page 35: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Proper pair programming

Page 36: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Proper pair programming is

communicating by writing down code.

Not just talking about hypothetical code.

Page 37: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Why pair programming helps us

We are subject to certain “brain patterns”:

interpretation

“how” vs. “why”

https://www.smidig.de/2015/12/brain-patterns-for-software-development/ https://javabarista.blogspot.de/2016/06/pair-programming-das-gehirn.html

Page 38: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Switching roles• Frequently!

• Every few minutes?!

• Keeps attentiveness & creativity alive.

ping-pong programmingred-green-refactor TDD

Page 39: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Code reviews: ongoing & implicit

Pair programming = software peer review.

Timely feedback.

Even for major changes.

Page 40: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Explicit code reviews: optional

No mandatory code reviews when working in pairs.

(But you can request them if you need another “senior” view.)

Page 41: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Attentiveness & creativity

Page 42: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Taking breaks efficientlyBefore attentiveness decreases too much.

Life hack of choice: “Pomodoro”

time management method

https://en.wikipedia.org/wiki/File:Il_pomodoro.jpg

Page 43: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Taking breaks efficiently

Use timer app!

25 min. 5 25 5 25 5 25 5timebox

work focused on the task!

break

stay on

schedule!

longer break

pair rotation?

Page 44: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Isolated knowledge

Page 45: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Isolated knowledge 2.0

1 12 2

3 3

Page 46: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Pair rotation!

112

2

3

3

At least

once a day

Page 47: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Who with whom?All together!

expert & expert

expert & beginner

beginner & beginner

Sparring partner

Know-how transfer. Beginner’s mind!

Discover project. Reveal weak spots.

Page 48: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

What about the coach?

Coach is an expert (methodically, sometimes technically)

Coach is a beginner (functionally, often technically)

Realistic collaboration!

Acceptance

Page 49: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

The coach …is a pairingpartnerwatches other pairs

practises together with the team: Switching roles. Pair rotation. Taking breaks. Variants of pair programming.

Page 50: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Variants of pair programming

https://twitter.com/thmuch/status/959456902877974528

@LlewellynFalco

“classic” “strong style”

Page 51: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Remotepair programming

Be an experienced offline (co-located) pair programmer first!

Tools:Floobits editor IDE plug-in, AWS Cloud 9 etc.

TeamViewer, appear.in, Tuple.app etc.

Give it a try. Depends a lot on your network (proxies etc.).

Page 52: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Thorough preparation a must

Joint preparation of suitable, small stories & tasks.

Discovery, planning, …

Often, teams see room for improvementwhen doing pair programming.

Page 53: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Comprehensive collaboration

Across roles:Dev, QA, UX, …

Pair Doing – “Pair on Everything”

Change of perspective.

Page 54: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

?Technology Programming language

Tooling ?Tests Quality

?Business Product

User

wait, research, (re-)plan

? ?

Page 55: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Technology Programming language

Tooling

Tests Quality

Business, Product, UserDev

Dev

Ops

PO

QS

Page 56: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Technology Programming language

Tooling

Tests Quality

Business, Product, User

Mob programming

Dev

Dev

Ops

PO

QS

at the same time, in the same space!

Page 57: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Mob programming

– Llewellyn Falco

“It’s about getting the BEST (not the most) from your team.”

– Woody Zuill

“All the brilliant minds working on the same thing, at the same time, on the same computer.”

“Continuous Integration of Ideas”

Page 58: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Mob programmingSwitch roles!

Fixed timebox (every 5-10 min.), http://mobster.cc

Dynamic mob: coming and going.

Feels less crampedcompared to pair programming.

Page 59: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Mob programmingAcross team roles!

Getting the most important taskdone first.

Dev

DevOps

QS UXPO

Page 60: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Highest priority first!To do In progress Done

Story 1

Story 2

WIP limit 1

Page 61: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Highest priority first!To do In progress Done

Story 1

Story 2

WIP limit 1

Page 62: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Mob programming – setups

Driver Nav.

Mob

Coach

Coach

Page 63: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

– Marcus Hammarberg

“Mob Programming ... is the most important improvement I've seen the last couple of years.”

https://twitter.com/marcusoftnet/status/1042708243544514560

Page 64: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Modern Agile

http://modernagile.org/

Pair & mob

programming

are part of it,

simple as that.

Page 65: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

And still …

Page 66: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

“I’m faster alone.”

Page 67: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

– African proverb

“If you want to go fast, go alone.

If you want to go far, go together.”

Raise awareness

Page 68: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Take care of the detailsMany reasons for rejection…

Proponents and opponents must compromise.

Fix clear agreements.

“Short-time pair programming”, for instance.

One small step for a developer, one giant leap for a team!

Page 69: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

– Jason Gorman

“Don't think of pair programmingas 2 people doing the work of one.

Think of it as 2 people avoiding the rework of 7.”

Page 70: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Speed… velocity… pace…

We follow these principles: …

Agile processes promote sustainable development. The sponsors, developers, and users should be able

to maintain a constant pace indefinitely. …

http://agilemanifesto.org/principles.html

Page 71: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

100% pair programming?Probably not. But:

Should be standard programming practice!

No excuses for not working in pairs.

How much % per day do we code? Hand on heart! 100%?

Much of the real coding time should be spent working in pairs!

Allow for solo time!

For learning something new,

reading, doing research etc.

Page 72: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Recap

Pair & mob programming strengthen agile processes.

Focus on developer skills & programming practices.

Coaching helps establishing pair & mob programming long-term.

Developers experience benefits hands-on.

Page 73: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Methodical agile coaching – important!

But:

Don’t forget coaching of programming practices.

Page 74: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Questions?

Mob Programming

Pomodoro

Strong Style Pairing

ReadabilitySimplicity

Know-How Transfer

Collective Product Ownership

XP

TDD

Pair Programming

Coaching

Modern Agile

Velocity Speed

Page 75: Pair and Mob Programming · Pair and Mob Programming Secret weapon for agile and continuous software development Thomas Much @thmuch #JAXLondon

Thank you!

[email protected] www.javabarista.de

@thmuch