When upgrading ex_money required removing the stale Timex library from a large Elixir codebase, a two-phase shim approach made the migration safe and reviewable. Phase 1 introduces a shim module that mirrors only the Timex functions actually used, backed by Elixir's standard library, with characterization tests that compare shim output directly against Timex while both are still installed. Phase 2 mechanically replaces call sites and removes Timex from mix.exs. The shim then erodes gradually as code is touched for other reasons. The technique maps to three classic patterns: seams (Feathers), characterization tests, and the strangler fig pattern applied at dependency scale rather than system scale.
Table of contents
When the footprint is small, replace itWhen the footprint is large, introduce a shimThe textbook names for what we just didA note on the idiomatic alternative309 Impressions