2. @gil_zilberfeld
Who Am I
Agile helper
Software improver
Author of “Everyday Unit Testing”
www.gilzilberfeld.com
www.everydayunittesting.com
@gil_zilberfeld
5. @gil_zilberfeld
Rules of Engagement
• We’re building parts of a spaceship
• Gotta have a test framework
• Break into pairs
• Introduce yourself - 5 minutes
• Try to stick to technology you feel comfortable in
• Work in rounds
• 15 minute work
• 10 public review
7. @gil_zilberfeld
Round 1: Silence of the Names
• Write empty tests
• Write as many test cases as possible using names
• All tests should pass
• No speaking
8. @gil_zilberfeld
Review - Names
• How do you feel about the names? Did it change over time?
• Did both of you suggest names?
• Are the names clear?
• Did the tests pass?
• How did the name ideation go?
• How did the first test set the stage?
9. @gil_zilberfeld
Round 2: Test Runner
• 1st person selects, writes and fails a test
• 2nd person makes it pass
• No refactoring
• All tests must pass
10. @gil_zilberfeld
Review – Test First, Pass Second
• How many tests passed?
• Which tests did you start with?
• Who’s holding up the line? What did you feel about this?
• What is the quality of the code?
• What is the quality of the test?
• Do the names describe the tests correctly?
• How much conversation time?
11. @gil_zilberfeld
Round 3 - Transformers
• Refactor code and tests
• Save the old version
• No adding and removing tests
• All tests must pass
12. @gil_zilberfeld
Review - Refactoring
• What did you decide to refactor?
• Who led the process?
• Did everyone agree on the changes?
• What did you refactor more, code or tests?
• Did you run the tests after every change?
• Did you do enough refactoring?
• How long between test runs?
13. @gil_zilberfeld
Round 4 –Predator Vs Alien
• Break up the pairs
• 3 minute introduction
• The Predators write the tests
• No talking to the aliens
• Add more tests if needed
• Step away when a test fails
• The Aliens write the passing code
• No talking to predators
• Observe already working tests and code
• Step away when a test passes
• All tests must pass
• Get points for passing additional tests
14. @gil_zilberfeld
Review – Facing the unknown
• Predators:
• What was the quality of tests compared to the ones you wrote before?
• Why did you pick those test cases?
• How did you work together?
• Aliens:
• What did you think about the tests picked by the predators?
• Was the existing code helpful?
• How did you work together?
15. @gil_zilberfeld
The many faces of TDD
• TDD is not just Red-Green-Refactor
• Can be done in different ways
• It is a learning experience
• More fun in groups / pairs