Lecture 10 – Systematic Debugging (ENGR 102)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

Which of the following is NOT a type of coding error discussed in the lecture?

Memory assignment error

2
New cards

What type of error prevents code from running at all?

Syntax error

3
New cards

Which error type occurs during execution, often called an “exception”?

Run-time error

4
New cards

Which error allows the program to run but gives incorrect results?

Logic error

5
New cards

What Python structure is used to handle run-time errors gracefully?

try–except

6
New cards

What keyword begins a block of code you want to test for exceptions?

try

7
New cards

What is an example of a run-time error?

Dividing by zero

8
New cards

Which of the following is NOT a common exception type listed in the lecture?

OverflowWarning

9
New cards

What is a "bug" in programming?

A problem or defect in a program

10
New cards

What does the acronym DRIFT stand for in debugging?

Discover, Reproduce, Isolate, Fix, Test

11
New cards

What is the purpose of the “isolate” step in DRIFT?

To find the exact line or area where the bug occurs

12
New cards

What tool lets you pause code at specific points to inspect variables?

Breakpoint

13
New cards

What debugger action executes the next line but does NOT enter a function call?

Step-over

14
New cards

What debugger action executes the next line and goes inside any function call?

Step-into

15
New cards

What does the “Variable Explorer” in a debugger show?

Current variables and their stored values

16
New cards

What is “rubber duck debugging”?

Explaining your code line-by-line to find logic mistakes

17
New cards

What is the purpose of the assert statement?

To perform sanity checks during debugging

18
New cards

What happens if an assert condition evaluates to False?

An AssertionError is raised and the program stops

19
New cards

What should you do with assert statements in final code?

Comment them out or remove them

20
New cards

What is the main idea of debugging according to the lecture?

Use a systematic process to find, isolate, and fix errors