working-with-legacy-code
Safely change and test untested codebases using Feathers' "Working Effectively with Legacy Code". Use when the user mentions "legacy code", "no tests", "untested codebase", "how do I test this", "seams", "characterization tests", "golden master", "sprout method", "afraid to change this code", "monster method", "dependency breaking", or "inherited a messy codebase". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout/wrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.
- Version
- 1.2.0
- License
- MIT
Pinned to revision 4f7124e6049e, so it is the text this page describes rather than whatever the author pushed since.
Files
- skills/working-with-legacy-code/SKILL.md
- skills/working-with-legacy-code/references/case-studies.md
- skills/working-with-legacy-code/references/change-algorithm.md
- skills/working-with-legacy-code/references/characterization-tests.md
- skills/working-with-legacy-code/references/dependency-breaking.md
- skills/working-with-legacy-code/references/seams.md
Every link opens the file at its source, pinned to the revision this page describes.