Debug with AI

Módulo 2: Work with AI on a real codebase

Conteúdo do curso

Esta aula ainda não está no seu idioma, então aqui está em inglês.

Teste rápido

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.

O resto desta aula faz parte do Learn Pro

O primeiro módulo de cada curso é grátis. O Learn Pro libera todas as aulas de todos os cursos por US$ 10 por mês. Todas as ferramentas do JobRise continuam grátis.