Chapter 11
Debugging and Testing
IN THIS CHAPTER
Identifying common types of programming errors
Using comments and print statements to debug
Working with breakpoints and watch variables
Running tests
Writing a program isn’t easy. Not only do you have to write a program that solves a big problem, but you must also solve a bunch of little problems along the way. Some of those problems might be mini-steps on the way to solving the big problem (such as how to predict whether a given sports team will win this week) while other problems may simply involve working with the hardware such as correctly printing data.
Writing a program takes time. However, a program is never done until it has been tested. Testing helps ensure the program works correctly and reliably. When testing reveals problems, the programmers must fix them, whether they’re minor (such as displaying the wrong icon on the screen) or major (the program crashes). That’s why testing is a crucial part of any software project.
Common Types of Programming Errors
Ultimately, there are a nearly infinite number of ways a program ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access