Interview practice question
Refactoring untested legacy code safely
Frontend Engineering · Testing and Tooling · Intermediate
You need to refactor a critical but untested legacy module. How would you do it safely?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Write characterisation tests first.
- Capture current behaviour, including quirks.
- Small refactor steps.
- Run tests after each step.
- Remove/adjust tests deliberately.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.