Top Banner
Deliberate Practice (New learning styles to overcome the software crisis?) Agile Slovenia 2015 Peter Kofler, ‘Code Cop’ @codecopkofler www.code-cop.org Copyright Peter Kofler, licensed under CC-BY.
64

Deliberate Practice (Agile Slovenia 2015)

Feb 18, 2017

Download

Technology

Peter Kofler
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Deliberate Practice (Agile Slovenia 2015)

Deliberate Practice(New learning styles to overcome the software crisis?)

Agile Slovenia 2015

Peter Kofler, ‘Code Cop’@codecopkofler

www.code-cop.org

Copyright Peter Kofler, licensed under CC-BY.

Page 2: Deliberate Practice (Agile Slovenia 2015)

Peter Kofler

• Ph.D. (Appl. Math.)

• Professional SoftwareDeveloper for 15 years

• “fanatic about code quality”

• Freelance Code Mentor

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 3: Deliberate Practice (Agile Slovenia 2015)

I help development teams with

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

● Professionalism

● Quality and Productivity

● Continuous Improvement

Page 4: Deliberate Practice (Agile Slovenia 2015)

Training and Mentoring

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

● Pair Programming

● ProgrammingWorkshops

● DeliberatePractice

Page 5: Deliberate Practice (Agile Slovenia 2015)

Who are You?

● Tester?● Test Manager?● QA?● QA Manager?● Developer?● Architect?

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 6: Deliberate Practice (Agile Slovenia 2015)

No, you are aSoftware Delivery

Professional!

Page 7: Deliberate Practice (Agile Slovenia 2015)

Your Goal:Developing

QualitySoftware

Page 8: Deliberate Practice (Agile Slovenia 2015)

What's the Problem?

Page 9: Deliberate Practice (Agile Slovenia 2015)

Software Crisis?

Page 10: Deliberate Practice (Agile Slovenia 2015)

“The major cause of the software crisis is that the machines have become several orders of magnitude more powerful! To put it quite bluntly: as long as there were no machines, programming was no problem at all; when we had a few weak computers, programming became a mild problem, and now we have gigantic computers, programming has become an equally gigantic problem.”

Software Crisis

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

http://en.wikipedia.org/wiki/Software_crisis

Page 11: Deliberate Practice (Agile Slovenia 2015)

Edsger Dijkstra

Page 12: Deliberate Practice (Agile Slovenia 2015)

Who createsthis software

he talked about?

Page 13: Deliberate Practice (Agile Slovenia 2015)

Professional(people)

Engineering(process)

Page 14: Deliberate Practice (Agile Slovenia 2015)

Software Professionals

Create Software!

Page 15: Deliberate Practice (Agile Slovenia 2015)

Software like that...

Page 16: Deliberate Practice (Agile Slovenia 2015)

Why is its quality so bad?

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 17: Deliberate Practice (Agile Slovenia 2015)

Is Software Engineering Education sufficient?

http://programmers.stackexchange.com/questions/60595/did-your-cs-program-prepare-you-well

Page 18: Deliberate Practice (Agile Slovenia 2015)

Trainingon the

Job?

Page 19: Deliberate Practice (Agile Slovenia 2015)

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Yes, some but...

● only what is already there● Trial & Error not popular in production● no practice - only production● time pressure

Page 20: Deliberate Practice (Agile Slovenia 2015)

Our Industry is Very Young

● Half of all developers age < 30

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

http://blog.cleancoder.com/uncle-bob/2014/06/20/MyLawn.html

Page 21: Deliberate Practice (Agile Slovenia 2015)

Not Enough Senior People

● either busy● e.g. critical issues● contact with business

● or left active development● architects, ● analysts, ● managers etc.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 22: Deliberate Practice (Agile Slovenia 2015)

DevelopingQuality

SoftwareDevelopers

Page 23: Deliberate Practice (Agile Slovenia 2015)

Quick Poll: Do you ...

● Technical magazines?● Internal library?● Reading groups?● Lunch & Learn?● Conferences?● Trainings?● Hackdays?

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 24: Deliberate Practice (Agile Slovenia 2015)

Classic Training is “Sheep Dip“

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 25: Deliberate Practice (Agile Slovenia 2015)

That is not enough

Page 26: Deliberate Practice (Agile Slovenia 2015)

More Practice!

Page 27: Deliberate Practice (Agile Slovenia 2015)

DeliberatePractice

Page 28: Deliberate Practice (Agile Slovenia 2015)

How do musicians practice?

Page 29: Deliberate Practice (Agile Slovenia 2015)

Then how do coders practice?Then how do testers practice?

Page 30: Deliberate Practice (Agile Slovenia 2015)

Code Kata

Page 31: Deliberate Practice (Agile Slovenia 2015)

Code Kata Definition

● A kata as a detailed choreographed pattern of movement.

● A code kata is an exercise in programming which helps a programmer hone their skills through practice and repetition.

● A testing kata is ...

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 32: Deliberate Practice (Agile Slovenia 2015)

Code Kata

● simple problem (max. 20 minutes)

● solve every day● memorization/create reflexes

● experiment with solutions● stretch yourself● try new technologies

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 33: Deliberate Practice (Agile Slovenia 2015)

Why repeat the same kata?

● de-emphasise the generation of code

● concentrate on

● the process of writing the code

● naming test cases

● the Red/Green cycle

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 34: Deliberate Practice (Agile Slovenia 2015)

Don't Focus on Getting it Done.F0cus on Doing

It Perfectly.

Page 35: Deliberate Practice (Agile Slovenia 2015)

Software Katas

● Finding algorithms● Coding solutions● Bringing code under test

● Unit Test/Test tools (“Test Lab“)● Refactoring katas● Finding test cases● Architectural katas

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 36: Deliberate Practice (Agile Slovenia 2015)

Code Kata Example:Prime Factors

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 37: Deliberate Practice (Agile Slovenia 2015)

The Requirements.

• Write a class named “PrimeFactors” that has one static method: generate.

● The generate method takes an integer argument and returns a List<Integer>.

● That list contains the prime factors in numerical sequence.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata

Page 38: Deliberate Practice (Agile Slovenia 2015)

I did it 115 times

● very easy● 10 minutes● 6 test cases● final algorithm is 5 lines

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 39: Deliberate Practice (Agile Slovenia 2015)

To learn and practice

● Test Driven Development cycle● first in every new language● IDE short-cuts● laptop keyboard layout● focus when distracted

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 40: Deliberate Practice (Agile Slovenia 2015)

Kata Example: Car Mechanic

Page 41: Deliberate Practice (Agile Slovenia 2015)

Coding Dojo

Page 42: Deliberate Practice (Agile Slovenia 2015)

Coding Dojo Definition

● A coding dojo is a meeting where a bunch of coders get together and work on a code kata, a programming challenge to improve their skills.

● They code, learn and have fun away from interruptions, distractions, deadlines and production bugs.

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

http://codingdojo.org/

Page 43: Deliberate Practice (Agile Slovenia 2015)

Coding Dojo Structure

● Introduction 15'● Coding 45'● Interim (Retrospective) 5'● Break 15'● Coding 45'● Retrospective 15'

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 44: Deliberate Practice (Agile Slovenia 2015)

Coding Dojo Mindset

● Safe place outside work● We are here to learn● Need to slow down● Focus on doing it right● Collaborative Game

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 45: Deliberate Practice (Agile Slovenia 2015)

Coding Dojo Rules

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 46: Deliberate Practice (Agile Slovenia 2015)

Pair Programming

● Collaborative = Pair Programming● “Randori“ (pairing on the projector)● or regular programming in pairs

● regular Pair Programming● do not talk for too long● do not interrupt the other● no “keyboard hugging“

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 47: Deliberate Practice (Agile Slovenia 2015)

Pair Programming adds discussion & a second opinion to the practice.

Page 48: Deliberate Practice (Agile Slovenia 2015)

Constraints

● Challenges during a dojo or code retreat.

● Moving to the extreme is a way of learning

● Examples● Missing Tool (No Mouse, …)● Missing Feature (No IFs, …)

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 49: Deliberate Practice (Agile Slovenia 2015)

Testing Dojo Example:Testcases for Gilded Rose

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 50: Deliberate Practice (Agile Slovenia 2015)

Given

● Production code (60 lines)● Detailed requirements (1 page A4)● No tests (at least 38 cases)● Prepared FitNesse fixtures (Java)● dbFit connector (PL/SQL)

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

https://bitbucket.org/pkofler/gilded-rose-fitnesse

Page 51: Deliberate Practice (Agile Slovenia 2015)

Testing Task

● Modify existing test cases, play around● Create some “perfect” tests

● derive test cases from requirements● name test cases accordingly● test boundary conditions● readable, concise, free of duplication

● Experiment with styles

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 52: Deliberate Practice (Agile Slovenia 2015)

Code Retreat

Page 53: Deliberate Practice (Agile Slovenia 2015)

Code Retreat (Overview)

● Sort of six Coding Dojos in sequence.● A day-long, intensive practice event.

● Examples: ● Global Day of Coderetreat● Test Automation Retreat

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 54: Deliberate Practice (Agile Slovenia 2015)

Conclusion

Page 55: Deliberate Practice (Agile Slovenia 2015)

DevelopingQuality

Software

Page 56: Deliberate Practice (Agile Slovenia 2015)

Software Professionals

Create Software!

Page 57: Deliberate Practice (Agile Slovenia 2015)

DevelopingQuality

SoftwareDevelopers

Page 58: Deliberate Practice (Agile Slovenia 2015)

DeliberatePractice

Page 59: Deliberate Practice (Agile Slovenia 2015)

What you need to do

Page 60: Deliberate Practice (Agile Slovenia 2015)

What you need to do

● Make space for deliberate learning● Improve yourself

● Try katas● Visit dojos/retreats

● Mentor next generation● Prepare kata exercises● Run in-house dojos/retreats

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 61: Deliberate Practice (Agile Slovenia 2015)

We will notship shit!

(Uncle Bob)

Page 62: Deliberate Practice (Agile Slovenia 2015)

Peter Kofler

@codecopkofler

www.code-cop.org

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 63: Deliberate Practice (Agile Slovenia 2015)

CC Images #1● masters https://www.flickr.com/photos/kevinpoh/4404925960● Bruce http://www.flickr.com/photos/sherpas428/4350620602/● pairing http://www.flickr.com/photos/dav/94735395/● wants you http://www.flickr.com/photos/shutter/105497713/● Cthulhu http://community.imaginefx.com/forums/thread/402575.aspx● dump http://www.flickr.com/photos/sanmartin/2682745838/● shoe maker http://www.flickr.com/photos/tbatty/1450209613/ (by 2010)● factory http://www.flickr.com/photos/94693506@N00/4643248587/● Hamster http://www.flickr.com/photos/zebrapares/4529836138● baby http://www.flickr.com/photos/11904001@N00/3983980813/● sheep dip https://www.flickr.com/photos/christianspenceranderson/6990570682

● music https://www.flickr.com/photos/jeremyhiebert/11474303315

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY

Page 64: Deliberate Practice (Agile Slovenia 2015)

CC Images #2● code https://www.flickr.com/photos/slworking/7726767220/● karate http://www.flickr.com/photos/the-consortium/5301698212/● math https://www.flickr.com/photos/jimmiehomeschoolmom/4427775569● mechanic https://www.flickr.com/photos/ravages/9242464882● dojo http://www.flickr.com/photos/49715404@N00/3267627038/● todos http://www.flickr.com/photos/kylesteeddesign/3724074594/● rule http://www.flickr.com/photos/phunk/4188827473● inn http://www.flickr.com/photos/danielleblue/170496395/● incense http://www.flickr.com/photos/cibomahto/7651263514/● finish http://www.flickr.com/photos/jayneandd/4450623309/● call https://www.flickr.com/photos/melenita/15166203826

PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY