General troubleshooting

We learned the basics of the debugging process for each platform, but we never covered any techniques for debugging or troubleshooting. Just like profiling, there is a basic guide or list that you can follow to make you more efficient when troubleshooting. Use the following list of steps to help you troubleshoot your next issue:

  1. Console: The first place to look is for any errors that are being reported to the console. All our platforms provide a console, and you should be familiar with accessing it on your platform of choice. Does the error make sense? Are you able to pinpoint the section of code or item causing the issue?
  2. Google: If you see an obscure console message and are not quite sure what it does, then Google it. You don't want to Google the entire message, but just extract five or six key words in the phrase and use those. You may also want to add words to cover your platform; for instance, Java, Android, or, Unity C#.
  3. Logging: Instrument your code by injecting logging statements in key areas of your code. If your code is not reporting errors to the console, put in logging to let you know where the code flows. This can help you determine if and when key sections of code are being run.
  4. Replicate: Isolate the problem and try to replicate it in a new project or test app. If you are unable to isolate the code, you have a bigger issue, and you should probably refactor. Generally, unless the issue requires a workaround or is something more serious, replicating the project can solidify your understanding of the issues. Replicating an issue cannot only help you solve the problem, but it can also help you refactor and clean your code.
  5. Post it: If you still don't have a resolution after replicating the problem then look for the appropriate forum and post your issue. Ensure that you provide your replicated sample when you post your issue. It will often be the first thing someone will likely ask you for, especially if the problem is complex. Also, showing that you spent time replicating the problem will make your post more credible and avoid the wasted time of responding to simple questions.
  6. Work around it: If you can't resolve your issue, then work around it. Sometimes, resolving your issue is not possible or just too expensive and time consuming. Then, you will need to come up with another way to either build the feature or alter it. This will often require going back to the designer or visionary, if your project has one, and consulting them for some possible workarounds.

The preceding list is again a good place to start when you encounter an issue. If you have been developing software for some time, you will likely have your own process, but the preceding list is probably not much different from yours.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.212.124