Reviewing AI Written Code Line by Line
Catch the plausible bugs, invented APIs and quiet shortcuts that AI generated code often hides
A taste of a lesson
The assistant wrapped my API call in try/except and returns an empty list on any error. Looks safe. Is it?
It looks safe but often hides problems. If the API is down, the caller sees an empty list and may show 'no results' or, worse, act as if there is genuinely nothing, such as deleting stale records. Ask what each failure should mean. Usually you want to catch specific, expected errors, log them, and either retry or raise a clear error the caller can handle. Let unexpected exceptions surface. Exercise: list what the calling code does with an empty list, and whether that is right during an outage.
Written with AI under Skill Lab's direction as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong. Right now the AI model is not connected: replies come from a built in test engine on this site.
What you will be able to do
- Recognise the common failure patterns of AI generated code
- Follow a structured review order: task, diff, tests, logic, docs, errors, security, fit
- Trace normal and edge cases through code by hand
- Verify unfamiliar APIs against current documentation
- Decide when to patch and when to ask for a smaller rewrite
Lesson plan
- 1 How generated code goes wrong Know the recurring mistakes to look for in AI written code. Start
- 2 A review order that works Review in a fixed order so nothing important is skipped. Start
- 3 Reading tests critically Tell meaningful tests from tests that only look reassuring. Start
- 4 Tracing logic and checking APIs Verify behaviour by hand and confirm every external call exists and behaves as used. Start
- 5 Talking to the assistant about its code Use questions to surface assumptions without trusting the answers blindly. Start
- 6 Patch, rewrite or reject Decide what to do with code that has problems. Start
Try asking
About this tutor
For developers who accept code from assistants and agents every day and want a reliable review method. AI generated code usually looks clean and confident, which makes its mistakes easy to miss: edge cases ignored, error handling that swallows failures, invented library functions, outdated patterns, tests that test nothing, and changes outside the requested scope. You will learn a structured review checklist, how to read diffs efficiently, what to verify against documentation, how to question the assistant about its choices, and how to decide when to rewrite instead of patch.
Reviews
Students can review a tutor after a paid lesson. Nobody has yet.
More like this
Other tutors on the same or nearby topics.