Debugging is the process of detecting and removing of existing and potential errors (also called as ‘bugs’) in a software code that can cause it to behave unexpectedly or crash. Importance of Debugging in programming is increasing as the complexity in code increases.
How to do Debugging??
To debug a program, user has to start with a problem, isolate the source code of the problem, and then fix it. A user of a program must know how to fix the problem as knowledge about problem analysis is expected. When the bug is fixed, then the software is ready to use. Debugging tools (called debuggers) are used to identify coding errors at various development stages.
Steps involved in debugging are:
- Problem identification and report preparation.
- Assigning the report to software engineer to the defect to verify that it is genuine.
- Defect Analysis using modeling, documentations, finding and testing candidate flaws, etc.
- Defect Resolution by making required changes to the system.
- Validation of corrections.
The Views debug tool
Views plugin has a built-in debug mode, which helps you analyze the output of any View or Content Template in details.
To enable the Views debug tool, go to Toolset->Settings, click on the Front-end Content tab and look for the section called Debug mode.
The debug tool is disabled by default. Once enabled, you can choose between two modes:
- Compact debug mode: displays basic information, without information about filters and hooks executed by Views.
- Full debug mode: shows the same basic information plus all the details about the filters being applied during a Views request and the results of every query performed by Views.
If you are debugging something that does not work, we recommend that you first enable the debug mode while programming and try it on a View that works as you intend. This will help you understand the debug output better. You can then proceed to the View that you want to debug, and do that much easier.