Test data construction method and device, equipment and storage medium
By automatically constructing test data from lineage data, the problem of manually constructed test cases failing to reflect real business scenarios is solved, thus improving the accuracy and efficiency of test data while ensuring data security and flexible updates.
Patent Information
- Application Number
- CN202511504331.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-21
AI Technical Summary
In existing technologies, manually constructed test cases cannot reflect real business scenarios, resulting in inaccurate testing. Furthermore, test cases need to be reconstructed when downstream dependencies change, which is time-consuming and labor-intensive.
By receiving lineage data, the calling relationship between parent and child operations is determined, and request and response messages are constructed. Test data is automatically generated, including decryption and anonymization of lineage data, to ensure data security.
It improves the accuracy and efficiency of test data, ensures data security, reduces manual intervention, and enables automated and flexible updates of test data.
Smart Images

Figure CN120973694A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of software engineering technology, and in particular relates to a test data construction method, apparatus, device and storage medium. Background Technology
[0002] Before a system or application is deployed, it typically needs to be tested. Generally, test cases are manually constructed; testers create simulated data based on real-world business scenarios and use this simulated data to test the system or application.
[0003] Therefore, manually building test cases will lead to the following problems: simulated data cannot reflect the real business scenario, resulting in a disconnect between simulated data and the real business scenario, which in turn leads to inaccurate testing when simulated data is used for testing; when downstream dependencies change, test cases need to be rebuilt, which is time-consuming and labor-intensive. Summary of the Invention
[0004] This application provides a test data construction method for constructing test data based on real-world scenarios, and solves the problem of the inability to automatically build test data.
[0005] In a first aspect, embodiments of this application provide a method for constructing test data, including: Receive first lineage data sent by a first interface; wherein the lineage data includes multiple operations for at least one request link; each operation includes its own attribute information; Identify parent and child operations with a calling relationship from multiple operations in the same request chain, and establish an association relationship between the attribute information of the parent and child operations. The transmission parameters between parent and child operations are determined from the association relationship, and the request message is constructed from the attribute information of the child operation; Send the request message to the corresponding second interface and obtain the response message returned by the second interface; The request message, the response message, and the transmitted parameters are used to construct test data.
[0006] In this embodiment, by obtaining test data from real lineage data, the source of the test data becomes more reliable, avoiding the problem of poor test results caused by manually constructed test data being inaccurate. By identifying parent-child operations with a calling relationship in the same link request, the calling relationship between various operations can be directly constructed based on the lineage data, eliminating the need for manual addition of calling relationships. Furthermore, it automatically establishes interface parameters and calling relationships between upstream and downstream processes, improving the efficiency and accuracy of test data construction. When constructing test data, by adding the response message of the second interface to the test data, the system or application to be tested can be verified, improving the accuracy of the test.
[0007] Optionally, before determining the parent-child operations with a calling relationship from multiple operations in the same request chain, the method further includes: The first bloodline data is decrypted, and the sensitive information after decryption is anonymized.
[0008] In this embodiment of the application, the received bloodline data is anonymized to avoid leaking user privacy and improve the security of test data.
[0009] Optionally, determining parent and child operations with a calling relationship from multiple operations in the same request chain includes: For any operation in the same request chain, the parent and child operations with a calling relationship are determined based on the tracing identifier in the operation and / or the tracing identifier of the parent operation.
[0010] In this embodiment of the application, the parent and child operations with a calling relationship are determined by the tracking identifier in the operation or the tracking identifier of the parent operation in a pre-configured manner. When the tracking identifier in the operation cannot determine the parent and child operations, the tracking identifier of the parent operation in a pre-configured manner can be used, which avoids the situation where the parent and child operations cannot be determined and reduces the situation where the parent and child operation calling relationship confirmation fails.
[0011] Optionally, determining the transmission parameters between parent and child operations from the association includes: In the aforementioned relationship, attributes whose parent operation has the same attribute value as the child operation are used as upstream and downstream transmission parameters; and / or Attributes that conform to the same parameter name rule in the aforementioned relationship will be used as parameters for upstream and downstream transmission.
[0012] In this embodiment of the application, by using the same attribute value as the transmission parameter, the attribute information of the upstream and downstream can be determined according to the transmission parameter. There are fewer dependent elements when determining the upstream and downstream relationship, which makes it easier to improve the speed of determining the upstream and downstream relationship, thereby improving the speed of constructing test data.
[0013] Optionally, after obtaining the response message returned by the second interface, the method further includes: The business scenario to which the request message belongs is determined based on the response message; The request message, the response message, and the transmitted parameters are used to construct test data, including: The scenario identifier corresponding to the business scenario, the request message, the response message, and the transmission parameters are used to construct test data.
[0014] In this embodiment of the application, the business scenario of the request message is determined by the response message, and the scenario identifier of the business scenario is added to the test data, so that the test data can display the business scenario being tested, thereby improving the user's experience when conducting tests.
[0015] Optionally, after constructing the test data from the request message, the response message, and the transmitted parameters, the method further includes: Set a dynamic update flag for the test data; Receive the second lineage data subsequently sent by the first interface; After determining that there is updated content in the test data based on the second bloodline data, the test data is updated.
[0016] In this embodiment of the application, the need for dynamic updating of test data can be determined by the dynamic update identifier. Thus, when new lineage data is received, the test data can be updated according to the new lineage data, making the test data more flexible.
[0017] Secondly, embodiments of this application provide a test data construction apparatus, comprising: A receiving module is used to receive first lineage data sent by a first interface; wherein the lineage data includes multiple operations for at least one request link; each operation includes its own attribute information; The association module is used to identify parent and child operations with a calling relationship from multiple operations in the same request chain, and to establish an association relationship between the attribute information of the parent and child operations. The determination module is used to determine the transmission parameters between parent and child operations from the association relationship and to construct a request message from the attribute information of the child operation; The sending module is used to send the request message to the corresponding second interface and obtain the response message returned by the second interface; A construction module is used to construct test data from the request message, the response message, and the transmitted parameters.
[0018] Optionally, the association module is further configured to: The first bloodline data is decrypted, and the sensitive information after decryption is anonymized.
[0019] Optionally, the association module is specifically used for: For any operation in the same request chain, the parent and child operations with a calling relationship are determined based on the tracing identifier in the operation and / or the tracing identifier of the parent operation.
[0020] Optionally, the determining module is specifically used for: In the aforementioned relationship, attributes whose parent operation has the same attribute value as the child operation are used as upstream and downstream transmission parameters; and / or Attributes that conform to the same parameter name rule in the aforementioned relationship will be used as parameters for upstream and downstream transmission.
[0021] Optionally, the sending module is specifically used for: The business scenario to which the request message belongs is determined based on the response message; The request message, the response message, and the transmitted parameters are used to construct test data, including: The scenario identifier corresponding to the business scenario, the request message, the response message, and the transmission parameters are used to construct test data.
[0022] Optionally, the building module is specifically used for: Set a dynamic update flag for the test data; Receive the second lineage data subsequently sent by the first interface; After determining that there is updated content in the test data based on the second bloodline data, the test data is updated.
[0023] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the methods described above.
[0024] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of any of the methods described above.
[0025] Fifthly, this application provides a computer program product comprising a computer program stored on a computer-readable storage medium, the computer program including program instructions that, when executed by a computer device, cause the computer device to perform the steps of any of the methods described above. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 A system architecture diagram provided for an embodiment of this application; Figure 2 A flowchart (I) illustrating a method for constructing test data according to an embodiment of this application; Figure 3 A schematic diagram illustrating the relationship between upstream and downstream parameters provided in an embodiment of this application; Figure 4 This is a schematic diagram of a process for updating test data provided in an embodiment of this application; Figure 5 A flowchart (II) illustrating a method for constructing test data according to an embodiment of this application; Figure 6 A schematic diagram of a test data construction apparatus provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and beneficial effects of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0029] Before a system or application goes live, pre-deployment testing is generally required to prevent bugs during official use. Test data and test cases used in testing are typically manually written, making dynamic generation of test data impossible. Furthermore, if related upstream or downstream data is used in the test data, the association between these data points must be manually performed, as automatic extraction of related parameters is not possible. Moreover, current test data only provides visualization of the data chain and lacks tracking of interface-level parameter transmission. This application provides a method for constructing test data that can automatically generate test data for interfaces and automatically associate upstream and downstream parameters to form the test data. The operation steps of this application embodiment are described in detail below: This application embodiment uses an upstream calling a downstream example for detailed explanation. First, this application embodiment obtains the lineage data of the downstream being called. After parsing the lineage data, it obtains the attribute information of the downstream lineage data. The lineage data includes at least one request chain. Data sanitization processing is performed on the parsed lineage data, such as desensitizing sensitive fields. Then, the calling relationship is determined based on the transmitted parameters in the same request chain. The attribute information belonging to the calling relationship (i.e., parent-child relationship) is associated, and a request message for initiating the test is constructed from this association. Finally, the request message is sent to a second interface, and test data is constructed based on the response information returned by the second interface, as well as the request message and transmitted parameters.
[0030] refer to Figure 1 This is a system architecture diagram provided in an embodiment of the present application, including a server 101 where the first interface is located, a server 102 where the second interface is located, and a server 103 to be tested, wherein the server 103 to be tested can be either the server 101 where the first interface is located or the server 102 where the second interface is located.
[0031] Servers 101, 102, and 103 can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0032] Terminal device 104 is pre-installed with business applications for building test data. These business applications include client applications, web applications, and mini-program applications. Terminal device 104 can be a smartphone, POS machine, desktop laptop, computer, etc., but is not limited to these.
[0033] See Figure 2 The present application provides a test data construction method, which includes the following steps: Step 201: Receive first lineage data sent by the first interface; wherein the lineage data includes multiple operations for at least one request link; each operation includes its own attribute information.
[0034] Specifically, lineage data refers to the calling relationships formed when a system or application calls other link data. The lineage data sent by an interface can be the lineage data of an interface calling a downstream interface, or the lineage data of an interface being called by other upstream interfaces. However, the operational steps are the same regardless of whether the lineage data is from an interface calling another interface or from an interface being called by another interface. This application embodiment takes the example of an interface calling a downstream interface's lineage data, but it does not limit this application embodiment to the situation where an interface calls downstream lineage data.
[0035] The first lineage data sent by the first interface can be received by the server where the second interface is located, or by the server where other interfaces are located, or by an independent system under test. This application embodiment is not limited to this.
[0036] The first lineage data sent by the first interface is the lineage data of other interfaces called by the first interface. This lineage data contains at least one request chain, and each request chain includes multiple operations, each with its own attribute information. The request chain records a client request behavior in the system; for example, a request chain records a single HTTP user request behavior. The request chain ID is used to link all related operations. For instance, a user request may involve multiple service calls, all sharing a single request chain ID.
[0037] The operations in the request chain are requests specific to certain business processes. For example, a request to query a user's credit rating involves querying the user's number of purchases in the past 7 days, the amount of a single purchase, and the maximum time interval between purchases. Each operation includes its own attribute information. For instance, the attribute information for the number of purchases in the past 7 days includes the purchase time, the attribute information for the amount of a single purchase includes the purchase amount, and the attribute information for the maximum time interval between two purchases includes the time interval between purchases.
[0038] Step 202: Identify parent and child operations with a calling relationship from multiple operations in the same request chain, and establish an association relationship between the attribute information of the parent and child operations.
[0039] Specifically, based on multiple operations within the same request chain, the parent and child operations between each operation are determined. A parent-child operation is one in which a parent operation calls a child operation. The association relationship is established based on the parent and child operations, and the attribute information of the parent operation and the attribute information of the child operation are linked together.
[0040] As mentioned above, a request to query a user's credit rating requires accessing the user's recent 7-day spending history, single spending amount, and maximum spending interval information. Then, it calls the credit rating calculation and the corresponding rating levels, such as "Level A" and "Level B." When making multiple calls, various call relationships exist; for example, accessing a user's "credit rating" requires accessing their "credit score," thus creating a parent-child operation.
[0041] Step 203: Determine the transmission parameters between parent and child operations from the association relationship and construct the request message from the attribute information of the child operation.
[0042] Specifically, after determining the parent and child operations, the transmission parameters between the parent and child operations are determined based on the attribute information. The transmission parameters are used to associate the attribute information of the parent and child operations. Then, a request message is constructed based on the attribute information of the child operation and the transmission parameters.
[0043] For example, when querying a user's credit rating, after determining that calling the user's "credit rating" is the parent operation and calling "credit score" is the child operation, the "user_id" from both the parent and child operations is passed as a parameter. The attribute information in the child operation, such as the "credit score" for "user_id=123", is then used to construct a request message based on "user_id=123" and the "credit score," which is the request message "Get the credit score of user 'user_id=123'".
[0044] Step 204: Send the request message to the corresponding second interface and obtain the response message returned by the second interface.
[0045] Specifically, the request message constructed above is sent to the second interface, and a response message is obtained from the second interface. For example, if the request message "Get the credit score of user 'user_id=123'" is sent to the second interface, the second interface will respond according to the request message. For example, the response message of the second interface is {
[0046] "userid": 123, "credit_score": 850, "risk_level": "A" } That is, the user with "userid=123" has a "credit score of 850" and a "credit rating of A".
[0047] Step 205: Construct test data from the request message, response message, and passed parameters.
[0048] Specifically, such as Figure 3The image shows the constructed test data. It can be seen that this request is an HTTP request, where "http_req_body" is the request message. The "http_req_body" request message contains "appid", "userid", and "options", with "options" being "yuntrust_data", meaning the request is for "retrieving cloud data".
[0049] Among them, the parameter "userid" is a variable. When using other parameters, you only need to change the value of the parameter and do not need to change the other parameters.
[0050] In some embodiments, before determining parent and child operations with a calling relationship from multiple operations in the same request chain, the method further includes: decrypting the first lineage data and desensitizing the decrypted sensitive information.
[0051] Specifically, after obtaining the bloodline data, the bloodline data is decrypted, and in order to prevent the leakage of sensitive data, the bloodline data is anonymized.
[0052] First, a dynamic sensitive word database (containing keywords such as password, token, and key) is created, and then regular expressions are used to scan all parameter fields.
[0053] like: SENSITIVE_PATTERNS = { r “pass(word|wd|phrase)”, r “token”, r “secret”, r “auth(orization)?”, r “key”, r “credit(_?card)?\d{13,16}”, } After performing a regular expression scan, multiple layers of filtering are applied, such as: 1. Field name matching: Automatically delete fields containing sensitive keywords; 2. Value pattern matching: Delete values that match the characteristics of sensitive data (such as long random strings or encrypted data); 3. Contextual association: When a field value contains sensitive words, the associated fields are also filtered.
[0054] The above method is merely one desensitization method provided by the embodiments of this application, but it is not specifically limited. Whether to use regular expressions for matching or multi-layer filtering is only for reference.
[0055] In some embodiments, determining parent and child operations with a calling relationship from multiple operations in the same request chain includes: for any operation in the same request chain, determining parent and child operations with a calling relationship based on the tracing identifier in the operation and / or the tracing identifier of the parent operation.
[0056] Specifically, in a bloodline relationship, if a parent-child operation exists in the calling relationship, the calling relationship is determined based on the tracking identifiers of the parent-child operations. The existence of a parent-child operation is determined in the following way: One alternative implementation involves first determining the type relationship between attribute information based on the "KIND" type in the bloodline relationship, with parent and child nodes residing in different "KIND" types. For example, in the bloodline relationship, there might be "INTERNAL" and "CLIENT" types of "KIND".
[0057] Then, an index dictionary `internal_span_index` is constructed to look up `parent_span_id` and its corresponding attribute information by `span_id`, and an index dictionary `client_parent_index` is constructed to look up its corresponding attribute information by `parent_id`. The link tracing identifier `span_id` is determined in `KIND` set to `INTERNAL`. Based on the `span_id` in `INTERNAL`, a search is conducted in `KIND` set to `CLIENT` to see if `parent_span_id` is the same as `span_id`. If so, `span_id` and `parent_span_id` are corresponding parent and child operations, and their attribute information is associated and stored in `new_var_links`. `new_var_links` records information such as the HTTP request method, userid, and operation type.
[0058] If "span_id" is "abcdef" in "KIND" set to "INTERNAL", then check if "parent_span_id" is also "abcdef" in "KIND" set to "CLIENT". If they exist, then they are considered to be parent and child operations.
[0059] Another alternative implementation directly determines the parent-child relationship based on "span_id" and "parent_span_id". If the same "span_id" and "parent_span_id" exist, they are considered parent and child operations. For example, if "span_id" is "abcdef", then the lineage data is searched for a parent "span_id" that is also "abcdef". If it exists, the two are associated as parent and child operations.
[0060] In some embodiments, determining the pass parameters between parent and child operations from the association relationship includes: Attributes in a relationship whose parent operation has the same attribute value as the child operation are passed as upstream and downstream parameters; and / or attributes in a relationship that match the same parameter name rule are passed as upstream and downstream parameters.
[0061] Specifically, the parameters to be passed, such as "userid", can be determined by using attributes with the same value in parent and child operations as the parameters passed between upstream and downstream operations. For example, "userid" can be "123" for both operations. Alternatively, the parameters can be determined based on the mapping relationship in a pre-configured table, as shown in the following example: { ParansMap = { "userid": ["userid", "userld", "userids", "customerUserId", "tenantUserId"、"inviteeUserId"、"borrowerIds ], "Listingid": ['orderId', 'listingld','Riatingid'], 'appid':['applicationId','appid','appId','Apple'], 'bizid':['bizid'], 'dingid':['dingid'], 'fLow_count':['flow_count'], 'flowid':[ 'flowid'], 'Listangtime': ['endtime', 'end_time", 'startDate', 'endDate', 'applyTime'], 'options.tenantid':['tenantld',], 'options.mobile':['phone',"key'], 'options.idnumber':['access_value",'key'], 'options.clueid':['clueId"] 'options.instid':['instId'], 'options.breaktype':[], 'options.exclude_tenantids':[], 'options.otherUids': [ userId ], } The above examples illustrate a pre-configuration table provided in the embodiments of this application, but are not intended to limit this application. When it is impossible to determine the parent-child operation based on the upstream and downstream relationships according to the passed parameters, the pre-configuration table can be used to determine the relationship. Alternatively, either the pre-configuration table or other relationships can be used to determine the relationship; the embodiments of this application do not impose any limitations.
[0062] In some embodiments, after receiving the response message returned by the second interface, the method further includes: Determine the business scenario to which the request message belongs based on the response message; The request message, response message, and passed parameters are used to construct test data, including: The test data consists of the scenario identifier, request message, response message, and transmitted parameters corresponding to the business scenario.
[0063] Specifically, the response message includes the requested business scenario, and a scenario identifier corresponding to the business scenario is added when building the test data.
[0064] The scenarios can be divided into basic scenarios and abnormal scenarios. For basic scenarios, the status code returned by the response message is used to determine the status. If status_code = 200, it is a basic scenario "normal"; if status_code = 400, it is an abnormal scenario "fault".
[0065] In some embodiments, after constructing the request message, response message, and passed parameters into test data, such as Figure 4 As shown, it also includes the following steps: Step 401: Set the dynamic update flag for test data.
[0066] Step 402: Receive the second lineage data subsequently sent by the first interface.
[0067] Step 403: After determining that there is updated content in the test data based on the second bloodline data, update the test data.
[0068] Specifically, the test data also includes a dynamic update flag, such as "is_need_update". The dynamic update flag is used to determine whether the test data needs to be updated. If it needs to be updated, "is_need_update" is set to "1"; if it does not need to be updated, "is_need_update" is set to "0".
[0069] If an update is required, the interface will receive subsequent second-lineage data from the first interface and then update the data based on the second-lineage data test data. The interface receives multiple sets of lineage data; the timing of receiving lineage data can be set periodically, or it can be received irregularly based on the amount of lineage data. This application does not limit the timing or amount of lineage data received.
[0070] To understand this application, the following describes it using specific application scenarios, such as... Figure 5 As shown, the first interface is interface 1 of server a, the second interface is interface 2 of server b, and the test is performed on server c. The business scenario is "user a's credit rating", which includes the following steps: Step 501: Server C obtains the lineage data of Interface 1. The lineage data includes request trace_1, which contains operations such as "Query user A's credit rating", "Query user A's credit score", "Number of transactions in the last 7 days", "Single transaction amount", and "Maximum transaction time interval".
[0071] Step 502: Decrypt and desensitize the bloodline data.
[0072] Step 503: Traverse the lineage data and determine the "span_id=123" of type "INTERNAL" under the "KIND" in the request link trace_1.
[0073] Step 504: Based on "span_id=123", search under "KIND" of type "CLIENT" to see if "parent_span_id =123" exists in "parent_span_id". If it exists, proceed to step 505; otherwise, proceed to step 509.
[0074] Step 505: If it exists, construct two indices, “internal_span_index” and “client_parent_index”, and pass “123” as the parameter.
[0075] Step 506: Determine the attribute information of "span_id=123" and "parent_span_id =123" based on the passed parameter "123".
[0076] Step 507: Associate the attribute information of “span_id=123” and “parent_span_id =123” to obtain the request message of “new_var_links”.
[0077] Step 508: Determine the parameters of interface 2 based on "new_var_links" to assemble a complete HTTP request.
[0078] Step 509: Obtain the response message from Interface 2.
[0079] Step 510: Determine the business scenario of the request message as "querying user a's credit rating" based on the response message.
[0080] Step 511: Construct test data based on request messages, response messages, transmitted parameters, and business scenarios.
[0081] Step 512: Determine the value of "is_need_update" in the test data; Step 513: If the value is "1", the test data will be updated when other bloodline data is received; if the value is "0", the test data will not be updated when other bloodline data is received.
[0082] Based on the same technical concept, embodiments of this application provide a test data construction apparatus, such as... Figure 6 As shown, the device 600 includes: The receiving module 601 is used to receive first lineage data sent by the first interface; wherein the lineage data includes multiple operations for at least one request link; each operation includes its own attribute information; The association module 602 is used to determine parent and child operations with a calling relationship from multiple operations in the same request chain, and to establish an association relationship between the attribute information of the parent and child operations. The determining module 603 is used to determine the transmission parameters between parent and child operations from the association relationship and to construct a request message from the attribute information of the child operation; The sending module 604 is used to send the request message to the corresponding second interface and obtain the response message returned by the second interface; The construction module 605 is used to construct test data from the request message, the response message, and the transmission parameters.
[0083] Optionally, the association module 602 is further configured to: The first bloodline data is decrypted, and the sensitive information after decryption is anonymized.
[0084] Optionally, the association module 602 is specifically used for: For any operation in the same request chain, the parent and child operations with a calling relationship are determined based on the tracing identifier in the operation and / or the tracing identifier of the parent operation.
[0085] Optionally, the determining module 603 is specifically used for: In the aforementioned relationship, attributes whose parent operation has the same attribute value as the child operation are used as upstream and downstream transmission parameters; and / or Attributes that conform to the same parameter name rule in the aforementioned relationship will be used as parameters for upstream and downstream transmission.
[0086] Optionally, the sending module 604 is specifically used for: The business scenario to which the request message belongs is determined based on the response message; The request message, the response message, and the transmitted parameters are used to construct test data, including: The scenario identifier corresponding to the business scenario, the request message, the response message, and the transmission parameters are used to construct test data.
[0087] Optionally, the construction module 605 is specifically used for: Set a dynamic update flag for the test data; Receive the second lineage data subsequently sent by the first interface; After determining that there is updated content in the test data based on the second bloodline data, the test data is updated.
[0088] Based on the same technical concept, embodiments of this application provide a computer device, which may be a terminal or a server, such as... Figure 7 As shown, it includes at least one processor 701 and a memory 702 connected to at least one processor. In this embodiment, the specific connection medium between the processor 701 and the memory 702 is not limited. Figure 7 Taking the connection between processor 701 and memory 702 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.
[0089] In this embodiment of the application, the memory 702 stores instructions that can be executed by at least one processor 701. By executing the instructions stored in the memory 702, at least one processor 701 can perform the steps included in the above-described test data construction method.
[0090] The processor 701 is the control center of the computer device, capable of connecting various parts of the computer device via various interfaces and lines. It executes instructions stored in the memory 702 and retrieves data stored in the memory 702. Optionally, the processor 701 may include one or more processing units. The processor 701 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.
[0091] The processor 701 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0092] Memory 702, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 702 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 702 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 702 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0093] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a computer device, which, when run on the computer device, causes the computer device to perform the steps of the above-described test data construction method.
[0094] Based on the same inventive concept, this application provides a computer program product, characterized in that the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer device, the computer device performs the steps of the above-described test data construction method.
[0095] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0096] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0097] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0098] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0099] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A test data construction method, characterized by, The method comprises the following steps: receiving first bloodline data sent by a first interface; wherein the bloodline data comprises a plurality of operations for at least one request link; any operation comprises respective attribute information; determining parent-child operations with a calling relationship from the plurality of operations of the same request link, and establishing an association between the respective attribute information of the parent-child operations; determining a transmission parameter between the parent-child operations from the association and constructing a request message from the attribute information of the child operation; sending the request message to a corresponding second interface and obtaining a response message returned by the second interface; constructing the request message, the response message and the transmission parameter into test data.
2. The method of claim 1, wherein, Before the step of determining parent-child operations with a calling relationship from the plurality of operations of the same request link, the method further comprises the following steps: decrypting the first bloodline data, and desensitizing the decrypted sensitive information.
3. The method of claim 1, wherein, The step of determining parent-child operations with a calling relationship from the plurality of operations of the same request link comprises the following step: for any operation of the same request link, determining parent-child operations with a calling relationship according to the tracking identifier in the operation and / or the tracking identifier of the parent operation.
4. The method of claim 1, wherein, The step of determining a transmission parameter between the parent-child operations from the association comprises the following steps: taking an attribute with the same attribute value of the parent operation and the child operation in the association as an upstream-downstream transmission parameter; and / or taking an attribute with the same parameter name rule in the association as an upstream-downstream transmission parameter.
5. The method according to any one of claims 1 to 4, characterized in that, After the step of obtaining the response message returned by the second interface, the method further comprises the following steps: determining a business scenario to which the request message belongs according to the response message; constructing the request message, the response message and the transmission parameter into test data comprises the following step: constructing a scenario identifier corresponding to the business scenario, the request message, the response message and the transmission parameter into test data.
6. The method according to any one of claims 1 to 4, wherein After the step of constructing the request message, the response message and the transmission parameter into test data, the method further comprises the following steps: setting a dynamic update identifier of the test data; receiving second bloodline data sent by the first interface subsequently; updating the test data after determining that there is update content in the test data according to the second bloodline data.
7. A test data construction apparatus characterized by comprising: The method comprises the following steps: a receiving module, configured to receive first bloodline data sent by a first interface; wherein the bloodline data comprises a plurality of operations for at least one request link; any operation comprises respective attribute information; an association module, configured to determine parent-child operations with a calling relationship from the plurality of operations of the same request link, and establish an association between the respective attribute information of the parent-child operations; a determination module, configured to determine a transmission parameter between the parent-child operations from the association and construct a request message from the attribute information of the child operation; a sending module, configured to send the request message to a corresponding second interface and obtain a response message returned by the second interface; a construction module, configured to construct the request message, the response message and the transmission parameter into test data.
8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the method of any one of claims 1-6 when executing the program. The processor implements the steps of the method of any one of claims 1-6 when executing the program.
9. A computer-readable storage medium, characterized in that, a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions that, when executed by a computer device, cause the computer device to perform the steps of the method of any one of claims 1-6.
10. A computer program product, characterised in that,
Citation Information
Patent Citations
Method and device for constructing test data
CN120216487A
Data blood relationship establishing method and device, electronic equipment, storage medium and program product
CN120491939A
Test method, device, equipment, medium and program product
CN120750822A