கணினி செயல்முறை நிரகளில் வழுநீக்கம் - ஒரு பயிற்சி நேக்க விளக்கம்
இந்த பாடங்கள் ஆங்கிலத்தில் உள்ள 'Debugging Python Code,' என்ற பயிற்சி பாடங்களின் தமிழாக்கமாகும்.
Debug a series of bugs with a variety of debugging tools
Debugging is a daily activity of any programmer. Frequently, it is assumed that programmers can debug. However, programmers often have to deal with existing code that simply does not work. This tutorial attempts to change that by introducing concepts for debugging and corresponding programming techniques.
In this tutorial, participants will learn strategies for systematically debugging Python programs. We will work through a series of examples, each with a different kind of bug and with increasing difficulty. The training will be interactive, combining one-person and group activities, to improve your debugging skills in an entertaining way.
- Syntax Error against Runtime exceptions
- Get file and directory names right
- Debugging with the scientific method
- Inspection of variables with
- Introspection functions
- Using an interactive debugger
- Basic knowledge of Python 3
- install Python 3
- install IPython
- install ipdb (
pip install ipdb)
- clone/download/unzip this repository
What is in the files?
twenty_questions/- exercise for rehearsing basic debugging techniques
proteins/- debugging exercise for biologists.
slides/- presentation for Jupyter notebook.
solution/- correct version of the program.
If you want to deliver the tutorial yourself, consider the following agenda:
|0'||explain problem: guess an animal!|
|1'||point to download link||participants may need time|
|2'||motivate the training||4MAT-method|
|WHY: the bigger your program grows, the more important debugging becomes|
|WHAT: show tutorial overview|
|HOW: we will fix a program with many bugs|
|WHAT ELSE: book raffle|
|5'||Part I: Basic Debugging Techniques|
||slowly walk through bugs|
|40'||Part II: Interactive debugger|
|walk through the issue of
|70'||part III: log files|
|extend the code by logging|
|90'||part IV: delta debugging|
|run example together|
|120'||Part IV: Code Review|
|participants review the example in
|140'||collect other debugging techniques||Q & A|
|150'||collect feedback and pick book winners|
Compiling the slides
jupyter nbconvert debugging.ipynb --to slides --post serve
(c) Dr. Kristian Rother
The material in this tutorial, unless stated otherwise, is available under the conditions of the Creative Commons Attribution Share-alike License 4.0. See www.creativecommons.org for details.
This tutorial was made possible by help from: Janick Mathys, Veit Schiele, Susanne Eiswirt, Marie Pilz, José Quesada, Chris Armbruster, Thomas Lotze, Magdalena Rother
Not covered by the tutorial
- typical pandas table bugs (missing or extra headers, column types)
- error from inside 3rd party libraries
- invalid NAN values
- fixing Heisenbugs and race condition
- Unicode issues
- catching Exceptions
- automated testing
- bugs with wrong filenames, permissions
The first computer bug: http://www.computerhistory.org/tdih/September/9/
How patches got their name: https://www.bram.us/wordpress/wp-content/uploads/2017/01/patch.jpg