Debugging
-
Upload
umang-shukla -
Category
Technology
-
view
339 -
download
0
Transcript of Debugging
Debugging
Debugging
Debugging is the process of finding and resolving bugs or defects that prevent correct operation of computer software or a system.
DEBUGGING ?
If you don’t debug
you are a code genius
OR
you don’t know how!
Agenda
Python
DOM
Javascript
Network
Python Debugging
PyCharm
Python debugger (ipdb or pdb)
Install ipython and ipdb for all projects
import ipdb; ipdb.set_trace()
print locals(), args
continue, step over
Logging (smarter prints)
1. import logging2. 3. # create logger with 'error_log'4. logger = logging.getLogger('error_log')5. logger.setLevel(logging.DEBUG)6. 7. # logging things in logger8. logger.info('this is info')9. logger.errors('this is error')
10. logger.warning('this is warning')11. logger.debug('this is debug')
DOM Debugging
Let’s review some concepts
DOM Debugging
Rearrange/add/delete nodes
Edit attributes
Edit css
See the event listeners
Javascript Debugging
Javascript Debugging
Javascript Debugging
Set debug points
Use console
Set watch expressions
Continue, Step over, Step Into, Step Out
See stack trace to find calling function
NetworkDebugging
Network Debugging
Watch requests
Read headers and response
Learn cURL and postman!
Other resources
● https://developer.chrome.com/devtools/docs/remote-debugging
● https://developer.chrome.com/devtools/docs/tips-and-tricks
● http://getfirebug.com/firebuglite
● http://stackoverflow.com/questions/5967241/how-to-execute-multi-line-statements-within-pythons-own-debugger-pdb
● http://frid.github.io/blog/2014/06/05/python-ipdb-cheatsheet/
● http://www.slideshare.net/noelled/debugging-python-pdb-ndaley-50574986
Any Questions
Credits
Special thanks to all the people who made and released these awesome resources for free:
■ Presentation template by SlidesCarnival■ Photographs by Unsplash