4. Outside-in development
● Start at the very top
○ discover dependencies
○ avoids unit interface incompatibility problem
○ how would I test this?
● Programming by wishful thinking
○ design usage, review/discuss, implement later,
refactor a lot later
○ do / refactor mode
5. TDD
● Acceptance (end-to-end) tests
○ start here!
○ nonexhaustive (avoid exponential blowup)
● Unit tests
○ a design tool
○ a testing tool
8. Immutable OO
● Best trick for maintainable code, by far!
● All fields immutable
● Mental trick
○ obj.method(*args) == method(Class obj, *args)
● Code smells are obvious
● Temporal coupling is impossible
● OOP finally makes sense
9. Smell-Driven Development
● private / protected
○ missing collaborator, extract & inject
● not using all fields
○ class doing too much, split
● prefixes
○ missing abstraction, extract & inject
● returning self or void
○ mutable state, avoid!
● duplicated logic in parent method
○ inject listener/responder
10. Smell-Driven Development (2)
● Law of Demeter (one dot rule)
○ getters are ok!
● Avoid global constants
○ a.k.a. implicit dependencies
○ yes, class name is a constant
● Data Clump, Feature Envy
● Test smells