Lecture 10: Systematic Debugging

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering error classifications, exception handling, the DRIFT debugging method, IDE debugger controls, and alternative debugging techniques from Lecture 10.

21 Terms

1
New cards

Syntax Errors

Errors caused by using incorrect syntax in code. They are usually caught by the code editor, typically prevent the program from running at all, and are relatively easy to find and fix.

2
New cards

Run-Time Errors

Errors that occur during program execution (often called "exceptions") and might not be predictable ahead of time, such as exceeding memory limits or nesting too many function calls.

3
New cards

Recursion

A programming technique where a function calls itself; if it makes too many nested calls, it can cause a run-time error.

4
New cards

Logic Errors

Mistakes in how code works where the program executes but produces incorrect output or fails unexpectedly. Considered the toughest errors to solve, they are the primary source of bugs.

5
New cards

try-except statement

A Python structure used to intercept and handle run-time errors so the program does not crash, providing an opportunity to recover or exit cleanly.

6
New cards

TypeError

A built-in exception raised when attempting to perform an operation on an inappropriate data type, such as adding an integer to a string.

7
New cards

IndexError

A built-in exception raised when attempting to access an index or element that is out of range of a sequence, such as a list.

8
New cards

ZeroDivisionError

A built-in exception raised when an arithmetic division or modulo operation is attempted with a denominator of zero (00).

9
New cards

NameError

A built-in exception raised when attempting to evaluate or access a variable identifier that has not been defined.

10
New cards

Bug

A common computing term for a problem in a program. Traced back to Thomas Edison's "bug trap" in telegraphs, it was famously popularized in 1947 when Grace Hopper found a moth trapped in a relay of the Mark II computer.

11
New cards

DRIFT

A structured five-step debugging framework: Discover (find a repeatable problem), Reproduce (create a reliable failing test case), Isolate (narrow down the code location), Fix (resolve the bug), and Test (verify the fix, ensure no regressions, and check for similar issues elsewhere).

12
New cards

Debugger

A software tool integrated into code editors that assists in locating bugs by controlling code execution and examining memory contents during runtime.

13
New cards

Debug Mode

A specialized execution mode separate from normal mode that builds extra diagnostic information into the executable with reduced optimization, causing code to run less efficiently.

14
New cards

Breakpoint

An execution control marker placed next to a line of code (often visualized as a red circle) that causes the program to pause execution immediately upon reaching that line.

15
New cards

Step / Step-over

A debugger execution control that executes the next line of code; if the line contains a function call, the function executes completely and returns before execution pauses again.

16
New cards

Step-into

A debugger execution control that executes the next line of code, navigating inside any called function and pausing at its first line.

17
New cards

Continue / Run

A debugger execution command that resumes normal program execution until the next breakpoint is reached or the program terminates.

18
New cards

Call Stack

A debugger inspection tool that lists the hierarchy of active function calls (viewed by typing "where"), showing the most recently entered function at the top.

19
New cards

Variable Explorer / Variable Watch-List

A debugger interface tool that displays active variables and their current values in memory, allowing developers to inspect hierarchies and monitor changes.

20
New cards

Rubber duck debugging

A manual debugging technique where a programmer explains code line-by-line to an inanimate object (such as a rubber duck) to identify logic discrepancies between intent and implementation.

21
New cards

assert statement

A sanity-check statement in Python that tests a Boolean expression; if the expression evaluates to False, it halts the program and raises an AssertionError.