Working Effectively with Android Legacy Code
summary
Defines legacy as code without tests and shows concrete tactics to get tests and reduce risk: use IntelliJ refactor tools, add unit JVM tests and Robolectric, and apply small, safe edits like sprout method or sprout class to isolate new behavior. Demonstrates wrapping a NotificationFactory with a decorator TrackingNotificationFactory, parameterizing click handlers, constructor injection and test-only static setters to break singletons. Each change is incremental and testable so refactors become verifiable rather than risky.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 3:30Legacy code meaning
- 7:23Working with legacy code
- 12:47Finding seams in code
- 17:22Tools for legacy code
- 19:11Start where you are
- 20:38Sprouting new methods
- 23:33Sprouting new classes
- 26:09Burrito refactoring
- 28:57Dependency breaking techniques
- 35:22Final thoughts
related talks
42mWorking Effectively with (Android) Legacy Code
41mHow to Really Test an Android Application
18mRescuing Old Code with JetPack
01h 00mTesting Legacy Code & Refactoring Patterns
40mProtips: A fresh look at advanced topics for Android experts
41mCreating A Better Developer Experience By Avoiding Legacy Code
46mRefactoring Legacy Code guided by Simple Design
20mUnit testing on Android
