Testing Legacy Code - What To Do When It Seems Untestable
summary
Claims that nothing is truly untestable and that tests become a living contract with requirements, demonstrated by turning 0 tests into 20,000 tests across five repos that run in 12 minutes. Starts by writing a failing test for the observed bug or new feature, uses PHP tooling like XDebug, unpicks a near 10,000 line god controller, and through testing and refactoring removes 29 steps from a complex calculation, catching hidden bugs and increasing confidence.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:42Christophers background
- 3:20School of Code
- 4:47Christophers favorite and least favourite examples
- 7:29Oblivion
- 8:40Code Now vs Legacy Code
- 11:03What are the risks
- 13:41Traceability
- 18:25readability vs reliability
- 23:45common problems
- 26:49why do I need testing
- 27:24first test
- 30:00high test coverage
- 31:25aiming for confidence
- 32:12paying for testing
- 36:26refactoring
related talks
41mTesting Legacy Code & Safe Refactoring
40mTesting Legacy Code: Safe Refactoring
25mWriting Testable Code
56mUnit Testing by Example
01h 01mYou Can Test Anything
54mTesting in Legacy: From Rags to Riches
29mEffective tests and testing effectively
44mTesting the untestable - patterns and use cases analysis
