Quality is delighting customers
Debugging is a process finding the errors in a code and fix them. Debugging process generally begins when a new code is written and continues till it is integrated with existing code.
As per the best practices from software testing services, below are the steps which we need to follow for debugging.
1. Try to reproduce defect before changing code at least once
2. Write a testcase due to which error occured
2. Run through each line of code to reproduce error
3. After identifying the error change the code
4. Once the code is fixed ,re-run the testcase written above and make sure it passes
5. Also check if there are any other references which is caused by this same issue.Change code on all references.
There are various ways to do this,. But first of all you should know what debugging is?
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. To prevent incorrect operation of a software or system, debugging is used to find and resolve bugs or defects.
You can start a debugging session as follows:
Set some breakpoints in the app code.
In the toolbar, click Debug to display the Select Deployment Target window.
If no devices appear in the Select Deployment Target window after you click Debug, then you need to either connect a device via USB or click Create new virtual device to use the Android Emulator.
If, instead of the Select Deployment Target window, you see a dialog asking if you want to "switch from Run to Debug," that means your app is already running on the device and it will restart in order to begin debugging.
If you'd rather keep the same instance of the app running, click Cancel Debug and instead attach the debugger to a running app.
Select a deployment target and click OK.
Android Studio builds an APK, signs it with a debug key, installs it on your selected device, and runs it. If you add C and C++ code to your project, Android Studio also runs the LLDB debugger in the Debug window to debug your native code.