Skip to content

leobalter/hanoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Dojo

Pair Programming TDD - Write tests first; let them fail; fix them!

This exercise is good for both new and experienced developers.

New developers can learn how to code from TDD (that's an extra), and experienced developers can practice one golden rule on testing: baby steps.

Surprisingly, new developers, the less experienced ones use to provide more great ideas than experienced developers.

Tower of Hanoi

Rules

  1. Only one disk can be moved at a time.
  2. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.
  3. No disk may be placed on top of a smaller disk.

Source: https://en.wikipedia.org/wiki/Tower_of_Hanoi

How to Coding Dojo

More information here: http://www.codingdojo.org/

The basics are: everyone decide a problem/app/thing they want to create or solve, the Tower of Hanoi is just one example.

You have 1 computer attached to 1 big screen that everyone else can see. You need 1 pilot and 1 co-pilot. Only the pilot can touch the computer, the co-pilot just talk to him or to everyone else. The co-pilot can have a cake to keep his hands busy. The crowd can talk to the co-pilot if necessary.

The pilot needs to:

  1. Write a test that fail, just a single test. (Red)
  2. Write code to make that test pass. (Green)
  3. Refactor that code.

Repeat.

Everything the pilot does needs to be told to the crowd, like: "I want to write a test that asserts the return will be 42".

You can set a timer of 5, 7 or 10 minutes. When the time is over, the pilot goes back to the crowd, the co-pilot becomes the pilot, someone from the crowd becomes the co-pilot.

They work on the same code they've had before. Removing code is natural, no one owns the code.

At the end the whole group might have a retrospective, like on scrum, telling what went well and what could be improved.

It's not necessary to solve the problem. Most of the time the solution is unfinished, the most important is to practice TDD through baby steps.

Mixing experienced w/ new developers as pilot and co-pilot creates a powerful group to work on great new ideas and share experiences.


Coding Dojo is language and test framework agnostic. So it's great if the team wants to experiment something totally new to everyone.

The ideas from the new developers (including those with 0 experience on code) are usually amazing. They are thinking out of the box and they'll suggest things worth trying.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages