Introduction
What is a bug?
Sometimes it’s a real bug:

But most of the time it is computer code that did not produce the output you anticipated.
Debugging Tasks
Identify the bug
Locate the bug
Investigate the bug
Reproduce the bug
Fix the bug
Prevent prevent bug
Not all of these steps will be relevant every time, but some of them will always be relevant, and sometimes you will need all of them.