Skip to main content

Debugging systematically

Find the cause of a bug step by step: reproduce it, read the traceback, narrow it down, inspect state with a debugger, fix it and prove the fix with a test.

Beginner 3 · Data and toolsabout 1 hour5 sections

Quick answer

Debugging is finding why code misbehaves. Reproduce the bug, read the error, narrow down where it starts, inspect the values there, fix the cause and add a test.

Why it matters

Most of a developer's time goes into understanding why something does not work. A method beats guessing, and interviewers often ask you to talk through how you would track down a bug.

Sign up free to read the whole lesson

The rest of this lesson: 5 parts, video lessons, the best course, practice and a quick check. It is free, takes a few seconds and needs no card.

Accounts are for learners aged 18 and over. Under 18? The quick answer and the first part of every lesson stay open: browse lessons by topic.

Software engineeringBeginner 3: Data and toolsVideo lessonsDebuggerBreakpointUnit test

Track

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.