Automatic joint debugging test method based on test case, sandbox system and equipment
By executing automated joint debugging test methods based on test cases in a sandbox environment, using a preset test case database to match target test cases and update the test interface, the problems of low efficiency and waste of resources in the existing technology are solved, and efficient and secure automated testing and interface management are achieved.
Patent Information
- Application Number
- CN202411980583.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-06
AI Technical Summary
In the prior art, joint debugging test requires a lot of manpower to perform manual testing and debugging, which is inefficient and has a high error rate. In addition, it is necessary to communicate and update interface information frequently during access testing of third-party applications, resulting in waste of resources and reduced efficiency.
Provide an automated joint commissioning test method based on test cases, perform test requests in the sandbox environment through the sandbox system, use the preset test case database to match the target test cases, and update the test interface according to the success rate to achieve automated response and interface management.
It reduces labor costs and resource waste, improves testing efficiency and security, realizes automated matching of test cases and independent deployment, and reduces duplicate cooperation work for different customers.
Smart Images

Figure CN119938526A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer testing technology, and in particular to an automated joint debugging test method based on test cases, a sandbox system and equipment. Background Art
[0002] In the prior art, when the application to be tested needs to be tested in conjunction with an external system, a large amount of manpower is usually required to produce test data that meets the needs of the external docking party from a real test environment. Therefore, a large amount of manual testing and manual debugging is required, which is slow and inefficient, and has a high error rate. Joint debugging requires the application to be tested and its upstream and downstream processors to be tested in coordination according to preset test cases, but manually written test cases have many defects and need to be repeatedly modified and retested after failure, further slowing down the test progress.
[0003] In addition, similar problems also exist when using external tools or platforms for access testing. After the third-party application completes the interface development, it is necessary to manually call the platform interface to verify the linkage, and the platform technicians also need to call the third-party interface based on the test unit for feedback. If one party updates the information, it is necessary to re-notify the other party to update the interface information and re-commission, which requires frequent communication and cooperation between the platform technicians and the third-party technicians, resulting in large occupation of platform technical resources and waste of human resources, and reducing the efficiency of interface access testing. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides an automated joint debugging test method, a sandbox system and a device based on test cases to improve the problem that existing testing technologies require a lot of human resources and are inefficient.
[0005] A first aspect of the present invention provides an automated joint debugging test method based on a test case, the method being used to be executed in a sandbox environment, the method comprising the following steps:
[0006] Receive a test request from a user; the test request includes information about the application to be tested and information about the test scenario;
[0007] Convert the test scenario information into an input format adapted to the test interface of the sandbox system according to a preset interface mapping rule to construct a test request message; and record the test request message input by the test interface;
[0008] Acquire a matching target test case from a preset test case database according to the test request message; the target test case includes a test execution logic and a test execution parameter; and record a success rate of the test request message matching the target test case;
[0009] Convert the acquired target test case into an output format adapted to the test interface of the sandbox system according to a preset interface mapping rule to construct a test response message;
[0010] Sending the test response message to the user;
[0011] In each preset update cycle, whether to update the test interface is determined based on the success rate of matching the test request message to the target test case, and the updated test interface is republished and put on the shelf.
[0012] In some embodiments of the present invention, after receiving the test request from the user, the method further includes:
[0013] Verify the format and information integrity of the test request; if the verification fails, send the test request verification failure information to the user; the verification failure information includes the type of verification failure and the information content in the test request that caused the verification failure.
[0014] In some embodiments of the present invention, obtaining a matching test case from a preset test case database according to the test request message includes:
[0015] The test request message is matched with the target test case by using a clustering algorithm or a long short-term memory network.
[0016] In some embodiments of the present invention, determining whether to update the test interface according to the success rate of matching the test request message to the target test case includes:
[0017] If the success rate is lower than the preset success rate threshold within the preset update period of the current round, the version of the test interface is rolled back to the previous round in which the success rate reaches the preset success rate threshold;
[0018] Or adjust the parameters of the test interface of the current round to build a new test interface.
[0019] In some embodiments of the present invention, the method further comprises:
[0020] receiving feedback information of the user in response to the response message;
[0021] In each preset update cycle, if it is determined to update the test interface, the collected feedback information is used as a feedback parameter for adjusting the test interface.
[0022] In some embodiments of the present invention, the method further comprises:
[0023] If the number of test requests received by the test interface exceeds a preset number threshold within a preset time period, the unprocessed test requests in the waiting state are forwarded to the standby test interface.
[0024] A second aspect of the present invention provides a sandbox system, wherein the sandbox system adopts a microservice architecture, and the sandbox system includes:
[0025] A test case management module receives a user's test request; the test request includes information about the application to be tested and test scenario information; the test scenario information is converted into an input format that adapts to the test interface of the sandbox system according to a preset interface mapping rule to construct a test request message; a matching target test case is obtained from a preset test case database according to the test request message; the target test case includes test execution logic and test execution parameters; the obtained target test case is converted into an output format that adapts to the test interface of the sandbox system according to a preset interface mapping rule to construct a test response message; the test response message is sent to the user; wherein, within each preset update cycle, whether to update the test interface is determined based on the success rate of matching the test request message to the target test case;
[0026] A capability management module republishes the updated test interface;
[0027] A data monitoring module records the success rate of the test request message matching the target test case;
[0028] A data statistics module records the test request message input by the test interface.
[0029] In some embodiments of the present invention, the sandbox system further comprises:
[0030] A reverse proxy server, configured to receive a test request and distribute the test request to a corresponding test interface in the sandbox system to achieve load balancing;
[0031] The gateway module is used to receive the test request forwarded by the reverse proxy server and forward it to the corresponding test interface in the sandbox system.
[0032] The third aspect of the present invention provides a computer device, including a processor, a memory and a computer program stored in the memory, wherein the processor is used to execute the computer program, and when the computer program is executed, the device implements the steps of any one of the above-mentioned automated joint debugging test methods based on test cases.
[0033] A fourth aspect of the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of any one of the above-mentioned automated joint debugging testing methods based on test cases.
[0034] The beneficial effects of the present invention are at least:
[0035] The present invention provides an automated joint debugging test method, a sandbox system and a device based on test cases, the method comprising: receiving a test request from a user. Converting the test scenario information into an input format of a test interface according to a preset interface mapping rule, and constructing a test request message. Obtaining a matching target test case from a preset test case database according to the test request message, the target test case including a test execution logic and a test execution parameter. Converting the acquired target test case into an output format of a test interface according to a preset interface mapping rule, and constructing a test response message. Sending the test response message to the user. In each round of preset update cycle, determining whether to update the test interface according to the success rate of matching the test request message to the target test case, and re-publishing the updated test interface. The present invention reduces labor costs, can be continuously reused after one deployment, and the system can automatically respond to test requests. There is no need to do repetitive coordination work for different customers. The present invention can realize automatic matching of test cases, can realize independent deployment of the system and improve test security.
[0036] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0037] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0039] Figure 1 The present invention is a flowchart of an automated joint debugging test method based on test cases in one embodiment of the present invention.
[0040] Figure 2 This is a structural diagram of an automated joint debugging test system based on test cases in another embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0042] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0043] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0044] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0045] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0046] Joint debugging testing refers to the testing activities carried out after different modules or components are integrated during the software development process. Its main purpose is to verify the correctness of the interface between modules, ensure that the data flow and control flow between modules realize their functions as designed, and the correctness of the overall function after integration.
[0047] An embodiment of the present invention provides an automated joint debugging test method based on test cases, such as Figure 1 As shown, the method is used to be executed in a sandbox environment, and the method includes the following steps S101 to S105:
[0048] Step S101: receiving a test request from a user, wherein the test request includes information about the application to be tested and information about the test scenario.
[0049] Step S102: convert the test scenario information into an input format adapted to the test interface of the sandbox system according to the preset interface mapping rule to construct a test request message and record the test request message input by the test interface.
[0050] Step S103: Obtain a matching target test case from a preset test case database according to the test request message. The target test case includes test execution logic and test execution parameters. Record the success rate of the test request message matching the target test case.
[0051] Step S104: converting the acquired target test case into an output format adapted to the test interface of the sandbox system according to a preset interface mapping rule to construct a test response message.
[0052] Step S105: Send the test response message to the user.
[0053] In each preset update cycle, whether to update the test interface is determined based on the success rate of matching the test request message to the target test case, and the updated test interface is republished.
[0054] Specifically, sandbox is an important security mechanism in the field of computer security. The sandbox environment is a virtual system program that provides an isolated environment for running programs. In this environment, real scenarios in the network can be simulated, and restrictions and monitoring of network resources can be provided. The sandbox can contain some virtual hardware and software resources, such as file systems, networks, operating systems, etc., so that applications or processes can run in this virtual environment without adversely affecting the real computer system. In this embodiment, executing a joint debugging test request in a sandbox environment can ensure that all subsequent data interactions related to the target device will not cause damage to the test device. Avoid damage to the test device due to malicious or erroneous operations in the process of providing joint debugging test services to the outside world, thereby improving the safety and reliability of the test device.
[0055] In some embodiments, after receiving the test request from the user, the method further includes:
[0056] Verify the format and information integrity of the test request. If the verification fails, send the test request verification failure information to the user. The verification failure information includes the type of verification failure and the information content in the test request that caused the verification failure.
[0057] This step is to verify the format and content of the test scenario information in the test request to ensure its completeness and accuracy.
[0058] In some embodiments, obtaining a matching test case from a preset test case database according to a test request message includes:
[0059] Use clustering algorithms or long short-term memory networks to match target test cases for test request messages.
[0060] In some embodiments, determining whether to update the test interface according to the success rate of matching the test request message to the target test case includes:
[0061] If the success rate is lower than the preset success rate threshold in the preset update cycle of the current round, the version of the test interface will be rolled back to the previous round in which the success rate reached the preset success rate threshold.
[0062] Or adjust the parameters of the current round of test interfaces to build a new test interface.
[0063] In some embodiments, the method further comprises:
[0064] Receive user feedback on the response message.
[0065] In each preset update cycle, if it is determined to update the test interface, the collected feedback information is used as a feedback parameter for adjusting the test interface.
[0066] In some embodiments, the method further comprises:
[0067] If the number of test requests received by the test interface exceeds a preset number threshold within a preset time period, the unprocessed test requests in the waiting state are forwarded to the backup test interface.
[0068] Correspondingly, this embodiment provides a sandbox system, which adopts a microservice architecture and includes:
[0069] The test case management module receives the user's test request. The test request includes the application information to be tested and the test scenario information. The test scenario information is converted into the input format of the test interface that adapts to the sandbox system according to the preset interface mapping rules to construct a test request message. The matching target test case is obtained from the preset test case database according to the test request message. The target test case includes the test execution logic and the test execution parameters; the obtained target test case is converted into the output format of the test interface that adapts to the sandbox system according to the preset interface mapping rules to construct a test response message. The test response message is sent to the user. Among them, in each round of preset update cycle, it is determined whether to update the test interface based on the success rate of matching the test request message to the target test case.
[0070] The capability management module re-publishes the updated test interface.
[0071] The data monitoring module records the success rate of the test request message matching the target test case.
[0072] The data statistics module records the test request messages input by the test interface.
[0073] In some embodiments, the sandbox system further includes:
[0074] The reverse proxy server is used to receive test requests and distribute the test requests to the corresponding test interfaces in the sandbox system to achieve load balancing.
[0075] The gateway module is used to receive the test request forwarded by the reverse proxy server and forward it to the corresponding test interface in the sandbox system.
[0076] The reverse proxy server can be a server that can configure a reverse proxy, such as Nginx, Apache HTTP Server, or HAProxy. Nginx is a high-performance Web server and reverse proxy server, which is widely used in load balancing, HTTP caching, and other scenarios.
[0077] The gateway, as a unified entry point for all user test requests, can route requests to different backend services or applications to achieve centralized management of services. The gateway can also provide a variety of security features, such as identity authentication and permission checking, to ensure that only legitimate users can access specific APIs or services. This can effectively prevent unauthorized access and malicious attacks. The gateway can also monitor and limit the traffic entering the system to prevent sudden traffic from causing service crashes or slow responses. By setting rate limits, the stability of backend services can be protected.
[0078] Another embodiment of the present invention provides an automated joint debugging test method based on test cases, which is executed in a pre-created sandbox environment. The sandbox environment is a virtual system program that allows programs to be run in a sandbox environment, and the changed data generated by the running can be deleted, thereby providing a visible test environment to third-party users, so that the third-party users can visualize the process. In the sandbox environment, each test step is tracked in the form of a label.
[0079] The basic principle of the present invention is that the sandbox system presets test cases, finds corresponding test cases according to requests, and returns expected results.
[0080] The sandbox integrates the scenario request and response interface of the automated test. The service provider needs to provide test cases for each scenario and convert them into request-response pairs. When the user verifies the scenario, he only needs to send the corresponding request, and the sandbox system returns the response result corresponding to the request.
[0081] The structure of the sandbox system is as follows Figure 2 As shown, the detailed technical solution specifically includes:
[0082] This sandbox system is developed and designed using the currently popular Spring Cloud microservice architecture. Each microservice is deployed in a distributed cluster mode to improve the availability and stability of the platform.
[0083] This system uses Nacos as the service registration and discovery center to achieve unified registration and configuration management of microservices, and can dynamically update configuration and service online and offline. When a user accesses this system, he first goes through Nginx reverse proxy and load balancing to the gateway service, and then through the gateway service load and routing to the docked sandbox service interface.
[0084] Among them, Nacos is used to manage the registration and discovery of microservices. All microservices will register themselves with Nacos when they start. Nacos maintains a directory of microservices, and other services can query the addresses of the required services through Nacos. In addition, Nacos also supports configuration management, which can dynamically update the configuration of services and support the online and offline of services.
[0085] Among them, Nginx is a reverse proxy server that is responsible for forwarding requests to the backend gateway service and achieving load balancing.
[0086] Among them, the gateway service is a service that centrally handles all external requests. It receives requests from clients and then forwards the requests to specific backend microservice interfaces according to routing rules. The gateway can provide a unified access portal. The client only needs to know the address of the gateway without knowing the specific addresses and interfaces of multiple backend microservices. The gateway can also implement security policies, such as authentication and authorization, to ensure that only authenticated requests can access backend services, thereby enhancing the security of the system. The gateway can centrally manage the monitoring and logging of requests, helping the operation and maintenance team to grasp the system status in real time and perform troubleshooting.
[0087] Furthermore, the core functions of this sandbox system include:
[0088] ① Test case management: used for continuous iterative maintenance of the test case database, converting test scenarios into interface-level interactions, and returning expected results based on user requests.
[0089] Specifically, before conducting software testing, write test cases to prepare a preset test case database. During testing, test the corresponding scenarios according to the test cases, such as checking whether the status is correct or not, and whether the message data sent to other systems is correct or not. That is, the sandbox system presets the request and response messages corresponding to the test scenario case into the system in advance, and after receiving the test request message, matches the response message corresponding to the request in the system, and then returns the response message to the user.
[0090] ② Capability management: used to publish external interfaces.
[0091] ③Data monitoring: Real-time monitoring of call success rate to help operation and maintenance colleagues to control the system operation status in real time.
[0092] ④Data statistics: record the user’s interface usage.
[0093] Its core principles are:
[0094] ① Exhaust all test scenarios and convert the text test cases into request messages and response messages. A set of request-response messages corresponds to one test case.
[0095] ② If the user wants to verify whether a scenario is correct or not, he only needs to send the request corresponding to the corresponding test case under the scenario.
[0096] The present invention has the following advantages:
[0097] ① Reduced labor costs, one-time deployment can be reused continuously, and the system responds automatically. No need to do repetitive coordination work for different customers.
[0098] ② Independent deployment, not dependent on the internal system, the normal operation of the internal system does not affect the use of the sandbox.
[0099] ③ Greatly reduces communication costs. Customers can check the use case library to verify any type of scenario.
[0100] ④Simple debugging and easy maintenance.
[0101] In summary, the present invention provides an automated joint debugging test method, sandbox system and device based on test cases, the method comprising: receiving a test request from a user. Converting the test scenario information into the input format of the test interface according to a preset interface mapping rule, and constructing a test request message. Obtaining a matching target test case from a preset test case database according to the test request message, the target test case including a test execution logic and a test execution parameter. Converting the acquired target test case into the output format of the test interface according to the preset interface mapping rule, and constructing a test response message. Sending the test response message to the user. In each round of preset update cycle, determining whether to update the test interface according to the success rate of matching the test request message to the target test case, and re-publishing the updated test interface. The present invention reduces labor costs, can be continuously reused after one deployment, and the system can automatically respond to test requests. There is no need to do repetitive coordination work for different customers. The present invention can realize automatic matching of test cases, can realize independent deployment of the system and improve test security.
[0102] Corresponding to the above method, the present invention also provides an apparatus / system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus / system implements the steps of the method described above.
[0103] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0104] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0105] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0106] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0107] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An automated joint debugging test method based on test cases, characterized in that: The method is used to be executed in a sandbox environment, and the method comprises the following steps: Receive a test request from a user; the test request includes information about the application to be tested and information about the test scenario; Convert the test scenario information into an input format adapted to the test interface of the sandbox system according to a preset interface mapping rule to construct a test request message; and record the test request message input by the test interface; Acquire a matching target test case from a preset test case database according to the test request message; the target test case includes a test execution logic and a test execution parameter; and record a success rate of the test request message matching the target test case; Convert the acquired target test case into an output format adapted to the test interface of the sandbox system according to a preset interface mapping rule to construct a test response message; Sending the test response message to the user; In each preset update cycle, whether to update the test interface is determined based on the success rate of matching the test request message to the target test case, and the updated test interface is republished and put on the shelf.
2. The test case-based automated joint debugging test method according to claim 1, characterized in that: After receiving the user's test request, it also includes: Verify the format and information integrity of the test request; if the verification fails, send the test request verification failure information to the user; the verification failure information includes the type of verification failure and the information content in the test request that caused the verification failure.
3. The test case-based automated joint debugging test method according to claim 1, characterized in that: Acquiring a matching test case from a preset test case database according to the test request message, including: The test request message is matched with the target test case by using a clustering algorithm or a long short-term memory network.
4. The test case-based automated joint debugging test method according to claim 1, characterized in that: Determining whether to update the test interface according to a success rate of matching the test request message to the target test case includes: If the success rate is lower than the preset success rate threshold within the preset update period of the current round, the version of the test interface is rolled back to the previous round in which the success rate reaches the preset success rate threshold; Or adjust the parameters of the test interface of the current round to build a new test interface.
5. The test case-based automated joint debugging test method according to claim 1, characterized in that: The method further includes: receiving feedback information of the user in response to the response message; In each preset update cycle, if it is determined to update the test interface, the collected feedback information is used as a feedback parameter for adjusting the test interface.
6. The test case-based automated joint debugging test method according to claim 1, characterized in that: The method further includes: If the number of test requests received by the test interface exceeds a preset number threshold within a preset time period, the unprocessed test requests in the waiting state are forwarded to the standby test interface.
7. A sandbox system for automated joint debugging based on test cases, characterized in that: The sandbox system adopts a microservice architecture, and the sandbox system includes: A test case management module receives a user's test request; the test request includes information about the application to be tested and test scenario information; the test scenario information is converted into an input format that adapts to the test interface of the sandbox system according to a preset interface mapping rule to construct a test request message; a matching target test case is obtained from a preset test case database according to the test request message; the target test case includes test execution logic and test execution parameters; the obtained target test case is converted into an output format that adapts to the test interface of the sandbox system according to a preset interface mapping rule to construct a test response message; the test response message is sent to the user; wherein, within each preset update cycle, whether to update the test interface is determined based on the success rate of matching the test request message to the target test case; A capability management module republishes the updated test interface; A data monitoring module records the success rate of the test request message matching the target test case; A data statistics module records the test request message input by the test interface.
8. The sandbox system for automated joint debugging based on test cases according to claim 7, characterized in that: The sandbox system also includes: A reverse proxy server, configured to receive a test request and distribute the test request to a corresponding test interface in the sandbox system to achieve load balancing; The gateway module is used to receive the test request forwarded by the reverse proxy server and forward it to the corresponding test interface in the sandbox system.
9. A computer device comprising a processor, a memory and a computer program stored in the memory, characterized in that: The processor is used to execute the computer program. When the computer program is executed, the device implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.