We're going to be going through the exercises at exercism.io, with two twists:
- You'll be writing you own tests (exercism.io gives you tests, but you'll be ignoring them)
- We'll be Pairing up to do them.
For the pairing, we'll be using a method known as "Ping Pong Pairing," so that each pair gets to write both tests and code, and it's more clear when the "driver" should switch to another person.
Here's an elegant description, from the c2.com wiki:
- A writes a new test and sees that it fails.
- B implements the code needed to pass the test.
- B writes the next test and sees that it fails.
- A implements the code needed to pass the test.
And so on. Refactoring is done whenever the need arises by whoever is driving.
- Head on over to exercism.io
- Click the "Start Now (via Github) button
- Follow the instructions
If you don't want to sign up, or if you don't have a Github account, you have two options
- Ask your pair to sign up and you can use their computer instead.
- The other option is to follow the instructions on the homepage in the "Try It!" section. It'll walk you through how to do at least the first exercise without signing up.
Don't worry, there's a Windows client. You can download the appropriate file from here (follow the instructions on that page).
If you don't want to use that binary, you can signup for a nitrous.io account and install it on your free Linux box.
You can either
- Ask your neighbour if they're up for pairing, or
- Await further instructions and we'll pair you up.
Here are a few tips
- Single Responsibility (should extend to methods as well)
- E.g., Extract responsibilities into classes, where appropriate. If you notice a method is getting kind of long, chances are you should split some code into a separate method.
- Descriptive names for methods, variables and classes
- Extract functionality into methods where appropriate
- Favour simplicity and readability
- First, run the original set of tests given by exercism.io. For example, for the Bob exercise:
ruby bob_test.rb
- Raise your hand to get the attention of a Code Reviewer. Someone will come over for a review.
Please feel free to let us know if you have any questions. Other than that, have fun! :)