Which task is a good match for Copilot on a legacy codebase?
Why D is the answer
Generating unit tests and proposing refactors you then review
Copilot speeds up test generation, refactoring and modernization. Decisions and accountability stay with people.
In detail
- Tests and refactors suit Copilot when you review what it produces.
- Decisions stay with people, even when the code comes from Copilot.
Use case
An illustrative scenario, not a real incident.
A team inherits an old payments module. Copilot drafts tests for current behavior and proposes refactors, and engineers review each one before it merges.
See it in different ways
flowchart LR A["Ask Copilot for unit tests"] --> B["Review the tests"] B --> C["Ask for code that passes them"] C --> D["Run the tests"]
stateDiagram-v2 [*] --> Suggested Suggested --> Reviewed: check correctness, security and fit Reviewed --> Accepted: passes review Reviewed --> Rejected: fails review Accepted --> [*] Rejected --> [*]
mindmap
root(("Legacy code"))
n1["Copilot drafts"]
n2["Unit tests"]
n3["Refactors"]
n4["People decide"]
n5["Approvals"]
n6["Security review"]
n7["Roadmap"]Key point: Copilot speeds up work, and people stay accountable.
Why the other options are wrong
- A. Deciding the product roadmap
- A roadmap is a human business decision.
- B. Approving its own pull requests with no human review
- People must review, and it should not approve its own work.
- C. Replacing all security review
- Copilot does not replace security review.

