Debugging

Once we get our projects to a place where we can run them, we will begin testing the software, looking for errors, and attempting to find solutions to correct these errors. Debugging is the name given to the process of finding and getting rid of the problems in our software. This process can be accomplished in numerous ways, from simple console warnings to using far more elaborate software. We will go over all the options we have with the Visual Studio and Unity setup.

The primary categories of errors that occur can be broken down into the following:

  • Syntax errors: These types of bugs do not affect us in the testing phase because if they occur, we cannot test; the application will not run at all.
  • Logic errors: Infinite loops, index out of range errors.
  • Arithmetic errors: In my mind, this is a subcategory of logic errors. When the math is wrong, the application will behave erratically and it can be painful to track down the problem.
  • Resource or Runtime errors: These are access violations or errors that occur during the execution of a program. 
  • Null pointers: An error that occurs when we are trying to access the members/methods of a null object.
  • Performance errors: Attempting to use more processing power than the device is capable of producing.

One of the benefits of using C# as our language is that it is a very smart language. C# falls into the Common Language Runtime or CLR standard. Just-in-time compilation is compilation done during program execution or runtime. CLR is a standard that brings with it many benefits, including memory management, garbage collection, smart exception handling and thread management. Due to the benefits of CLR, the preceding error list is not a lot more elaborate.

This section will cover many different tools and, as such, this will not be in the tutorial form as the rest of this book has been, well mostly. This is more about informing you of the options and a few lessons I have learned along the way.

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

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