Monday, November 21, 2022

Locating the source of a problem

To locate the source of a problem, we can either begin where the problem occurs and work towards the source of the bug, or start at the top level of the application and drill down until the buggy source is located.  

When a program crashes and if the error messages indicate a specific problem routine, we can use this troubleshooting method:
This will likely lead to the source of the bug.  This is a process of identifying the bug by following the calls in a sequence of routines to its origins in order to identify the bug.  When a program freezes, this method can also be used by starting from a memory dump.  Memory dumps are possible if there are tools or commands available for this.  Otherwise, we'll have to create a dump of log messages from the entries and exits of our code routines and examine them.  One source of the problem is the libraries we use for our code.  

If the problem is an emergent property which cannot be readily associated with any part of the code, then we'll have to begin at the top level of the code, break down the code into parts, and examine the contribution of each part to the problem individually.  These problems relate to the performance, security and reliability of our code.  


Reference:

Diomidis Spinellis, "Effective Debugging: 66 Specific Ways to Debug Software and Systems"

No comments:

Post a Comment

Mirdin Coding Tips

Tradeoffs for Pre and Post Conditions for Code Blocks A weaker precondition or less preconditions for a code block will be more general and ...