To improve readability without changing behaviour, the developer will ___ the legacy module.
To refactor a module means to restructure code internally while preserving behaviour. Refactor is the precise term, behind "refactoring" and Fowler's catalogue. Redo up, rework out, and fix over are not real collocations. Developers "refactor the legacy module before extending it," so refactor the module is the correct collocation.
2 / 5
The developer will ___ the repeated logic into a shared helper function.
To extract a method (or function) means to move a block of code into its own named unit — a core refactoring. Extract is the precise term, behind "Extract Method." Pull out up, take over, and lift off are informal or wrong. Developers "extract the duplicated logic into a helper," so extract a method is the correct collocation.
3 / 5
To make the intent clearer, the developer will ___ the cryptic variable to something descriptive.
To rename a variable means to give it a clearer name — a basic, safe refactoring. Rename is the precise term, behind the "Rename" refactoring in every IDE. Change up, switch out, and relabel over are informal or imprecise. Developers "rename the variable for clarity," so rename a variable is the correct collocation.
4 / 5
The reviewer flagged a ___ — a structural hint that the code may need refactoring.
A code smell is a surface symptom (long method, duplicated code, large class) suggesting a deeper design problem. Code smell is the precise term, popularised by Fowler and Beck. Bad whiff up, rot out, and stink over are not real terms. Reviewers "flag a code smell," so a code smell is the correct collocation.
5 / 5
Before refactoring, the developer will ___ the existing behaviour with tests to refactor safely.
To cover code with tests means to add tests that capture current behaviour so refactoring does not break it. Cover is the precise term, behind "test coverage" and "characterisation tests." Wrap up, guard out, and shield over are informal or imprecise. Developers "cover the code with tests before refactoring," so cover with tests is the correct collocation.