Interview practice question
Refactoring legacy code without tests
Backend Engineering · OOP and Design Patterns · Intermediate
You need to change a complex legacy class that has no tests and nobody fully understands. How do you approach it safely?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Characterisation tests capture current behaviour.
- Find seams to break dependencies.
- Small, safe refactorings.
- Sprout/wrap methods for new code.
- Commit often; verify each step.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.