SlideShare una empresa de Scribd logo
1 de 60
Red, green,
… what now?!
@kevinrutherford
@jjeffries1
Primitive Obsession
Feature Envy
Sim
ulated
Polym
orphism
Lazy Class
Temporary Field
Inappropriate Intimacy
ShotgunSurgery
Data Clump
Long
M
ethod
Large Class
???
??? ???
???
???
???
???
RefusedBequest
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Connascence of ...
Scanning a
single item
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Test: Code:
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Test: Code:CoEO
scan()scan()
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
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
Checkout with
an empty basket
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
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Test: Code:
Different items
have different
prices
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Test: Code:
string string
CoM
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Test: Code:
“A”“A”
string string
balance.add()
balance.add()
CoV
CoM
CoA
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Test: Code:
CoV
“A”“A”
3030
string string
balance.add()
balance.add()
CoV
CoM
CoA
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Test: Code:
“A”“A”
string string
balance.add()
balance.add()
CoV
CoM
CoA
Money, MoneyMoney, Money
CoP
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
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Test: Code:
Recap
Scanning a
single item
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Introduce
Parameter{
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Write a test{
Checkout with
an empty basket
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Introduce @Before
block{
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Introduce Money class{
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Different items
have different
prices
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”
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Introduce
Parameter{
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Introduce
Parameter{
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
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{
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
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Introduce
PriceList{
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Introduce
ProductCode{
Name
Type
Meaning
Algorithm
Position
Execution Order
Timing
Value
Identity
1
2
3
4
5
6
7
8
9
Red, green,
… what now?!
@kevinrutherford
@jjeffries1

Más contenido relacionado

Más de Kevin Rutherford (18)

Don't forget the developers!
Don't forget the developers!Don't forget the developers!
Don't forget the developers!
 
Love and death
Love and deathLove and death
Love and death
 
The 5-day challenge
The 5-day challengeThe 5-day challenge
The 5-day challenge
 
Pair programming
Pair programmingPair programming
Pair programming
 
Tdd is dead
Tdd is deadTdd is dead
Tdd is dead
 
Hex arch
Hex archHex arch
Hex arch
 
Shepherding antipatterns
Shepherding antipatternsShepherding antipatterns
Shepherding antipatterns
 
Kata rules
Kata rulesKata rules
Kata rules
 
Movie app kata
Movie app kataMovie app kata
Movie app kata
 
Object discovery
Object discoveryObject discovery
Object discovery
 
OCP Checkout kata
OCP Checkout kataOCP Checkout kata
OCP Checkout kata
 
OCP bowling kata
OCP bowling kataOCP bowling kata
OCP bowling kata
 
OCP String Calculator kata
OCP String Calculator kataOCP String Calculator kata
OCP String Calculator kata
 
OCP kata overview
OCP kata overviewOCP kata overview
OCP kata overview
 
Telling not-asking
Telling not-askingTelling not-asking
Telling not-asking
 
Uml
UmlUml
Uml
 
Agile principles
Agile principlesAgile principles
Agile principles
 
Flow
FlowFlow
Flow
 

Último

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburgmasabamasaba
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Último (20)

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Red, green, ... what now?!