Software testing method and device, equipment and storage medium

By reading and updating the configuration center address list in software testing, and using the simulation data service center to generate target simulation data, the problem of inconsistent test results caused by data differences in different environments is solved, and the test accuracy and development efficiency are improved.

CN119938541APending Publication Date: 2025-05-06政采云股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510085974.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

During the software testing process, the data stored in the Apollo configuration center corresponding to different environments is different, resulting in inconsistent test results when the environment is selected incorrectly, which affects production.

Method used

By reading the target data sent by the preset distributed configuration center, storing it in the configuration center address list, and updating the client request address to connect to the simulation data service center, generating the target simulation data for testing.

Benefits of technology

Improve the accuracy of software testing and reduce the problem of inconsistent test results caused by environmental selection errors, thereby improving the efficiency of the software development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938541A_ABST
    Figure CN119938541A_ABST
Patent Text Reader

Abstract

The invention discloses a software testing method and device, equipment and a storage medium, and relates to the technical field of software testing, and the method comprises the steps: storing a first address corresponding to a preset distributed configuration center to a first configuration center address list, and reading target data issued by the preset distributed configuration center connected with a preset client; updating a request address corresponding to the preset client to a second address corresponding to the preset analog data service center from the first address to obtain a second configuration center address list, so that the preset client sends a data acquisition request to the preset analog data service center based on the second address; and judging whether the data acquisition request meets a preset condition or not through a preset simulation data service center, if so, generating target simulation data based on the target data, and issuing the target simulation data to a preset test tool, so that the preset test tool tests the to-be-tested software by using the target simulation data. Therefore, the accuracy of testing the software can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a software testing method, device, equipment and storage medium. Background Art

[0002] At present, the process of initializing the application is to use Apollo (a distributed configuration center) to request different Apollo configuration centers in different environments, so that after the Apollo application receives the data returned by the configuration center, it will store the data in the memory for software use.

[0003] After the software is started, the test tool needs to be started to test the software. The process of testing the software is as follows: first, select the environment to be tested, such as environment 1 and environment 2. Then, select the traffic test case to be executed so that the test tool can read the case data and call the business logic code to pass the case data to the test tool. Then, the comparison result node in the test tool will read the case data and obtain the business data returned by the software. Finally, compare the case data with the business data to determine whether the two data are consistent.

[0004] However, the data stored in the Apollo configuration center corresponding to different environments are different. For example, the value of the data corresponding to environment 1 is A, and the value of the data corresponding to environment 2 is B. When executing the test, if an error occurs in the environment selection link, the test results will be inconsistent due to data differences, thus affecting production.

[0005] From the above, it can be seen that how to improve the accuracy of software testing during the software testing process is a problem that needs to be solved urgently. Summary of the invention

[0006] In view of this, the purpose of the present invention is to provide a software testing method, device, equipment and storage medium, which can improve the accuracy of software testing and thus improve the efficiency of the software development process. The specific scheme is as follows:

[0007] In a first aspect, the present application provides a software testing method, comprising:

[0008] The first address corresponding to the preset distributed configuration center is stored in the first configuration center address list, and the target data issued by the preset distributed configuration center connected to the preset client is read; wherein the preset client initiates a request based on the address stored in the first configuration center address list;

[0009] In the first configuration center address list, the request address corresponding to the preset client is updated from the first address to a second address corresponding to the preset simulation data service center to obtain an updated second configuration center address list;

[0010] Sending the second configuration center address list to the preset client, so that the preset client sends a data acquisition request for simulation data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list;

[0011] The preset simulation data service center determines whether the data acquisition request meets the preset conditions. If the data acquisition request meets the preset conditions, corresponding target simulation data is generated based on the target data, and the target simulation data is sent to the preset test tool so that the preset test tool can use the target simulation data to test the software to be tested.

[0012] Optionally, before sending the second configuration center address list to the preset client, the method further includes:

[0013] Updating the polling time corresponding to the preset simulation data service center from the initial time to the preset time, so that the communication connection established between the preset simulation data service center and the preset client meets the preset connection condition;

[0014] Correspondingly, after judging whether the data acquisition request meets the preset conditions through the preset simulation data service center, and if the data acquisition request meets the preset conditions, generating corresponding target simulation data based on the target data, and sending the target simulation data to a preset test tool so that the preset test tool uses the target simulation data to test the software to be tested, the method further includes:

[0015] The polling time corresponding to the preset simulation data service center is restored from the preset time to the initial time.

[0016] Optionally, after sending the second configuration center address list to the preset client so that the preset client sends a data acquisition request for simulation data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list, the method further includes:

[0017] Starting the preset simulation data service center to obtain a startup result, and determining whether the startup result indicates a successful startup;

[0018] If the startup result indicates that the startup is successful, controlling the preset simulation data service center to receive and process the data acquisition request, and monitoring the process of processing the data acquisition request;

[0019] If the startup result does not indicate a successful startup, an error message is generated and sent based on the startup result so that the staff terminal can process based on the error message.

[0020] Optionally, judging whether the data acquisition request satisfies a preset condition by the preset simulation data service center, and if the data acquisition request satisfies the preset condition, generating corresponding target simulation data based on the target data, and sending the target simulation data to a preset test tool, includes:

[0021] Determining, by the preset simulation data service center, whether the request type corresponding to the data acquisition request is a polling request, and if the request type corresponding to the data acquisition request is not a polling request, determining whether the request type corresponding to the data acquisition request is a stop simulation data service type;

[0022] If the request type corresponding to the data acquisition request is not a stop simulation data service type, determining whether the request type corresponding to the data acquisition request is a data request type;

[0023] If the request type corresponding to the data acquisition request is a data request type, the preset simulation data service center is called to generate target simulation data based on the target data, and the target simulation data is sent to the preset test tool.

[0024] Optionally, calling the preset simulation data service center and generating target simulation data based on the target data, and sending the target simulation data to the preset test tool includes:

[0025] Calling the preset simulation data service center to establish an initial object, and generating target simulation data based on the target data, and then setting the target simulation data as a sub-object of the initial object;

[0026] The sub-object is stored in the initial object to obtain an object to be converted, and a preset format conversion technology is used to convert a format corresponding to the object to be converted to obtain a target object, and then the target object is sent to the preset test tool.

[0027] Optionally, after judging whether the data acquisition request satisfies a preset condition through the preset simulation data service center, and if the data acquisition request satisfies the preset condition, generating corresponding target simulation data based on the target data, and sending the target simulation data to a preset test tool so that the preset test tool uses the target simulation data to test the software to be tested, the method further includes:

[0028] Using a preset reflection calling method to call a preset updating method, so as to update the request address corresponding to the preset client from the second address to the first address corresponding to the preset distributed configuration center in the second configuration center address list by using the preset updating method, so as to obtain an updated third configuration center address list;

[0029] The third configuration center address list is sent to the preset client, so that the preset client sends a connection request to the preset distributed configuration center for reconnection based on the first address in the third configuration center address list.

[0030] Optionally, the preset distributed configuration center is an Apollo configuration center, the preset update method is an initConfig Services method, the preset simulation data service center is a Mock service center, and the target simulation data is Mock data.

[0031] In a second aspect, the present application provides a software testing device, comprising:

[0032] A data reading module, used to read target data sent by a preset distributed configuration center connected to a preset client, and store a first address corresponding to the preset distributed configuration center in a first configuration center address list; wherein the preset client initiates a request based on the address stored in the first configuration center address list;

[0033] An address list updating module, configured to update the request address corresponding to the preset client from the first address to a second address corresponding to the preset simulation data service center in the first configuration center address list, so as to obtain an updated second configuration center address list;

[0034] a data acquisition request sending module, configured to send the second configuration center address list to the preset client, so that the preset client sends a data acquisition request for simulation data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list;

[0035] A request judgment module is used to judge whether the data acquisition request meets the preset conditions through the preset simulation data service center. If the data acquisition request meets the preset conditions, corresponding target simulation data is generated based on the target data, and the target simulation data is sent to the preset test tool so that the preset test tool can use the target simulation data to test the software to be tested.

[0036] In a third aspect, the present application provides an electronic device, including:

[0037] Memory, used to store computer programs;

[0038] The processor is used to execute the computer program to implement the aforementioned software testing method.

[0039] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned software testing method when executed by a processor.

[0040] As can be seen from the above, before performing software testing, the present application needs to read the target data issued by the preset distributed configuration center connected to the preset client, and store the first address corresponding to the preset distributed configuration center in the first configuration center address list; update the request address corresponding to the preset client from the first address to the second address corresponding to the preset simulation data service center in the first configuration center address list; update the first configuration center address list using a preset update method, so that the preset client sends a data acquisition request to the preset simulation data service center based on the obtained second configuration center address list; determine whether the data acquisition request meets the preset conditions, and if the data acquisition request meets the preset conditions, call the preset simulation data service center and generate simulation data based on the target data, so as to use the target simulation data to test the software to be tested.

[0041] It can be seen that the present application reads the target data sent by the preset distributed configuration center connected to the preset client, and stores the first address corresponding to the preset distributed configuration center in the first configuration center address list; updates the request address corresponding to the preset client from the first address to the second address corresponding to the preset simulation data service center in the first configuration center address list; updates the first configuration center address list using the preset update method, so that the preset client sends a data acquisition request to the preset simulation data service center based on the obtained second configuration center address list; determines whether the data acquisition request meets the preset conditions, and if the data acquisition request meets the preset conditions, calls the preset simulation data service center and generates simulation data based on the target data, so as to use the simulation data to test the software to be tested. In this way, the accuracy of software testing is improved, thereby improving the efficiency of the software development process and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0043] Figure 1 A flowchart of a software testing method disclosed in this application;

[0044] Figure 2 This is a schematic diagram of a traditional software testing process;

[0045] Figure 3 A schematic diagram comparing an original process disclosed in this application and the process of the present invention;

[0046] Figure 4 A schematic diagram of a specific flow chart between functional modules disclosed in this application;

[0047] Figure 5 A schematic diagram of a specific process for replacing a configuration center address disclosed in this application;

[0048] Figure 6 A schematic diagram of a process in a specific Mock service disclosed in this application;

[0049] Figure 7 A schematic diagram of a specific process for restoring data disclosed in this application;

[0050] Figure 8 A schematic diagram of the structure of a software testing device disclosed in this application;

[0051] Fig. 9 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] After the software is started, it is necessary to start the test tool to test the software. The process of testing the software is as follows: first, select the environment to be tested, such as environment 1, environment 2, and then select the traffic test case to be executed so that the test tool can read the case data and call the business logic code to pass the case data into the test tool. Then, the comparison result node in the test tool will read the case data and obtain the business data returned by the software. Finally, the case data is compared with the business data to determine whether the two data are consistent. However, the data content stored in the Apollo configuration center corresponding to different environments is different. When executing the test, if an error occurs in the environment selection link, the test results will be inconsistent due to data differences. To this end, the present application provides a software testing method that can improve the accuracy of software testing and thereby improve the efficiency of the software development process.

[0054] See also Figure 1 As shown, an embodiment of the present invention discloses a software testing method, including:

[0055] Step S11, store the first address corresponding to the preset distributed configuration center into the first configuration center address list, and read the target data issued by the preset distributed configuration center connected to the preset client; wherein the preset client initiates a request based on the address stored in the first configuration center address list.

[0056] In the traditional way, the software will request the Apollo configuration center corresponding to the environment through the Apollo client in different environments. Then, the Apollo client can receive the data returned by the configuration center and store the data returned by the configuration center in the memory for the software to use. After the software is started, you need to start the test tool to test the software. The process of testing the software is as follows: first, select the environment to perform the test, such as: environment 1, environment 2, and then select the traffic test case to be executed so that the test tool can read the case data and call the business logic code to pass the case data into the test tool. Then, the comparison result node in the test tool will read the case data and obtain the business data returned by the software. Finally, compare the use case data with the business data to determine whether the two data are consistent. Among them, the above process is as follows Figure 2 However, since the data stored in the Apollo configuration center for different environments is different, for example, the value of the data corresponding to environment 1 is A, and the value of the data corresponding to environment 2 is B, when using the test tool to perform software testing, if an error occurs in the environment selection link, the test results will be inconsistent due to data differences, thus affecting production.

[0057] To this end, this embodiment chooses to add three functional modules, namely, replacement configuration center address, Mock service, and data restoration, to the traditional process to skip the process node of environment selection by the test tool, and the schematic diagram comparing the original process and the process of the present invention is shown as follows: Figure 3 shown.

[0058] In this embodiment, three functional modules are mainly involved: replacing the configuration center address, Mock service, and restoring data. The flow chart between the above three functional modules is as follows: Figure 4 As shown: First, the embodiment of the present application needs to use the configuration center address replacement module to replace the configuration center address corresponding to the preset Apollo client with the address corresponding to the Mock service, and disconnect the connection between the preset Apollo client and the Apollo configuration center, and connect the preset Apollo client to the Mock service. Then, the Mock service will generate simulation data for testing the software. Finally, the address corresponding to the Mock service corresponding to the preset Apollo client is replaced with the configuration center address.

[0059] Step S12: in the first configuration center address list, the request address corresponding to the preset client is updated from the first address to a second address corresponding to the preset simulation data service center, so as to obtain an updated second configuration center address list.

[0060] In this embodiment, the operation flow diagram of replacing the configuration center address is as follows Figure 5As shown: First, set the Apollo polling time. In a specific implementation, 0 means sending a polling request immediately, 1 means sending a polling request after 1 second, and the embodiment of the present application sets the Apollo polling time to 0. Specifically, the polling time corresponding to the preset simulation data service center is updated from the initial time to the preset time, so that the communication connection established between the preset simulation data service center and the preset client meets the preset connection conditions. In a specific implementation, the embodiment of the present application can set the initialization delay time of the polling task: apollo.long Polling Initial Delay In Mills=0, so that the Apollo client has no delay request.

[0061] Subsequently, the address corresponding to the Apollo configuration center is stored in the local memory, and the request address of the preset Apollo client in the first configuration center address list is replaced from the initial address of the Apollo configuration center to the address corresponding to the Mock service, and the second configuration center address list is obtained to send the second configuration center address list to the preset client. In a specific implementation, the initial address of apollo.config-service needs to be read and saved, and apollo.config-service is set to the address corresponding to the Mock service.

[0062] Step S13: Send the second configuration center address list to the preset client, so that the preset client sends a data acquisition request for simulation data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list.

[0063] In this embodiment, after the second configuration center address list is sent to the preset client, the connection between the preset Apollo client and the configuration center will be disconnected, and the preset Apollo client will be controlled to request the Mock service based on the second address in the second configuration center address list. It is worth mentioning that after replacing the request address corresponding to the preset Apollo client, the preset Apollo client will not request the Mock service immediately, and the configuration needs to be reloaded before it can take effect. That is, the configuration center list is initialized by calling the initConfigServices method through reflection, so that the preset Apollo client loads the modified configuration content, so that the preset Apollo client can use the configuration content to request the Mock service.

[0064] Step S14: determine whether the data acquisition request meets the preset conditions through the preset simulation data service center. If the data acquisition request meets the preset conditions, generate corresponding target simulation data based on the target data, and send the target simulation data to the preset test tool so that the preset test tool can use the target simulation data to test the software to be tested.

[0065] In this embodiment, the process diagram performed in the Mock service is as follows: Figure 6 As shown: First, start the Mock service. Among them, after starting the Mock service, the embodiment of the present application needs to determine whether the Mock service is started. If it has been started, there is no need to start it again. If it has not been started, start the Mock service. Then, determine whether the startup result is successful. If the startup is successful, enter the listening state. Specifically, after sending the second configuration center address list to the preset client, so that the preset client sends a data acquisition request for the simulated data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list, it can also include: starting the preset simulation data service center to obtain the startup result, and judging whether the startup result indicates a successful startup; if the startup result indicates a successful startup, control the preset simulation data service center to receive and process the data acquisition request, and monitor the process of processing the data acquisition request; if the startup result does not indicate a successful startup, generate and send an error message based on the startup result, so that the staff terminal can process based on the error message.

[0066] Subsequently, after the Mock service is started, the embodiment of the present application needs to send a data acquisition request to the preset simulation data service center, and use the preset simulation data service center to determine whether the request type corresponding to the data acquisition request is a polling request. If the request type corresponding to the data acquisition request is a polling request, it is prohibited to return the simulation data. If the request type corresponding to the data acquisition request is not a polling request, enter the next judgment condition.

[0067] Then, it is determined whether the request type corresponding to the data acquisition request is the stop Mock service type. If the request type corresponding to the data acquisition request is the stop Mock service type, the Mock service is stopped. If the request type corresponding to the data acquisition request is not the stop Mock service type, the data acquisition request determination is entered, that is, the data acquisition request type is determined. If the request type corresponding to the data acquisition request is a data acquisition request, the Mock data is returned. If the request type corresponding to the data acquisition request is not a data acquisition request, the process ends.

[0068] Specifically, judging whether a data acquisition request satisfies preset conditions through a preset simulation data service center; if the data acquisition request satisfies preset conditions, generating corresponding target simulation data based on the target data, and sending the target simulation data to a preset test tool may include: judging whether a request type corresponding to a data acquisition request is a polling request through a preset simulation data service center; if the request type corresponding to the data acquisition request is not a polling request, judging whether the request type corresponding to the data acquisition request is a stop simulation data service type; if the request type corresponding to the data acquisition request is not a stop simulation data service type, judging whether the request type corresponding to the data acquisition request is a data request type; if the request type corresponding to the data acquisition request is a data request type, calling the preset simulation data service center and generating target simulation data based on the target data, and sending the target simulation data to the preset test tool.

[0069] In this embodiment, an Apollo Config object can be created, and the Mock data generated by the Mock service can be set as a sub-object of Apollo Config. Subsequently, the newly created Apollo Config object is converted into a json format, and the converted object is returned. Specifically, calling the preset simulation data service center and generating target simulation data based on the target data, and sending the target simulation data to the preset test tool can include: calling the preset simulation data service center to establish an initial object, and generating target simulation data based on the target data, and then setting the target simulation data as a sub-object of the initial object; storing the sub-object in the initial object to obtain the object to be converted, and using the preset format conversion technology to convert the format corresponding to the object to be converted to obtain the target object, and then sending the target object to the preset test tool.

[0070] In this embodiment, the flowchart of restoring data is as follows: Figure 7 As shown: First, the embodiment of the present application needs to restore the Apollo polling time, that is, update the polling time corresponding to the preset simulation data service center from the preset time to the initial time. Specifically, the preset simulation data service center determines whether the data acquisition request meets the preset conditions. If the data acquisition request meets the preset conditions, the corresponding target simulation data is generated based on the target data, and the target simulation data is sent to the preset test tool so that the preset test tool uses the target simulation data to test the software to be tested. It can also include: restoring the polling time corresponding to the preset simulation data service center from the preset time to the initial time.

[0071] Subsequently, the embodiment of the present application needs to replace the initial address of the Apollo configuration center with the address corresponding to the Mock service, that is, read the saved apollo.config-service initial address, and set the above initial address to apollo.config-service, that is, reflectively call the initConfigServices method to initialize the configuration center list, and set apollo.config-service = initial address. Then, call the initialization service of the Apollo client so that the Apollo client loads the configuration content and establishes a connection with the original Apollo configuration center. Specifically, a preset simulation data service center is used to determine whether a data acquisition request meets a preset condition. If the data acquisition request meets the preset condition, corresponding target simulation data is generated based on the target data, and the target simulation data is sent to a preset test tool so that the preset test tool can use the target simulation data to test the software to be tested. It can also include: using a preset reflection call method to call a preset update method, so as to use the preset update method to update the request address corresponding to the preset client from the second address in the second configuration center address list to the first address corresponding to the preset distributed configuration center, so as to obtain an updated third configuration center address list; the third configuration center address list is sent to the preset client, so that the preset client sends a connection request to the preset distributed configuration center based on the first address in the third configuration center address list to reconnect.

[0072] It can be seen that the embodiment of the present application first reads the target data issued by the preset distributed configuration center connected to the preset client, and stores the first address corresponding to the preset distributed configuration center in the first configuration center address list. Subsequently, the request address corresponding to the preset client is updated from the first address to the second address corresponding to the preset simulation data service center in the first configuration center address list; the first configuration center address list is updated using the preset update method, so that the preset client sends a data acquisition request to the preset simulation data service center based on the obtained second configuration center address list; finally, it is determined whether the data acquisition request meets the preset conditions. If the data acquisition request meets the preset conditions, the preset simulation data service center is called and simulation data is generated based on the target data, so as to use the simulation data to test the software to be tested. In this way, the accuracy of software testing is improved, thereby improving the efficiency of the software development process.

[0073] Accordingly, see Figure 5 As shown, the present application also provides a software testing device, including:

[0074] The data reading module 11 is used to read the target data sent by the preset distributed configuration center connected to the preset client, and store the first address corresponding to the preset distributed configuration center into the first configuration center address list; wherein the preset client initiates a request based on the address stored in the first configuration center address list;

[0075] An address list updating module 12, configured to update the request address corresponding to the preset client from the first address to a second address corresponding to the preset simulation data service center in the first configuration center address list, so as to obtain an updated second configuration center address list;

[0076] The data acquisition request sending module 13 is used to send the second configuration center address list to the preset client, so that the preset client sends a data acquisition request for the simulation data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list;

[0077] The request judgment module 14 is used to judge whether the data acquisition request meets the preset conditions through the preset simulation data service center. If the data acquisition request meets the preset conditions, corresponding target simulation data is generated based on the target data, and the target simulation data is sent to the preset test tool so that the preset test tool can use the target simulation data to test the software to be tested.

[0078] As can be seen from the above, before the software test is performed, the embodiment of the present application needs to read the target data sent by the preset distributed configuration center connected to the preset client, and store the first address corresponding to the preset distributed configuration center in the first configuration center address list; in the first configuration center address list, the request address corresponding to the preset client is updated from the first address to the second address corresponding to the preset simulation data service center; the first configuration center address list is updated using the preset update method, so that the preset client sends a data acquisition request to the preset simulation data service center based on the obtained second configuration center address list; it is determined whether the data acquisition request meets the preset conditions, and if the data acquisition request meets the preset conditions, the preset simulation data service center is called and simulation data is generated based on the target data, so as to use the simulation data to test the software to be tested. In this way, the accuracy of software testing is improved, thereby improving the efficiency of the software development process.

[0079] In some specific implementations, the software testing device may further include:

[0080] A first polling time updating unit, used to update the polling time corresponding to the preset simulation data service center from an initial time to a preset time, so that the communication connection established between the preset simulation data service center and the preset client meets a preset connection condition;

[0081] Accordingly, in some specific implementations, the software testing device may further include:

[0082] The second polling time updating unit is used to restore the polling time corresponding to the preset simulation data service center from the preset time to the initial time.

[0083] In some specific implementations, the software testing device may further include:

[0084] A startup result judgment unit, used to start the preset simulation data service center to obtain a startup result, and judge whether the startup result indicates a successful startup;

[0085] a request processing unit, configured to control the preset simulation data service center to receive and process the data acquisition request if the startup result indicates that the startup is successful, and monitor the process of processing the data acquisition request;

[0086] The error information generating unit is used to generate and send error information based on the startup result if the startup result does not indicate successful startup, so that the staff terminal can process based on the error information.

[0087] In some specific implementations, the request determination module 14 may specifically include:

[0088] a first request type determination unit, configured to determine, through the preset simulation data service center, whether the request type corresponding to the data acquisition request is a polling request, and if the request type corresponding to the data acquisition request is not a polling request, determine whether the request type corresponding to the data acquisition request is a stop simulation data service type;

[0089] a second request type determination unit, configured to determine whether the request type corresponding to the data acquisition request is a data request type if the request type corresponding to the data acquisition request is not a stop simulation data service type;

[0090] The simulation data generating unit is used to call the preset simulation data service center and generate target simulation data based on the target data if the request type corresponding to the data acquisition request is a data request type, and send the target simulation data to the preset test tool.

[0091] In some specific implementations, the request determination module 14 may specifically include:

[0092] An object creation unit, configured to call the preset simulation data service center to create an initial object, generate target simulation data based on the target data, and then set the target simulation data as a sub-object of the initial object;

[0093] The object format conversion unit is used to store the sub-object into the initial object to obtain the object to be converted, and convert the format corresponding to the object to be converted using a preset format conversion technology to obtain a target object, and then send the target object to the preset test tool.

[0094] In some specific implementations, the software testing device may further include:

[0095] An address list updating subunit is configured to call a preset updating method by using a preset reflection calling method, so as to update the request address corresponding to the preset client from the second address to the first address corresponding to the preset distributed configuration center in the second configuration center address list by using the preset updating method, so as to obtain an updated third configuration center address list;

[0096] An address list sending unit is used to send the third configuration center address list to the preset client, so that the preset client sends a connection request to the preset distributed configuration center for reconnection based on the first address in the third configuration center address list.

[0097] Furthermore, the present application also discloses an electronic device. Fig. 9 1 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the software testing method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0098] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0099] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0100] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs that can be used to complete the software testing method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.

[0101] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the software testing method disclosed above. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.

[0102] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0103] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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 this application.

[0104] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0105] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0106] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A software testing method, characterized in that: include: The first address corresponding to the preset distributed configuration center is stored in the first configuration center address list, and the target data issued by the preset distributed configuration center connected to the preset client is read; wherein the preset client initiates a request based on the address stored in the first configuration center address list; In the first configuration center address list, the request address corresponding to the preset client is updated from the first address to a second address corresponding to the preset simulation data service center to obtain an updated second configuration center address list; Sending the second configuration center address list to the preset client, so that the preset client sends a data acquisition request for simulation data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list; The preset simulation data service center determines whether the data acquisition request meets the preset conditions. If the data acquisition request meets the preset conditions, corresponding target simulation data is generated based on the target data, and the target simulation data is sent to the preset testing tool so that the preset testing tool can use the target simulation data to test the software to be tested.

2. The software testing method according to claim 1, characterized in that: Before sending the second configuration center address list to the preset client, the method further includes: Updating the polling time corresponding to the preset simulation data service center from the initial time to the preset time, so that the communication connection established between the preset simulation data service center and the preset client meets the preset connection condition; Correspondingly, after judging whether the data acquisition request meets the preset conditions through the preset simulation data service center, and if the data acquisition request meets the preset conditions, generating corresponding target simulation data based on the target data, and sending the target simulation data to a preset test tool so that the preset test tool uses the target simulation data to test the software to be tested, the method further includes: The polling time corresponding to the preset simulation data service center is restored from the preset time to the initial time.

3. The software testing method according to claim 1, characterized in that: After sending the second configuration center address list to the preset client so that the preset client sends a data acquisition request for simulation data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list, the method further includes: Starting the preset simulation data service center to obtain a startup result, and determining whether the startup result indicates a successful startup; If the startup result indicates that the startup is successful, controlling the preset simulation data service center to receive and process the data acquisition request, and monitoring the process of processing the data acquisition request; If the startup result does not indicate a successful startup, an error message is generated and sent based on the startup result so that the staff terminal can process based on the error message.

4. The software testing method according to claim 1, characterized in that: The method of determining whether the data acquisition request satisfies a preset condition through the preset simulation data service center, and if the data acquisition request satisfies the preset condition, generating corresponding target simulation data based on the target data, and sending the target simulation data to a preset test tool includes: Determining, by the preset simulation data service center, whether the request type corresponding to the data acquisition request is a polling request, and if the request type corresponding to the data acquisition request is not a polling request, determining whether the request type corresponding to the data acquisition request is a stop simulation data service type; If the request type corresponding to the data acquisition request is not a stop simulation data service type, determining whether the request type corresponding to the data acquisition request is a data request type; If the request type corresponding to the data acquisition request is a data request type, the preset simulation data service center is called to generate target simulation data based on the target data, and the target simulation data is sent to the preset test tool.

5. The software testing method according to claim 4, characterized in that: The calling the preset simulation data service center and generating target simulation data based on the target data, and sending the target simulation data to the preset test tool includes: Calling the preset simulation data service center to establish an initial object, and generating target simulation data based on the target data, and then setting the target simulation data as a sub-object of the initial object; The sub-object is stored in the initial object to obtain an object to be converted, and a preset format conversion technology is used to convert a format corresponding to the object to be converted to obtain a target object, and then the target object is sent to the preset test tool.

6. The software testing method according to claim 1, characterized in that: After judging whether the data acquisition request satisfies a preset condition through the preset simulation data service center, and if the data acquisition request satisfies the preset condition, generating corresponding target simulation data based on the target data, and sending the target simulation data to a preset test tool so that the preset test tool uses the target simulation data to test the software to be tested, the method further includes: Using a preset reflection calling method to call a preset updating method, so as to update the request address corresponding to the preset client from the second address to the first address corresponding to the preset distributed configuration center in the second configuration center address list by using the preset updating method, so as to obtain an updated third configuration center address list; The third configuration center address list is sent to the preset client, so that the preset client sends a connection request to the preset distributed configuration center for reconnection based on the first address in the third configuration center address list.

7. The software testing method according to any one of claims 1 to 6, characterized in that: The preset distributed configuration center is the Apollo configuration center, the preset update method is the init Config Services method, the preset simulation data service center is the Mock service center, and the target simulation data is the Mock data.

8. A software testing device, characterized in that: include: A data reading module, used to read target data sent by a preset distributed configuration center connected to a preset client, and store a first address corresponding to the preset distributed configuration center in a first configuration center address list; wherein the preset client initiates a request based on the address stored in the first configuration center address list; An address list updating module, configured to update the request address corresponding to the preset client from the first address to a second address corresponding to the preset simulation data service center in the first configuration center address list, so as to obtain an updated second configuration center address list; a data acquisition request sending module, configured to send the second configuration center address list to the preset client, so that the preset client sends a data acquisition request for simulation data of the software to be tested to the preset simulation data service center based on the second address in the second configuration center address list; A request judgment module is used to judge whether the data acquisition request meets the preset conditions through the preset simulation data service center. If the data acquisition request meets the preset conditions, corresponding target simulation data is generated based on the target data, and the target simulation data is sent to the preset test tool so that the preset test tool can use the target simulation data to test the software to be tested.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the software testing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the steps of the software testing method according to any one of claims 1 to 7 are implemented.