Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Global Day of Coderetreat Munich 2017

201 views

Published on

The slides of the Global Day of Coderetreat Munich 2017 I facilitated and we organized in the context of our Softwerkskammer Software Craft Meetup Munich on 18.11.2017.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Global Day of Coderetreat Munich 2017

  1. 1. GLOBAL DAY OF CODERETREAT Munich, November 18, 2017
  2. 2. @DAVIDVOELKEL @codecentric @softwerkskammer #TDD
  3. 3. WHAT IS A CODERETREAT?
  4. 4. 1 DAY 1 KATA
  5. 5. 1 DAY 1 KATA 6 SESSIONS 6 PAIRING PARTNER 6 CONSTRAINTS
  6. 6. Hidden Slide Slower 2000 Developers 100 Cities 6 Continents 18 Time zones GLOBAL DAY OF CODERETREAT
  7. 7. ROLES HOST &Z?jBrA+>y(r
  8. 8. ROLES HOST FACILITATOR &Z?jBrA+>y(r
  9. 9. ROLES HOST FACILITATOR &Z?jBrA+>y(r YOUR PAIR
  10. 10. ROLES HOST FACILITATOR &Z?jBrA+>y(r YOUR PAIR YOU
  11. 11. WHY A CODERETREAT?
  12. 12. @ DAY JOB
  13. 13. @ DAY JOB NO ROOM FOR LEARNING & IMPROVEMENT
  14. 14. A SAFE PLACE NO TIME PRESSURE
  15. 15. A SAFE PLACE NO TIME PRESSURE BE RESPECTFUL
  16. 16. GOALS FUN
  17. 17. GOALS FUN LEARN
  18. 18. CHALLENGE YOURSELF Experiment Stretch your comfort zone Learn new practices
  19. 19. FOCUS ON finish the problem doing it right practicing improvement
  20. 20. DELETE YOUR CODE After each session
  21. 21. WHY RESET? Clear your mind Focus on different goals Get to the same level
  22. 22. ORGA
  23. 23. PREREQUISITES Coding Environment Testing Framework VCS (e.g. Git, Mercurial)
  24. 24. Local Sponsors Hidden Slide Slower
  25. 25. PLEASE Ask for help Use the feedback wall =>
  26. 26. AGENDA Intro Session 1-3 Lunch Session 4-6 Closing Circle / Retro
  27. 27. KATA TIC TAC TOE 3x3 Board Player "X" and "O" Player with 3 in one line wins • horizontal • vertical • diagonal
  28. 28. SESSION 1 PART 1 "THE TEST LIST" Goal Understand • the problem • its test cases
  29. 29. SESSION 1 PART 1 "THE TEST LIST" Collect a list of tests in a text file (no coding yet!)
  30. 30. SESSION 1 PART 1 "THE TEST LIST" Collect a list of tests in a text file Player with 3 in one line wins • horizontal • vertical • diagonal
  31. 31. SESSION 1 PART 1 "THE TEST LIST" Sync What tests do you have? Names? Test categories? Dimensions? Combinatorics?
  32. 32. SESSION 1 PART 2 "TEST FIRST" Write a test and let it fail Write the simplest possible implementation that the test runs green
  33. 33. SESSION 1 PART 2 "TEST FIRST" Why? Set a clear goal no YAGNI Separate API from Implementation Causality: Red->Green Testing discipline, high coverage early ROI
  34. 34. SESSION 1 PART 2 "TEST FIRST" Write several tests and let them fail
  35. 35. SESSION 1 PART 2 "TEST FIRST" Sync Which tests did you write? Naming? Object under Test? Representation of Fields?
  36. 36. PLEASE LINE UP! HOW IS YOUR EXPERIENCE LEVEL WITH TDD?
  37. 37. SESSION 2 "TDD + PING PONG" GOALS Learn TDD Change pairing roles often
  38. 38. SESSION 2 "TDD + PING PONG" TDD = test-first + refactoring = red, green, refactor
  39. 39. SESSION 2 "TDD + PING PONG" Focus write test: what should code do implement: solve the problem refactor: good design
  40. 40. SESSION 2 "TDD + PING PONG" Uncle Bob’s 3 Rules of TDD 1. You can't write any production code until you have first written a failing unit test. 2. You can't write more of a unit test than is sufficient to fail, and not compiling is failing. 3. You can't write more production code than is sufficient to pass the currently failing unit test.
  41. 41. SESSION 2 "TDD + PING PONG" TDD GOALS Incremental & Clean Design Fast Feedback
  42. 42. SESSION 2 "TDD + PING PONG" Ping Pong Pairing 1. Alice writes failing test 2. Bob makes test green 3. Bob writes failing test 4. Alice makes test green 5. Alice writes failing test 6. …
  43. 43. SESSION 2 "TDD + PING PONG" Uncle Bob’s 3 Rules of TDD 1. You can't write any production code until you have first written a failing unit test. 2. You can't write more of a unit test than is sufficient to fail, and not compiling is failing. 3. You can't write more production code than is sufficient to pass the currently failing unit test. Do refactor duplication and improve names
  44. 44. SESSION 2 "TDD + PING PONG" Sync What did you observe? What did (not) work? What about design/refactoring? How did pairing work?
  45. 45. SESSION 3 "BABY STEPS TDD" LEARNING GOALS Why are baby steps important How to achieve baby steps
  46. 46. SESSION 3 "BABY STEPS TDD" change 1 Initial code state change 2 state 1 state 2 … change n target code state ● slow feedback ● high risk ● exponential complexity ● problems hard to find LEAP
  47. 47. SESSION 3 "BABY STEPS TDD" get green asap ● commit on green ● revert to green change 1 Initial state change 2 state 1 state 2 … change n target state BABY STEPS
  48. 48. SESSION 3 "BABY STEPS TDD" + fast feedback + less risk - a bit more effort change 1 Initial state change 2 state 1 state 2 … change n target state BABY STEPS
  49. 49. SESSION 3 "BABY STEPS TDD" Start a 2 min. timer when you get red When back to green reset the timer and When timer rings and you are still in red git reset --hard git commit
  50. 50. SESSION 3 "BABY STEPS TDD" Sync Did you get better during the session? How did it work, was it hard? How did you achieve baby steps?
  51. 51. SESSION 4 "CLEAN CODE" GOALS Readable Code Maintainable Code
  52. 52. SESSION 4 "CLEAN CODE" Clean Code constraints "Code Swap" at the end
  53. 53. SESSION 4 "CLEAN CODE" Constraints Use good names No duplication > 2 times Single Responsibility Max 4 LOC / method
  54. 54. SESSION 4 "CLEAN CODE" Why? Use good names No duplication > 2 times Single Responsibility Max 4 LOC / method
  55. 55. SESSION 4 "CLEAN CODE" Code Swap review • 5 min by other team • write comments read comments
  56. 56. SESSION 4 "CLEAN CODE" Sync What was hard? What violations did you see?
  57. 57. SESSION 5 "OOP" GOAL Rethink good Object Oriented Design
  58. 58. SESSION 5 "OOP" What makes good OO Design?
  59. 59. SESSION 5 "OOP" Constraints Wrap all primitives and strings Use first-class collections Use only one dot per line Keep all entities small No more than two instance variables Don’t use any getters / setters / properties
  60. 60. SESSION 5 "OOP" Why? Wrap all primitives and strings Use first-class collections Use only one dot per line Keep all entities small No more than two instance variables Don’t use any getters / setters / properties
  61. 61. SESSION 5 "OOP" Constraints Wrap all primitives and strings Use first-class collections Use only one dot per line Keep all entities small No more than two instance variables Don’t use any getters / setters / properties
  62. 62. SESSION 5 "OOP" Sync • What was hard? • How did you handle it? • Which constraints make sense for "real life"
  63. 63. SESSION 6 "FAVORITE" The goal is fun!
  64. 64. SESSION 6 "FAVORITE" Choose yourself Your favorite of the day No conditionals and/or loops Wishful thinking (Outside-In) Functional Calisthenics …
  65. 65. Sync • What did you choose? • What was hard? • How did you handle it? SESSION 6 "FAVORITE"
  66. 66. • what did you learn today? • what surprised you about today? • what are you going to do differently in your Project? CLOSING
  67. 67. LICENSE Creative Commons Attribution-ShareAlike
  68. 68. IMAGES Some are Public Domain except theses licensed with Creative Commons with attributions: By Symbolon By Ainsley Wagoner
  69. 69. IMAGES By Luis Prado Dave Gandy Christopher.Michel
  70. 70. IMAGES Kigsz Another Believer Maria Ly
  71. 71. IMAGES Büşra ÖZCOŞKUN Guru Aneeque Ahmed
  72. 72. IMAGES  Rudy Jaspers  logan Hopkins
  73. 73. IMAGES  Kick THOR Seattle Municipal Archives
  74. 74. IMAGES   Uriel Sosa Adrien Coquet Yogesh More

×