Finding Errors: Debugging

Errors in software code are sometimes referred to as bugs. Debugging is the process of finding and fixing bugs in code. This process can be performed at varying degrees of sophistication. The most efficient way is to use a tool called debugger. Having unittests in place is a good way to identify errors early, refer section Using unittest of Chapter 13, Testing. When it is not obvious where or what the problem is, a debugger is very useful.

Bugs

There are typically two kinds of bugs:

  • An exception is raised and not caught.
  • The code does not function properly.

The first case is usually easier to fix. The second can be more difficult as the problem can be a faulty idea or solution, a faulty implementation, or a combination of ...

Get Scientific Computing with Python 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.