Question 90
A Copilot-assisted software team encounters the following situation: A team inherits a legacy method with deeply nested conditionals and unclear intent. Which action should the team choose first to satisfy the stated need?
Explanation
Correct Answer
Refactoring assistance saves effort only when existing behavior remains correct. The proposed action directly addresses the identified need: A team inherits a legacy method with deeply nested conditionals and unclear intent. A suitable acceptance check is: Characterization tests produce the same observable outputs before and after the refactor.
Incorrect Answers
Generated tests omitted authorization-denial paths. The specific problem here is that the rewrite was accepted without preserving legacy behavior.
Generated tests copied the implementation's mistakes into expected values. The specific problem here is that the rewrite was accepted without preserving legacy behavior.
A generic explanation ignored language-version differences. The specific problem here is that the rewrite was accepted without preserving legacy behavior.