KEMBAR78
Agile Prague Coding Dojo | PPTX
Coding Dojo
                     AgilePrague 2012
  Johannes Brodwall, Principal Architect
                         Steria Norway

                          @jhannes
Prague Coding Dojo?
http://johannesbrodwall.com/2011/12/18/
             how-to-start-a-coding-dojo/
Motivation
Master programming
through practice
What does good
                  programming mean
                  for you?

What do you want to get
out of the day?

             How do you want to
             apply this tomorrow?
Agenda
•   9:10: Demo of TDD and pair programming
•   9:20: Randori style Leap Years kata with everyone
•   9:40: Paired style Prime Factors
•   10:10: Retrospective
•   10:30: Paired style Prime Factors, take 2
•   11:00: Coding dojo 2:
            Romans if you’re slow,
            Yahtzee if you’re quick,
            minesweeper if you’re smart
•   12:00: Retrospective
•   12:15: Lunch (?)
•   13:00: Extreme startup – first round
•   13:30: Break
•   13:45: Extreme startup – second round
•   15:45: Wrap-up
TDD
TDD
      No code without test
   Just enough test to red
Just enough code to green
              (+ refactor!)
Pair programming
Ping/pong
Driver/Navigator
Failing test

               Write code


               Failing test

Write code


Failing test
Failing test

                            Write code
                      Refactor code
                        and tests
                            Failing test
Write code
      Refactor code
        and tests
Failing test
What benefits can you get
 from pair programming?
Kata 0: Leap Year
Kata 1: Prime
      factors
Kata: Prime factors
                              1 => []
                             2 => [2]
                             3 => [3]
                           4 => [2,2]
                                   …
2*2*13*17*23*23 => [2,2,13,17,23,23]
How did your choice of
      language help/hurt?


                                 Did you change
 What tests did you              drivers at good
 start with?
                                 frequency?
Which tests didn’t
help you?                      How did you determine
                               next test?

                       How did the solution
                       end up looking?
What surprised you?

What did you learn?


             What do you want to
             achieve next round?
Kata 2a:
Minesweeper
Given:
var minefield = new Minefield([
              "....",
              ".*..",
              ".*.*",
              "...*“ ])
What surprised you?

What did you learn?


             What do you want to
             achieve next round?
How did your choice of
      language help/hurt?


                                Did you change
 What tests did you             drivers at good
 start with?
                                frequency?
Which tests didn’t
help you?                      How did you determine
                               next test?
                   How did the boundary
                   conditions affect your
                   test and code?
Kata 2b: Yahtzee
Kata: Yahtzee
                                  ({1,1,1,1,1}, «ones»} => 5
                                 ({1,1,1,1,1}, «sixes»} => 0
                             ({1,1,1,1,1}, «yahtzee»} => 50

                    Ones, twos, threes, fours, fives, sixes
Pair, two pairs, three of a kind, four of a kind, full house
                                                     Yahtzee
                                Little straight, big straight
                                                     Chance
What surprised you?

What did you learn?


             What do you want to
             achieve next round?
How did your choice of
      language help/hurt?


                                  Did you change
 What tests did you               drivers at good
 start with?
                                  frequency?
Which tests didn’t
help you?                      How did you determine
                               next test?
                   What is ({2,2,3,6,6}, «pair»)?
Kata 2c: Romans
Kata: Romans
              1 => I
             5 => V
   1999 => MCMXCIX
What surprised you?

What did you learn?


             What do you want to
             achieve next round?
How did your choice of
      language help/hurt?


                                 Did you change
 What tests did you              drivers at good
 start with?
                                 frequency?
Which tests didn’t
help you?                      How did you determine
                               next test?
                   How did you implement
                   rules for «IV» etc?
Extreme startup
The Extreme startup code
             competition
     By Matt Wynne and Robert Chatly
Orientation
          Download starting point
(http://github.com/steria/extreme_startup_servers)

                              Start server
                                 Register
                   (http://192.168.155.249:3000/)

                       Solve questions
Rules
                    Cheat like mad!
                 Only results matter
         No destruction of property
                    Obey local laws
Don’t f$%! with workshop computer
Guidelines
               Work as you like
(Tip: Use a language you know)
              Help those behind
  Upload your code (if possible)
Orientation
          Download starting point
(http://github.com/steria/extreme_startup_servers)

                              Start server
                                 Register
                      (http://192.168.155.249:3000/)

                       Solve questions
Form teams!
Round 1
Round 1
 (fight!)
Round 1:
Retrospective
What surprised you?

What did you learn?


             What do you want to
             achieve next round?
Round 2
Round 2
 (fight!)
Round 2:
Retrospective
Course
Retrospective
What surprised you?

What did you learn?


             How will you change
             how you work?
Testing?
 How did you mess up?
How did you cheat?
                            Which questions did
                            you solve?

                        Annoying questions?

  Teamwork?
Thank you
     johannes@brodwall.com

  http://johannesbrodwall.com

    http://twitter.com/jhannes

Agile Prague Coding Dojo

  • 1.
    Coding Dojo AgilePrague 2012 Johannes Brodwall, Principal Architect Steria Norway @jhannes
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
    What does good programming mean for you? What do you want to get out of the day? How do you want to apply this tomorrow?
  • 11.
  • 12.
    9:10: Demo of TDD and pair programming • 9:20: Randori style Leap Years kata with everyone • 9:40: Paired style Prime Factors • 10:10: Retrospective • 10:30: Paired style Prime Factors, take 2 • 11:00: Coding dojo 2: Romans if you’re slow, Yahtzee if you’re quick, minesweeper if you’re smart • 12:00: Retrospective • 12:15: Lunch (?) • 13:00: Extreme startup – first round • 13:30: Break • 13:45: Extreme startup – second round • 15:45: Wrap-up
  • 13.
  • 14.
    TDD No code without test Just enough test to red Just enough code to green (+ refactor!)
  • 15.
  • 16.
  • 17.
    Failing test Write code Failing test Write code Failing test
  • 18.
    Failing test Write code Refactor code and tests Failing test Write code Refactor code and tests Failing test
  • 19.
    What benefits canyou get from pair programming?
  • 20.
  • 21.
  • 22.
    Kata: Prime factors 1 => [] 2 => [2] 3 => [3] 4 => [2,2] … 2*2*13*17*23*23 => [2,2,13,17,23,23]
  • 23.
    How did yourchoice of language help/hurt? Did you change What tests did you drivers at good start with? frequency? Which tests didn’t help you? How did you determine next test? How did the solution end up looking?
  • 24.
    What surprised you? Whatdid you learn? What do you want to achieve next round?
  • 25.
  • 26.
    Given: var minefield =new Minefield([ "....", ".*..", ".*.*", "...*“ ])
  • 28.
    What surprised you? Whatdid you learn? What do you want to achieve next round?
  • 29.
    How did yourchoice of language help/hurt? Did you change What tests did you drivers at good start with? frequency? Which tests didn’t help you? How did you determine next test? How did the boundary conditions affect your test and code?
  • 30.
  • 31.
    Kata: Yahtzee ({1,1,1,1,1}, «ones»} => 5 ({1,1,1,1,1}, «sixes»} => 0 ({1,1,1,1,1}, «yahtzee»} => 50 Ones, twos, threes, fours, fives, sixes Pair, two pairs, three of a kind, four of a kind, full house Yahtzee Little straight, big straight Chance
  • 32.
    What surprised you? Whatdid you learn? What do you want to achieve next round?
  • 33.
    How did yourchoice of language help/hurt? Did you change What tests did you drivers at good start with? frequency? Which tests didn’t help you? How did you determine next test? What is ({2,2,3,6,6}, «pair»)?
  • 34.
  • 35.
    Kata: Romans 1 => I 5 => V 1999 => MCMXCIX
  • 36.
    What surprised you? Whatdid you learn? What do you want to achieve next round?
  • 37.
    How did yourchoice of language help/hurt? Did you change What tests did you drivers at good start with? frequency? Which tests didn’t help you? How did you determine next test? How did you implement rules for «IV» etc?
  • 38.
  • 39.
    The Extreme startupcode competition By Matt Wynne and Robert Chatly
  • 40.
    Orientation Download starting point (http://github.com/steria/extreme_startup_servers) Start server Register (http://192.168.155.249:3000/) Solve questions
  • 41.
    Rules Cheat like mad! Only results matter No destruction of property Obey local laws Don’t f$%! with workshop computer
  • 42.
    Guidelines Work as you like (Tip: Use a language you know) Help those behind Upload your code (if possible)
  • 43.
    Orientation Download starting point (http://github.com/steria/extreme_startup_servers) Start server Register (http://192.168.155.249:3000/) Solve questions
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
    What surprised you? Whatdid you learn? What do you want to achieve next round?
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
    What surprised you? Whatdid you learn? How will you change how you work?
  • 54.
    Testing? How didyou mess up? How did you cheat? Which questions did you solve? Annoying questions? Teamwork?
  • 55.
    Thank you johannes@brodwall.com http://johannesbrodwall.com http://twitter.com/jhannes

Editor's Notes

  • #18 Note to translator: Here, I willexplainhow pair programmingcanwork in practice:One person writes a failing test and theother person writesthecode to make it pass. Thenthe person whomadethe test pass writesthenext test.In theexamplewithme and Boris, weswitched «drivers» (the person at thekeyboard) aboutonce a minute. On real lifeproject, I usuallyexperiencethatweswitch drivers everytenminutes or so.It’s alsoimportant to refactorbetween tests. I like to onlyrefactorwhenthecode is green. This way I knowthatthecodedoesn’t stop working. Therearetwoways to thinkaboutthis:Either, ifyoucan, refactorthecode and the tests a little to «getready» for thenext testOr, ifyouseethatyoucan’t make the test pass, commentout (or @Ignore) the test and refactoron green.