Monday, November 14, 2022

Focus our Search Queries to Google Search the Web to Find Possible Solutions to our Debug Problem

Summary

We should search the Internet for solutions to error messages by enclosing the messages in double quotes, and include relevant details if needed.  Answers coming from the website Stack Overflow are usually very helpful and useful.  If we can't find answers, we can post our problems on Stack Overflow or open an issue with the relevant developers.  

Currently, the Internet is ubiquitous, so we can use web search engines, such as Google, Yahoo, Bing, etc, to find answers and solutions to our questions and problems.  We can directly paste our debug error message enclosed in double quotes directly into the search engine's search box.  We can also include anything related to the problem, such as the name of the problematic library, middleware, class, method, returned error codes, etc, into the search phrase.  

Solutions to problems associated with invoking APIs can also be found by researching how others use the API.  This can be found in available code already on the Internet, such as open source software, or through searching Black Duck Open Hub Code Search: https://www.openhub.net/.  We find the problematic function in the code example, and investigate how the input parameters are obtained and how the output return value is used.  

A useful website that frequently appears in our search results for debugging problems is Stack Overflow from the StackExchange network.  It contains very relevant coding and debugging questions, answers and discussions.  We should read most posts with more votes, if possible, in a discussion thread, including the comments, not just the post with the highest number of votes.  

When we can't find answers in this way, we can also post our problems on Stack Overflow.  When we post our problems, we should follow the problem description requirements as stated at https://maxloo-coding-debugging.blogspot.com/2022/11/use-issue-tracking-system-for-all.html, namely: "Ideally, a short, complete, and compilable or runnable example should be provided in the issue description."  More information can be about this can be found at: http://sscce.org/, http://www.catb.org/%7Eesr/faqs/smart-questions.html.  For some languages, our problems can also be presented live at: https://jsfiddle.net/, https://www.sourcelair.com/.  

If we find that our problem may have arise from an open source library or program, and we have good reasons to believe there's a bug in that code, we can search that code's related issues for solutions, and open an issue on that code's bug tracking system if similar questions could not be found.  It may even be possible to send a polite, careful and considerate email to the developer of that code if no bug tracking system is available, but we must remember that they aren't paid to support us.  


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 ...