Debug with AI

Module 2 : Work with AI on a real codebase

Plan du cours

Cette leçon n'est pas encore dans votre langue, la voici donc en anglais.

Petit test

Guess first, no penalty. Your app throws KeyError: 'user_id' in production. Which message to the AI gets the most useful answer?

A stack trace is the list of function calls that led to an error, printed with the error itself. It's the most useful thing you can paste, so paste all of it.

A good debugging request has five parts:

  • The exact error and stack trace.
  • The code involved: the function, and how it's called.
  • Expected vs actual: what should happen, and what does.
  • What you've tried, so it doesn't suggest the same thing.
  • The ask: likely causes, ranked, and how to confirm each one. Not a patch yet.

Asking for causes before a patch matters. A patch for a cause nobody confirmed can hide the symptom and leave the bug in place. So confirm the root cause first, with a test that fails for exactly that reason. Then accept a fix only when that test passes.

La suite de cette leçon fait partie de Learn Pro

Le premier module de chaque cours est gratuit. Learn Pro ouvre toutes les leçons de tous les cours pour 10 $ par mois. Tous les outils JobRise restent gratuits.