Debugging Skills as a Tester
A tester’s job does not end after discovering and just reporting a problem. Actual fun begins only after we know that there is something unusual about the product while using in a certain way, and we need to investigate the same to get more information. Here are my tips for debugging any issue and finding evidence:
- First step will be always reproducing the issue consistently by applying the same steps and input.
- Identify the first level source of the issue – for example in a web application find out if the issue is due to frontend code or backend code or database issue or 3rd party problem or due to environment related.
- If we are sure issue is coming from the frontend, chrome dev tool can be handy for debugging. We can add break points in any files in sources panel, look for console messages. We can also use command menu (ctrl/Cmd + Shift + P) to select variety of functions to perform on the frontend for debugging purpose.
- For backend API issue, we need to depend on the request and response data and application level logs. It’s a good practice to have a look in the response status code, data to identify if issue is due to auth, bad requests or server side errors. Together with this looking into the actual code level logs in monitoring applications like Splunk or Datadog can give more insight about the issue. Its also worth looking into session parameters, headers, cookies to get additional information.
- Issues can be also due to hardware/software/browser version/configurations. So it’s also important to pay attention to the environment used for reproducing and debugging the issue. Issues can come due to infra layer like not receiving 3rd part response due to missing IP whitelisting.
- Sometime getting another prospective about the issue also helps in debugging. Instead of debugging alone, paring with another tester or developer can bring more insight into the entire process.
- We may not be lucky enough in reproducing intermittent issue by following the exact steps. In case of web application testing, we can use tools to record the steps we are performing so that in case of any issue we can playback and find out the actual steps and discard the remaining recording. It’s also a good idea to have a look into the application logs for occurrence of errors/alerts/exceptions during the time period we found the issue for the first time.
- In case of mobile app, cleaning the log files before testing and pulling the copy of it after testing completes can help for debugging purpose.
If you are automation test engineer and want to improve debugging skills
- Get really good at the IDE that you are using like Eclipse or IntelliJ. Know all the useful tricks and tips of your IDE
- Get good at logging.
- Use print statements effectively in your code.
- Learn to read and query logs in all the platforms that is been used in your project. Each platform has its own query language so it is recommended to know about the query language used in your application. For e.g. Kibana, Grafana, Elastic search and Sumologic all have different query language to read and extract logs.
- Do cross-peer debugging. Debug other people’s code frequently
- Common yet very useful tips like – use online resources effectively like Google, Stack overflow