Service testing method and system based on simulation environment, computing equipment and medium
By using the request files generated by the production environment to treat the online service in the simulation environment, the problem of difficulty in fully covering automated test cases is solved, and testing that is closer to actual scenarios and timely discovery and correction of potential problems is achieved.
Patent Information
- Application Number
- CN202411959430.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-11
AI Technical Summary
During the software update iteration process, the newly introduced service code is difficult to fully cover all paths and potential problems through automated test cases, resulting in insufficient comprehensive testing.
By obtaining online requests in the production environment, a request file is generated for service testing, and the online services and services to be launched are tested in the simulation environment, and the test results are obtained for comparison and analysis.
The service code of the online service is tested closer to the actual operation scenario, comprehensively evaluate the possible problems in the actual operation scenario, timely discover and correct potential problems, and ensure that the service can meet the expected quality and performance requirements after it is officially launched.
Smart Images

Figure CN119807065A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and specifically to a service testing method, system, computing device and medium based on a simulation environment. Background Art
[0002] In the daily update and iteration process of software, new service codes often need to be introduced, and the newly introduced service codes are often accompanied by increased potential risks. In order to ensure that the project can run stably before it is officially launched, the newly introduced service codes are usually tested using automated test cases. This approach improves testing efficiency. However, due to the limitations of test design and the increase in code complexity, it is often difficult to fully cover all newly introduced service code paths and potential problems using automated test cases. Therefore, how to conduct more comprehensive testing of new service codes has become an urgent problem to be solved. Summary of the invention
[0003] In view of the above problems, the present application is proposed to provide a service testing method, system, computing device and medium based on a simulation environment that overcome the above problems or at least partially solve the above problems.
[0004] According to one aspect of an embodiment of the present application, a service testing method based on a simulation environment is provided, comprising:
[0005] Obtain online requests in the production environment, and generate request files for service testing based on online requests;
[0006] Execute the test task, use the request file to test the online service and the service to be launched in the simulation environment, and obtain the test results corresponding to the online service and the service to be launched;
[0007] Compare the test results corresponding to the online service with the test results corresponding to the service to be launched to obtain comparative analysis results.
[0008] Furthermore, obtaining an online request in a production environment and generating a request file for service testing according to the online request further includes:
[0009] Sample online requests in the production environment and store them in the message system;
[0010] Obtain online requests from the message system, modify the online requests to form test request samples, and aggregate the test request samples according to time granularity to obtain request files.
[0011] Furthermore, modifying the online request to form a test request sample further includes:
[0012] The request identifier of the online request is modified, and an experimental identifier is added to the online request to form a test request sample.
[0013] Furthermore, before executing the test task, the method further includes:
[0014] Generate a test task according to the user's setting information for the test task setting items, and add the test task to the message queue; wherein the test task includes: stress testing task and playback task.
[0015] Further, executing the test task, using the request file to test the online service and the service to be launched in the simulation environment respectively, and obtaining the test results corresponding to the online service and the test results corresponding to the service to be launched further includes:
[0016] When the test appointment time is reached, the request task consumer consumes the test task in the message queue through the scheduled task, and obtains the target request file corresponding to the test task from the request file;
[0017] Send the test request sample in the target request file to the online service in the simulation environment for processing, so as to test the online service and obtain the test result corresponding to the online service;
[0018] The test request sample in the target request file is sent to the service to be launched in the simulation environment for processing, so as to test the service to be launched and obtain the test result corresponding to the service to be launched.
[0019] Furthermore, the comparative analysis results include: request processing result analysis information, server performance indicator analysis information, and query rate per second analysis information.
[0020] According to another aspect of an embodiment of the present application, a service testing system based on a simulation environment is provided, including:
[0021] A generation module is suitable for obtaining online requests in a production environment and generating request files for service testing based on online requests;
[0022] The test module is suitable for executing the test task, using the request file to test the online service and the service to be launched in the simulation environment respectively, and obtaining the test results corresponding to the online service and the service to be launched;
[0023] The comparison module is suitable for comparing the test results corresponding to the online service with the test results corresponding to the service to be launched, so as to obtain a comparative analysis result.
[0024] According to another aspect of the embodiment of the present application, there is provided a computing device, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0025] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned service testing method based on the simulation environment.
[0026] According to another aspect of the embodiments of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned service testing method based on a simulation environment.
[0027] According to another aspect of the embodiments of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the above-mentioned service testing method based on a simulation environment.
[0028] According to the technical solution provided in the embodiment of the present application, online requests in the production environment are applied to the testing process of the services to be launched. Not only can a large number of test request samples be easily obtained through automated means, providing strong data support for the testing work, effectively reducing the workload of testers and achieving efficient testing, but also the service code of the services to be launched can be tested more closely to the actual operation scenarios, and the problems that may arise in the service code of the services to be launched in the actual operation scenarios can be tested more comprehensively; and the test results corresponding to the online services and the test results corresponding to the services to be launched are deeply compared from multiple aspects. According to the comparative analysis results, the differences in stability, response speed and processing power between the services to be launched and the online services can be intuitively and conveniently known, which helps to promptly discover and correct potential problems in the service code of the services to be launched, and ensure that the services to be launched can meet the expected quality and performance requirements after they are officially launched.
[0029] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation method of the embodiment of the present application is listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the embodiments of the present application. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0031] Figure 1 A schematic diagram of a process of a service testing method based on a simulation environment according to an embodiment of the present application is shown;
[0032] Figure 2a A schematic diagram of a process of a service testing method based on a simulation environment according to another embodiment of the present application is shown;
[0033] Figure 2b A schematic diagram showing the service logic of the simulation environment request service;
[0034] Figure 2c A schematic diagram of an architecture of a service testing method based on a simulation environment is shown;
[0035] Figure 3 A structural block diagram of a service testing system based on a simulation environment according to an embodiment of the present application is shown;
[0036] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0037] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0038] First, the terms involved in one or more embodiments of the present application are explained.
[0039] Simulation environment: refers to a system environment that is isolated from the production environment but has the same functions as the production environment.
[0040] Kafka: It is a high-throughput distributed publish-subscribe messaging system, widely used to build real-time data pipelines and streaming applications. It is not only a message queue system, but also provides powerful persistent storage, high throughput and low latency features, making it suitable for a variety of application scenarios.
[0041] Message queue: It is an asynchronous communication mechanism for transmitting information between different applications or services. The data to be processed is placed in the queue, and the message delivery and consumption is realized through the queue mechanism. It decouples the direct dependency between producers and consumers by introducing a middleware to store and forward messages. The producer sends messages to the message queue, and the consumer receives and processes messages from the message queue.
[0042] Consumption: refers to the process of consumers obtaining and processing messages from the message queue.
[0043] Replay testing: is a performance testing method that simulates user activities by recording real user behaviors or system interactions and replaying these recordings in a simulation environment.
[0044] Stress testing: is a performance testing method that aims to evaluate the performance of the tested service under high load conditions. It tests the key performance indicators of the tested service, such as response time, throughput, and server resource utilization, by simulating a large number of users accessing or performing operations at the same time. Stress testing helps to discover potential bottlenecks, evaluate the scalability and stability of services, and provide data support for capacity planning.
[0045] Figure 1 A flow chart of a service testing method based on a simulation environment according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:
[0046] Step S101, obtaining an online request in a production environment, and generating a request file for service testing according to the online request.
[0047] In an embodiment of the present application, taking into account the diversity and unpredictability of real online requests sent by various users in a production environment, online requests in the production environment are obtained and applied to the testing process of the services to be launched. Specifically, online requests are used to construct test request samples, and then a request file for service testing is generated, wherein the request file includes multiple test request samples.
[0048] This processing method can not only easily obtain a large number of test request samples through automated means, providing strong data support for testing work, effectively reducing the workload of testers and improving testing efficiency, but also enable the service code of the service to be launched to be tested closer to the actual operation scenario, and more comprehensively test the problems that may arise in the service code of the service to be launched in the actual operation scenario.
[0049] Step S102, executing the test task, using the request file to test the online service and the service to be launched in the simulation environment respectively, and obtaining the test results corresponding to the online service and the test results corresponding to the service to be launched.
[0050] The simulation environment has the same system environment as the production environment. It is equipped with online services that have been launched and services to be launched. Test tasks can be generated according to the specific test requirements of testers and other users. Test tasks can be managed through message queues to achieve efficient management of test tasks.
[0051] In step S102, the test task is executed, and the online service and the service to be launched are tested separately in the simulation environment using the request file. The request file can be applied to the service code of the online service and the service code of the service to be launched at the same time. The online service and the service to be launched process the test request samples in the request file to obtain the test results corresponding to the online service and the test results corresponding to the service to be launched.
[0052] Step S103, comparing the test result corresponding to the online service with the test result corresponding to the service to be launched, and obtaining a comparison analysis result.
[0053] After obtaining the test results corresponding to the online service and the test results corresponding to the service to be launched through testing, the two test results are compared in depth from multiple aspects such as request processing results, server performance indicators, and query rate per second to obtain comparative analysis results.
[0054] According to the service testing method based on the simulation environment provided in the embodiment of the present application, the online requests in the production environment are applied to the testing process of the service to be launched. Not only can a large number of test request samples be obtained conveniently through automated means, providing strong data support for the testing work, effectively reducing the workload of testers and achieving efficient testing, but also the service code of the service to be launched can be tested closer to the actual operation scenario, and the problems that may arise in the service code of the service to be launched in the actual operation scenario can be tested more comprehensively; and the test results corresponding to the online service and the test results corresponding to the service to be launched are deeply compared from multiple aspects. According to the comparative analysis results, the differences in stability, response speed and processing power between the service to be launched and the online service can be intuitively and conveniently known, which helps to timely discover and correct potential problems in the service code of the service to be launched, and ensure that the service to be launched can meet the expected quality and performance requirements after it is officially launched.
[0055] Figure 2a FIG. 4 shows a flow chart of a service testing method based on a simulation environment according to another embodiment of the present application. Figure 2a As shown, the method comprises the following steps:
[0056] Step S201, sampling online requests in the production environment and storing them in the message system, obtaining online requests from the message system, modifying the online requests to form test request samples, and aggregating the test request samples according to time granularity to obtain a request file.
[0057] In order to be able to test the service code of the service to be launched more closely to the actual operation scenario, in an embodiment of the present application, online requests in the production environment are obtained and applied to the test process of the service to be launched. Specifically, the real online requests sent by each user in the production environment can be sampled through the online cluster, and then the sampled online requests can be stored in the message system through the service. Those skilled in the art can set the sampling rules according to actual needs, which are not specifically limited here.
[0058] Figure 2b A schematic diagram showing the service logic of the simulation environment request service is shown in FIG. Figure 2b As shown in the figure, taking the Kafka system as an example, the sampled online requests are stored in the Kafka server in the form of Kafka messages. In the simulation environment, Kafka messages can be obtained from the Kafka system in real time through consumer tasks, thereby obtaining online requests and caching them, storing local files according to time granularity, and generating request files.
[0059] In an embodiment of the present application, after obtaining the online request, some modifications are made to the online request, and the modified online request is used as a test request sample for testing. Among them, the request identifier (such as request ID, etc.) of the online request is modified to achieve effective distinction between real traffic and test traffic, which is convenient for attribution; and, an experimental identifier (such as experimental number, etc.) can also be added to the online request. There is a corresponding relationship between the experimental identifier and the pre-set model experiment information. According to the experimental identifier, it can be easily identified which model experiment it needs to participate in, and an association relationship is established with the model experiment information. When the time granularity is 1 minute, the test request samples within each minute are summarized to obtain the request file corresponding to the minute, which realizes local file storage at the minute level, and can effectively and fragmentedly manage online requests.
[0060] Through automated means, a large number of test request samples can be easily obtained, which provides strong data support for the testing work, effectively supplements the test case library, and introduces rich test request samples, which significantly improves the comprehensiveness and accuracy of the test, greatly reduces the workload of testers, and realizes efficient testing.
[0061] The test request samples in this application are stored in the Kafka system, which supports the selection of historical time ranges and can easily replay historical traffic for testing. For example, if the historical time range is selected as a certain day last week, the request file corresponding to that day can be used for replay testing.
[0062] Considering that the newer online requests have higher testing value, in order to further effectively manage the request files, the file version information can be set for the request files according to the usage of the request files. In the application, the file version information may include the latest version information, historical version information, in-use version information, and version information to be deleted. Specifically, Figure 2b As shown, the file version information of the latest generated request file is marked as the latest version information, and the file version information of the request file that is not the latest generated is updated as the historical version information. Determine whether the request file needs to be deleted; if it does not need to be deleted, when executing the test task and processing the test request sample in the request file, the file version information of the request file can be marked as the version information in use; if it needs to be deleted, the file version information of the request file is marked as the version information to be deleted, and the corresponding request file is deleted according to the version information to be deleted. Among them, all file information can be stored in a list.
[0063] In an optional implementation, when a new request file is generated, the system may automatically delete all historically generated request files except request files with the latest version information and request files with in-use version information to ensure storage efficiency and data updating.
[0064] Step S202: Generate a test task according to the setting information of the user for the test task setting items, and add the test task to the message queue.
[0065] In an embodiment of the present application, a service testing system is provided. Figure 2c A schematic diagram of an architecture of a service testing method based on a simulation environment is shown. Figure 2c As shown, the service test system provides functions such as application management, task management, task status recovery, and database recovery. Users can easily manage the tested applications and test tasks through page operations in the test management system. Users can generate test tasks based on applications, code branches, time information, etc., support scheduled execution of test tasks, and can also automatically deploy the services to be launched for the tested applications. Among them, the task status is set according to the execution status of the test task, and the task status may include unexecuted status, executing status, execution completed status, etc. Figure 2c The service logic of the simulation environment request service is as follows: Figure 2b shown.
[0066] Specifically, the task management page in the test management system can provide multiple test task setting items, which may include application setting items, code branch setting items, time information setting items, etc. Testers and other users can set each test task setting item according to their specific test needs, and then generate test tasks according to the user's setting information for each test task setting item, and add the test tasks to the message queue. The test tasks are managed through the message queue, which effectively improves flexibility, scalability and fault tolerance. Figure 2b As shown, after a new test task is generated, the new test task can be submitted to the data bus cluster, and the request task consumer is responsible for consuming the test task in the message queue.
[0067] The test tasks may include: stress testing tasks and playback tasks. Those skilled in the art may set the specific task content of the test tasks according to actual needs, which is not specifically limited here. The simulation environment in the embodiment of the present application is not only a forwarding of production environment data, but also supports playback testing of requests within a historical time range, and also supports stress testing, and can customize the query rate per second (QPS) information. In addition, it supports horizontal expansion, and can realize multiple stress testing nodes to stress test the same target server.
[0068] Step S203, when the time reaches the test appointment time, the request task consumer consumes the test task in the message queue through the scheduled task, and obtains the target request file corresponding to the test task from the request file.
[0069] The embodiment of the present application supports the scheduled execution of test tasks. When the current time reaches the test scheduled time, the request task consumer consumes the test task in the message queue through the scheduled task, and obtains the target request file corresponding to the test task from the request file, such as Figure 2b and Figure 2c shown.
[0070] Step S204, executing the test task, using the target request file to test the online service and the service to be launched in the simulation environment respectively, and obtaining the test results corresponding to the online service and the test results corresponding to the service to be launched.
[0071] Specifically, the test request samples in the target request file are sent to the online service in the simulation environment for processing, so as to test the online service and obtain the test results corresponding to the online service; the test request samples in the target request file are sent to the service to be launched in the simulation environment for processing, so as to test the service to be launched and obtain the test results corresponding to the service to be launched. After the test task is executed, the test results are automatically stored in the database to realize the automatic storage of the test results.
[0072] The embodiments of the present application cleverly utilize real-time online requests in the production environment to synchronize requests to online services and services to be launched, thereby being able to more comprehensively test the potential multi-dimensional risks of services to be launched, covering key areas such as code risks, business logic risks, and performance risks.
[0073] Step S205: Compare the test results corresponding to the online service with the test results corresponding to the service to be launched, and obtain a comparison analysis result.
[0074] like Figure 2c As shown, the test management system can automatically send requests to online services and services to be launched through scheduled tasks, and use the interface to obtain the test results corresponding to the online services and the test results corresponding to the services to be launched from the monitoring platform. The test results include detailed request processing results and server data, etc.
[0075] From the aspects of request processing results, server performance indicators, query rate per second, etc., an in-depth comparative analysis is conducted on the test results corresponding to the online service and the test results corresponding to the service to be launched to obtain the comparative analysis results.
[0076] like Figure 2b and Figure 2c As shown in the figure, after the test task is completed, the test results are automatically stored in the database. After the comparative analysis results are obtained, the comparative analysis results are automatically stored in the database, realizing the automatic storage of all results and providing continuous performance optimization and problem tracking capabilities. The entire test and comparison process is efficient, ensuring the smooth progress of the test work.
[0077] Among them, the comparative analysis results may include: request processing result analysis information, server performance indicator analysis information and query rate per second analysis information. Taking the test request sample as a page display request for a page containing advertising resources as an example, the request processing result analysis information may include analysis information such as the advertising resource display success rate and the advertising resource display failure rate. The server performance indicator analysis information may include analysis information on indicators such as CPU usage, memory usage, disk I / O performance, network performance, CPU / GPU temperature, etc. According to the comparative analysis results, the differences in stability, response speed and processing power between the service to be launched and the online service can be intuitively and conveniently known, and the robustness of the service code of the service to be launched can be comprehensively evaluated.
[0078] According to the service testing method based on the simulation environment provided in the embodiment of the present application, the online requests in the production environment are applied to the testing process of the services to be launched, which not only introduces a wealth of test request samples, effectively supplements the test case library, and significantly improves the comprehensiveness and accuracy of the test, but also greatly reduces the workload of testers and achieves efficient testing. Before the services to be launched are officially launched, the service codes of the services to be launched can be tested more closely to the actual operation scenarios, and the quality and performance of the service codes of the services to be launched can be comprehensively evaluated. Potential problems in the service codes of the services to be launched can be discovered and corrected in time, which greatly reduces the risks after the project is officially launched and ensures that it can meet the expected quality and performance requirements after it is officially launched. The solution is also applicable to functional branches in the development stage, and provides a strong guarantee for the stable advancement of the project through simulation environment testing.
[0079] Figure 3 FIG. 4 shows a structural block diagram of a service testing system based on a simulation environment according to an embodiment of the present application. Figure 3 As shown, the system includes: a generating module 310 , a testing module 320 and a comparing module 330 .
[0080] The generation module 310 is adapted to: obtain online requests in a production environment, and generate a request file for service testing according to the online requests.
[0081] The test module 320 is adapted to: execute the test task, test the online service and the service to be launched respectively in the simulation environment using the request file, and obtain the test results corresponding to the online service and the test results corresponding to the service to be launched.
[0082] The comparison module 330 is adapted to compare the test results corresponding to the online service with the test results corresponding to the service to be launched, and obtain a comparison analysis result.
[0083] Optionally, the generation module 310 is further adapted to: sample online requests in the production environment and store them in a message system; obtain online requests from the message system, modify the online requests to form test request samples, and aggregate the test request samples according to time granularity to obtain a request file.
[0084] Optionally, the generating module 310 is further adapted to: modify the request identifier of the online request, and add an experimental identifier to the online request to form a test request sample.
[0085] Optionally, the generating module 310 is further adapted to: generate a test task according to setting information of a user for a test task setting item, and add the test task to a message queue; wherein the test task includes: a stress testing task and a playback task.
[0086] Optionally, the test module 320 is further adapted to: when the time reaches the test appointment time, the request task consumer consumes the test task in the message queue through a scheduled task, and obtains a target request file corresponding to the test task from the request file; the test request sample in the target request file is sent to the online service in the simulation environment for processing, so as to test the online service and obtain the test result corresponding to the online service; the test request sample in the target request file is sent to the service to be launched in the simulation environment for processing, so as to test the service to be launched and obtain the test result corresponding to the service to be launched.
[0087] Optionally, the comparative analysis results include: request processing result analysis information, server performance indicator analysis information, and query rate per second analysis information.
[0088] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.
[0089] According to the service testing system based on the simulation environment provided in the embodiment of the present application, online requests in the production environment are applied to the testing process of the services to be launched, which not only introduces a wealth of test request samples, effectively supplements the test case library, and significantly improves the comprehensiveness and accuracy of the test, but also greatly reduces the workload of testers and achieves efficient testing. Before the services to be launched are officially launched, the service codes of the services to be launched can be tested in a more realistic operating scenario, and the quality and performance of the service codes of the services to be launched can be comprehensively evaluated. Potential problems in the service codes of the services to be launched can be discovered and corrected in a timely manner, which greatly reduces the risks after the project is officially launched and ensures that it can meet the expected quality and performance requirements after it is officially launched. The solution is also applicable to functional branches in the development stage, and provides a strong guarantee for the stable advancement of the project through simulation environment testing.
[0090] An embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction or computer program, which enables a processor to perform operations corresponding to the service testing method based on a simulation environment in any of the above method embodiments.
[0091] An embodiment of the present application provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the service testing method based on a simulation environment in any of the above method embodiments.
[0092] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.
[0093] like Figure 4 As shown, the computing device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .
[0094] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the embodiment of the service testing method based on the simulation environment for computing devices.
[0095] Specifically, the program 410 may include program codes, which include computer operation instructions.
[0096] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0097] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0098] Program 410 can be specifically used to enable processor 402 to execute the service testing method based on the simulation environment in any of the above-mentioned method embodiments. The specific implementation of each step in program 410 can refer to the corresponding descriptions in the corresponding steps and units in the above-mentioned service testing embodiment based on the simulation environment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.
[0099] The algorithm and display provided herein are not inherently related to any specific computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present application embodiment described herein, and the above description of specific languages is to disclose the best mode of implementation of the present application embodiment.
[0100] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0101] Similarly, it should be understood that in order to streamline the present disclosure and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed embodiments of the present application require more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the embodiment of the present application.
[0102] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0103] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the embodiments of the present application and to form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0104] The various component embodiments of the embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The embodiments of the present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the embodiments of the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0105] It should be noted that the above embodiments illustrate rather than limit the embodiments of the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The embodiments of the present application may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
Claims
1. A service testing method based on a simulation environment, comprising: Obtaining online requests in a production environment, and generating a request file for service testing based on the online requests; Execute the test task, and use the request file to test the online service and the service to be launched in the simulation environment respectively, to obtain the test results corresponding to the online service and the test results corresponding to the service to be launched; The test result corresponding to the online service is compared with the test result corresponding to the service to be launched, and a comparative analysis result is obtained.
2. According to the method of claim 1, the obtaining of online requests in the production environment and generating a request file for service testing according to the online requests further comprises: Sampling the online requests in the production environment and storing them in a message system; An online request is obtained from the message system, the online request is modified to form a test request sample, and the test request sample is aggregated according to a time granularity to obtain the request file.
3. According to the method of claim 2, the step of modifying the online request to form a test request sample further comprises: The request identifier of the online request is modified, and an experiment identifier is added to the online request to form the test request sample.
4. The method according to any one of claims 1 to 3, before executing the test task, the method further comprises: A test task is generated according to the setting information of the user for the test task setting item, and the test task is added to the message queue; wherein the test task includes: a stress testing task and a playback task.
5. According to the method according to any one of claims 1 to 4, the executing the test task, using the request file to test the online service and the service to be launched in the simulation environment respectively, and obtaining the test result corresponding to the online service and the test result corresponding to the service to be launched further comprises: When the time reaches the test appointment time, the request task consumer consumes the test task in the message queue through the scheduled task, and obtains the target request file corresponding to the test task from the request file; Sending the test request sample in the target request file to the online service in the simulation environment for processing, so as to test the online service and obtain the test result corresponding to the online service; The test request sample in the target request file is sent to the service to be launched in the simulation environment for processing, so as to test the service to be launched and obtain the test result corresponding to the service to be launched.
6. The method according to any one of claims 1 to 5, wherein the comparative analysis result comprises: Request processing result analysis information, server performance indicator analysis information, and query rate per second analysis information.
7. A service testing system based on a simulation environment, comprising: A generation module, adapted to obtain online requests in a production environment, and generate a request file for service testing according to the online requests; A test module, adapted to execute a test task, and to test the online service and the service to be launched in a simulation environment respectively using the request file, and obtain a test result corresponding to the online service and a test result corresponding to the service to be launched; The comparison module is adapted to compare the test result corresponding to the online service with the test result corresponding to the service to be launched, so as to obtain a comparison analysis result.
8. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the service testing method based on the simulation environment as described in any one of claims 1-6.
9. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the service testing method based on a simulation environment as described in any one of claims 1 to 6.
10. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the service testing method based on a simulation environment as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Data testing method, device, equipment, medium and product
CN118689758A
Cited By
Simulation test method and device for resource distribution service and electronic equipment
CN120780612A
A simulation test method, device and electronic equipment of a resource distribution service
CN120780612B