51
How do you Learn New Skills? Emily Bache

How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

How do you Learn New Skills?Emily Bache

Page 2: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

www.praqma.com

how do you learn new skills?Emily Bache@emilybache

http://coding-is-like-cooking.info

As a Professional Programmer -

Page 3: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Emily BacheTest Automation Specialist

Senior Consultant at Praqma

Author of

“The Coding Dojo Handbook”

@emilybache

[email protected]

Page 4: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Programming

flic

kr: M

atyl

da C

zarn

ecka

Page 5: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Practical Coding Skills! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally, committing

code often ! Designing using SOLID principles ! Object Oriented Paradigm ! Functional Programming Paradigm ! ...

Page 6: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Test Driven Development

Red

GreenRefactor

Page 7: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Why TDD?design verification: the code does what

you think it does

work incrementally: share your changes often,

maintain flowdesign benefits:

isolated units should have low coupling & high cohesion

refactoring support: Make changes with

confidence

Wonderful feeling of freedom & productivity!

Page 8: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Self-testing codeYou have self-testing code when you can run a series of automated tests against the code base and be confident that, should the tests pass, your code is free of any substantial defects.

http://www.martinfowler.com/bliki/SelfTestingCode.html

— Martin Fowler

Page 9: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Agile Testing Pyramid

a few tests for the whole stack

many ‘service’ tests, may be public or test-specific API

majority are unit tests

http://www.mountaingoatsoftware.com/blog/the-forgotten-layer-of-the-test-automation-pyramid

UI

API

Unit

Page 10: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

TDD gives more than self-testing code

design verification: the code does what

you think it does

work incrementally: share your changes often,

maintain flowdesign benefits:

isolated units should have low coupling & high cohesion

refactoring support: Make changes with

confidence

Wonderful feeling of freedom & productivity!

Page 11: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Kent Beck in 2009

http://www.threeriversinstitute.org/blog/?p=291

Page 12: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Learning to Ski

flick

r use

r non

anet

Page 13: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Cross Country skiing

Page 14: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Snowplow

flickr: MichaEli

Page 15: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Parallel turns

flick

r use

r non

anet

Page 16: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Test Driven Development

Red

GreenRefactor

Page 17: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Training Course

image: http://www.flickr.com/photos/fboyd/

Page 18: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Learn on-the-job

image: flickr user Lisamarie Babik

Pair Program & Get Stuff Done

Page 19: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

The Coding Dojo

Dojo = The place you go to learn

Page 20: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

What happens at a dojo meeting?! 5 – 15 or so coders ! write code, collaborate, discuss

Page 21: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

A Regular Coding Dojo

! Your team meets for a coding dojo every so often ! practice skills you can use in production code

Page 22: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Dojo Principles! The first rule of the dojo:

" You can’t discuss a technique without code " You can’t show code without tests

Code without tests simply doesn’t exist!

The Dojo Principles: http://bossavit.com/dojo/archives/2005_02.html

Page 23: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Code Kata

! In martial arts, a “Kata” is a sequence of moves that you learn.

! Dave Thomas proposed the idea of the “Code Kata” " http://codekata.pragprog.com/

! small exercises, that you repeat

Page 24: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Code Kata - Leap Years

Write a function that returns true or false depending on whether its input integer is a leap year or not. A leap year is divisible by 4, but is not otherwise divisible by 100, unless it is also divisible by 400.

Examples: 1996 --> true 2001 --> false 2000 --> true 1900 --> false

Page 25: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

2 kinds of Practice

Incidental Practice

Deliberate Practice

- Repeatedly doing something you can already do, and improving at it

Page 26: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Incidental Practice: Good Habits

“I’m not a great programmer; I’m just a good programmer with great habits.”

- Kent Beck

quote from p57, “Refactoring” by Martin Fowler

image taken by Martin Fowler at XP2002

Page 27: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

US Military training philosophy

“Under pressure, you don’t rise to the occasion, you sink to the level of your training.

That’s why we train so hard” -- A US Navy Seal

Page 28: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Experience TDD

• Experience what TDD feels like when it works

• Recognise problems well suited to it

Page 29: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Repeatedly practice the same Katas

! In Karate there are some katas everyone learns

! There are some popular software katas lots of people have done

Page 30: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Practice

Incidental Practice: - Repeatedly doing something you can already do, and improving at it

Deliberate Practice: - Trying to do something you can’t comfortably do - breaking down a skill into components you practice separately

Page 31: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Deliberate Practice! Need to feel safe ! Need to feel motivated

flick

r use

r ant

ony_

mayfie

ld

Page 32: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

TDD skills

Designing Test Cases

Refactoring Safely

Driving Development with Tests

Designing Clean Code

TDD is a composite skill

Page 33: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

TDD skillsDesigning Test Cases

Refactoring Safely

Driving Development with Tests

Designing Clean Code

In the dojo we can focus on one at a time

Page 34: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

TDD skillsDesigning Test Cases

Refactoring Safely

Driving Development with Tests

Designing Clean Code

Refactoring Katas: Tennis, Yatzy, Gilded Rose…

Page 35: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Tennis Refactoring Kata

http

s://g

ithub

.com

/em

ilyba

che/

Tenn

is-R

efac

torin

g-Ka

ta

Page 36: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

TDD skillsDesigning Test Cases

Refactoring Safely

Driving Development with Tests

Designing Clean Code

SOLID principles Katas: Tyre Pressure, Leaderboard

Page 37: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Tyre Pressure Kata

Page 38: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

TDD skills

Designing Test Cases

Refactoring Safely

Driving Development with Tests

Designing Clean Code

Diamond Kata, ISBN

Page 39: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Diamond Kata

https://github.com/emilybache/DiamondKata

Page 40: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Diamond Kata

Page 41: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

TDD skills

Designing Test Cases

Refactoring Safely

Driving Development with Tests

Designing Clean Code

Gilded Rose, Functional Code

Page 42: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Functional Code Kata

Page 43: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

https://github.com/emilybache

Page 44: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Essential Dojo Elements

! Hold an introduction and retrospective ! Write tests as well as code ! Show your working ! Be a facilitator

Page 45: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Dojo Principles: Mastery

! If it seems hard, find someone who can explain it.

! If it seems easy, explain to those who find it hard.

! No-one has mastery in all areas: everyone will both teach & learn.

Sensei Henri Canditan by flickr user Flavio~

Page 46: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Coding Dojos in practice

! Paris Dojo ! Ruby & Python User Groups ! Consultant flown-in for 5 or 6 sessions ! (semi) Regularly at Pagero

Page 47: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Coding Dojos @ Pagero

Once a month

! Standard structure " Short intro " 45 minutes coding " short retrospective " (optional) repeat Kata

icon

s: D

oubl

e-J

Des

ign,

bal

licon

s.ne

t

One or Two hours

Page 48: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Improving at TDDhttp://cyber-dojo.org/

Tests failing Compiler/Syntax Error Tests Passing

TDD at first dojo

After 6 dojos

Page 49: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

Coding Dojo Summary

! Better coding skills ! Teach and Learn in a Group ! Incidental & Deliberate Practice ! Have Fun!

Page 50: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,
Page 51: How do you Learn New Skills? - GOTO Conference · ! using IDE shortcuts ! Pair Programming ! Test Driven Development ! Designing good Test Cases ! Refactoring ! Working incrementally,

www.praqma.com

how do you learn new skills?Emily Bache@emilybache

http://coding-is-like-cooking.info

As a Professional Programmer -