
Debugging Stratgies
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Medium
Kevvin Hankins
Used 1+ times
FREE Resource
13 Slides • 4 Questions
1
By Kevvin Hankins
2
IT-CSP-6
Create programs that translate human intention into computational artifacts including music, images, visualizations, and more while exploring the concepts, techniques and development used in writing programs.
3
Locate and correct errors in a program.
IT-CSP-6.4
Evaluate, justify, and explain a program for correctness, i.e., program style affecting the determination of program correctness.
IT-CSP-6.3
4
Debugging is fixing a problem in your code.
DeBugging
A bug is a problem in your code.
Bug
5
Match
Match the term to the correct definition.
Bug
Debugging
IT-CSP-6.4
A problem in your code.
Fixing a problem in your
Locate and correct errors in a program.
A problem in your code.
Fixing a problem in your
Locate and correct errors in a program.
6
Open Ended
1. What are some bugs you’ve encountered in your programs?
2. How did you find the location of the bug?
3. What did you do to fix the bug? How did you know to do this?
7

CodeHS
You can open this webpage in a new tab.
8
Multiple Choice
Which of the following is an example of a ‘runtime error’?
I. Karel crashing into a wall
II. Leaving a semicolon off the end of a command
III. Using the wrong syntax in an if/else statement
IV. Not closing all open brackets
I.
I. and III.
II and IV
I-IV-All
9

CodeHS
You can open this webpage in a new tab.
10
Debugging
Basics
11
12
First Debugging Strategies
● Attention to detail
○
Even the smallest syntax error could be the source of the
problem, something as small as a typo!
● Questioning assumptions
○
Sometimes the thing we are so sure can’t be the source of
the problem actually is. Make sure to question everything.
13
Attention to Detail
● We need to get the details exactly right!
● But it is easy for things to slip by
○
Look out for typos
○
Small errors
■
Typos in variable names
■
Syntax errors in functions, if statements, loops
■
Valid code that isn’t what you meant
■
Accidental mix-ups
14
Questioning Assumptions
● The computer isn’t likely making a mistake, it is just
doing what you told it to do.
● This means we may have (and likely did!) overlook
something
○
The problem description
○
Our pre and post conditions
○
Does this actually do what I think it does?
○
What have I assumed worked that could actually be
broken?
15
The bug can be a simple fix!
Tricky bugs often have simple
sources.
The first step is just to
double-check your code!
16
Let’s debug a
problem together!
17
Multiple Choice
The following code contains an error. What line is it on?
Line 3
Line 4
Line 5
Line 9
By Kevvin Hankins
Show answer
Auto Play
Slide 1 / 17
SLIDE
Similar Resources on Wayground
12 questions
Suffixes y and ly
Presentation
•
9th - 12th Grade
12 questions
Using Line of Best Fit to Make Predictions
Presentation
•
9th - 12th Grade
12 questions
In-text Citations
Presentation
•
9th - 12th Grade
13 questions
Area of a Sector
Presentation
•
9th - 12th Grade
11 questions
Must and Mustn't
Presentation
•
9th - 12th Grade
11 questions
Distance & Midpoint Formulas
Presentation
•
9th - 12th Grade
15 questions
Strategi Algoritmik dan Pemrograman - Proses Pemrograman
Presentation
•
9th - 12th Grade
12 questions
Alg. 1 10-5
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
How much do you know about our Portrait of an Eagle?
Quiz
•
10th Grade
10 questions
Fast Food Slogans
Quiz
•
6th - 8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
20 questions
[AP CSP] Python Coding: Functions, Parameters, Return
Presentation
•
9th - 12th Grade
40 questions
Introduction to Microsoft Word
Quiz
•
8th - 12th Grade
20 questions
APCS Unit 1A
Quiz
•
9th - 12th Grade
24 questions
Binary
Quiz
•
9th - 12th Grade