Intermediate 8 min

Review a generated diff

A diff shows exactly which lines changed, so you can compare the change with the original request.

How it works

Read the diff by tracing the user action into the new code. Ask where the incoming value is validated and where the result is used. Finally, check whether any old behavior changed on an empty or unexpected input. This catches mistakes a simple happy path can miss.

Walk through an example

Read the files that implement the requested behavior, then scan for unrelated configuration, dependency, or formatting edits. Check the normal entry point as well as helper functions.

What to watch for

Generated explanations can miss changes. Inspect the actual diff and open the affected page or feature before accepting it.

Check your understanding

What should you inspect before accepting the change?

See the example and explanation
Worked example
Given A spelling fix also changes the database connection settings.
Answer Why the unrelated database change exists.

The extra change may affect startup or deployment and is outside the spelling task.

Open practice problem
Next lessonDebug with evidence