You Can Test Anything
summary
Claim: any hard-to-test legacy code can be made testable by small, mechanical refactorings and test doubles. The session walks code excerpts in Java C# C++ and Ruby and shows techniques like adapt parameter, parametrize constructor, extract and override call, moving globals into objects (one project had 760 globals), splitting methods into a method object, and definition completion/monkey‑patching to stub platform calls. Each recipe produces a fake or overload, compiles and lets unit tests run; some changes trade ugliness for safety but they work.
AI-written summary · about
chapters (11)
- 0:00Start
- 2:56Automated Unit Testing
- 6:49The Parthenon
- 8:00Legacy Code
- 43:15Practices for Scaling Lean Agile Development
- 45:53One Definition Rule
- 47:21Definition Completion
- 48:48Monkey Patching
- 53:20Code Snippets
- 54:39In-Memory Database
- 57:45What about Interaction between Asynchronous Events
related talks
40mTesting Legacy Code: Safe Refactoring
45mTesting Legacy Code - What To Do When It Seems Untestable
45mWorking with C++ Legacy Code
49mWorking with C++ Legacy Code
36mUsing Tests as a Tool to Wrangle Legacy Projects
44mTesting the untestable - patterns and use cases analysis
01h 19mYou Can't Test This? Hammertime!
25mWriting Testable Code
