1. Red, green, what now?! @kevinrutherford @jjeffries1
2. Primitive Obsession Feature Envy Sim ulated Polym orphism
Lazy Class Temporary Field Inappropriate Intimacy ShotgunSurgery
Data Clump Long M ethod Large Class ??? ??? ??? ??? ??? ??? ???
RefusedBequest
3. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
4. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
5. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
6. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
7. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
8. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
9. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
10. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
11. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
12. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Connascence of ...
13. Scanning a single item
14. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code:
15. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code:CoEO scan()scan()
16. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: CoV CoEO scan()scan()
5050
17. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code:CoEO CoM scan()scan()
int int int
18. Checkout with an empty basket
19. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: CoM int int int
unitPrice = 50 unitPrice = 50 int CoA
20. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: CoM int int int
21. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code:
22. Different items have different prices
23. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: string string CoM
24. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: string string
balance.add() balance.add() CoM CoA
25. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: AA string string
balance.add() balance.add() CoV CoM CoA
26. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: CoV AA 3030 string
string balance.add() balance.add() CoV CoM CoA
27. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: AA string string
balance.add() balance.add() CoV CoM CoA Money, MoneyMoney, Money
CoP
28. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: string string
balance.add() balance.add() CoM CoA Money, MoneyMoney, Money
CoP
29. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code: string string CoM Map
Map CoM
30. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Test: Code:
31. Recap
32. Scanning a single item
33. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Scanning has no effect on the
balance Both classes know the price = 50
34. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Introduce Parameter{
35. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Scanning has no effect on the
balance Everyone knows we use an int to represent money
36. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Write a test{
37. Checkout with an empty basket
38. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Everyone knows we use an int to
represent money Common test setup
39. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Introduce @Before block{
40. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Everyone knows we use an int to
represent money
41. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Introduce Money class{
42. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9
43. Different items have different prices
44. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 balance.add() called twice Strings
used to represent product codes Everyone depends on A Everyone
knows the price of B
45. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Introduce Parameter{
46. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 balance.add() called twice Strings
used to represent product codes Everyone depends on A Constructor
parameters are indistinguishable
47. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Introduce Parameter{
48. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 balance.add() called twice Strings
used to represent product codes Constructor parameters are
indistinguishable
49. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Introduce a Map of names to
prices{
50. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Strings used to represent product
codes Map used to represent the price list
51. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Introduce PriceList{
52. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9 Introduce ProductCode{
53. Name Type Meaning Algorithm Position Execution Order Timing
Value Identity 1 2 3 4 5 6 7 8 9
54. Red, green, what now?! @kevinrutherford @jjeffries1