6. Code that
actively prevents
you from making
changes
Code we¡¯re
afraid to change
Code where the
design makes
more design
decisions than
the programmer
Code without
Unit Tests
11. Your turn now!
2 Practice sessions + Debrief
We need to choose a common Programming
Language
Java
C#
Javascript
Find a partner (we¡¯ll switch for Session 2)
Log in to my Cyber-Dojo:
http://cyberdojo.ddns.net
12. Welcome to Ugly Trivia!
What does the code do?
What are the different RESPONSIBILITIES?
How ¡°good¡± or ¡°bad¡± is this code? Why?
How much ¡°Technical Debt¡± does it have?
Can you identify two distinct kinds of tests?
What is the purpose of each?
14. Adding More Characterization
Tests
What kinds of things are displayed? When?
What¡¯s the minimum number of players?
What happens when a player rolls?
How does the current location change?
How are categories selected?
How are coins awarded?
What¡¯s the order of the players?
How big is the board? How is it traversed?
What happens when the answer is correct?
Incorrect?
What are the rules around the ¡°penalty box¡±?
15. Debrief: What was it like?
What are most important insights you gained
from the session?
What was helpful / not-helpful?
What will you do differently in the next session?
16. Let¡¯s fix some defects!
Fix typo when answering correctly ("Answer was
corrent")
Terminate nicely instead of throwing exceptions:
when questions run out
when rolling before adding players
17. Let¡¯s add some new
features!
Backlog
1. Display the winner's
name when the game
ends
2. Display output in
multiple languages
Guidelines
Cover, then modify
Can you test-drive a
replacement?
Are your tests passing
all the time?
How small are your
steps? Can you make
them smaller?
18. Large-Scale Refactoring
New Features
1. Configurable board size
2. New Category: Politics
3. When questions run out (in
any category), the game ends
and the player with the most
coins wins
4. Different categories pay
different amount of coins
when answered correctly
5. if 2 people in a row answer
incorrectly, the order of
players inverts
Guidelines
Pick a feature to work
on
Agree on a ¡°good
design¡± for it.
Sketch general
incremental steps to
get there
20. Debrief: What was it like?
What are most important insights you gained
from this session?
What was the overall feeling?
How does the result compares to what you
initially thought the outcome might be?
How/Where could this approach be useful?
What will you do differently tomorrow, back in the
office?