CN113360376A - Buried point testing method and device - Google Patents

Buried point testing method and device Download PDF

Info

Publication number
CN113360376A
CN113360376A CN202110609683.0A CN202110609683A CN113360376A CN 113360376 A CN113360376 A CN 113360376A CN 202110609683 A CN202110609683 A CN 202110609683A CN 113360376 A CN113360376 A CN 113360376A
Authority
CN
China
Prior art keywords
test
buried point
data
point information
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110609683.0A
Other languages
Chinese (zh)
Inventor
刘彩君
林伟腾
吴丹
李宏兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110609683.0A priority Critical patent/CN113360376A/en
Publication of CN113360376A publication Critical patent/CN113360376A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The invention discloses a buried point testing method and device, and relates to the technical field of computers. One embodiment of the method comprises: generating a test case of the embedded point information according to a test requirement document of at least one embedded point information; the test case comprises test expected data of the buried point information; when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case. The implementation mode can realize efficient and accurate automatic embedded point testing.

Description

Buried point testing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a buried point testing method and device.
Background
The buried point is a term of a data collection scene, and refers to a related technology for capturing, processing and sending specific user behaviors or events and an implementation process thereof, the buried point plays a crucial role in analyzing the user behaviors and observing the product state, and whether the buried point data can be reported correctly or not directly influences the data accuracy and the reliability of subsequent analysis, so that the buried point data testing (namely, buried point testing) has important significance.
Currently, a buried point test mainly depends on a developer or a tester to manually grab buried point report requests one by one through a packet grabbing tool, analyze request parameters of the requests, and compare the request parameters with a required document one by one to judge whether buried point data is reported correctly.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems: firstly, the manual testing mode has large repeated workload, high error rate and low efficiency, so that the testing result cannot be obtained in real time after the buried point data is reported, the buried point data is often found to be abnormal after the product is on line for several days, and the best opportunity for analyzing the user data is likely to be missed at the moment, so that certain service loss is caused. Secondly, the reported buried point data generally has a large number of fields, and developers or testers are more labourious to find out concerned target fields.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for testing a buried point, which can implement efficient and accurate automatic buried point testing.
To achieve the above object, according to one aspect of the present invention, a buried site testing method is provided.
The embedded point testing method comprises the following steps: generating a test case of the embedded point information according to a test requirement document of at least one embedded point information; the test case comprises test expected data of the buried point information; when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case.
Optionally, the test expectation data of any buried point information includes: the mark and the expected reporting type of the embedded point information; and generating a test case of the embedded point information according to the test requirement document of the at least one embedded point information, wherein the test case comprises: acquiring a test requirement document of the buried point information, and identifying preset identification keywords and reporting type keywords from the test requirement document; and determining the mark of the buried point information by using the identified mark key word, determining the expected reporting type of the buried point information by using the identified reporting type key word, and generating a test case of the buried point information by using the determined mark of the buried point information and the expected reporting type.
Optionally, the intercepting a buried point reporting request corresponding to the test case includes: intercepting a network request sent by a user terminal; and determining the network request pointing to the URL corresponding to the test case as the buried point reporting request.
Optionally, the comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case includes: determining a buried point information identifier in the real buried point data by using a preset identifier indication parameter; if the test case has the embedded point information with the same identification as the embedded point information identification, determining the real embedded point data as target data, and determining the embedded point information as the associated embedded point of the target data; determining a real reporting type in the target data by using a preset reporting type indication parameter; and when the real reporting type is different from the expected reporting type of the associated buried point, marking the test result of the associated buried point as failing.
Optionally, the test expectation data of any buried point information further includes: the name of the field to be displayed and a judging condition aiming at the field to be displayed; the comparing the obtained real buried point data with the test expected data in the test case to obtain the test result corresponding to the test case further comprises: acquiring field data to be displayed in the target data according to the field name to be displayed; when the field data to be displayed accord with the judgment condition aiming at the field to be displayed, marking the test result of the associated buried point as passing; and when the field data to be displayed do not accord with the judgment condition, marking the test result of the associated buried point as failed.
Optionally, the method further comprises: after the test result corresponding to the test case is obtained, displaying the test result and the field data to be displayed in the target data; and hiding data corresponding to a preset field name to be hidden in the target data.
Optionally, the method further comprises: and after the real reporting type in the target data is determined by using the preset reporting type indication parameter, counting the reporting times of the real reporting type corresponding to the associated buried point.
Optionally, the method is performed at a test server in communication with a plurality of test clients; the obtaining of the test requirement document of the buried point information includes: receiving a test requirement document sent by the test client; the method further comprises: after the test result corresponding to the test case is obtained, the test result and the field data to be displayed in the target data are sent to the corresponding test client for displaying; and, the test case includes: the test system comprises a sharing case which can be shared by the plurality of test clients and a personal case which cannot be shared by the plurality of test clients, wherein the sharing case can be sent to a preset cloud server by the test server or the test clients for sharing.
To achieve the above object, according to another aspect of the present invention, there is provided a buried point testing apparatus.
The buried point testing device of the embodiment of the invention can comprise: the embedded point processing unit is used for generating a test case of the embedded point information according to a test requirement document of at least one embedded point information; the test case comprises test expected data of the buried point information; a request processing unit to: when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; a buried point verification unit for: and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case.
Optionally, the test expectation data of any buried point information includes: the mark of the embedded point information, the expected reporting type, the name of the field to be displayed and a judging condition aiming at the field to be displayed; and, the buried point processing unit may be further configured to: acquiring a test requirement document of the buried point information, and identifying preset identification keywords and reporting type keywords from the test requirement document; determining the mark of the buried point information by using the recognized mark key word, determining the expected reporting type of the buried point information by using the recognized reporting type key word, and generating a test case of the buried point information by using the determined mark of the buried point information and the expected reporting type; the buried point verification unit may be further configured to: determining a buried point information identifier in the real buried point data by using a preset identifier indication parameter; if the test case has the embedded point information with the same identification as the embedded point information identification, determining the real embedded point data as target data, and determining the embedded point information as the associated embedded point of the target data; determining a real reporting type in the target data by using a preset reporting type indication parameter; when the real reporting type is different from the expected reporting type of the associated buried point, marking the test result of the associated buried point as failing; acquiring field data to be displayed in the target data according to the field name to be displayed; when the field data to be displayed accord with the judgment condition aiming at the field to be displayed, marking the test result of the associated buried point as passing; and when the field data to be displayed do not accord with the judgment condition, marking the test result of the associated buried point as failed.
To achieve the above object, according to still another aspect of the present invention, there is provided an electronic apparatus.
An electronic device of the present invention includes: one or more processors; and a storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the embedded point testing method provided by the present invention.
To achieve the above object, according to still another aspect of the present invention, there is provided a computer-readable storage medium.
A computer-readable storage medium of the present invention stores thereon a computer program, which when executed by a processor implements the buried point testing method provided by the present invention.
According to the technical scheme of the invention, the embodiment of the invention has the following advantages or beneficial effects:
automatically generating a test case in advance according to the test requirement document of the buried point information; when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case. Through the steps, the automatic generation of the test case, the automatic capture of the embedded point reporting request and the automatic verification of the embedded point data can be achieved, so that the efficient, real-time and accurate automatic embedded point testing process and the visualization of the embedded point testing are realized. Further, by presetting the field to be hidden and the field to be displayed, most irrelevant fields (namely the field to be hidden) in the buried point data can be hidden, and a target field (namely the field to be displayed) concerned by a tester or a developer is exposed, so that the energy for searching the target field from a large number of fields is saved. In addition, in the embodiment of the invention, the embedded point test can be executed by combining the test server and the architecture of the test client, the test cases can be divided into the sharing cases and the individual cases, the sharing cases can be shared among the test clients and also can be sent to the cloud server for sharing, so that a collaborative efficient embedded point test mode is realized, and meanwhile, when a new product needs to be tested or an existing product needs to be subjected to regression test, the test can be rapidly developed on the basis of the existing case.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a buried point testing method according to an embodiment of the present invention;
FIG. 2 is a test case interface diagram of an embodiment of the invention;
FIG. 3 is a first flowchart of a buried point testing method according to an embodiment of the present invention;
FIG. 4 is a second flowchart of a buried point testing method according to an embodiment of the present invention;
FIG. 5 is a logic diagram of a buried point testing method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the components of a buried point testing apparatus according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of an electronic device for implementing the buried point testing method in the embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features of the embodiments may be combined with each other without conflict.
FIG. 1 is a schematic diagram of main steps of a buried point testing method according to an embodiment of the present invention.
As shown in fig. 1, the method for testing a buried point according to the embodiment of the present invention may be specifically performed according to the following steps:
step S101: and generating a test case of the embedded point information according to the test requirement document of the at least one embedded point information.
In the embodiment of the present invention, a piece of embedded point information is a general term for a piece of embedded point and its implementation process, for example, when a certain button of a certain application needs to be counted and clicked, an SDK (Software Development Kit) for embedded point may be introduced, and a method provided by the SDK may be added at a position where the embedded point is needed, and later, click number collection is implemented by this method, and this embedded point implementation may be referred to as an embedded point information set in the application. The test requirement document is a file for helping a tester or a developer to test the embedded point information, and generally includes data required by embedded point test, such as an identifier of the embedded point information, an expected reporting type and the like. The mark is used for uniquely indicating the buried point information, so that different buried point information can be distinguished. The expected reporting type refers to a correct reporting type of the embedded point data determined by the embedded point code, and may exemplarily include PV reporting (i.e., Page View reporting, PV indicates Page View, meaning Page View number), click reporting (i.e., click number reporting), search reporting (i.e., search number reporting), article display reporting (i.e., article display number reporting), and the like.
In practical application, the embedded point testing method of the embodiment of the invention can be executed at a testing server, the testing server can pre-deploy a testing plug-in special for embedded point testing, and the testing plug-in can have functions required by testing such as test case management, network request agent and the like. During testing, the testing server may perform testing independently based on the testing plug-in, or may interact with the testing client to perform testing, which will be mainly described in the following with the following scenario as an example. In this scenario, a tester or a developer directly inputs a test requirement document (generally, part of data related to a buried point in the test requirement document) at a test plug-in (i.e., a test plug-in client) of a test client, and the test plug-in can verify formats of various data in the input test requirement document according to a preset regular expression and can also process contents such as line feed, space and the like. For example, the preset regular expression requires that the identification format of the buried point information is "x.x.x" (each x is any number), and if the buried point information in the test requirement document is identified as "1.2", the test plug-in will report an error and prompt to modify or re-input.
After that, the test client may send the data in the test requirement document to the test server through an HTTP (HyperText Transfer Protocol) request, and after receiving the data sent by the test client, the test server may automatically generate a test case of the embedded point information according to the data. Generally, a test case generally corresponds to a software project or sub-project, i.e., related test data that includes buried point information for the same project or sub-project. In some cases, a test case may also include buried point information corresponding to different projects or different sub-projects.
In this embodiment of the present invention, a test case may include test expected data of at least one piece of buried point information, where the test expected data of any piece of buried point information may include an identifier of the piece of buried point information and an expected reporting type, and in some cases, the test expected data of one piece of buried point information may further include: the name of the field to be displayed and a judging condition aiming at the field to be displayed. The fields to be displayed refer to fields which need to be checked by a tester or a developer, and it can be understood that in the prior art, reported buried point data generally has a large number of fields, and it is laborious for the developer or the tester to search concerned target fields from the fields, and the target fields are set as the fields to be displayed, so that the fields can be directly checked through subsequent steps without searching in a large number of fields. The above judgment condition is a condition for one or more fields to be displayed, and if the buried point data does not meet the judgment condition, the test is judged to fail. For example, if the field to be displayed set by the tester or the developer for a certain embedded point information is skiid and the determination condition is "skiid 10027", it indicates that after the embedded point data of the embedded point information is acquired, the data of the skiid field needs to be displayed, and it is determined that the test is passed when "skiid 10027" needs to be satisfied.
It can be seen that the test case generated by the test server is an automated test case that can be directly executed by a program, and the test case can be generated through the following steps: the test server side identifies preset identification keywords and reporting type keywords from the test requirement document; and determining the mark of the buried point information by using the identified mark key word, determining the expected reporting type of the buried point information by using the identified reporting type key word, and generating a test case of the buried point information by using the determined mark of the buried point information and the expected reporting type. It is understood that the above identification key and the report type key are determined by the test server and the test client through a predetermined agreement. Therefore, the automatic generation of the test case can be realized, and the embedded point test efficiency is improved.
Step S102: when testing is carried out based on any test case, a buried point reporting request corresponding to the test case is intercepted, and the buried point reporting request is analyzed to obtain real buried point data carried in the buried point reporting request.
In this step, the buried point reporting request corresponding to the test case refers to a buried point reporting request related to the buried point information in the test case. For example, if the reporting addresses of the buried point information in a certain test case are URL1 and URL2 (the URLs are Uniform Resource locators, which means Uniform Resource locators), the network requests pointing to URL1 and URL2 may be used as the buried point reporting requests corresponding to the test case. Therefore, in practical applications, after receiving a test instruction sent by a tester or a developer from a test client, a test server may first intercept a network request sent by a user terminal (which may include a test terminal in a product test phase), and then determine a network request pointing to a URL corresponding to a test case as a buried point reporting request corresponding to the test case.
And then, the test server can analyze the buried point reporting request to obtain real buried point data carried in the buried point reporting request, wherein the real buried point data refers to various data related to the buried point carried in the buried point reporting request.
Step S103: and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case.
In this step, the test server compares the real buried point data obtained by analysis in the buried point reporting request with the test expected data in the test case, so as to obtain the test result. Specifically, after acquiring real buried point data carried in a certain buried point reporting request, the test server determines a buried point information identifier in the real buried point data by using a preset identifier indication parameter (which can be implemented by using a regular expression in practical application). If the test case has the buried point information with the same identification as the buried point information identification, namely, the buried point information identification in the real buried point data is the same as the identification of a certain buried point information in the test case, it indicates that the real buried point data hits the buried point information, at this moment, the real buried point data can be determined as the target data, and the hit buried point information is determined as the associated buried point of the target data. Thereafter, the test server may determine the real reporting type in the target data by using the preset reporting type indication parameter (which may be implemented by using a regular expression in actual application). And if the real reporting type is different from the expected reporting type of the associated buried point, marking the test result of the associated buried point as failing. And if the real reporting type is the same as the expected reporting type of the associated buried point, continuously judging whether a judgment condition based on the field to be displayed exists. If the judging condition does not exist, marking the test result of the associated buried point as passing; if the discrimination condition exists, subsequent determinations regarding the discrimination condition are performed. In an actual scenario, after determining a real reporting type in target data by using a preset reporting type indication parameter, the test server may also count the reporting times of the real reporting type corresponding to the associated embedded point, that is, the reporting times corresponding to each real reporting type are accumulated for each embedded point information. Preferably, the identifier indication parameter and the report type indication parameter may be configured in advance by a developer or a tester and stored in a database, and the test server may obtain the identifier indication parameter and the report type indication parameter from the database when the test server is used.
In the specific application, if the real reporting type is the same as the expected reporting type of the associated buried point and a judgment condition based on the field to be displayed exists, the test server can acquire the field data to be displayed in the target data according to the field name to be displayed and judge whether the field data to be displayed meets the judgment condition aiming at the field to be displayed. If so, marking the test result of the associated buried point as passing; if not, the test result of the associated buried point is marked as failed. The testing process is executed for each embedded point information of the test case, and efficient, real-time and accurate embedded point testing can be achieved.
Particularly, after the test result corresponding to the test case is obtained, the test server can display the test result and the field data to be displayed in the target data, and can hide the data corresponding to the preset field name to be hidden in the target data, so that most irrelevant fields in the buried data can be hidden, and the target field concerned by a tester or a developer is exposed, thereby saving the energy of searching for the target field from a large number of fields. In addition, the test server can store the test progress or the test result at any moment for query according to the instruction of the tester or the developer.
Through the steps, the information of each embedded point in the test case can be verified. Referring to fig. 2, the test server may display the total number of the buried point information, the total number of the buried point information passing the test, the total number of the buried point information failing the test (i.e., there is a test failure), and the total number of the buried point information to be tested on the relevant interface, and may distinguish several cases of passing, failing, and being tested in different colors in each data line. It can be understood that each data row corresponds to a piece of buried point information, which includes a buried point information description for a tester or a developer to read, in addition to the buried point information identifier, the reporting type and the reporting times (i.e., the reporting statistics in fig. 2, the field in fig. 2 is the real reporting type), the field to be shown, and the field data to be shown (the field data to be shown in the real buried point data in fig. 2). The interface also has functional buttons for continuing the test (the test can be continuously executed for the test case in the pause or some embedded point information), retesting (the test can be continuously executed for the test case in the stop or some embedded point information), adding (adding the test case or the embedded point information), deleting (deleting the test case or the embedded point information), and the like.
After the test server obtains the test result, the test server can send the test result and the field data to be displayed in the target data to the corresponding test client (that is, the test client sends the test requirement document data and the relevant instructions to the test server) for displaying, thereby realizing the visualization of the embedded point test.
In particular, the above test cases may include shared cases that can be shared among multiple test clients (for example, viewing the shared cases, copying the shared cases to local use or editing), and individual cases that can only be edited and used by a certain test client and cannot be shared among multiple test clients. It can be understood that, in practical applications, the conversion between the personal use case and the shared use case can be realized through a related process. In specific application, the sharing case can be sent to a preset cloud server by the test server or the test client for sharing. Therefore, a collaborative efficient embedded point test mode can be realized, and when a new product needs to be tested or an existing product needs to be subjected to regression test, the test can be rapidly developed on the basis of an existing case.
Fig. 3 is a first flowchart of a method for testing a buried point according to an embodiment of the present invention, and as shown in fig. 3, when a certain item needs to be tested for a buried point, it is first determined whether the item is a new item, if the item is a new item, a new test case is entered, if the item is not a new item, a previous sharing case (or a personal case may be used in some cases) may be used, if the buried point changes, the sharing case needs to be edited, and if the buried point does not change, the sharing case may be directly used. And then, a tester or a developer can send an instruction to start an automatic test, namely, firstly, the test page is operated to send a buried point reporting request, then, the test server intercepts and verifies the request, and finally, the test server outputs a test result.
Fig. 4 is a second flowchart of the embedded point testing method according to the embodiment of the present invention, fig. 5 is a logic diagram of the embedded point testing method according to the embodiment of the present invention, and an embodiment of the present invention will be described below with reference to fig. 4 and 5.
In this embodiment, a buried point test is performed using the test server and the test client. At the test service end, a new test port (i.e. the port of the test plug-in) can be opened up for each person (tester or developer), and the test plug-in can be realized by adding functions such as test case management, data verification and the like on the basis of a network request agent tool Whistle, so as to realize that packet capturing data are not influenced by each other. Meanwhile, a set of shared use cases and individual use cases of each person are maintained, the individual use cases are managed according to the account dimension, and the editing and verification results (namely buried point test results) of the persons on the individual buried point use cases are invisible for other persons. The shared use case is visible/referenceable to all people, but only the person in charge of the shared use case has the right to edit.
At a test client, a React (a front-end framework) can be used for writing a test plug-in interface, and the document data of the test requirement input by a person is verified by using a regular expression. After a user starts a test, the test plug-in puts verified test requirement document data in request body parameters in a form of a Post request (an HTTP request type) of HTTP, submits the document data to a test server, establishes WebSocket (a full-duplex communication protocol) connection with the test server, and monitors the buried point test progress in real time and updates an interface.
The test server is developed by using node.js language (a server language), and can sequentially execute links such as embedded point processing, request processing, embedded point verification and the like.
In the embedded point processing link, the test server receives test requirement document data sent by the test client, acquires an embedded point reporting rule (including the identifier indication parameter and the reporting type indication parameter) and a field to be hidden from a database, then performs data preprocessing (namely, the identifier of embedded point information and an expected reporting type are determined by using a regular expression so as to form test expected data), and finally generates a test case of the test expected data containing each embedded point information. In practical application, the buried point reporting rule belongs to a general rule with low change frequency, and only a test plug-in manager can modify the rule. In one embodiment, the time for writing the buried point case can be saved in the mode, the test plug-in can input data in batches, personnel only need to copy relevant data from a test requirement document, paste the relevant data into an editing frame of the test plug-in, and process the data and change lines, the test plug-in can automatically identify the data according to a regular expression to generate the test case, and the efficiency is higher than that of manually writing the test case by using a mind guide graph in the prior art.
The functional module responsible for request processing is always in a listening state, and the start and the shut down of the functional module are synchronized with Whistle. At present, if the test case needs to be verified, the module intercepts an HTTP request sent by a test page by calling a Whistle interface, determines a buried point reporting request corresponding to the test case from the HTTP request, and finally analyzes the buried point reporting request to obtain real buried point data carried in the buried point reporting request.
In the buried point verification link, whether the real buried point data hits the buried point information in the test case is judged, and if the real buried point data does not hit the buried point information, the request is abandoned. And if the field is hit, counting the reporting type and the reporting times, hiding the field to be hidden, displaying the field to be displayed, and marking the test result according to the judgment condition aiming at the field to be displayed. And finally, storing the test result or the test state, sending a message to the test client through the WebSocket to update the test progress, updating the page data and the progress in real time after the client receives the message, and enabling related personnel to see the current test state at any time.
Through the arrangement, the test plug-in can be used for filtering the embedded point reporting request, the function of generating the embedded point automatic test case is provided, and the test case is stored in the test server or the cloud server to realize multi-user sharing, so that higher test efficiency and convenience are realized.
In fig. 5, a tester or a developer firstly enters or selects a test case to start testing, i.e., submits a test task, then the test server updates a shared case and an individual case, and adds a case to be tested, then the test server generates a test task through monitoring and adding operations, and realizes a buried point test by intercepting a request, executing a test, and updating a test progress.
In the technical scheme of the embodiment of the invention, a test case is automatically generated in advance according to the test requirement document of the buried point information; when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case. Through the steps, the automatic generation of the test case, the automatic capture of the embedded point reporting request and the automatic verification of the embedded point data can be achieved, so that the efficient, real-time and accurate automatic embedded point testing process and the visualization of the embedded point testing are realized. Further, by presetting the fields to be hidden and the fields to be displayed, most irrelevant fields in the buried point data can be hidden, and the target fields concerned by testers or developers are exposed, so that the energy for searching the target fields from a large number of fields is saved. In addition, in the embodiment of the invention, the embedded point test can be executed by combining the test server and the architecture of the test client, the test cases can be divided into the sharing cases and the individual cases, the sharing cases can be shared among the test clients and also can be sent to the cloud server for sharing, so that a collaborative efficient embedded point test mode is realized, and meanwhile, when a new product needs to be tested or an existing product needs to be subjected to regression test, the test can be rapidly developed on the basis of the existing case.
It should be noted that, for the convenience of description, the foregoing method embodiments are described as a series of acts, but those skilled in the art will appreciate that the present invention is not limited by the order of acts described, and that some steps may in fact be performed in other orders or concurrently. Moreover, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required to implement the invention.
To facilitate a better implementation of the above-described aspects of embodiments of the present invention, the following also provides relevant means for implementing the above-described aspects.
Referring to fig. 6, a buried point testing apparatus 600 according to an embodiment of the present invention may include: a buried point processing unit 601, a request processing unit 602, and a buried point verification unit 603.
The embedded point processing unit 601 is configured to generate a test case of the embedded point information according to a test requirement document of at least one embedded point information; the test case comprises test expected data of the buried point information; the request processing unit 602 may be configured to: when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; the buried point verification unit 603 may be configured to: and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case.
In the embodiment of the present invention, the expected test data of any buried point information includes: the mark of the embedded point information, the expected reporting type, the name of the field to be displayed and a judging condition aiming at the field to be displayed; and, the buried point processing unit 601 may be further configured to: acquiring a test requirement document of the buried point information, and identifying preset identification keywords and reporting type keywords from the test requirement document; determining the mark of the buried point information by using the recognized mark key word, determining the expected reporting type of the buried point information by using the recognized reporting type key word, and generating a test case of the buried point information by using the determined mark of the buried point information and the expected reporting type; the buried point verification unit 603 may further be configured to: determining a buried point information identifier in the real buried point data by using a preset identifier indication parameter; if the test case has the embedded point information with the same identification as the embedded point information identification, determining the real embedded point data as target data, and determining the embedded point information as the associated embedded point of the target data; determining a real reporting type in the target data by using a preset reporting type indication parameter; when the real reporting type is different from the expected reporting type of the associated buried point, marking the test result of the associated buried point as failing; acquiring field data to be displayed in the target data according to the field name to be displayed; when the field data to be displayed accord with the judgment condition aiming at the field to be displayed, marking the test result of the associated buried point as passing; and when the field data to be displayed do not accord with the judgment condition, marking the test result of the associated buried point as failed.
As a preferred solution, the request processing unit 602 may further be configured to: intercepting a network request sent by a user terminal; and determining the network request pointing to the URL corresponding to the test case as the buried point reporting request.
Preferably, the buried point verification unit 603 is further configured to: after the test result corresponding to the test case is obtained, displaying the test result and the field data to be displayed in the target data; and hiding data corresponding to a preset field name to be hidden in the target data.
In a specific application, the buried point verification unit 603 can be further configured to: and after the real reporting type in the target data is determined by using the preset reporting type indication parameter, counting the reporting times of the real reporting type corresponding to the associated buried point.
Furthermore, in the embodiment of the present invention, the apparatus 600 is disposed at a testing server communicating with a plurality of testing clients; the buried point processing unit 601 may be further configured to: receiving a test requirement document sent by the test client; the buried point verification unit 603 may further be configured to: after the test result corresponding to the test case is obtained, the test result and the field data to be displayed in the target data are sent to the corresponding test client for displaying; and, the test case includes: the test system comprises a sharing case which can be shared by the plurality of test clients and a personal case which cannot be shared by the plurality of test clients, wherein the sharing case can be sent to a preset cloud server by the test server or the test clients for sharing.
In the technical scheme of the embodiment of the invention, a test case is automatically generated in advance according to the test requirement document of the buried point information; when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case. Through the steps, the automatic generation of the test case, the automatic capture of the embedded point reporting request and the automatic verification of the embedded point data can be achieved, so that the efficient, real-time and accurate automatic embedded point testing process and the visualization of the embedded point testing are realized. Further, by presetting the fields to be hidden and the fields to be displayed, most irrelevant fields in the buried point data can be hidden, and the target fields concerned by testers or developers are exposed, so that the energy for searching the target fields from a large number of fields is saved. In addition, in the embodiment of the invention, the embedded point test can be executed by combining the test server and the architecture of the test client, the test cases can be divided into the sharing cases and the individual cases, the sharing cases can be shared among the test clients and also can be sent to the cloud server for sharing, so that a collaborative efficient embedded point test mode is realized, and meanwhile, when a new product needs to be tested or an existing product needs to be subjected to regression test, the test can be rapidly developed on the basis of the existing case.
Fig. 7 shows an exemplary system architecture 700 to which the buried point testing method or the buried point testing apparatus of the embodiments of the invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704 and a server 705 (this architecture is merely an example, and the components included in a specific architecture may be adjusted according to specific application). The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. Various client applications, such as a buried point test application (for example only), may be installed on the terminal devices 701, 702, 703.
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a test server (for example only) providing support for a buried test application operated by a user with the terminal devices 701, 702, 703. The test server may process the received buried point test request and feed back the processing result (e.g., test result-just an example) to the terminal devices 701, 702, 703.
It should be noted that the embedded point testing method provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the embedded point testing apparatus is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides the electronic equipment. The electronic device of the embodiment of the invention comprises: one or more processors; and a storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the embedded point testing method provided by the present invention.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use in implementing an electronic device of an embodiment of the present invention. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data necessary for the operation of the computer system 800 are also stored. The CPU801, ROM 802, and RAM803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted into the storage section 808 as necessary.
In particular, the processes described in the main step diagrams above may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the main step diagram. In the above-described embodiment, the computer program can be downloaded and installed from a network via the communication section 809 and/or installed from the removable medium 811. The computer program, when executed by the central processing unit 801, performs the above-described functions defined in the system of the present invention.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a buried point processing unit, a request processing unit, and a buried point verification unit. Where the names of these units do not in some cases constitute a limitation on the units themselves, for example, a buried point processing unit may also be described as a "unit that provides test cases to a requesting processing unit".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to perform steps comprising: generating a test case of the embedded point information according to a test requirement document of at least one embedded point information; the test case comprises test expected data of the buried point information; when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case.
In the technical scheme of the embodiment of the invention, a test case is automatically generated in advance according to the test requirement document of the buried point information; when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request; and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case. Through the steps, the automatic generation of the test case, the automatic capture of the embedded point reporting request and the automatic verification of the embedded point data can be achieved, so that the efficient, real-time and accurate automatic embedded point testing process and the visualization of the embedded point testing are realized. Further, by presetting the fields to be hidden and the fields to be displayed, most irrelevant fields in the buried point data can be hidden, and the target fields concerned by testers or developers are exposed, so that the energy for searching the target fields from a large number of fields is saved. In addition, in the embodiment of the invention, the embedded point test can be executed by combining the test server and the architecture of the test client, the test cases can be divided into the sharing cases and the individual cases, the sharing cases can be shared among the test clients and also can be sent to the cloud server for sharing, so that a collaborative efficient embedded point test mode is realized, and meanwhile, when a new product needs to be tested or an existing product needs to be subjected to regression test, the test can be rapidly developed on the basis of the existing case.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method of buried point testing, comprising:
generating a test case of the embedded point information according to a test requirement document of at least one embedded point information; the test case comprises test expected data of the buried point information;
when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request;
and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case.
2. The method of claim 1, wherein the test expectation data for any buried point information comprises: the mark and the expected reporting type of the embedded point information; and generating a test case of the embedded point information according to the test requirement document of the at least one embedded point information, wherein the test case comprises:
acquiring a test requirement document of the buried point information, and identifying preset identification keywords and reporting type keywords from the test requirement document;
and determining the mark of the buried point information by using the identified mark key word, determining the expected reporting type of the buried point information by using the identified reporting type key word, and generating a test case of the buried point information by using the determined mark of the buried point information and the expected reporting type.
3. The method of claim 1, wherein intercepting the site-embedded reporting request corresponding to the test case comprises:
intercepting a network request sent by a user terminal;
and determining the network request pointing to the URL corresponding to the test case as the buried point reporting request.
4. The method of claim 2, wherein comparing the obtained real buried point data with the expected test data in the test case to obtain the test result corresponding to the test case comprises:
determining a buried point information identifier in the real buried point data by using a preset identifier indication parameter; if the test case has the embedded point information with the same identification as the embedded point information identification, determining the real embedded point data as target data, and determining the embedded point information as the associated embedded point of the target data;
determining a real reporting type in the target data by using a preset reporting type indication parameter; and when the real reporting type is different from the expected reporting type of the associated buried point, marking the test result of the associated buried point as failing.
5. The method of claim 4, wherein the test expectation data for any buried point information further comprises: the name of the field to be displayed and a judging condition aiming at the field to be displayed; the comparing the obtained real buried point data with the test expected data in the test case to obtain the test result corresponding to the test case further comprises:
acquiring field data to be displayed in the target data according to the field name to be displayed; when the field data to be displayed accord with the judgment condition aiming at the field to be displayed, marking the test result of the associated buried point as passing; and when the field data to be displayed do not accord with the judgment condition, marking the test result of the associated buried point as failed.
6. The method of claim 5, further comprising:
after the test result corresponding to the test case is obtained, displaying the test result and the field data to be displayed in the target data; and the number of the first and second electrodes,
and hiding data corresponding to a preset field name to be hidden in the target data.
7. The method of claim 4, further comprising:
and after the real reporting type in the target data is determined by using the preset reporting type indication parameter, counting the reporting times of the real reporting type corresponding to the associated buried point.
8. The method of claim 5 or 6, wherein the method is performed at a test service in communication with a plurality of test clients; the obtaining of the test requirement document of the buried point information includes: receiving a test requirement document sent by the test client; the method further comprises: after the test result corresponding to the test case is obtained, the test result and the field data to be displayed in the target data are sent to the corresponding test client for displaying; and the number of the first and second groups,
the test case comprises: the test system comprises a sharing case which can be shared by the plurality of test clients and a personal case which cannot be shared by the plurality of test clients, wherein the sharing case can be sent to a preset cloud server by the test server or the test clients for sharing.
9. A buried point testing device, comprising:
the embedded point processing unit is used for generating a test case of the embedded point information according to a test requirement document of at least one embedded point information; the test case comprises test expected data of the buried point information;
a request processing unit to: when testing is carried out based on any test case, intercepting a buried point reporting request corresponding to the test case, and analyzing the buried point reporting request to obtain real buried point data carried in the buried point reporting request;
a buried point verification unit for: and comparing the obtained real buried point data with the test expected data in the test case to obtain a test result corresponding to the test case.
10. The apparatus of claim 9, wherein the test expected data for any buried point information comprises: the mark of the embedded point information, the expected reporting type, the name of the field to be displayed and a judging condition aiming at the field to be displayed; and the number of the first and second groups,
the buried point processing unit is further configured to: acquiring a test requirement document of the buried point information, and identifying preset identification keywords and reporting type keywords from the test requirement document; determining the mark of the buried point information by using the recognized mark key word, determining the expected reporting type of the buried point information by using the recognized reporting type key word, and generating a test case of the buried point information by using the determined mark of the buried point information and the expected reporting type;
the buried point verification unit is further configured to: determining a buried point information identifier in the real buried point data by using a preset identifier indication parameter; if the test case has the embedded point information with the same identification as the embedded point information identification, determining the real embedded point data as target data, and determining the embedded point information as the associated embedded point of the target data; determining a real reporting type in the target data by using a preset reporting type indication parameter; when the real reporting type is different from the expected reporting type of the associated buried point, marking the test result of the associated buried point as failing; acquiring field data to be displayed in the target data according to the field name to be displayed; when the field data to be displayed accord with the judgment condition aiming at the field to be displayed, marking the test result of the associated buried point as passing; and when the field data to be displayed do not accord with the judgment condition, marking the test result of the associated buried point as failed.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202110609683.0A 2021-06-01 2021-06-01 Buried point testing method and device Pending CN113360376A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110609683.0A CN113360376A (en) 2021-06-01 2021-06-01 Buried point testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110609683.0A CN113360376A (en) 2021-06-01 2021-06-01 Buried point testing method and device

Publications (1)

Publication Number Publication Date
CN113360376A true CN113360376A (en) 2021-09-07

Family

ID=77530991

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110609683.0A Pending CN113360376A (en) 2021-06-01 2021-06-01 Buried point testing method and device

Country Status (1)

Country Link
CN (1) CN113360376A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114331574A (en) * 2022-03-17 2022-04-12 北京搜狐新媒体信息技术有限公司 Verification method, device, storage medium and equipment for reporting buried point
CN115484200A (en) * 2022-09-21 2022-12-16 北京沃东天骏信息技术有限公司 Embedded point testing method, device, server, storage medium and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114331574A (en) * 2022-03-17 2022-04-12 北京搜狐新媒体信息技术有限公司 Verification method, device, storage medium and equipment for reporting buried point
CN115484200A (en) * 2022-09-21 2022-12-16 北京沃东天骏信息技术有限公司 Embedded point testing method, device, server, storage medium and system

Similar Documents

Publication Publication Date Title
US20170075790A1 (en) Integrating quality analysis with a code review tool
US10592327B2 (en) Apparatus, system, and method for analyzing logs
CN113987074A (en) Distributed service full-link monitoring method and device, electronic equipment and storage medium
CN108900388A (en) Method and apparatus for monitor network quality
CN113360376A (en) Buried point testing method and device
CN111245642A (en) Method and device for acquiring dependency relationship between multiple systems and electronic equipment
CN107168844B (en) Performance monitoring method and device
US10775751B2 (en) Automatic generation of regular expression based on log line data
CN113448854A (en) Regression testing method and device
CN107704357B (en) Log generation method and device
WO2020259034A1 (en) Method, apparatus, and device for identifying offline source code, and storage medium
CN110162448A (en) The method and apparatus of log collection
CN113760697A (en) Interface testing method and device, electronic equipment and storage medium
CN111125066B (en) Method and device for detecting functions of database auditing equipment
CN109587197A (en) It is associated with the methods, devices and systems of reported data
CN115964302A (en) Data testing method and device
CN111045915A (en) Safety test method and device based on product function test case
CN114416597A (en) Test case record generation method and device
CN112988560A (en) Method and device for testing system robustness
CN113434382A (en) Database performance monitoring method and device, electronic equipment and computer readable medium
CN112100534A (en) Information processing method, device, medium and electronic equipment in page sharing
CN113626301A (en) Method and device for generating test script
CN111382071A (en) User behavior data testing method and system
CN112579428A (en) Interface testing method and device, electronic equipment and storage medium
CN110633182A (en) System, method and apparatus for monitoring server stability

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination