Methods of Debugging
-
Upload
ravikanth1988 -
Category
Technology
-
view
88 -
download
0
Transcript of Methods of Debugging
![Page 1: Methods of Debugging](https://reader035.fdocuments.in/reader035/viewer/2022062822/587f633d1a28ab9b398b5589/html5/thumbnails/1.jpg)
Methods of DebuggingRavikanth Andhavarapu
![Page 2: Methods of Debugging](https://reader035.fdocuments.in/reader035/viewer/2022062822/587f633d1a28ab9b398b5589/html5/thumbnails/2.jpg)
Mindset for Debugging
As soon as you encounter a bug you should focus on these two questions
1. Where is the source location of the bug?
2. What is happening?
![Page 3: Methods of Debugging](https://reader035.fdocuments.in/reader035/viewer/2022062822/587f633d1a28ab9b398b5589/html5/thumbnails/3.jpg)
Source Location of the Bug
1. Read the error message. This is the first clue for finding where the exact bug is. This may not be enough.
2. Start removing pieces of code and see if the bug disappears. Obviously some functionality also disappears as you do this.
This should be enough for you to figure out the exact source location of the bug.
![Page 4: Methods of Debugging](https://reader035.fdocuments.in/reader035/viewer/2022062822/587f633d1a28ab9b398b5589/html5/thumbnails/4.jpg)
Advantage of finding the source location first
1. Reduces your search area
2. Sometimes this may be so precise that you don't have to do go to the next step(figure out what is happening) to fix it.
![Page 5: Methods of Debugging](https://reader035.fdocuments.in/reader035/viewer/2022062822/587f633d1a28ab9b398b5589/html5/thumbnails/5.jpg)
Find out what is happening
You should know the methods of inspecting code for this.
Chrome developer tools for front end
Print out variables in the middle of the code
Set up debugger to interact with the code
Use REPL if it is available.