2. About Me
• Clean coder, TDDer, Software Craftsman
• Over 12 years of development
• Lead the infrastructure operations and development
workflows at StartApp
• Tech lead and scrum master (eBay)
egolan74@gmail.com
http://eyalgo.com/
@eyalgo_egolan
27. Difficult to Instantiate the Class
Expose Static Method (which does not use
instance’s variables)
1. Write test that access the method to
be tested
2. Extract the body to a static method
3. Call the static method from the
original one
37. Hidden Method
• Test through a public method
• Extract to a new class
• Expose the method
38. Did I Break Something?
Do one thing at a time
Preserve signature
Trust your computer and IDE
Pair programming
39. Huge Method
• Usually not following SRP
• Usually with too many dependencies
• Invest time and create a safety harness
• Refactor: extract to smaller, tested
methods, extract class
40. More Operations
Introduce / Extract interface
Rename (better understanding)
Expose visibility (package protected)
Extract and override
44. Ask Yourself
1. What changes do we have to make?
2. How will we know that we’ve done
them correctly?
3. How will we know we haven’t
broken anything?