~/talk

Refactoring Legacy Code Guided by Simple Design

Talkat Agile India 2017 · 2017-03-05..03-12· [testing]
slides:none on file

Walks through a real legacy Java module and performs safe refactorings guided by the Four Rules of Simple Design: enable Eclipse warnings, remove dead code, and shrink a constants file into its owning classes. Uses the Unnecessary Code Detector to drop ~149 unused items down to zero, runs tests under EclEmma coverage, and writes characterization JUnit tests with Mockito mocks to capture behavior before changing it. Extracts methods, renames for intent, consolidates duplicated assertions, commits after each step, and ends with full branch coverage so new features can be added safely.

AI-written summary · about

  1. 0:00Introduction
  2. 0:56Legacy Code
  3. 2:08Dead Code
  4. 2:56Remove
  5. 5:31Find Dead Code
  6. 6:25Remove Unused Code
  7. 10:53Remove Unused Classes
  8. 12:56Revealing Intent
  9. 15:34Renaming
  10. 16:49Extract Method
  11. 18:48Characterization Tests
  12. 26:04Testing System
  13. 36:14Refactoring
  14. 37:18Code Coverage
~/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.