Test data construction method and apparatus
By generating test data by splitting and combining synchronous and asynchronous sub-tool tasks, the problem of data construction in complex scenarios is solved, improving testing and delivery efficiency. It is suitable for both manual and automated testing.
Patent Information
- Application Number
- CN202410051509.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-12
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2044-01-12
AI Technical Summary
During business testing, complex scenarios present significant challenges in data construction, impacting project delivery cycles and incurring high maintenance costs. Furthermore, different roles have stringent quality assurance requirements for their data needs.
The user-submitted scenario tasks are broken down into a set of sub-tool tasks. Test data is generated by calling synchronous and asynchronous sub-tool tasks, including a combination of the direct running results of synchronous tools and the results of asynchronous callbacks.
It improves the efficiency of data construction in the business testing process, reduces the phenomenon of reinventing the wheel, improves delivery efficiency, and is suitable for both manual and automated testing.
Smart Images

Figure CN117880144B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of business testing technology, specifically the field of test data construction technology. Background Technology
[0002] Business testing is inseparable from data. Different test objects (e.g., business-side global WAN services, backend server services, client applications, etc.), different testing methods (e.g., functional testing, performance testing, integration testing, big data comparison, etc.), and different test categories (e.g., manual, automated, intelligent testing, etc.) all have relevant test data requirements. Even logging into a test website requires account data.
[0003] Internet service testing requires a wide variety of data, including specific data related to numerous business characteristics, such as different types of materials, items, and orders in information delivery; data returned from external dependencies of internal systems, such as audit data and query volume; and various report data, such as business performance reports and statistical reports.
[0004] As an essential part of the delivery process, various stakeholders, including product managers, R&D engineers, test development engineers, and outsourcing personnel, all face these data requirements. Some complex scenarios present significant challenges in data construction, impacting project delivery cycles, while also demanding high quality assurance standards and incurring substantial maintenance costs. Summary of the Invention
[0005] This disclosure provides a method, apparatus, device, storage medium, and program product for constructing test data.
[0006] In a first aspect, embodiments of this disclosure propose a test data construction method, comprising: splitting a user-submitted scenario task into a set of sub-tool tasks; for synchronous sub-tool tasks in the set of sub-tool tasks, calling the corresponding synchronous tool based on the input parameters of the synchronous tool sub-task to obtain synchronous running results; for asynchronous sub-tool tasks in the set of sub-tool tasks, obtaining the callback interface of the asynchronous sub-tool task to obtain asynchronous callback results; and generating test data for the scenario task based on the synchronous running results and the asynchronous callback results.
[0007] Secondly, embodiments of this disclosure propose a test data construction apparatus, comprising: a task splitting module configured to split a user-submitted scenario task into a set of sub-tool tasks; a synchronous execution module configured to, for synchronous sub-tool tasks in the set of sub-tool tasks, call the corresponding synchronous tool based on the input parameters of the synchronous tool sub-tool tasks to obtain synchronous execution results; an asynchronous callback module configured to, for asynchronous sub-tool tasks in the set of sub-tool tasks, obtain the callback interface of the asynchronous sub-tool tasks to obtain asynchronous callback results; and a data generation module configured to, based on the synchronous execution results and the asynchronous callback results, generate test data for the scenario task.
[0008] Thirdly, embodiments of this disclosure provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
[0009] Fourthly, embodiments of this disclosure provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method as described in the first aspect.
[0010] Fifthly, embodiments of this disclosure provide a computer program product including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0011] This disclosure provides a scenario-based, efficient data construction method that can effectively improve the efficiency of data construction during business testing, including both manual and automated testing. It successfully reduces the phenomenon of reinventing the wheel and improves delivery efficiency.
[0012] The key or essential features of the embodiments disclosed herein are not intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0013] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. The drawings are provided for a better understanding of the invention and are not intended to limit the scope of this disclosure. Wherein:
[0014] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0015] Figure 2 This is a flowchart of one embodiment of the test data construction method according to this disclosure;
[0016] Figure 3This is a flowchart of yet another embodiment of the test data construction method based on this disclosure;
[0017] Figure 4 It is a comparison chart of the advantages and disadvantages of different test data construction methods;
[0018] Figure 5 It is a platform-based layered diagram;
[0019] Figure 6 This is an example image of the tool registration process;
[0020] Figure 7 This is an example image of scene stitching;
[0021] Figure 8 It is a scenario-based construction and usage flowchart;
[0022] Figure 9 This is a flowchart of the scene tool scheduling process;
[0023] Figure 10 This is a schematic diagram of one embodiment of the apparatus for constructing test data based on the present disclosure;
[0024] Figure 11 This is a block diagram of an electronic device used to implement the test data construction method of the embodiments of this disclosure. Detailed Implementation
[0025] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0026] It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0027] Figure 1 An exemplary system architecture 100 to which this application can be applied is shown.
[0028] like Figure 1 As shown, system architecture 100 may include terminal device 101, network 102, and server 103. Network 102 is used as a medium to provide a communication link between terminal device 101 and server 103. Network 102 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0029] Terminal device 101 interacts with server 103 via network 102 to receive or send messages, etc. Various client applications, such as business testing applications, can be installed on terminal device 101.
[0030] Terminal device 101 can be hardware or software. When terminal device 101 is hardware, it can be various electronic devices, including but not limited to smartphones, tablets, laptops, and desktop computers. When terminal device 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software programs or software modules (e.g., multiple software programs or software modules used to provide distributed services) or as a single software program or software module. No specific limitations are made here.
[0031] Server 103 can be a server that provides various services, such as a backend server for autonomous driving simulation applications. Server 103 can analyze and process the received driving information of the host vehicle and obstacle vehicles, and generate processing results (such as vehicle interaction scenarios).
[0032] It should be noted that server 103 can be either hardware or software. When server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 103 is software, it can be implemented as multiple software programs or software modules (e.g., used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0033] It should be noted that the test data construction method or test data construction model training method provided in the embodiments of this application are generally executed by the server 103, and correspondingly, the test data construction device or test data construction model training device is generally set in the server 103.
[0034] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0035] Continue to refer to Figure 2 The diagram illustrates a flow 200 of an embodiment of a test data construction method according to the present disclosure. The test data construction method includes the following steps:
[0036] Step 201: Break down the user-submitted scenario task into a set of sub-tool tasks.
[0037] In this embodiment, the execution body of the test data construction method (e.g.) Figure 1 The server 103 shown can obtain the scene tasks submitted by the user and split the scene tasks into a set of sub-tool tasks.
[0038] Typically, user-submitted scenario tasks are quite complex, requiring multiple data construction tools to construct the test data. Therefore, scenario tasks can be broken down into a set of sub-tool tasks. This set can include multiple sub-tool tasks, and each sub-tool task can be completed by a single data construction tool. Data construction tools can include, but are not limited to, storage, messaging, and traffic tools.
[0039] Step 202: For the synchronization sub-tool task in the sub-tool task set, call the corresponding synchronization tool based on the input parameters of the synchronization tool sub-task to obtain the synchronization result.
[0040] In this embodiment, for the synchronization sub-tool task in the sub-tool task set, the aforementioned execution entity can call the corresponding synchronization tool based on the input parameters of the synchronization tool sub-task to obtain the synchronization result.
[0041] Among them, the data construction tool whose construction time is no greater than a preset time threshold is the synchronization tool. Because of its short construction time, the synchronization tool can be directly called and run according to the input parameters to obtain the synchronization result.
[0042] Step 203: For the asynchronous sub-tool tasks in the sub-tool task set, obtain the callback interface of the asynchronous sub-tool task and get the asynchronous callback result.
[0043] In this embodiment, for asynchronous sub-tool tasks in the sub-tool task set, the aforementioned execution entity can obtain the callback interface of the asynchronous sub-tool task and get the asynchronous callback result.
[0044] Among them, data construction tools whose construction time exceeds a preset time threshold are asynchronous tools. For asynchronous tools, due to their long construction time, their callback interfaces can be obtained, and synchronous execution results can be obtained through the callback interfaces.
[0045] If a scenario task contains data constructed by an asynchronous tool, then the scenario task is an asynchronous scenario; if a scenario task does not contain data constructed by an asynchronous tool, then the scenario task is a synchronous scenario.
[0046] In some embodiments, after obtaining the callback interface of the asynchronous sub-tool task, the execution of the asynchronous sub-tool task can be exited directly without blocking the thread. Subsequently, a single-threaded asynchronous callback thread can be added specifically to handle asynchronous callbacks and obtain the asynchronous callback results.
[0047] In some embodiments, after a scenario task is split into a set of sub-tool tasks, the set of sub-tool tasks can be added to a queue; the queue can be read to retrieve incomplete sub-tool tasks for synchronous execution or asynchronous callback; and after a sub-tool task has completed execution, the running status of the sub-tool tasks in the queue can be updated. The queue can be a Redis (RemoteDictionary Server) used to record the set of sub-tool tasks into which the scenario task is split, and the running status of the sub-tool tasks within that set.
[0048] Step 204: Based on the synchronous execution results and asynchronous callback results, generate test data for the scenario task.
[0049] In this embodiment, the aforementioned execution entity can generate test data for the scenario task based on synchronous execution results and asynchronous callback results. Specifically, the test data for the scenario task can be obtained by combining the synchronous execution results and asynchronous callback results.
[0050] This disclosure provides a scenario-based, efficient data construction method that can effectively improve the efficiency of data construction during business testing, including both manual and automated testing. It successfully reduces the phenomenon of reinventing the wheel and improves delivery efficiency.
[0051] Further reference Figure 3 The diagram illustrates a flow 300 of an embodiment of a test data construction method according to the present disclosure. The test data construction method includes the following steps:
[0052] Step 301: Encapsulate the various data construction tools into interfaces.
[0053] In this embodiment, the execution body of the test data construction method (e.g.) Figure 1 The server 103 shown can encapsulate various data construction tools into interfaces.
[0054] Here, commonly used data construction methods such as storage, messaging, and traffic are uniformly encapsulated into interfaces. This standardizes the construction methods and allows for unified codebase management, facilitating tool reuse and management. Most common data construction methods can be implemented programmatically. To reduce the learning curve for business users, a unified external method call can be implemented, encapsulating storage, messaging, and traffic construction methods into interfaces. Specifically, data construction tools with construction times no greater than a preset time threshold are encapsulated as synchronous interfaces. Data construction tools with construction times exceeding the preset time threshold are encapsulated as asynchronous interfaces, triggered by tasks. Furthermore, interface-based tools facilitate subsequent platformization, lowering the user's learning curve.
[0055] Figure 4A comparison chart showing the advantages and disadvantages of different test data construction methods is presented.
[0056] The page construction method involves obtaining the required data through platform page operations. Its advantages are: simplicity and directness, data sourced from real business processes, and frequent use in manual testing; its disadvantages are low efficiency, unsuitability for automation, and unsuitability for batch data generation.
[0057] For storage construction methods, direct manipulation of storage is possible, such as with Baidu, Palo Alpha, and MySQL. The advantages are higher efficiency and greater suitability for reporting large datasets; the disadvantages are a high level of business acumen required, and potential inconsistencies between tables and fields.
[0058] Regarding message construction methods, options include constructing Kafka and Burp Suite messages. The advantage is that microservice message middleware can directly construct messages, reducing reliance on testing; the disadvantages are essentially the same as storage construction methods.
[0059] Regarding traffic structure methods, online analysis of traffic or data involves direct use, filtering, and customization. The advantage is the rapid preparation of diverse big data for stress, stability, and comparative testing; the disadvantage is that it's not suitable for functional testing and has limited boundary value data.
[0060] Regarding interface construction methods, constructing data via APIs (Application Programming Interfaces) is a common approach for web applications. Its advantages include the ability to quickly construct pages through parameter combinations, but it's less effective at data construction and is easy to automate. The disadvantages are that it's unsuitable for scenarios without APIs, and generally requires calling multiple APIs to achieve the desired result.
[0061] Step 302: Register the various encapsulated data construction tools and add attribute information.
[0062] In this embodiment, the aforementioned execution entity can be registered with various encapsulated data construction tools and have attribute information added.
[0063] Figure 5 The diagram illustrates a platform-based hierarchical structure. Tool management is platformized. A tool registration service is provided, allowing tools to be tagged for easier access. Different tools across different business functions require unified management, enabling users to quickly and easily find the tools they need, avoiding reinventing the wheel. Therefore, the platform needs to provide tool registration and search functions. Simultaneously, the platform also supports visual tool assembly and scene registration. For complex scene construction, there's no need to write code to connect related tools; users can directly operate through the platform.
[0064] Figure 6The example diagram shows a tool registration example. Tools are now standardized to an API interface. During the tool registration process, attribute information needs to be added for easier subsequent searching. This attribute information may include, but is not limited to, at least one of the following: tool name, tool type, tool identifier, tool usage description, search tags, product line to which the tool belongs, API execution method, tool owner, etc. When users need to check if a tool already exists, they can directly filter and search for the desired tool on the platform using the multi-dimensional attribute information.
[0065] Step 303: Record the registered data construction tool into the tool table of the base table.
[0066] In this embodiment, the aforementioned execution entity can record the registered data construction tool into the tool table of the base table.
[0067] Step 304: Create a new scene based on the scene configuration input by the user, and combine at least two registered data construction tools into the scene to generate a scene tool.
[0068] In this embodiment, the aforementioned execution entity can create a new scenario based on the scenario configuration input by the user, and concatenate at least two registered data construction tools in the scenario to generate a scenario tool.
[0069] Figure 7 The diagram illustrates a scenario stitching example. Complex scenarios can be stitched together without requiring code submissions. The configuration-based stitching function allows for the interconnection of tools, improving scenario construction efficiency and reducing maintenance costs. For example, when two scenarios require interface A (e.g., A->B, A->C), if the business interface A changes, only one atomic tool, A, needs to be upgraded. Similarly, to stitch existing tools A and B together to form a complex scenario tool C, tools A and B only need to be registered on the platform, and then a new scenario C can be created to connect tools A and B.
[0070] During the assembly process, the sources of input parameters for the data construction tool may include, but are not limited to: obtaining user-filled data from the scenario task as parameters for the data construction tool to execute; obtaining data from the results of the preceding data construction tool, with the specific value path defined by the scenario template designer during the development phase, so that the user is unaware of it when creating the task.
[0071] After constructing the complex visualization scenario, the next step is to trigger its execution and provide it to the user. The data construction platform provides the triggering, scheduling, and result viewing of scenario tasks.
[0072] Figure 8 The diagram illustrates the complete process of scenario-based construction, which mainly includes:
[0073] 1. The platform provides visual registration tools and scenarios, supporting the combination and scheduling of synchronous and asynchronous tools. When an asynchronous tool is present in a combined scenario, that scenario is also asynchronous.
[0074] 2. The middle platform records the scene splicing configuration and provides scene triggering APIs to tool builders for triggering.
[0075] 3. Trigger Construction. If the goal is to lower the barrier to entry for each role to use their tools, a scene trigger page can be designed to call the trigger API, allowing users to visually submit construction requirements; if automation is required, the scene trigger API can be called directly.
[0076] 4. Result Acquisition. In synchronous scenarios, the scenario execution result can be directly obtained, indicating successful data construction. In asynchronous scenarios, the result retrieval API can be called to poll for asynchronous results. If the result is abnormal, it can be viewed through the scenario task table to trace the running status of individual tools within the scenario, facilitating troubleshooting.
[0077] 5. Continue with subsequent tests.
[0078] Figure 9 The flowchart for the scene tool scheduling process is shown.
[0079] like Figure 9 As shown, platformization involves the web application layer and the data middleware layer. After successful registration of tools and scenarios, they are recorded in the tool table and scenario table of the base tables. After a scenario task is submitted, the tool task is split and directly entered into the scenario task table and sub-tool task table of the running table. The scenario data construction platform is responsible for scheduling and running scenario tasks.
[0080] 1. Add the scenario task to the Redis queue for later execution.
[0081] 2. Read the Redis queue to retrieve unfinished sub-tool tasks.
[0082] 3. Synchronous tools are called and run directly according to the input parameters; when encountering asynchronous sub-tool tasks, after obtaining the callback API, the subsequent sub-tool tasks are exited directly without blocking the thread.
[0083] 4. Add a single-threaded asynchronous callback thread, which is specifically responsible for asynchronous callbacks, obtaining callback results, and adding Redis records to notify subsequent sub-tool tasks to run.
[0084] Step 305: Record the scene tools into the scene table in the base table.
[0085] In this embodiment, the aforementioned execution entity can record the scene tools into the scene table of the base table.
[0086] Step 306: Break down the user-submitted scenario task into a set of sub-tool tasks.
[0087] Step 307: For the synchronization sub-tool task in the sub-tool task set, call the corresponding synchronization tool based on the input parameters of the synchronization tool sub-task to obtain the synchronization result.
[0088] Step 308: For the asynchronous sub-tool tasks in the sub-tool task set, obtain the callback interface of the asynchronous sub-tool task and get the asynchronous callback result.
[0089] Step 309: Based on the synchronous execution results and asynchronous callback results, generate test data for the scenario task.
[0090] In this embodiment, the specific operations of steps 306-309 have been described. Figure 2 Steps 201-204 in the illustrated embodiments are described in detail and will not be repeated here.
[0091] This disclosure provides a scenario-based, efficient data construction method that can effectively improve the efficiency of data construction during business testing, including both manual and automated testing. It successfully reduces the phenomenon of reinventing the wheel and improves delivery efficiency.
[0092] Further reference Figure 10 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a test data construction apparatus, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0093] like Figure 10 As shown, the test data construction device 1000 of this embodiment may include: a task splitting module 1001, a synchronous running module 1002, an asynchronous callback module 1003, and a data generation module 1004. The task splitting module 1001 is configured to split the user-submitted scene task into a set of sub-tool tasks; the synchronous running module 1002 is configured to, for the synchronous sub-tool tasks in the sub-tool task set, call the corresponding synchronous tool based on the input parameters of the synchronous tool sub-tasks to obtain synchronous running results; the asynchronous callback module 1003 is configured to, for the asynchronous sub-tool tasks in the sub-tool task set, obtain the callback interface of the asynchronous sub-tool tasks to obtain asynchronous callback results; and the data generation module 1004 is configured to, based on the synchronous running results and the asynchronous callback results, generate test data for the scene task.
[0094] In this embodiment, the specific processing of the task splitting module 1001, synchronous running module 1002, asynchronous callback module 1003, and data generation module 1004 in the test data construction device 1000, and the resulting technical effects, can be found in reference to [reference needed]. Figure 2 The relevant descriptions of steps 201-204 in the corresponding embodiments will not be repeated here.
[0095] In some optional implementations of this embodiment, the asynchronous callback module 1003 is further configured to: after obtaining the callback interface of the asynchronous sub-tool task, exit the execution of the asynchronous sub-tool task; add a single-threaded asynchronous callback thread, perform asynchronous callback, and obtain the asynchronous callback result.
[0096] In some optional implementations of this embodiment, the test data construction device 1000 further includes: a queue addition module configured to add a set of sub-tool tasks to a queue; and a queue update module configured to read the queue, obtain unfinished sub-tool tasks for execution, and update the running status of the sub-tool tasks in the queue after the sub-tool tasks have been executed.
[0097] In some optional implementations of this embodiment, the test data construction apparatus 1000 further includes an interface encapsulation module configured to encapsulate various data construction tools into interfaces respectively.
[0098] In some optional implementations of this embodiment, the interface encapsulation module is further configured to: encapsulate data construction tools with a construction time greater than a preset time threshold into an asynchronous interface; and encapsulate data construction tools with a construction time not greater than a preset time threshold into a synchronous interface.
[0099] In some optional implementations of this embodiment, the test data construction device 1000 further includes: a tool registration module, configured to register various encapsulated data construction tools and add attribute information, wherein the attribute information includes at least one of the following: tool name, tool type, tool identifier, tool purpose description, search and use tags, product line to which the tool belongs, tool interface execution method, and tool owner; and a tool recording module, configured to record the registered data construction tools in the tool table of the base table.
[0100] In some optional implementations of this embodiment, the test data construction device 1000 further includes: a scene generation module, configured to create a new scene based on the scene configuration input by the user, and to concatenate at least two registered data construction tools in the scene to generate a scene tool; and a scene recording module, configured to record the scene tool into the scene table of the base table.
[0101] In some optional implementations of this embodiment, the test data construction device 1000 further includes: during the splicing process, the source of the input parameters of the data construction tool includes at least one of the following: parameters filled in by the user from the scenario task, and parameters obtained from the value retrieval path of the data construction tool.
[0102] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0103] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0104] Figure 11 A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0105] like Figure 11 As shown, device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1102 or a computer program loaded from storage unit 1108 into random access memory (RAM) 1103. The RAM 1103 may also store various programs and data required for the operation of device 1100. The computing unit 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Input / output (I / O) interface 1105 is also connected to bus 1104.
[0106] Multiple components in device 1100 are connected to I / O interface 1105, including: input unit 1106, such as keyboard, mouse, etc.; output unit 1107, such as various types of monitors, speakers, etc.; storage unit 1108, such as disk, optical disk, etc.; and communication unit 1109, such as network card, modem, wireless transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0107] The computing unit 1101 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1101 performs the various methods and processes described above, such as the test data construction method. For example, in some embodiments, the test data construction method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by the computing unit 1101, one or more steps of the test data construction method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform a test data construction method by any other suitable means (e.g., by means of firmware).
[0108] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0109] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0110] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0112] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0113] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, distributed system servers, or servers incorporating blockchain technology.
[0114] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.
[0115] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for constructing test data, comprising: The user-submitted scenario tasks are broken down into a set of sub-tool tasks; For the synchronization sub-tool task in the set of sub-tool tasks, the corresponding synchronization tool is called based on the input parameters of the synchronization sub-tool task to obtain the synchronization result; For the asynchronous sub-tool tasks in the set of sub-tool tasks, obtain the callback interface of the asynchronous sub-tool task and get the asynchronous callback result; Based on the synchronous execution results and the asynchronous callback results, test data for the scenario task is generated.
2. The method according to claim 1, wherein, The step of obtaining the callback interface for the asynchronous sub-tool task and obtaining the asynchronous callback result includes: After obtaining the callback interface of the asynchronous sub-tool task, exit the execution of the asynchronous sub-tool task; Add a single-threaded asynchronous callback thread to perform the asynchronous callback and obtain the asynchronous callback result.
3. The method according to claim 2, wherein, The method further includes: Add the set of sub-tool tasks to the queue; Read the queue, retrieve unfinished sub-tool tasks for execution, and update the running status of the sub-tool tasks in the queue after the sub-tool tasks have been completed.
4. The method according to claim 1, wherein, The method further includes: Various data construction tools are encapsulated into interfaces.
5. The method according to claim 4, wherein, The process of encapsulating various data construction tools into interfaces includes: Encapsulate data construction tools whose construction time exceeds a preset time threshold into an asynchronous interface; The data construction tool with a construction time not exceeding a preset time threshold is encapsulated into a synchronous interface.
6. The method according to claim 5, wherein, The method further includes: Register the various encapsulated data construction tools and add attribute information, wherein the attribute information includes at least one of the following: tool name, tool type, tool identifier, tool purpose description, search and usage tags, product line to which the tool belongs, tool interface execution method, and tool owner; The registered data construction tools are recorded in the tool table of the base table.
7. The method according to claim 6, wherein, The method further includes: Create a new scenario based on the scenario configuration input by the user, and combine at least two registered data construction tools into the scenario to generate a scenario tool; The scene tools are recorded in the scene table of the base table.
8. The method according to claim 7, wherein, During the splicing process, the input parameters of the data construction tool may come from at least one of the following sources: parameters filled in by the user from the scenario task, and parameters obtained from the value retrieval path of the data construction tool.
9. A test data construction apparatus, comprising: The task splitting module is configured to split user-submitted scenario tasks into a set of sub-tool tasks; The synchronization module is configured to call the corresponding synchronization tool based on the input parameters of the synchronization sub-tool task in the set of sub-tool tasks, and obtain the synchronization result. The asynchronous callback module is configured to obtain the callback interface of the asynchronous sub-tool task in the set of sub-tool tasks and get the asynchronous callback result; The data generation module is configured to generate test data for the scenario task based on the synchronous execution results and the asynchronous callback results.
10. The apparatus according to claim 9, wherein, The asynchronous callback module is further configured to: After obtaining the callback interface of the asynchronous sub-tool task, exit the execution of the asynchronous sub-tool task; Add a single-threaded asynchronous callback thread to perform the asynchronous callback and obtain the asynchronous callback result.
11. The apparatus according to claim 10, wherein, The device further includes: The queue addition module is configured to add the set of sub-tool tasks to the queue; The queue update module is configured to read the queue, retrieve unfinished sub-tool tasks for execution, and update the running status of the sub-tool tasks in the queue after the sub-tool tasks have been executed.
12. The apparatus according to claim 9, wherein, The device further includes: The interface encapsulation module is configured to encapsulate various data construction tools into interfaces.
13. The apparatus according to claim 12, wherein, The interface encapsulation module is further configured to: Encapsulate data construction tools whose construction time exceeds a preset time threshold into an asynchronous interface; The data construction tool with a construction time not exceeding a preset time threshold is encapsulated into a synchronous interface.
14. The apparatus according to claim 13, wherein, The device further includes: The tool registration module is configured to register various encapsulated data construction tools and add attribute information, wherein the attribute information includes at least one of the following: tool name, tool type, tool identifier, tool purpose description, search and usage tags, product line to which the tool belongs, tool interface execution method, and tool owner; The tool recording module is configured to record the registered data construction tools in the tool table of the base table.
15. The apparatus according to claim 14, wherein, The device further includes: The scene generation module is configured to create a new scene based on the scene configuration input by the user, and to concatenate at least two registered data construction tools in the scene to generate a scene tool; The scene recording module is configured to record the scene tools into the scene table of the base table.
16. The apparatus according to claim 15, wherein, During the splicing process, the input parameters of the data construction tool may come from at least one of the following sources: parameters filled in by the user from the scenario task, and parameters obtained from the value retrieval path of the data construction tool.
17. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-8.
19. A computer program product comprising a computer program that, when executed by a processor, implements the method of any one of claims 1-8.
Citation Information
Patent Citations
Asynchronous task processing method and device
CN103019806A
Method and device for automatically generating test data based on historical data
CN117234832A
