The Myth of Untestable Code
summary
Contrary to “untestable” labels, legacy PHP code at mattify gets safety by running end-to-end tests that feed idml inputs and assert produced FO (Apache FOP) XML matches known-good files; Xdebug traces plus a legacy-to-data-provider step replay real production calls for characterization tests. PHPMD flags an N‑path complexity threshold of 200 and the legacy script far exceeds it, so the team avoids full rewrite, uses integration tests and branch by abstraction to route a single product format to new code and gradually replace the monolith.
AI-written summary · about
chapters (10)
- 0:00Introduction to testing talk
- 1:04Legacy code challenges explained
- 7:06Codebase evolution and growth
- 16:20Why legacy code is untestable
- 20:14End-to-end testing strategy
- 26:44Refactoring for testability
- 31:02Branch by abstraction approach
- 33:56Testing benefits and documentation
- 36:27Building new code foundations
- 37:18Q&A session
