Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Perth Code Dojo 12

Perth Code Dojo 12

William Webster

July 28, 2015
Tweet

More Decks by William Webster

Other Decks in Technology

Transcript

  1. Code Dojo Format A Coding Dojo is a coding session

    centered around a programming challenge. The dojo provides a safe place to learn and experiment away from the pressures of business delivery. All programmers of varying skill levels meet as equals to learn and share.
  2. Software Craftsmanship “Deliberate practice is closely related to the attained

    level of performance of many types of experts” - Dr. K. Anders Ericsson 10,000 hrs rule - Malcolm Gladwell
  3. TDD as if you meant it! 1. Write exactly ONE

    failing test 2. Make the test from (1) pass by first writing implementation code IN THE TEST 3. Create a new implementation method/function by: a. doing extract method on implementation code created as per (2), or b. moving implementation code as per (2) into an existing implementation method 4. Only ever create new methods IN THE TEST CLASS 5. Only ever create implementation classes to provide a destination for extracting a method created as per (4). 6. Populate implementation classes by doing move method from a test class into them 7. Refactor as required 8. Go to (1)
  4. Noughts & Crosses ➔ A game is over when all

    fields are taken ➔ A game is over when all fields in a column are taken by a player ➔ A game is over when all fields in a row are taken by a player ➔ A game is over when all fields in a diagonal are taken by a player ➔ A player can take a field if not already taken AKA Tic Tac Toe
  5. Begin! ➔ A game is over when all fields are

    taken ➔ A game is over when all fields in a column are taken by a player ➔ A game is over when all fields in a row are taken by a player ➔ A game is over when all fields in a diagonal are taken by a player ➔ A player can take a field if not already taken ➔ Players take turns taking fields until the game is over
  6. Begin! ➔ A game is over when all fields are

    taken ➔ A game is over when all fields in a column are taken by a player ➔ A game is over when all fields in a row are taken by a player ➔ A game is over when all fields in a diagonal are taken by a player ➔ A player can take a field if not already taken ➔ Players take turns taking fields until the game is over
  7. Begin! ➔ A game is over when all fields are

    taken ➔ A game is over when all fields in a column are taken by a player ➔ A game is over when all fields in a row are taken by a player ➔ A game is over when all fields in a diagonal are taken by a player ➔ A player can take a field if not already taken ➔ Players take turns taking fields until the game is over
  8. Thanks! Gojko - His blog, write up and developing the

    idea http://gojko.net/2009/08/02/tdd-as-if-you-meant-it- revisited/ Keith Brathwaite - For the concept @willwebst
  9. Mini Retro How did you find the exercise? Was it

    hard to write code in your tests? Did your code improve as a result?