~/talk

Working Effectively with (Android) Legacy Code

github:ecgreb
speakerdeck:heyitsmohit
links:none on file

Provides concrete micro‑refactors that turn untestable Android Java code into testable seams: find object seams, break singletons like a DatabaseManager with a static setter, replace static util calls with instance delegators, and split god objects via extract interface so presenters accept mocks. Shows runnable examples (NotificationFactory, login presenter, event tracker) and a decorator wrap class for tracking without changing legacy code. Recommends incremental tests first and measures wins (example: swapped GSON to Mashi and validated serialization performance improvements).

AI-written summary · about

  1. 0:00Introduction to legacy code
  2. 1:09Defining legacy code challenges
  3. 4:24Why legacy code is untestable
  4. 7:37Reasons to modify legacy code
  5. 9:25Understanding seams in code
  6. 10:49Demo: Finding seams in activities
  7. 13:38Dependency breaking techniques
  8. 16:28Handling singletons in tests
  9. 18:56Breaking static method dependencies
  10. 20:45Extracting interfaces for god objects
  11. 22:54Extracting implementers for interfaces
  12. 25:01Sprout method technique
  13. 28:53Sprout class strategy
  14. 31:03Wrap class burrito strategy
  15. 34:59Key takeaways and next steps
  16. 37:48Q&A: Rewriting vs refactoring
  17. 39:09Q&A: Regression testing
  18. 40:11Q&A: Refactoring approach
  19. 41:14Q&A: Java to Kotlin migration
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.