Buried point testing method, computer device and computer readable storage medium

Through automated comparison of buried point testing methods, the efficiency and accuracy of buried point testing are improved, the problems of low efficiency and high error rate in the existing technology are solved, and efficient and accurate buried point testing is achieved.

CN111984520BActive Publication Date: 2025-01-10SHANGHAI BILIBILI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201910435871.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-05-23
Publication Date
2025-01-10
Estimated Expiration
2039-05-23

AI Technical Summary

Technical Problem

The existing buried point testing methods are inefficient and have high error rates, so it is necessary to improve the efficiency and accuracy of buried point testing.

Method used

Acquire the network data of the target application through automated means, determine whether it is the data collected by the buried point to be tested, and compare it with the expected data to determine whether the buried point is working normally, avoid manually modifying the response data, and modify the response data using the automatically generated modified data. To trigger the buried point, local web page data is pre-existed to avoid inaccurate test results caused by third-party web page updates or network blockage.

Benefits of technology

It improves the efficiency and accuracy of buried point testing, saves labor and time costs, reduces manual error rates, and ensures the reliability of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111984520B_ABST
    Figure CN111984520B_ABST
Patent Text Reader

Abstract

The present invention discloses a buried point test method, which can improve the buried point test efficiency and buried point test accuracy. The buried point test method includes: obtaining network data transmitted by a target application, and judging whether the network data is data collected by a buried point to be tested, wherein a buried point to be tested is deployed on the target application; when judging that the network data is data collected by the buried point to be tested, obtaining expected data, and comparing the network data with the expected data, wherein the expected data is determined by data collected when the buried point to be tested works normally; and determining whether the buried point to be tested works normally according to the comparison result. The present invention also provides a buried point test system, a computer device, and a computer-readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a buried point testing method, system, computer equipment and computer-readable storage medium. Background Art

[0002] In real-world scenarios, in order to understand user behavior and the functional effects of applications, tracking points are usually set at specific functions of the application. During the use of the application, once the tracking point is triggered, the application will send the corresponding data to the server. By analyzing the data collected by the tracking point (also known as tracking point data), the usage of certain functional modules of the application can be learned, which can be used to further optimize the product or provide data support for operations.

[0003] In order to ensure the normal use of tracking points, testers will test the tracking points. The current existing testing method is: after the tracking point is triggered, the tracking point actively collects the corresponding data, and manually checks whether the tracking point data meets the requirements. However, the tracking point data is usually large, and manual inspection has the defects of low efficiency and high error rate.

[0004] Therefore, providing a buried point testing method, system, computer device and computer-readable storage medium to improve the buried point testing efficiency and accuracy has become a technical problem to be solved in the field. Summary of the invention

[0005] The object of the present invention is to provide a buried point testing method, system, computer device and computer readable storage medium, which can improve the buried point testing efficiency and buried point testing accuracy.

[0006] One aspect of the present invention provides a method for testing a buried point, which includes: obtaining network data transmitted by a target application, and determining whether the network data is data collected by the buried point to be tested, wherein the buried point to be tested is deployed on the target application; when it is determined that the network data is data collected by the buried point to be tested, obtaining expected data, and comparing the network data with the expected data, wherein the expected data is determined by data collected when the buried point to be tested is working normally; and determining whether the buried point to be tested is working normally based on the comparison result.

[0007] Optionally, the above-mentioned judgment whether the above-mentioned network data is the data collected by the above-mentioned buried point to be tested includes: obtaining the test rules of the above-mentioned buried point to be tested; judging whether the above-mentioned network data conforms to the test rules of the above-mentioned buried point to be tested; if so, storing the above-mentioned network data, and forwarding the above-mentioned network data to the server corresponding to the above-mentioned target application; if not, directly forwarding the above-mentioned network data to the server corresponding to the above-mentioned target application.

[0008] Optionally, the above-mentioned acquisition of expected data includes: acquiring data collected when the above-mentioned buried point to be tested is working normally, and acquiring an expected data template, wherein the above-mentioned expected data template includes a first data category that currently needs to be compared; determining data that meets the above-mentioned first data category from the data collected when the above-mentioned buried point to be tested is working normally, and generating the above-mentioned expected data based on the above-mentioned data that meets the above-mentioned first data category and the above-mentioned expected data template.

[0009] Optionally, the above-mentioned comparing the above-mentioned network data with the above-mentioned expected data includes: determining the network data and the expected data belonging to the same data category; and sequentially comparing the network data belonging to the same data category and the data belonging to the same level and at the same position in the expected data.

[0010] Optionally, the above method also includes: receiving response data returned by the server corresponding to the above target application; judging whether the above response data is related to the function of triggering the above buried point to be tested; when judging that the above response data is related to the function of triggering the above buried point to be tested, obtaining modification data for triggering the above buried point to be tested, and modifying the above response data according to the above modification data; forwarding the modified response data to the above target application to trigger the above buried point to be tested.

[0011] Optionally, the above method also includes: obtaining all data used to trigger the above-mentioned buried point to be tested, and obtaining a modified data template, wherein the above-mentioned modified data template includes a second data category that currently needs to be returned to the above-mentioned target application to trigger the above-mentioned buried point to be tested; determining data that meets the above-mentioned second data category from all data used to trigger the above-mentioned buried point to be tested, and generating the above-mentioned modified data based on the data that meets the above-mentioned second data category and the above-mentioned modified data template.

[0012] Optionally, after acquiring the network data transmitted by the target application, the method further includes: determining whether the network data is used to request to open a preset web page; when it is determined that the network data is used to request to open the preset web page, returning the locally stored web page data corresponding to the preset web page to the target application.

[0013] To achieve the above-mentioned purpose, another aspect of the present invention provides a point-of-containment testing system, which includes an automatic testing framework and an agent tool. The agent tool is used to: obtain network data transmitted by the target application, and determine whether the network data is data collected by the point-of-containment to be tested, wherein the point-of-containment to be tested is deployed on the target application; the automatic testing framework is used to: when the agent tool determines that the network data is data collected by the point-of-containment to be tested, obtain expected data, and compare the network data with the expected data, wherein the expected data is determined by the data collected when the point-of-containment to be tested is working normally; and determine whether the point-of-containment to be tested is working normally based on the comparison result.

[0014] To achieve the above-mentioned purpose, another aspect of the present invention provides a computer device, which includes: a memory, a processor, and a computer program stored in the above-mentioned memory and executable on the above-mentioned processor, and the above-mentioned processor implements the steps of the above-mentioned embedded point testing method when executing the above-mentioned computer program.

[0015] To achieve the above-mentioned purpose, another aspect of the present invention provides a computer-readable storage medium on which a computer program is stored. When the above-mentioned computer program is executed by a processor, the steps of the buried point testing method introduced above are implemented.

[0016] The buried point test method, system, computer device and computer-readable storage medium provided by the present invention are different from the manual testing methods in the prior art. Instead, they implement the test of the buried point function to be tested in an automated manner, that is, automatically comparing the data collected by the buried point to be tested with the expected data, thereby improving the buried point test efficiency and the buried point test accuracy. In addition, the present invention can also avoid manual modification of response data, by automatically generating modification data, and automatically using the modification data to modify the response data, and then returning the modified response data to trigger the buried point to be tested, further saving labor costs and time costs, and improving the buried point test efficiency. In addition, the present invention also pre-stores the web page data needed for the test process locally to avoid inaccurate test results due to third-party web page updates or network outages, further improving the accuracy of the buried point test. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0018] Figure 1 A flowchart of a buried point testing method according to an embodiment of the present invention is schematically shown;

[0019] Figure 2 A schematic diagram of a buried point test solution according to an embodiment of the present invention is schematically shown;

[0020] Figure 3 A block diagram of a buried point test system according to an embodiment of the present invention is schematically shown;

[0021] Figure 4 A block diagram of a computer device suitable for implementing a buried point testing method according to an embodiment of the present invention is schematically shown. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0023] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0024] The buried point test method, system, computer device and computer-readable storage medium provided by the present invention are different from the manual testing methods in the prior art. Instead, they implement the test of the buried point function to be tested in an automated manner, that is, automatically comparing the data collected by the buried point to be tested with the expected data, thereby improving the buried point test efficiency and the buried point test accuracy. In addition, the present invention can also avoid manual modification of response data, by automatically generating modification data, and automatically using the modification data to modify the response data, and then returning the modified response data to trigger the buried point to be tested, further saving labor costs and time costs, and improving the buried point test efficiency. In addition, the present invention also pre-stores the web page data needed for the test process locally to avoid inaccurate test results due to third-party web page updates or network outages, further improving the accuracy of the buried point test.

[0025] The buried point testing method provided by the present invention is described below with reference to the accompanying drawings.

[0026] Figure 1A flow chart of a buried point testing method according to an embodiment of the present invention is schematically shown.

[0027] like Figure 1 As shown, the buried point testing method may include steps S101 to S103, wherein:

[0028] Step S101, obtaining network data transmitted by the target application, and determining whether the network data is data collected by the buried point to be tested, wherein the buried point to be tested is deployed on the target application.

[0029] In the application scenario of the present disclosure, the embedded point test method can be run on a test server, the target application can be installed on a test client (such as a mobile phone), and the test server and the test client are in the same network. Test tools (such as Appium), automated test frameworks (such as WebDriverIO) and proxy tools (such as AnyProxy) can be installed on the test server. The automated test framework can perform preset operations on the target application installed on the test client through the test tool. After the target application responds to the preset operation, it transmits data (i.e., network data) through the network. In this embodiment, the target application will not interact directly with its corresponding server, but forward it through the proxy tool, that is, the proxy tool intercepts the network data transmitted by the target application and forwards the network data to the server corresponding to the target application.

[0030] In this embodiment, one or more buried points to be tested may be deployed on the target application, and for any buried point to be tested, the function of the buried point to be tested may be tested through steps S101 to S103. In addition, since this solution tests the function of the buried point to be tested, after intercepting the network data transmitted by the target application, it is also necessary to detect whether the network data is the data collected by the buried point to be tested.

[0031] Optionally, determining whether the network data is data collected by the buried point to be tested may include: obtaining the test rules of the buried point to be tested; determining whether the network data complies with the test rules of the buried point to be tested; if so, storing the network data and forwarding the network data to a server corresponding to the target application; if not, directly forwarding the network data to the server corresponding to the target application.

[0032] It should be noted that before executing this embodiment, the staff has written the test case in advance, and the test case includes the test rules of the buried point to be tested. When starting the test, the test rules of the buried point to be tested in the test case can be written into the rule file, and the rule file can be, for example, rules.js. In this embodiment, after intercepting the network data, the test rules of the buried point to be tested can be read from the rule file, and then it is determined whether the network data meets the test rules of the buried point to be tested. If so, it is considered that the network data is the data collected by the buried point to be tested after the buried point to be tested is triggered, and the network data is stored in the rule file, so as to determine whether the buried point to be tested is working normally according to the network data later. For example, the buried point to be tested is a login buried point, and the test rule of the buried point to be tested is that the event of the data is login. When the event of the network data is login, it indicates that the network data is the data collected by the buried point to be tested, and the network data can be stored in rules.js at this time. If the network data does not meet the test rules of the buried point to be tested, it indicates that the network data is not the data collected by the buried point to be tested. At this time, there is no need to compare the network data, and there is no need to store the network data, but to forward it directly.

[0033] Step S102, when it is determined that the network data is data collected by the buried point to be tested, the expected data is obtained, and the network data is compared with the expected data, wherein the expected data is determined by the data collected when the buried point to be tested works normally.

[0034] In this embodiment, the data collected when the buried point to be tested is working normally belongs to multiple data categories, but when detecting the function of the buried point to be tested, it may not be necessary to compare all the data, and some privacy data may also need to be encrypted. Therefore, the expected data that needs to be compared this time can be determined based on the data collected when the buried point to be tested is working normally, and then the network data can be compared with the expected data. In this embodiment, the Chai assertion library can be used for comparison. Optionally, obtaining the expected data may include: obtaining the data collected when the buried point to be tested is working normally, and obtaining an expected data template, wherein the expected data template includes a first data category that currently needs to be compared; determining data that meets the first data category from the data collected when the buried point to be tested is working normally, and generating the expected data based on the data that meets the first data category and the expected data template.

[0035] It should be noted that the test case may also include data collected when the buried point to be tested is working normally. In this embodiment, the data category to which the data collected when the buried point to be tested is working normally includes a first data category, and the first data category is the data category involved in this comparison, and the first data category in this embodiment is at least one data category. For example, the buried point to be tested is a login buried point, and the first data category may be: login time, user ID, login location, etc. The data category to which the data collected when the buried point to be tested is working normally may include: login time, user ID, login location, login password, etc. Generating expected data based on data that conforms to the first data category and the expected data template may be to determine the data that needs to be encrypted in the data that conforms to the first data category, encrypt it using a preset encryption algorithm, and then add the encrypted data and the data that does not need to be encrypted to the expected data template to form the expected data. For example, the user ID and login location are private data and need to be encrypted, and the login time does not need to be encrypted. The login time, the encrypted user ID, and the encrypted login location can be added to the expected data template to form the expected data. Furthermore, network data can be read from the rule file, and then the data in the network data that needs to be encrypted can be determined, and then encrypted using the same preset encryption algorithm, and then the encrypted data and the data that does not need to be encrypted can be used as the final network data for comparison with the expected data.

[0036] Optionally, comparing the network data with the expected data may include: determining the network data and the expected data that belong to the same data category; and sequentially comparing the network data and the expected data that belong to the same data category and are at the same level and at the same position at the level.

[0037] For example, the first data category includes login time and user ID. The login time included in the network data is: 11:10:05, and the user ID is: 124; the login time included in the expected data is: 11:10:01, and the encrypted user ID is 466332. For login time, the levels are sorted from large to small: "hour", "minute", and "second". When comparing, you can first compare whether the first digit of "time" in the network data is greater than or equal to the first digit of "time" in the expected data, and then compare whether the second digit of "time" in the network data is greater than or equal to the second digit of "time" in the expected data, and so on. For user ID, you can first use the same preset encryption algorithm to encrypt the user ID included in the network data, and then compare whether the encrypted user ID of the network data is consistent with the encrypted user ID in the expected data.

[0038] Step S104, determining whether the buried point to be tested is working normally according to the comparison result.

[0039] When the network data meets the expected data, it is determined that the buried point to be tested is working normally; when the network data does not meet the expected data, it is determined that the buried point to be tested is not working normally. For example, the first data category includes login time and user ID. When the login time in the network data is greater than or equal to the login time in the expected data, and the encrypted user ID in the network data is consistent with the encrypted user ID in the expected data, it is considered that the buried point to be tested is working normally.

[0040] In this embodiment, some of the buried points to be tested are triggered not by performing preset operations on the target application, such as clicking a login button, but by displaying specific data on the page of the target application. For example, when an advertisement appears at a specific position on the homepage of the target application, the corresponding advertisement buried point can be triggered. Therefore, when the buried point to be tested in this scheme is a buried point of the above category, it is usually necessary to change the response data returned to the target application by the server corresponding to the target application in order to trigger the buried point to be tested. Among them, the response data can be, for example, the data displayed on the homepage mentioned above. After changing the response data, the response data can contain data for triggering the buried point to be tested. For example, the buried point testing method can also include: receiving response data returned by the server corresponding to the target application; determining whether the response data is related to the function of triggering the buried point to be tested; when determining that the response data is related to the function of triggering the buried point to be tested, obtaining modification data for triggering the buried point to be tested, and modifying the response data according to the modification data; forwarding the modified response data to the target application to trigger the buried point to be tested.

[0041] Specifically, the rule file may include modification data and preset response rules, wherein the preset response rules may be written directly into the rule file from the test case at the beginning of the test. After receiving the response data (also known as mock data) returned by the server, the preset response rules may be obtained from the rule file. When the response data satisfies the preset response rules, it indicates that the response data is related to the function of triggering the buried point to be tested. The corresponding modification data may be further read from the rule file, and then the modification data may replace the data at the corresponding position in the response data, and then the modified response data may be returned to the target application to trigger the buried point to be tested. For example, the home page of the target application needs to display 10 videos, and the buried point to be tested may be triggered when the second video is an advertisement. After the target application sends the home page loading instruction, the proxy tool on the test server may forward the home page loading instruction to the server corresponding to the target application, and receive the response data returned by the server corresponding to the target application. Then the proxy tool may obtain the modification data from the rule file, and the modification data at this time is an advertisement, and then the modification data may replace the data at the second video position in the response data, and then the modified response data may be given to the target application.

[0042] Optionally, the buried point testing method may also include: obtaining all data used to trigger the buried point to be tested; obtaining a modified data template, wherein the modified data template includes a second data category that currently needs to be returned to the target application to trigger the buried point to be tested; determining data that meets the second data category from all data used to trigger the buried point to be tested, and forming modified data based on the data that meets the second data category and the modified data template.

[0043] In this embodiment, the test case also includes all the data used to trigger the above-mentioned buried points to be tested. These data may be arranged in a disorderly manner in the test case, or there may be a lot of repeated and useless data, but these data include modified data. Before modifying the response data, this implementation can first obtain all the data used to trigger the above-mentioned buried points to be tested from the test case, and then determine the data that meets the second data category in the modified data template from all the data used to trigger the buried points to be tested, where the second data category can be a data category, for example, the second data category can include: advertisement identifier, advertisement content, advertisement location, etc. Select data that meets the second data category from all the data used to trigger the above-mentioned buried points to be tested, and then add these data to the modified data template according to the data category to generate modified data, and further write the generated modified data into the rule file.

[0044] Optionally, in the process of testing the buried point to be tested, it may be necessary to open a third-party web page, that is, it is necessary to request the web page data of the third party. However, since the web page data of the third party may be updated frequently, or the web page data of the third party cannot be requested due to network failure, etc., the test result of this test may be inaccurate. Therefore, the present embodiment may also store the web page data required for the test process in the test server. For example, after obtaining the network data transmitted by the target application, the buried point test method may also include: determining whether the network data is used to request to open a preset web page; when it is determined that the network data is used to request to open a preset web page, the web page data corresponding to the preset web page stored locally is returned to the target application. Among them, multiple groups of web page data can be stored on the test server, and each group of web page data can have a web page tag, which is used to characterize that the web page data uniquely corresponds to a preset web page. After obtaining the network request transmitted by the target application, if the web page tag contained in the network request is consistent with the pre-stored web page tag, the web page data uniquely corresponding to the web page tag stored locally can be returned to the target application to improve the accuracy of the buried point test.

[0045] Figure 2 A schematic diagram of a buried point test solution according to an embodiment of the present invention is schematically shown.

[0046] It should be noted that, in order to further realize automated testing, this embodiment can also automatically execute the solution of the present invention based on the Jenkins tool. Among them, Jenkins includes two parts: one part is a controller, which can be installed on a control server; the other part is an executor, which can be installed on a test server. The control server can run continuously throughout the day, and control the test server to start up when the preset time is reached, so that the test server executes the program of the buried point test method of the present invention.

[0047] During testing, you can enter the link of the latest test package in Jenkins on the test server (for example, Android is the link of the apk package, and IOS is the QR code link for scanning and installation), and click the build button. Then Jenkins performs automated operations, which mainly include the following two parts.

[0048] The first part is the environment initialization operation, which includes the following steps: 1. Initialize the test environment, clear node_modules and update dependencies, and then download the latest test script from Git; 2. Remove the old test package on the test client, download and install the new test package according to the filled-in address; 3. Get the IP of the test client, such as a unique identifier; 4. If the test client is an iOS system, you can use Appium (WebDriverAgent) to open "Settings" to modify the agent through UI automation. If the test client is an Android system, you can modify the agent through ADB and then point it to the test client; 5. Start the WebDriverIO test, and through the WebDriverIO hook, start AnyProxy before Appium establishes a session; 6. Use the UI automation script to authorize the permissions applied for by the installed test package.

[0049] The second part is the test operation, such as Figure 2As shown, start WebDriverIO to start the test, and start AnyProxy through the hook of WebDriverIO before Appium establishes a session. Then WebDriverIO can write the test rules and preset response rules of the embedded points to be tested in the test case into the rule file, and add all the data used to trigger the embedded points to be tested in the test case to the modified data template to form the modified data, and write the modified data into the rule file. WebDriverIO can also interact with Appium through JsonWireProtocol, so that Appium performs preset operations on the target application on the mobile phone according to the instructions of WebDriverIO. The target application responds to the preset operation and transmits network data through the network. AnyProxy intercepts the network data and reads the test rules of the embedded points to be tested from the rule file. Then AnyProxy determines whether the network data meets the test rules of the embedded points to be tested. If so, the network data is stored in the rule file. WebDriverIO will read the data that needs to be collected when the test point is working normally from the test case. According to the method described in the above embodiment, the expected data is formed by the data that needs to be collected when the test point is working normally and the expected data template, and then the network data is read from the rule file, and then the network data is compared with the expected data. When the network data meets the expected data, it can be considered that the test point is working normally. When the network data does not meet the expected data, it can be considered that the test point is not working normally. After the test is completed, the hook of WebDriverIO can also be used to stop AnyProxy after Appium closes the session, thereby restoring the state where the test client does not use the proxy.

[0050] In the test execution process, manual operation requires at least 8 steps, while the present invention only requires 1 step. The present invention can quickly and accurately verify whether the function of the buried point to be tested is effective; and automatically verify network data and expected data, not only does not need to use various verification tools, but also the test results obtained are highly readable. At the same time, according to the test results of the present invention, the functional difference between the current version and the historical version of the target application can be quickly determined, and the buried point positions arranged on the Android side and the IOS side can be quickly and effectively found to be consistent, reducing the inconsistency caused by the testing of the double-end target application by different people, and enhancing the robustness of the code. In addition, automated testing also has the following advantages: by using proxy tools, proxy rules can be started, closed, configured and written in a programmable manner; automated test cases are similar to traditional forms, test data preparation, test result assertions in test case files; advertising reporting data can be persisted; low external dependence, such as landing pages, evoked App, interfaces that are not concerned by advertising; convenient manual debugging; each test case is independent of each other and has no data dependence; when testing subsequent versions, the test cases passed by the previous version are used as documents for reference.

[0051] Figure 3 A block diagram of a buried point testing system according to an embodiment of the present invention is schematically shown.

[0052] like Figure 3 As shown, the tracking point testing system 300 may include an agent tool 301 and an automatic testing framework 302, wherein:

[0053] The proxy tool 301 is used to: obtain network data transmitted by the target application, and determine whether the network data is data collected by the buried point to be tested, wherein the buried point to be tested is deployed on the target application;

[0054] The automatic testing framework 302 is used to: when the agent tool 301 determines that the network data is the data collected by the buried point to be tested, obtain the expected data and compare the network data with the expected data, wherein the expected data is determined by the data collected when the buried point to be tested is working normally; determine whether the buried point to be tested is working normally based on the comparison result.

[0055] Optionally, when the proxy tool determines whether the network data is data collected by the buried point to be tested, it is also used to: obtain the test rules of the buried point to be tested; determine whether the network data complies with the test rules of the buried point to be tested; if so, store the network data and forward the network data to the server corresponding to the target application; if not, directly forward the network data to the server corresponding to the target application.

[0056] Optionally, when obtaining expected data, the automated testing framework is also used to: obtain data collected when the buried point to be tested is working normally, and obtain an expected data template, wherein the expected data template includes a first data category that currently needs to be compared; determine data that conforms to the first data category from the data collected when the buried point to be tested is working normally, and generate expected data based on the data that conforms to the first data category and the expected data template.

[0057] Optionally, when comparing network data with expected data, the automated testing framework is also used to: determine network data and expected data that belong to the same data category; and sequentially compare the network data and expected data that belong to the same data category and are at the same level and at the same position at the level.

[0058] Optionally, the proxy tool is also used to: receive response data returned by the server corresponding to the target application; determine whether the response data is related to the function of triggering the buried point to be tested; when it is determined that the response data is related to the function of triggering the buried point to be tested, obtain modification data used to trigger the buried point to be tested, and modify the response data according to the modification data; forward the modified response data to the target application to trigger the buried point to be tested.

[0059] Optionally, the automated testing framework is also used to: obtain all data used to trigger the buried point to be tested, and obtain a modified data template, wherein the modified data template includes a second data category that currently needs to be returned to the target application to trigger the buried point to be tested; determine data that meets the second data category from all data used to trigger the buried point to be tested, and generate modified data based on the data that meets the second data category and the modified data template.

[0060] Optionally, the proxy tool is also used to: after obtaining the network data transmitted by the target application, determine whether the network data is used to request to open a preset web page; when it is determined that the network data is used to request to open a preset web page, return the locally stored web page data corresponding to the preset web page to the target application.

[0061] Figure 4 A block diagram of a computer device suitable for implementing a method for embedding a point of interest test according to an embodiment of the present invention is schematically shown. In this embodiment, the computer device 400 may be a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that executes a program. Figure 4 As shown, the computer device 400 of this embodiment includes at least but is not limited to: a memory 401, a processor 402, and a network interface 403 that can be interconnected through a system bus. It should be noted that Figure 4 Only computer device 400 is shown with components 401 - 403 , but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0062] In this embodiment, the memory 403 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 401 can be an internal storage unit of the computer device 400, such as a hard disk or memory of the computer device 400. In other embodiments, the memory 401 can also be an external storage device of the computer device 400, such as a plug-in hard disk equipped on the computer device 400, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 401 can also include both the internal storage unit of the computer device 400 and its external storage device. In this embodiment, the memory 401 is generally used to store the operating system and various application software installed on the computer device 400, such as the program code of the buried point test method, etc. In addition, the memory 401 can also be used to temporarily store various types of data that have been output or are to be output.

[0063] In some embodiments, the processor 402 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 402 is generally used to control the overall operation of the computer device 400. For example, control and processing related to data interaction or communication with the computer device 400 are performed. In this embodiment, the processor 402 is used to run the program code of the steps of the buried point test method stored in the memory 401.

[0064] In this embodiment, the embedded point testing method stored in the memory 401 can also be divided into one or more program modules and executed by one or more processors (processor 402 in this embodiment) to complete the present invention.

[0065] The network interface 403 may include a wireless network interface or a wired network interface, and the network interface 403 is generally used to establish a communication link between the computer device 400 and other computer devices. For example, the network interface 403 is used to connect the computer device 400 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 400 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0066] This embodiment also provides a computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, App application store, etc., on which a computer program is stored, and the computer program implements the steps of the buried point test method when executed by the processor.

[0067] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.

[0068] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0069] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A buried point testing method, characterized in that: The method comprises: Acquire network data transmitted by a target application, and determine whether the network data is data collected by a buried point to be tested, wherein the buried point to be tested is deployed on the target application; When it is determined that the network data is the data collected by the buried point to be tested, expected data is obtained, and the network data is compared with the expected data, wherein the expected data is determined by the data collected when the buried point to be tested works normally; Determine whether the buried point to be tested is working normally according to the comparison result; The method further comprises: Receiving response data returned by a server corresponding to the target application; Determine whether the response data is related to the function of triggering the buried point to be tested; When it is determined that the response data is related to the function of triggering the buried point to be tested, obtaining modification data for triggering the buried point to be tested, and modifying the response data according to the modification data; The modified response data is forwarded to the target application to trigger the buried point to be tested.

2. The method according to claim 1, characterized in that The determining whether the network data is data collected by the buried point to be tested includes: Obtain the test rules for the buried point to be tested; Determine whether the network data complies with the test rules of the buried point to be tested; if so, store the network data and forward the network data to the server corresponding to the target application; if not, directly forward the network data to the server corresponding to the target application.

3. The method according to claim 1, characterized in that The obtaining of expected data includes: Acquire data collected when the buried point to be tested works normally, and acquire an expected data template, wherein the expected data template includes a first data category that currently needs to be compared; Data that meets the first data category is determined from the data collected when the buried point to be tested is working normally, and the expected data is generated based on the data that meets the first data category and the expected data template.

4. The method according to claim 3, characterized in that The comparing the network data with the expected data includes: Identify network data and expected data that belong to the same data category; The network data belonging to the same data category are compared with the data belonging to the same level and at the same position in the expected data in turn.

5. The method according to claim 1, characterized in that The method further comprises: Acquire all data used to trigger the buried point to be tested, and acquire a modified data template, wherein the modified data template includes a second data category that currently needs to be returned to the target application to trigger the buried point to be tested; Determine data that conforms to the second data category from all data used to trigger the buried point to be tested, and generate the modified data based on the data that conforms to the second data category and the modified data template.

6. The method according to claim 1, characterized in that After acquiring the network data transmitted by the target application, the method further includes: Determining whether the network data is used to request to open a preset web page; When it is determined that the network data is used to request to open the preset web page, the locally stored web page data corresponding to the preset web page is returned to the target application.

7. A buried point test system, characterized in that: The system includes agent tools and an automated testing framework: The proxy tool is used to: obtain network data transmitted by the target application, and determine whether the network data is data collected by the buried point to be tested, wherein the buried point to be tested is deployed on the target application; The automatic test framework is used to: when the agent tool determines that the network data is the data collected by the buried point to be tested, obtain the expected data, and compare the network data with the expected data, wherein the expected data is determined by the data collected when the buried point to be tested is working normally; determine whether the buried point to be tested is working normally according to the comparison result; The proxy tool is also used to: receive response data returned by the server corresponding to the target application; determine whether the response data is related to the function of triggering the buried point to be tested; when it is determined that the response data is related to the function of triggering the buried point to be tested, obtain modification data for triggering the buried point to be tested, and modify the response data according to the modification data; forward the modified response data to the target application to trigger the buried point to be tested.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Buried-point testing method, as well as data query method and device

    CN104915296A

  • Website function testing method, website function testing system and website server

    CN105471665A

  • Event track data consistency detecting method, device and system

    CN108063691A