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 by the teacher as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong.
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
4.7
3 ratingsSample
- Mohammed Y.Sample
Reading tests before logic changed my reviews. I found two tests that only checked no exception was thrown.
- Camille B.Sample
The 'spot the plausible bug' exercises were humbling and useful. I wanted more examples in Go, but the method transfers.
- Rajesh K.Sample
The swallowed errors lesson alone was worth it. We found that exact pattern in production code.
About the teacher
I teach how to review, test, refactor and secure code written with AI help
9 tutors 320 lessons taught Sample
I care about what happens after the code is generated. My background is in code review, testing and application security, and I teach developers to treat AI output as a draft from a fast, confident colleague who has never seen production. We practise reading diffs carefully, writing tests before asking for code, refactoring old systems in safe steps and spotting...
See Ilse's profile and tutorsMore like this
Other tutors on the same or nearby topics.