How to trust code you didn't write line-by-line.
When an AI generates code, it often looks perfectly plausible. But "looks plausible" is not a verification strategy. To safely merge AI-generated code, you must treat it like code from an eager junior engineer who occasionally hallucinates.
You verify it by running Automated Tests, manually checking Edge Cases, and strictly diffing it against the original Specification. Let's see which verification strategy catches the hidden bug in this AI patch.
# AI Code is guilty until proven innocent.
1. Tests Pass?
Always run the test suite. But remember, the AI might have
written the tests too, so they might assert the WRONG behavior.
2. Specification Match?
Does the code do *exactly* what the ticket asked?
AI often adds "helpful" features that introduce security holes,
or ignores performance constraints you requested.
3. Edge Cases & Types?
AI struggles with boundaries (e.g. empty lists, negative numbers,
Null values). Always test the boundaries manually or via property tests.