Intro to Debugging Flashcards
Debugging
The process of identifying and removing errors from computer hardware or software
The model of “What, Why, How” to debug
When we encounter a bug, debugging should be our way of asking and answering the following questions, typically in this order:
1) What is happening? What did we expect to happen? What actually happened?
2) Why is this happening? What line(s) of code are making this happen?
3) How do we fix it? What do we need to change, add, or delete about our existing code?
* *Come up with a theory of what is happening and why it’s happening
* *Test your theory by trying one approach to fix it!
* *Document what you tried and what the results were… Probably on a piece of paper or a separate file.
* *Repeat this process until the bug is fixed!
If we approach debugging as a way to ask and answer questions, it’ll make it smoother for us to work through, and easier for others to help us.