Debugging Preparation
Overview
As you start to develop more complex programs, you are going to run into more errors and bugs. Today is focused on strategies for debugging and the kinds of errors that you will encounter.
Basic Learning Objectives
Before class, you should be able to:
- List strategies for avoiding bugs in the first place
- List “rules” for debugging
- Define syntax, runtime and semantic/logic errors
Advanced Learning Objectives
After class, you should be able to:
- Systematically debug a program with each type of error
- Combine the building blocks we’ve learned about into larger programs
- Write basic tests to check your code’s functionality
Resources
You should read the following:
- 3.1 Intro to Debugging
- 3.2 Three Kinds of Errors
- 3.3 Syntax Errors
- 3.4 Runtime Errors
- 3.5 Semantic Errors
- 3.6 Know Your Error Messages
- 3.7 Tips for Debugging
- 12.1 Handling Exceptions
Check
Submit the following to Moodle:
- You’ve almost certainly encountered many bugs in the few weeks that you’ve been programming. Reflect and write out what your current process is when a program isn’t doing what you wanted (2-4 sentences at least).
- What is the difference between an exception and an error?