Coding Dojos
på arbetstid
fredrik.wendt@squeed.com
PST, PSD, PSM I, CSM
This work by
Fredrik Wendt
is licensed under a
Creative Commons
Attribution-ShareAlike
3.0 Unported License
http://creativecommons.org/licenses/by-sa/3.0/
Ditt namn, vad du gör!
Vad är det?
Har du eller vän deltagit?
Erfarenheter från deltagande?
Förväntning(-ar) på denna session!
Coding Dojo!
Learning Objectives
• why you don't want to run typical generic katas
• how different exercise styles matches learning patterns,
skills and objectives of the dojo
• some things to think about when facilitating dojo sessions
• how I convince companies to see coding dojos as an invest
with short ROI
• what skill advancements you might expect from coding
dojos
• how a successfully run dojo may impact "soft values"
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
TL;DR
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
➔ Background, context
Based on What?
2 regular user groups
12 teams, 9 customers
past ~ 2 years
50 / 50
Taxonomy: Coding Dojo
“Dojo” from martial arts/budo
Means “place for the way”
More on Coding Dojos?
15% off: scrum-alliance-las-vegas-2013
Taxonomy: Kata
“Kata” from martial
arts/budo
Start from scratch, next
time – try
new approach
Practice until mastered
Small, 1-2 hrs
Presentation
Randori
Roundori
Break-out
biz
CHANGE!
new skills
Practice
Coding Dojo
Examples of ”Skills”
TDD, Good Tests – Test Design
Working with Legacy Code
BDD, ATDD
Clean Code, Refactoring
Patterns, New Technologies
Pair Programming
Examples of ”Change”
New Tests Are Written!
Old Tests starts passing!
Code Coverage Goes Up!
Everyone Cares when the build Fails!
Technology Shift – “On” Plan
Skill Advancement
How comfortable were/are you with SKILL?
Beginner Expert
Before
After
Today
... ... ...
Programming Language
How comfortable were/are you with the programming language?
Beginner Expert
Before
After
Today
... ... ...
IDE-editor
How comfortable were/are you with the IDE-editor?
Beginner Expert
Before
After
Today
... ... ...
Unit Tests
How often did/do you write unit tests?
Beginner Expert
Before
After
Today
... ... ...
Test-Driven Development
How good at test-driven development were/are you?
Beginner Expert
Before
After
Today
... ... ...
Mock Objects
How comfortable were/are you at using Mock objects?
Beginner Expert
Before
After
Today
... ... ...
Refactoring
How good at refactoring were/are you?
Beginner Expert
Before
After
Today
... ... ...
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
➔ Background, context
Coding dojo!
Vad tror du behövs för lärande på arbetsplatsen?
(Skills, Change – subjektiva resultat)
Pros/cons – olika sätt att organisera sig?
(Presentation, Randori, break-out)
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
➔ Background, context
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
Safe Environment for Learning
No salary setting managers in the room
Talk about how humans learn!
Show attendees –
what: learning objective
how: seeing is believing
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
Different Mind-Set!
Attend out of own interest vs told to attend
Telling is not enough
Showing is not enough
Need to experience to believe & understand
Production like, see it's doable outside dojo
Must Feel Real!
Enterprise Java Beans
Java Persistence API
javax.servlet.*
String Calculator? Fizz Buzz?
Roman Numerals? MMXIII?
Bowling? Poker Games?
Example: servlet.Filter
• Kata Java EE Authentication Filter
• Uses javax.servlet.* API
• Uses 2 custom interfaces
• Show classical vs mockist style
• 2nd time around Clean Code
request is part of
HTTP Session?
get token from session
SSO token is valid?
pass request on
down the filter chain
return;
throw AuthException;
resp.setStatus(401);
request contains
SSO cookie?
SSO token is valid?
request contains un
& pw parameters?
get token from cookie
get un & pw from request
un & pw valid in LDAP?
get new SSO token
store SSO token in cookie
store SSO token in session
No
No
No
Yes
Yes
Yes
Yes
KataJavaEEAuthenticationFilter
public interface UserAccountRegistry {
boolean credentialsAreValid(String username,
String password);
}
public interface SingleSignOnRegistry {
boolean tokenIsValid(String ssoToken);
String requireToken(String username);
void revokeToken(String ssoToken);
}
KataJavaEEAuthenticationFilter
Break-out
Break-out
Break-out
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
Format
15 90 15
40 – 10 – 40
Context
Understand exercise
Fail in order to learn
Tools? Techniques?
“Seeing is believing”
DO
Review, Feedback
Repetition
Participants' own
words means learning!
Input to next session
Learning by Doing
Repeat exercise
without trainer,
same time, place, people
”I can do this on my own”
vs
”only works for others”
Repetition Mother of Learning
E-mail with kata,
retrospective notes,
learning objectives,
ask if they've uncovered new
insights/experiences
➔ Safe Learning Env
➔ Like Production
➔ Practice, Repetition –
Learning by Doing
Summary
Learning Objectives
• why you don't want to run typical generic katas
• how different exercise styles matches learning patterns,
skills and objectives of the dojo
• some things to think about when facilitating dojo sessions
• how I convince companies to see coding dojos as an invest
with short ROI
• what skill advancements you might expect from coding
dojos
• how a successfully run dojo may impact "soft values"
MORE!
• Fruit, Candy, Coffee, Sugar!
• Whole team vs mixed teams
• Management buy-in – S-curve/hockey stick in learning
• Production like kata – 90 minute problems != realistic
• 1h topic-intro (clean code), lunch, 2h exercise
• 2h kata, lunch, 2h kata
• 1600-1800
• Come prepared, know your audience – 20 Questions
• Plant a mystery
NO MORE!
”Anti patterns”:
• Too complex problem
• Too complex biz rules (or game rules)
• Too huge data model – poker hands kata?
• Too great skill differences, depends on kata & style
• “Hero”?

Coding dojos på arbetstid

  • 1.
  • 2.
    This work by FredrikWendt is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/
  • 3.
    Ditt namn, vaddu gör! Vad är det? Har du eller vän deltagit? Erfarenheter från deltagande? Förväntning(-ar) på denna session! Coding Dojo!
  • 4.
    Learning Objectives • whyyou don't want to run typical generic katas • how different exercise styles matches learning patterns, skills and objectives of the dojo • some things to think about when facilitating dojo sessions • how I convince companies to see coding dojos as an invest with short ROI • what skill advancements you might expect from coding dojos • how a successfully run dojo may impact "soft values"
  • 5.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing TL;DR
  • 6.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing ➔ Background, context
  • 7.
    Based on What? 2regular user groups 12 teams, 9 customers past ~ 2 years 50 / 50
  • 8.
    Taxonomy: Coding Dojo “Dojo”from martial arts/budo Means “place for the way”
  • 9.
    More on CodingDojos? 15% off: scrum-alliance-las-vegas-2013
  • 10.
    Taxonomy: Kata “Kata” frommartial arts/budo Start from scratch, next time – try new approach Practice until mastered Small, 1-2 hrs
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
    Examples of ”Skills” TDD,Good Tests – Test Design Working with Legacy Code BDD, ATDD Clean Code, Refactoring Patterns, New Technologies Pair Programming
  • 17.
    Examples of ”Change” NewTests Are Written! Old Tests starts passing! Code Coverage Goes Up! Everyone Cares when the build Fails! Technology Shift – “On” Plan
  • 18.
    Skill Advancement How comfortablewere/are you with SKILL? Beginner Expert Before After Today ... ... ...
  • 19.
    Programming Language How comfortablewere/are you with the programming language? Beginner Expert Before After Today ... ... ...
  • 20.
    IDE-editor How comfortable were/areyou with the IDE-editor? Beginner Expert Before After Today ... ... ...
  • 21.
    Unit Tests How oftendid/do you write unit tests? Beginner Expert Before After Today ... ... ...
  • 22.
    Test-Driven Development How goodat test-driven development were/are you? Beginner Expert Before After Today ... ... ...
  • 23.
    Mock Objects How comfortablewere/are you at using Mock objects? Beginner Expert Before After Today ... ... ...
  • 24.
    Refactoring How good atrefactoring were/are you? Beginner Expert Before After Today ... ... ...
  • 25.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing ➔ Background, context
  • 26.
    Coding dojo! Vad trordu behövs för lärande på arbetsplatsen? (Skills, Change – subjektiva resultat) Pros/cons – olika sätt att organisera sig? (Presentation, Randori, break-out)
  • 27.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing ➔ Background, context
  • 28.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing
  • 29.
    Safe Environment forLearning No salary setting managers in the room Talk about how humans learn! Show attendees – what: learning objective how: seeing is believing
  • 30.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing
  • 31.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing
  • 32.
    Different Mind-Set! Attend outof own interest vs told to attend Telling is not enough Showing is not enough Need to experience to believe & understand Production like, see it's doable outside dojo
  • 33.
    Must Feel Real! EnterpriseJava Beans Java Persistence API javax.servlet.* String Calculator? Fizz Buzz? Roman Numerals? MMXIII? Bowling? Poker Games?
  • 34.
    Example: servlet.Filter • KataJava EE Authentication Filter • Uses javax.servlet.* API • Uses 2 custom interfaces • Show classical vs mockist style • 2nd time around Clean Code
  • 35.
    request is partof HTTP Session? get token from session SSO token is valid? pass request on down the filter chain return; throw AuthException; resp.setStatus(401); request contains SSO cookie? SSO token is valid? request contains un & pw parameters? get token from cookie get un & pw from request un & pw valid in LDAP? get new SSO token store SSO token in cookie store SSO token in session No No No Yes Yes Yes Yes KataJavaEEAuthenticationFilter
  • 36.
    public interface UserAccountRegistry{ boolean credentialsAreValid(String username, String password); } public interface SingleSignOnRegistry { boolean tokenIsValid(String ssoToken); String requireToken(String username); void revokeToken(String ssoToken); } KataJavaEEAuthenticationFilter
  • 37.
  • 38.
  • 39.
  • 40.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing
  • 41.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing
  • 42.
    Format 15 90 15 40– 10 – 40 Context Understand exercise Fail in order to learn Tools? Techniques? “Seeing is believing” DO Review, Feedback Repetition Participants' own words means learning! Input to next session
  • 43.
    Learning by Doing Repeatexercise without trainer, same time, place, people ”I can do this on my own” vs ”only works for others”
  • 44.
    Repetition Mother ofLearning E-mail with kata, retrospective notes, learning objectives, ask if they've uncovered new insights/experiences
  • 45.
    ➔ Safe LearningEnv ➔ Like Production ➔ Practice, Repetition – Learning by Doing Summary
  • 46.
    Learning Objectives • whyyou don't want to run typical generic katas • how different exercise styles matches learning patterns, skills and objectives of the dojo • some things to think about when facilitating dojo sessions • how I convince companies to see coding dojos as an invest with short ROI • what skill advancements you might expect from coding dojos • how a successfully run dojo may impact "soft values"
  • 47.
    MORE! • Fruit, Candy,Coffee, Sugar! • Whole team vs mixed teams • Management buy-in – S-curve/hockey stick in learning • Production like kata – 90 minute problems != realistic • 1h topic-intro (clean code), lunch, 2h exercise • 2h kata, lunch, 2h kata • 1600-1800 • Come prepared, know your audience – 20 Questions • Plant a mystery
  • 48.
    NO MORE! ”Anti patterns”: •Too complex problem • Too complex biz rules (or game rules) • Too huge data model – poker hands kata? • Too great skill differences, depends on kata & style • “Hero”?