Download presentation
Presentation is loading. Please wait.
1
Chapter 11: Debugging
2
Definition Debugging is the process of identifying and removing errors from programs.
3
“It’s not the computer. Maybe It’s you. “
4
Overview Purpose of chapter is to examine basic strategies for fixing bugs. The term debugging attributed to Admiral Grace Hopper in the 1940s. While working on a Mark II Computer at Harvard, her associates discovered a moth stuck in the computer and thereby impeding operation, whereupon she remarked that they were "debugging" the system. Typical types of bugs include variables not initialized, typos, non-existent array elements, etc.
5
Tip 1 Take a break This is a serious strategy, and scientifically based.
6
Get someone else involved
Tip 2 Get someone else involved Not just for a new set of eyes, but you should explain the program to them step by step. Programming buddies. What do you look for in a coding buddy? Should you aim to be the one with the least knowledge?
7
Simplify Tip 3 What are some of the ways that you simplify?
Incremental development to break up in manageable pieces. Comment out . Note that having OOP can help because it allows easier isolation. New sketch with just one of the classes. You’ll have less bells and whistles to work with
8
Tip 4 println() You have been using this from the start. The text appears in the console. It prints while the program is executing. Remember that you can concatenate or join text and variables. printArray() is also good because it will nicely format array contents and show the values along with index.
9
Tip 5 Debugging tool A new feature in version 3. It can be turned on from toolbar or from menu. You can pause program by specifying a break point. Then you can continue or go step by step.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.