SlideShare a Scribd company logo
Coding Dojo: 
Mars Rover 
Oct. 2014 
Peter Kofler, ‘Code Cop’ 
@codecopkofler 
www.code-cop.org 
Copyright Peter Kofler, licensed under CC-BY.
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Peter Kofler 
• Ph.D. (Appl. Math.) 
• Professional Software 
Developer for 15 years 
• “fanatic about code quality” 
• I help development teams
Coding Dojo? 
Expectations?
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Coding Dojo Mindset 
● Safe place outside 
work 
● We are here to learn 
● Need to slow down 
● Focus on doing it right 
● Collaborative Game
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Two Basic Rules 
● Collaborative = Pair Programming 
● “Randori“ (pairing on the projector) 
● or programming in pairs 
● Test Driven Development 
● think about tests 
● write the test first
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
(Maybe Some) Constraints 
● Challenges during a dojo or coderetreat. 
● Moving to the extreme is a way of learning 
● Examples 
● Missing Tool (No Mouse, …) 
● Missing Feature (No IFs, …)
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Dojo Structure 
● Introduction 15' 
● Coding 45' 
● Interim (Retrospective) 15' 
● Break 10' 
● Coding 45' 
● Retrospective 15'
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Assignment
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Mars Rover 
● Develop an API that moves a rover around on a grid. 
● You are given the initial starting point (x,y) of a rover and 
the direction ('N','S','E','W') it is facing. 
● The rover receives a character array of commands. 
● Move the rover forward/backward ('f','b'). 
● Turn the rover left/right ('l','r'). 
● Wrap the grid. (Planets are spheres after all.) 
● Detect obstacles before each move to a new square. If a 
sequence of commands encounters an obstacle, the rover 
moves up to the last possible point and reports obstacle.
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Mars Rover Example 
● The rover is on a 
100x100 grid 
● at location (0, 0), 
● facing "N"ORTH. 
● The rover is given 
commands "ffrff" 
● and should end up 
at (2, 2). 
r f f 
f 
f 
(0,0) 
N 
(2,2)
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Remember the Rules!
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Pair Programming & TDD 
● regular Pair Programming 
– do not talk for too long 
– do not interrupt the other 
– no “keyboard hugging“ 
● use TDD (or at least “sort of” TDD) 
– write a test before you write code 
– refactor mercilessly 
– no debugger
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
With a Constraint
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
“Yes, and ...“ 
● When working in pairs none of the pairs 
is allowed to delete the code of the other 
person. 
● We are looking for a common solution, 
that both of the pairs will agree. 
● Learn to build on top of the ideas 
already presented.
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
“Yes, and ...“ Rules 
● improve existing code of the other 
● can not delete code of the other 
● whenever one tries to delete code, say: 
“You should improve the existing one. 
Please go back and say Yes, and… I will do…” 
● Can not be angry on request of not deleting code. 
● Only unused code can be deleted. 
● Both must agree that the code can be deleted.
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Prepare 
● Find a pair. 
● Choose a programming language. 
● Set up the environment. 
● Create new project. 
● Add testing framework. 
● Check requirements. 
● Implement Mars Rover.
Don't Focus on 
Getting it Done. 
F0cus on Doing 
It Perfectly.
→ Practice
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Short Closing Circle 
● How did it work out? 
● How do you feel? 
● What did you 
learn and want 
to share with 
the group?
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Full Closing Circle 
● What did you learn today? 
● What surprised you today? 
● What will you do 
differently in the 
future?
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Global Day of Code Retreat 
● A world-wide event celebrating passion 
and software craftsmanship. 
● GDCR 2014: 
15th November 
● Follow #GDCR14 
http://globalday.coderetreat.org/
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
Peter Kofler 
@codecopkofler 
www.code-cop.org 
Game by 
Adrian Bolboaca 
@adibolb 
http://blog.adrianbolboaca.ro/2013/12/pair-programming-game-yes-and/
PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY 
CC Images 
● Rover Selfie http://www.flickr.com/photos/gsfc/7971341456 
● Dojo 
http://www.flickr.com/photos/49715404@N00/3267627038/ 
● Todos 
http://www.flickr.com/photos/kylesteeddesign/3724074594/ 
● Curiosity http://www.flickr.com/photos/mendhak/8162305237 
● Rule http://www.flickr.com/photos/phunk/4188827473 
● Model http://www.flickr.com/photos/eldave/8430367749 
● Wants you http://www.flickr.com/photos/shutter/105497713/

More Related Content

What's hot (20)

PDF
The Brutal Refactoring Game (2013)
Peter Kofler
 
PDF
Software Craftsmanship Journeyman Tour (2013)
Peter Kofler
 
PDF
Mob Programming (2016)
Peter Kofler
 
PDF
Designing Test Cases for the Gilded Rose Kata (2013)
Peter Kofler
 
PDF
Deliberate Practice, New Learning Styles (2015)
Peter Kofler
 
PDF
TDD as if You Meant It (2013)
Peter Kofler
 
PDF
Using Automated Code Reviews to Achieve Continuous Quality (ASQF Agile Night ...
Peter Kofler
 
PDF
Pair Programming (2015)
Peter Kofler
 
PDF
Coding Dojo: Data Munging (2016)
Peter Kofler
 
PDF
Coding Dojo: Asynchronous Clock-In (2016)
Peter Kofler
 
PDF
Outside-in Test Driven Development - the London School of TDD
Peter Kofler
 
PDF
Code Retreat Venice (2016)
Peter Kofler
 
PDF
JUnit Boot Camp (GeeCON 2016)
Peter Kofler
 
PDF
Refactoring the Tennis Kata v2 (2016)
Peter Kofler
 
PDF
Designing Test Cases for the Gilded Rose Kata v3 (2016)
Peter Kofler
 
PDF
Java User Groups in Austria (2013)
Peter Kofler
 
PDF
GDCR15 in Las Palmas, Gran Canaria
Peter Kofler
 
PDF
Brutal Coding Constraints (ITAKE 2017)
Peter Kofler
 
PDF
Writing Tests with the Unity Test Framework
Peter Kofler
 
PDF
Code Retreat Graz, Austria 2013
Peter Kofler
 
The Brutal Refactoring Game (2013)
Peter Kofler
 
Software Craftsmanship Journeyman Tour (2013)
Peter Kofler
 
Mob Programming (2016)
Peter Kofler
 
Designing Test Cases for the Gilded Rose Kata (2013)
Peter Kofler
 
Deliberate Practice, New Learning Styles (2015)
Peter Kofler
 
TDD as if You Meant It (2013)
Peter Kofler
 
Using Automated Code Reviews to Achieve Continuous Quality (ASQF Agile Night ...
Peter Kofler
 
Pair Programming (2015)
Peter Kofler
 
Coding Dojo: Data Munging (2016)
Peter Kofler
 
Coding Dojo: Asynchronous Clock-In (2016)
Peter Kofler
 
Outside-in Test Driven Development - the London School of TDD
Peter Kofler
 
Code Retreat Venice (2016)
Peter Kofler
 
JUnit Boot Camp (GeeCON 2016)
Peter Kofler
 
Refactoring the Tennis Kata v2 (2016)
Peter Kofler
 
Designing Test Cases for the Gilded Rose Kata v3 (2016)
Peter Kofler
 
Java User Groups in Austria (2013)
Peter Kofler
 
GDCR15 in Las Palmas, Gran Canaria
Peter Kofler
 
Brutal Coding Constraints (ITAKE 2017)
Peter Kofler
 
Writing Tests with the Unity Test Framework
Peter Kofler
 
Code Retreat Graz, Austria 2013
Peter Kofler
 

Similar to Coding Dojo: Mars Rover (2014) (20)

PDF
Coding Dojo: Fun with Tic-Tac-Toe (2014)
Peter Kofler
 
PDF
Coding Dojo: Roman Numerals (2014)
Peter Kofler
 
PDF
proper care and feeding for your junior developer
Eric St
 
PPTX
HAB Software Woes
jgrahamc
 
PDF
Coding Dojo: Baby Steps (2014)
Peter Kofler
 
PDF
Coding dojo
Rafael Rosa
 
PDF
Code Quality Assurance v4 (2013)
Peter Kofler
 
PDF
Code Retreat
Igor Popov
 
PDF
How to write good quality code
Hayden Bleasel
 
PDF
Global Day of Code Retreat (2013)
Peter Kofler
 
PDF
Coding Dojo: Adding Tests to Legacy Code (2014)
Peter Kofler
 
PDF
Alex Fernández - Has anyone else seen your code? - Codemotion Berlin 2018
Codemotion
 
PPT
Code Quality
François Camus
 
PDF
Code Reviews @ Quatico
Jan Wloka
 
PDF
Pragmatic notdogmatictdd agile2012
drewz lin
 
PDF
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Joseph Yoder
 
PDF
Software Craftmanship - Cours Polytech
yannick grenzinger
 
PDF
Global Day of Coderetreat Munich 2018
David Völkel
 
PDF
How to not blow up spaceships
Sabin Marcu
 
PPTX
Kiev Coding Dojo
Johannes Brodwall
 
Coding Dojo: Fun with Tic-Tac-Toe (2014)
Peter Kofler
 
Coding Dojo: Roman Numerals (2014)
Peter Kofler
 
proper care and feeding for your junior developer
Eric St
 
HAB Software Woes
jgrahamc
 
Coding Dojo: Baby Steps (2014)
Peter Kofler
 
Coding dojo
Rafael Rosa
 
Code Quality Assurance v4 (2013)
Peter Kofler
 
Code Retreat
Igor Popov
 
How to write good quality code
Hayden Bleasel
 
Global Day of Code Retreat (2013)
Peter Kofler
 
Coding Dojo: Adding Tests to Legacy Code (2014)
Peter Kofler
 
Alex Fernández - Has anyone else seen your code? - Codemotion Berlin 2018
Codemotion
 
Code Quality
François Camus
 
Code Reviews @ Quatico
Jan Wloka
 
Pragmatic notdogmatictdd agile2012
drewz lin
 
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Joseph Yoder
 
Software Craftmanship - Cours Polytech
yannick grenzinger
 
Global Day of Coderetreat Munich 2018
David Völkel
 
How to not blow up spaceships
Sabin Marcu
 
Kiev Coding Dojo
Johannes Brodwall
 
Ad

More from Peter Kofler (8)

PDF
Pragmatic Introduction to Python Unit Testing (PyDays 2018)
Peter Kofler
 
PDF
Coding Dojo Object Calisthenics (2016)
Peter Kofler
 
PDF
Designing Test Cases for the Gilded Rose Kata v2 (2015)
Peter Kofler
 
PDF
Pragmatic Introduction to PHP Unit Testing (2015)
Peter Kofler
 
PDF
Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)
Peter Kofler
 
PDF
Code Refactoring - Live Coding Demo (JavaDay 2014)
Peter Kofler
 
PDF
Coding Dojo: Bank OCR (2014)
Peter Kofler
 
PDF
Prime Factors Code Kata - Practicing TDD (2014)
Peter Kofler
 
Pragmatic Introduction to Python Unit Testing (PyDays 2018)
Peter Kofler
 
Coding Dojo Object Calisthenics (2016)
Peter Kofler
 
Designing Test Cases for the Gilded Rose Kata v2 (2015)
Peter Kofler
 
Pragmatic Introduction to PHP Unit Testing (2015)
Peter Kofler
 
Coding Dojo for Testers/Testing Dojo: Designing Test Cases with FitNesse (2014)
Peter Kofler
 
Code Refactoring - Live Coding Demo (JavaDay 2014)
Peter Kofler
 
Coding Dojo: Bank OCR (2014)
Peter Kofler
 
Prime Factors Code Kata - Practicing TDD (2014)
Peter Kofler
 
Ad

Recently uploaded (20)

PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
July Patch Tuesday
Ivanti
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 

Coding Dojo: Mars Rover (2014)

  • 1. Coding Dojo: Mars Rover Oct. 2014 Peter Kofler, ‘Code Cop’ @codecopkofler www.code-cop.org Copyright Peter Kofler, licensed under CC-BY.
  • 2. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Peter Kofler • Ph.D. (Appl. Math.) • Professional Software Developer for 15 years • “fanatic about code quality” • I help development teams
  • 4. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Coding Dojo Mindset ● Safe place outside work ● We are here to learn ● Need to slow down ● Focus on doing it right ● Collaborative Game
  • 5. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Two Basic Rules ● Collaborative = Pair Programming ● “Randori“ (pairing on the projector) ● or programming in pairs ● Test Driven Development ● think about tests ● write the test first
  • 6. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY (Maybe Some) Constraints ● Challenges during a dojo or coderetreat. ● Moving to the extreme is a way of learning ● Examples ● Missing Tool (No Mouse, …) ● Missing Feature (No IFs, …)
  • 7. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Dojo Structure ● Introduction 15' ● Coding 45' ● Interim (Retrospective) 15' ● Break 10' ● Coding 45' ● Retrospective 15'
  • 8. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Assignment
  • 9. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Mars Rover ● Develop an API that moves a rover around on a grid. ● You are given the initial starting point (x,y) of a rover and the direction ('N','S','E','W') it is facing. ● The rover receives a character array of commands. ● Move the rover forward/backward ('f','b'). ● Turn the rover left/right ('l','r'). ● Wrap the grid. (Planets are spheres after all.) ● Detect obstacles before each move to a new square. If a sequence of commands encounters an obstacle, the rover moves up to the last possible point and reports obstacle.
  • 10. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Mars Rover Example ● The rover is on a 100x100 grid ● at location (0, 0), ● facing "N"ORTH. ● The rover is given commands "ffrff" ● and should end up at (2, 2). r f f f f (0,0) N (2,2)
  • 11. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Remember the Rules!
  • 12. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Pair Programming & TDD ● regular Pair Programming – do not talk for too long – do not interrupt the other – no “keyboard hugging“ ● use TDD (or at least “sort of” TDD) – write a test before you write code – refactor mercilessly – no debugger
  • 13. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY With a Constraint
  • 14. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY “Yes, and ...“ ● When working in pairs none of the pairs is allowed to delete the code of the other person. ● We are looking for a common solution, that both of the pairs will agree. ● Learn to build on top of the ideas already presented.
  • 15. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY “Yes, and ...“ Rules ● improve existing code of the other ● can not delete code of the other ● whenever one tries to delete code, say: “You should improve the existing one. Please go back and say Yes, and… I will do…” ● Can not be angry on request of not deleting code. ● Only unused code can be deleted. ● Both must agree that the code can be deleted.
  • 16. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Prepare ● Find a pair. ● Choose a programming language. ● Set up the environment. ● Create new project. ● Add testing framework. ● Check requirements. ● Implement Mars Rover.
  • 17. Don't Focus on Getting it Done. F0cus on Doing It Perfectly.
  • 19. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Short Closing Circle ● How did it work out? ● How do you feel? ● What did you learn and want to share with the group?
  • 20. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Full Closing Circle ● What did you learn today? ● What surprised you today? ● What will you do differently in the future?
  • 21. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Global Day of Code Retreat ● A world-wide event celebrating passion and software craftsmanship. ● GDCR 2014: 15th November ● Follow #GDCR14 http://globalday.coderetreat.org/
  • 22. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY Peter Kofler @codecopkofler www.code-cop.org Game by Adrian Bolboaca @adibolb http://blog.adrianbolboaca.ro/2013/12/pair-programming-game-yes-and/
  • 23. PETER KOFLER, CODE-COP.ORG FANATIC ABOUT CODE QUALITY CC Images ● Rover Selfie http://www.flickr.com/photos/gsfc/7971341456 ● Dojo http://www.flickr.com/photos/49715404@N00/3267627038/ ● Todos http://www.flickr.com/photos/kylesteeddesign/3724074594/ ● Curiosity http://www.flickr.com/photos/mendhak/8162305237 ● Rule http://www.flickr.com/photos/phunk/4188827473 ● Model http://www.flickr.com/photos/eldave/8430367749 ● Wants you http://www.flickr.com/photos/shutter/105497713/