Copilot suggests a function that passes your tests. What is the responsible next step?
Why C is the answer
Review it for correctness, security and fit, as you would any code
You own what you commit. AI output must be validated, and tests only cover what they check.
In detail
- Passing tests does not prove code is correct, secure or a good fit.
- Review it as you would any code.
- Ask what the tests do not cover, as well as whether they pass.
Use case
An illustrative scenario, not a real incident.
Copilot writes a discount function that passes its tests. A review finds it applies the discount twice for members, a case the tests never covered.
See it in different ways
flowchart LR A["Copilot suggestion"] --> B["Read and understand it"] B --> C["Test it"] C --> D["Check security and licensing"] D --> E["Merge"]
stateDiagram-v2 [*] --> Suggested Suggested --> Reviewed: check correctness, security and fit Reviewed --> Accepted: passes review Reviewed --> Rejected: fails review Accepted --> [*] Rejected --> [*]
flowchart LR S0["Copilot suggests"] --> S1["Tests pass"] --> S2["You review"] --> S3["Merge if it is right"]
Key point: You own the code you accept.
Why the other options are wrong
- A. Only review it if it is over 100 lines
- Short code can also be wrong, so size is not the test.
- B. Merge it, because passing tests prove it is right
- Tests only cover what they check.
- D. Ask Copilot whether the code is safe and accept its answer
- Copilot can be wrong about its own output.

