~/talk

6 Safe Refactoring's for Untested Legacy Code

Talkat JSHeroes 2025 · 2025-05-29..05-30· [developer-experience, testing]
slides:none on file

Demos six concrete refactorings using VS Code shortcuts (F2, alt+enter, multi‑select) and an author‑made VS Code extension to decouple IO from domain: extract variable, split declaration and initialization, slide statements plus inlining and renaming. The concrete claim is that applying only automated refactor moves extracts domain logic from an Express controller so tests shrink from a dozen slow end‑to‑end checks to fast isolated cases — twelve slow tests become a suite running in about 6 ms — enabling safe bigger refactors.

AI-written summary · about

  1. 0:00Welcome
  2. 3:06What refactoring is
  3. 6:31Core refactorings
  4. 9:00Situational refactoring moves
  5. 12:58Why legacy code resists testing
  6. 15:54Separating domain logic from IO
  7. 16:36Live coding distill and extract
  8. 27:21Riskiest refactorings
  9. 28:02Closing
~/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.