Technology Sharing

Bug location strategy

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

Prerequisite--User Environment Level

  • Hosts abnormality: The hosts file is mainly used to speed up the resolution of a domain name or website, so as to achieve fast access, and it can also block websites. Hosts abnormality may cause some web pages to be inaccessible, and they can be loaded, but the web pages cannot be displayed normally;
  • Dirty data in the test environment: If the server reports a 500 error and a null pointer is reported after checking the log, it is likely that the data in the associated table in the database has been manually deleted (dirty data: the data retrieved from the target is expired, wrong, or meaningless);
  • The test environment has been branched;
  • Project configuration switch;
  • Incorrect operation;
  • Whether the network is pingable;
  • Whether the IP and port configuration are correct;

Front-end bug

  • Page layout issues; (css style issues)
  • Interaction issues: buttons cannot be clicked (the front-end buttons do not have corresponding interfaces, resulting in the interfaces not being called), there are no drag events, etc. (js interaction issues)
  • Text display (html text problem)
  • Compatibility issues;

Backend bug

  • Business logic issues: For example, the correct username and password cannot be used to log in, payment is successfully deducted but payment fails, etc.

  • Data problems: Understand the data table structure of the tested function, and check whether the data in the database is correct during the test; for example, if the newly added data is not displayed, or if the registration is successful but the login fails, by querying the database user table, it is found that no successfully registered data has been inserted, etc.

  • Performance issues: For example, pages and forms open slowly, and the form submission status keeps showing "Submission in Progress";

  • Security issues: such as unauthorized access, SQL injection, etc.

Packet capture tool + message analysis

  • The front-end did not send a request in the message, which is a bug in the front-end.
  • The front-end sends a request in the message, but the request parameters are abnormal, indicating a front-end bug.
  • In the message, the front-end sends a request, the request parameters are normal, the back-end response data is normal, but the front-end interface is not displayed normally, which indicates a front-end bug;
  • In the message, the front-end sends a request with normal request parameters, but the back-end does not respond with data, indicating a back-end bug.
  • In the message, the front-end sends a request with normal request parameters, but the back-end responds with incorrect data, indicating a back-end bug.

Analyze logs

  • When reproducing the bug, capture the backend server logs and analyze the backend logs;
  • If no log is generated for the operation, this is a front-end bug because there is no interaction with the back-end;
  • If the log contains relevant information, you can further analyze whether the log contains error information. If there is error information, it is a backend bug.
  • grep precise search (service/log file name/keyword/such as order number)
  • tail dynamic search