A method, apparatus, server, and storage medium for testing an application.
By establishing an application testing environment and communication connection, the problems of environmental instability and information asymmetry during application iteration were solved, enabling efficient development testing and troubleshooting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2026-03-10
AI Technical Summary
During the application iteration process, the development and testing environment is complex and unstable, and the various environments cannot coordinate and call each other, resulting in low development and testing efficiency, information asymmetry due to environment changes, and difficulty in troubleshooting.
Establish application testing environments subordinate to each application and form a stable network through communication connections. Respond to test requests to perform environment replacement and connection tests, and use automated test cases for fault analysis and change alerts.
It improves the efficiency of development and testing and the stability of the environment, reduces troubleshooting time, provides a stable external environment, and supports timely response and efficient information dissemination.
Smart Images

Figure CN116126683B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to application testing technology, and more particularly to an application testing method, apparatus, server, and storage medium. Background Technology
[0002] The complex relationships between current applications necessitate indispensable development and testing during application iteration. However, each application typically has multiple development and testing environments, further complicating the interconnections within these environments. Different environments deploy different programs and data; connecting to the wrong environment can trigger a series of problems. Secondly, frequent changes to programs and data in some environments, without the knowledge of these changes by the connecting parties, also cause numerous issues. Furthermore, programs providing transaction interfaces and those calling these interfaces have different environmental requirements. Programs providing transaction interfaces desire flexible environments for their own development and testing, while programs calling transaction interfaces require stable environments to provide a consistent service environment for their own development and testing.
[0003] In existing technologies, the iteration processes of each application are independent of each other. During the development and testing process of each application, multiple development and testing environments are built according to requirements. However, the environment setup takes too long, and the environments cannot coordinate and call each other. When the called service application itself iterates, resulting in changes to version, data, configuration, etc., the calling consumer developer has no way of knowing. Summary of the Invention
[0004] This invention provides a method, apparatus, server, and storage medium for testing applications, in order to improve the efficiency of development and testing.
[0005] In a first aspect, embodiments of the present invention provide a method for testing an application, the method comprising:
[0006] Establish application testing environments belonging to each application, and communication connections between each application testing environment; wherein, the application testing environment of each application deploys a test version of the corresponding application;
[0007] In response to a test request for a first application, a first application test environment is determined from the application test environments belonging to each application, and a second application test environment communicating with the first application test environment is determined from the communication connection.
[0008] The first application development environment is replaced with the first application testing environment, and the development version of the first application is replaced with the test version of the first application deployed in the first application testing environment, thereby establishing a communication connection between the first application development environment and the second application testing environment.
[0009] The communication connection between the development version of the first application and the test version of the second application is tested to obtain the connection relationship test results of the first application.
[0010] Optionally, establishing application testing environments subordinate to each application and communication connections between the various application testing environments includes:
[0011] Based on the various application production environments and the communication connections between them, establish the application testing environment and the communication connections between them.
[0012] Optionally, after establishing communication connections between the various application testing environments, the system further includes:
[0013] If the communication connection between the application production environment and / or between different application production environments changes, re-establish the communication connection between the application test environment and / or between different application test environments, and send a change notification to the application connected to the communication connection.
[0014] Optionally, after establishing the application testing environments belonging to each application and the communication connections between the application testing environments, the method further includes:
[0015] Test the communication connections between the various application test versions deployed in the various application test environments.
[0016] Optionally, testing the communication connectivity between different application test versions deployed in different application test environments includes:
[0017] Obtain automated test cases; wherein, the automated test cases are used to test the calls between various applications;
[0018] The automated test cases are executed periodically.
[0019] If an exception occurs during the execution of the automated test cases, the source of the fault is analyzed based on the connection relationship between the various applications, and an alert message is generated based on the source of the fault.
[0020] Secondly, embodiments of the present invention also provide an application testing apparatus, the apparatus comprising:
[0021] The test environment establishment module is used to establish application test environments belonging to each application, as well as communication connections between the application test environments; wherein, the test versions of the corresponding applications are deployed in the application test environments of each application.
[0022] A test environment determination module is used to determine a first application test environment from the application test environments belonging to each application in response to a test request for a first application, and to determine a second application test environment that communicates with the first application test environment from the communication connection.
[0023] The development environment replacement module is used to replace the first application test environment with the first application development environment, and to replace the test version of the first application deployed in the first application test environment with the development version of the first application, and to establish a communication connection between the first application development environment and the second application test environment.
[0024] The application environment testing module is used to test the communication connection between the development version of the first application and the test version of the second application, and obtain the connection relationship test results of the first application.
[0025] Thirdly, embodiments of the present invention also provide a server, the server comprising:
[0026] One or more processors;
[0027] Storage device for storing one or more programs.
[0028] When the one or more programs are executed by the one or more processors, the one or more processors implement the testing method for the application as described in any of the embodiments of this application.
[0029] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements a testing method for an application program as described in any of the embodiments of the present application.
[0030] In the embodiments of the present application, an application test environment subordinate to each application program is established, as well as a communication connection between each application test environment; wherein, a test version of the corresponding application program is deployed in the application test environment of each application program; in response to a test request for the first application program, a first application test environment is determined from the application test environments subordinate to each application program, and a second application test environment communicating with the first application test environment is determined from the communication connection; the first application development environment is used to replace the first application test environment, and the development version of the first application program is used to replace the test version of the first application program deployed in the first application test environment, and a communication connection between the first application development environment and the second application test environment is established; the communication connection between the development version of the first application program and the test version of the second application program is tested, and a connection relationship test result of the first application program is obtained, solving the problem of affecting the development test progress caused by unstable associated service-side environments and asymmetric changes in associated service-side environment information during the development test of application programs. The present invention solves the problem brought by unstable associated environments by establishing an application test environment, forming a stable communication network with the application test environments of each application program, and accessing the communication network composed of the application test environments as needed during the development test of application programs. Developers can troubleshoot which specific link has problems, greatly improving the development test efficiency.
[0031] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0033] Figure 1 It is a flowchart of a method for testing an application program provided in Embodiment 1 of the present invention;
[0034] Figure 2 It is a schematic diagram of an application program R & D environment in the prior art;
[0035] Figure 3 It is a schematic diagram of the connection relationship of an application program development environment in the prior art;
[0036] Figure 4 It is a flowchart of a method for testing an application program provided in Embodiment 2 of the present invention;
[0037] Figure 5 This is a schematic diagram illustrating the connection between applications according to Embodiment 2 of the present invention;
[0038] Figure 6 The diagram shown is a structural schematic of an application testing device provided in Embodiment 3 of the present invention;
[0039] Figure 7 This is a schematic diagram of the structure of a server provided in Embodiment 4 of this application. Detailed Implementation
[0040] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0041] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.
[0042] Example 1
[0043] Figure 1 This is a flowchart of an application testing method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of testing the interoperability between programs during the development and testing phase of an application. The method can be executed by an application testing device, which can be implemented in software and / or hardware. The device can be configured in a management platform, which can be deployed on a server.
[0044] Before introducing the testing method for the application provided in this embodiment, the application scenarios of the method can be illustrated by example.
[0045] Typically, an organization may have hundreds of applications with complex interrelationships. In a development and testing environment, see... Figure 2The diagram illustrates an application development environment in the prior art. Numerous development and testing environments exist, with each application having multiple sets, such as development environments, integration testing environments, functional testing environments, and performance testing environments. Furthermore, the environment version data changes frequently, leading to instability. During the application development and testing phase, the following environmental issues typically arise: First, instability of associated environments. Integration testing, application testing, functional testing, and business acceptance testing often require joint debugging with associated environments. If associated environments change frequently or become unavailable, transactions related to this application will also fail. The error is not due to a defect in this application, but rather to a problem caused by the associated environment. For development and testing personnel, the instability of associated environments significantly hinders their own application development and testing work, affecting the development and testing progress. Second, information asymmetry regarding changes in associated environments. An application typically provides interface services to multiple applications, see [reference needed]. Figure 3 The diagram illustrates a connection relationship between application development environments in the prior art. The connections between various development and testing environments are chaotic. When the service-side application environment needs significant changes (such as major version changes, full-scale data changes, or changes to critical related applications), it often has a significant impact on the consumer-side application environment. However, the service-side application environment has no way of knowing accurately which consumer-side environments are using its environment, thus making timely notification impossible. Conversely, the consumer-side application environment has no way of knowing about service-side environment changes. Thirdly, environment problems are difficult to troubleshoot. The implementation of an application function usually involves the interaction of multiple applications, resulting in long call chains. Each application is maintained by different personnel, making it difficult to pinpoint the specific link where the problem occurred when errors occur. This causes significant difficulties for development and testing work, greatly impacting efficiency. The development and testing environment is the foundation of development and testing work; how to better solve environment problems and improve development and testing efficiency is a major challenge for development and testing.
[0046] See Figure 1 The application testing method provided in this embodiment specifically includes:
[0047] S110. Establish application testing environments subordinate to each application, and communication connections between each application testing environment;
[0048] During the development of each application, there are numerous development and testing environments. Each application has multiple development and testing environments, and different environments are needed at different development stages according to the functional requirements of the development, such as development environment, integration testing environment, functional testing environment, performance testing environment, etc.
[0049] The environment can be an application system service deployed on a computer hardware platform, consisting of a database, cache, middleware, and application software, used to deploy the application and provide support for its operation. For example, the environment can be deployed on a server. Different environments are required at different stages of application development according to the functional requirements. For instance, the development environment can be the environment used when writing code for the application; for ease of development and debugging, it can enable all error reporting and testing tools and represents the most basic environment.
[0050] Optionally, in this embodiment of the application, the application testing environment of each application deploys a test version of the corresponding application. Each application has its corresponding application testing environment, which is an environment provided in this embodiment for testing the communication connections between applications. The application testing environments can be connected as needed to form a communication network between applications, so as to test the communication connections between the applications.
[0051] Optionally, in this embodiment, the application testing environment for each application can be deployed on a single server or distributed across multiple servers. After the application testing environment for each application is built, a routing management table can be created in the management platform, and its own routing information, such as IP address and ID, can be added to it. Each application shares the routing management table to facilitate establishing communication connections with other application testing environments.
[0052] Optionally, in this embodiment, since each application testing environment is used to test the communication connection between various applications, an application is a consumer when using the services of other applications and a service provider when providing services to other applications. In order to ensure the accuracy of the test, the application deployed in the application testing environment should be a stable and reliable version. In this embodiment, the test version of the application can be a small-scale gray-scale test version or a formal release version that is provided to the public.
[0053] Preferably, in this embodiment of the application, to ensure the stability of the application testing environment, the application testing environments of each application can be constructed according to a unified specification. Then, the application testing environments of each application can be connected for communication as needed. For example, the unified specification may include the following requirements: deploying test versions or official release versions on the application testing environment; data with the same meaning should use the same de-identification rules between mutually communicating applications to maintain data consistency; for shared resources that conflict during use, scheduling should be carried out according to the principles of first-come, first-served, prioritizing key resources, conflict resolution, and broad notification; the routing information of the application testing environment should be added to the routing management table for use by the application testing environment of the consumer application; the application testing environment should be a highly available architecture, and the architecture of the application testing environment for applications with higher importance should be consistent with the production environment.
[0054] Preferably, in this embodiment of the application, the establishment of application testing environments belonging to each application and the communication connections between each application testing environment includes: establishing application testing environments and communication connections between each application testing environment based on each application production environment and the communication connections between each application production environment.
[0055] The production environment refers to the environment in which applications providing services are deployed. Application testing environments built upon this environment perfectly comply with the aforementioned unified specifications, and the communication connections between various application testing environments can almost perfectly accommodate all user communication connection testing needs. Specifically, in this embodiment, the production environment and the communication connections between various application production environments can be directly cloned as application testing environments, and communication connections between these environments can be established.
[0056] S120. In response to a test request for a first application, determine a first application test environment from the application test environments belonging to each application, and determine a second application test environment that communicates with the first application test environment from the communication connection.
[0057] Wherein, the first application may be a consumer application, the first application testing environment may be an application testing environment that deploys the first application, there may be one or more second application testing environments, and a second application is deployed in the second application testing environment, the second application may be a service provider application that provides services to the first application.
[0058] To test whether the first application can call the data interface provided by the service provider application and communicate effectively, the user can enter the first application to be tested in the control interface, such as the name of the application. The management platform can find the first application test environment that deploys the first application, and determine the second application test environment that communicates with the first application test environment based on the established communication connection. Specifically, the second application test environment can be determined based on the routing relationship stored in the routing management table.
[0059] S130. Replace the first application test environment with the first application development environment, and replace the test version of the first application deployed in the first application test environment with the development version of the first application, and establish a communication connection between the first application development environment and the second application test environment.
[0060] The first application development environment may be an environment in which a development version of the first application is deployed.
[0061] In this application implementation, the application environment is divided into an application testing environment and an application development environment. The application development environment can be a collection of other environments for the application besides the application testing environment, including an environment for staff to develop application versions, an environment for conducting application performance testing, etc. Each application can include multiple application development environments.
[0062] Optionally, in this embodiment, after the application development environment of a certain application is built, the application development environment can be deployed on one server or distributed across multiple servers. After the application development environment of each application is built, it can add its own routing information, such as IP address and ID, to the routing management table to facilitate the establishment of communication connections with the application testing environment or application development environment of other applications.
[0063] For example, the management platform can identify the first application development environment and establish a communication connection between the first application development environment and the second application testing environment. Specifically, the communication connection can be established based on the routing relationship stored in the routing relationship table. For instance, the management platform can look up the communication interface of the second application testing environment according to the routing relationship table, send the communication interface information to the first application development environment, and enable the first application development environment to perform communication configuration and connect to the second application testing environment.
[0064] S140. Test the communication connection between the development version of the first application and the test version of the second application to obtain the connection relationship test results of the first application.
[0065] Specifically, the test version of the second application provides interface services to the outside world. Test cases can be written according to requirements to test the ability of the development version of the first application to call the interface, and the test results are used as the connection relationship test results of the first application.
[0066] The technical solution of this application divides the application environment into an application testing environment and an application development environment. By establishing application testing environments subordinate to each application and communication connections between these environments, various applications within the organization can connect and use the system. The application development environment connects to the service provider's application testing environment as needed, thus solving the problems of chaotic connections in the development environment and difficulty in troubleshooting integration testing issues. The application testing method proposed in this invention, by constructing application testing environments for each application, makes the maintenance goals of the development testing environment more focused and provides more timely support and response. The interconnected application testing environments form a stable and reliable communication network, and the application development environment connects on demand, greatly improving the stability of the associated environment and providing a stable external associated environment for development and testing work.
[0067] Example 2
[0068] Figure 4 This is a flowchart of an application testing method provided in Embodiment 2 of the present invention. It should be noted that this embodiment is a further optimization of the above embodiments, and the same terms have similar definitions, principles, processes, and technical effects as those in the above embodiments. The method includes:
[0069] S410. Establish application testing environments subordinate to each application, and communication connections between each application testing environment;
[0070] S420. If the communication connection between the application production environment and / or between the various application production environments changes, re-establish the communication connection between the application test environment and / or between the various application test environments, and send a change notification to the application connected to the communication connection.
[0071] For example, the application testing environments of various applications are listed in the management platform for unified management. Consumers can subscribe to messages for the service provider's application testing environments. The platform records the service provider's environment usage and subscription information. When there are significant changes to the service provider's application testing environment or communication connection, such as major version changes, full-scale data changes, or changes to key related applications, the service provider can directly send environment change notifications to users or subscribers through the application testing environment platform. For example, the components of environment information include [Environment ID, Environment Name, Environment Type, Application Name, Module Name, Access Address, Administrator, Subscriber].
[0072] Furthermore, if there are any changes to the application testing environment, they should be conducted during non-working hours, and staff should be notified of any changes to the working hours.
[0073] S430. Test the communication connection between the various application test versions deployed in each application test environment;
[0074] Optionally, in this embodiment, timed monitoring can be established for the application testing environment of each application system to achieve timely early warning and rapid troubleshooting of environment faults. For the communication network associated with a certain application, automated test cases supporting that communication network can be established for monitoring. If communication is abnormal, an abnormality reminder message is generated; if communication is normal, step S240 is executed.
[0075] For example, testing the communication connections between different application test versions deployed in different application test environments may include: obtaining automated test cases; wherein the automated test cases are used to test the calls between different applications; executing the automated test cases periodically; if an exception occurs during the execution of the automated test cases, analyzing the source of the fault based on the connection relationship between the different systems, and generating an alert message based on the source of the fault.
[0076] Specifically, the management platform organizes automated test cases into a multi-level call relationship view. The public service environment platform executes each automated test case periodically, covering the testing of communication connections in the application testing environment for all applications. When a test case execution result results in an error, the platform automatically analyzes the source of the environmental fault based on the execution status of test cases in upstream and downstream environments, displays the error in the multi-level call relationship view, and sends alarm notifications to relevant personnel, such as by phone, SMS, or email.
[0077] S440. In response to a test request for a first application, determine a first application test environment from the application test environments belonging to each application, and determine a second application test environment communicating with the first application test environment from the communication connection.
[0078] S450. Replace the first application test environment with the first application development environment, and replace the test version of the first application deployed in the first application test environment with the development version of the first application, and establish a communication connection between the first application development environment and the second application test environment.
[0079] Specifically, a service of a certain application may involve multiple applications. These applications communicate sequentially and call each other to jointly complete a certain service. Some of these applications can be developed simultaneously, and the communication connections between the development versions of these applications can be tested. Therefore, further in this embodiment, the first application may include multiple applications. The application test environments of these multiple applications communicate with each other and are collectively used as the first application test environment. After determining the first application test environment and the second application test environment to be tested, the management platform can determine the first development environment of the first application and establish a communication connection between the first application development environment and the second application test environment. Since the first application may include multiple applications, it has multiple application development environments corresponding to these multiple applications. In this case, a communication connection can be established between these multiple application development environments based on the communication connections of the multiple applications in the first application test environment, and the entire environment can be used as the first application development environment. Specifically, a communication connection can be established based on the routing relationships stored in the routing table.
[0080] Furthermore, the application testing environment in this application embodiment is dedicated to testing the communication connection between different applications. For the performance testing of a certain application itself, other environments should be established for testing. Of course, the application testing environment in this application implementation can also be used for performance testing, but in order to prioritize testing the communication connection between different applications, the application testing environment is generally not used for performance testing. If performance testing is necessary, authorization from relevant personnel should be obtained before testing.
[0081] S460. Test the communication connection between the development version of the first application and the test version of the second application to obtain the connection relationship test results of the first application.
[0082] For example, see below. Figure 5 This diagram illustrates a connection between applications. Assume there are five applications: A, B, C, D, and E. Application A has three environments: an application development environment (version development), an application development environment (performance testing), and an application testing environment. Application B also has these three environments. Application C has two environments: an application development environment (version development) and an application testing environment. Application E has one application testing environment. The connection relationships between the five systems are assumed to be: A calls B, B calls C, C calls D, and D calls E.
[0083] When developing and testing applications, applications are connected to the communication network of the application testing environment as needed. When there are multiple applications, for example, for the development and performance testing of application versions A and B, the development environments (version development) of application A and B can connect to the application testing environment of system C, and the development environments (performance testing) of application A and B can connect to the application testing environment of system C. When there is only one application, for the development of application version C, the development environment (version development) of application C can connect to the application testing environment of system D; for the performance testing of application D, the development environment (performance testing) of application D can connect to the application testing environment of system E.
[0084] The technical solution of this application divides the application environment into an application testing environment and an application development environment. By establishing application testing environments subordinate to each application and communication connections between these environments, it allows various applications within the organization to connect and use. The application development environment connects to the service provider's application testing environment as needed, thus solving the problems of chaotic connections in the development environment and difficulty in troubleshooting integration testing issues. The application testing method proposed in this invention, through environment change subscription and notification, builds a direct and efficient information dissemination bridge between the consumer system and the service application, resolving the contradictions caused by information asymmetry between the consumer and the service provider. Through environment monitoring and alarms, it transforms the situation from one of delayed detection and difficulty in troubleshooting transaction problems to early warning and rapid troubleshooting of environmental issues, greatly reducing the time cost of resolving environmental problems.
[0085] Example 3
[0086] Figure 6 The diagram shown is a structural schematic of an application testing device provided in Embodiment 3 of the present invention. The application testing device includes a test environment establishment module 610, a test environment determination module 620, a development environment replacement module 630, and an application environment testing module 640.
[0087] The test environment establishment module 610 is used to establish application test environments belonging to each application and communication connections between each application test environment; wherein, the application test environment of each application deploys a test version of the corresponding application.
[0088] The test environment determination module 620 is used to determine a first application test environment from the application test environments belonging to each application in response to a test request for the first application, and to determine a second application test environment that communicates with the first application test environment from the communication connection.
[0089] The development environment replacement module 630 is used to replace the first application test environment with the first application development environment, and replace the test version of the first application deployed in the first application test environment with the development version of the first application, and establish a communication connection between the first application development environment and the second application test environment.
[0090] The application environment testing module 640 is used to test the communication connection between the development version of the first application and the test version of the second application, and obtain the connection relationship test results of the first application.
[0091] The application testing method proposed in this invention, by constructing application testing environments for each application, makes the maintenance goals of the development and testing environments more focused, supports more timely responses, and interconnects the application testing environments to form a stable and reliable communication network. The application development environment can access the network on demand, which greatly improves the stability of the associated environment and provides a stable external associated environment for development and testing work.
[0092] As an optional implementation, the environment setup module includes a production environment replication unit;
[0093] The production environment replication unit is used to establish communication connections between various application production environments and between various application production environments, as well as to establish communication connections between application testing environments and between various application testing environments.
[0094] As an optional implementation, the environment establishment module further includes a test environment reconstruction unit;
[0095] The test environment reconstruction unit is used to re-establish the communication connection between the application test environment and / or between the application test environments if the communication connection between the application production environment and / or between the application production environments changes, and to send a change reminder to the application of the communication connection.
[0096] As an optional implementation, the device further includes a communication connection monitoring module for testing the communication connection between various application test versions deployed in various application test environments.
[0097] As an optional implementation, the communication connection monitoring module is specifically used to acquire automated test cases; wherein, the automated test cases are used to test the calling situation between various applications; the automated test cases are executed periodically; if an abnormality occurs during the execution of the automated test cases, the source of the fault is analyzed based on the connection relationship between various applications, and an alert message is generated based on the source of the fault.
[0098] The application testing apparatus provided in the embodiments of the present invention can execute the application testing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0099] Example 4
[0100] Figure 7 This is a schematic diagram of the structure of a server provided in Embodiment 4 of this application, as shown below. Figure 7 As shown, the server includes a processor 710, a memory 720, an input device 730, and an output device 740; the number of processors 710 in the device / terminal / server can be one or more. Figure 7 Taking a processor 710 as an example; the processor 710, memory 720, input device 730, and output device 740 in the device / terminal / server can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.
[0101] The memory 720, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the application testing method in this embodiment of the invention (e.g., the test environment establishment module 610, test environment determination module 620, development environment replacement module 630, and application environment testing module 640 in the application testing device). The processor 710 executes various functional applications and data processing of the device / terminal / server by running the software programs, instructions, and modules stored in the memory 720, thereby implementing the aforementioned application testing method.
[0102] The memory 720 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 720 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 720 may further include memory remotely located relative to the processor 710, which can be connected to the device / terminal / server via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0103] Input device 730 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the server. Output device 740 may include display devices such as a display screen.
[0104] Example 5
[0105] Embodiment 5 of the present invention also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the program implements a method for testing an application, the method comprising:
[0106] Establish application testing environments belonging to each application, and communication connections between each application testing environment; wherein, the application testing environment of each application deploys a test version of the corresponding application;
[0107] In response to a test request for a first application, a first application test environment is determined from the application test environments belonging to each application, and a second application test environment communicating with the first application test environment is determined from the communication connection.
[0108] The first application development environment is replaced with the first application testing environment, and the development version of the first application is replaced with the test version of the first application deployed in the first application testing environment, thereby establishing a communication connection between the first application development environment and the second application testing environment.
[0109] The communication connection between the development version of the first application and the test version of the second application is tested to obtain the connection relationship test results of the first application.
[0110] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the method operations described above, but can also execute related operations in the application testing methods provided in any embodiment of the present invention.
[0111] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0112] It is worth noting that in the embodiments of the search device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0113] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A test method of an application program, characterized by, The application comprises the following steps: establishing application test environments subordinate to respective application programs and communication connections between the respective application test environments, wherein the respective application test environments are deployed with test versions of the corresponding application programs; in response to a test request for a first application program, determining a first application test environment from the application test environments subordinate to the respective application programs and determining a second application test environment in communication with the first application test environment from the communication connections; replacing the first application test environment with a first application development environment and replacing the test version of the first application program deployed in the first application test environment with a development version of the first application program, and establishing a communication connection between the first application development environment and the second application test environment; testing the communication connection between the development version of the first application program and the test version of the second application program to obtain a connection relationship test result of the first application program; after the establishment of the application test environments subordinate to the respective application programs and the communication connections between the respective application test environments, the following steps are further included: obtaining automated test cases, wherein the automated test cases are used to test the calling conditions between the respective application programs; wherein the management platform organizes the automated test cases to form a multi-level calling relationship view, and the common service environment platform executes the respective automated test cases at regular time intervals to cover the testing of the communication connections of the application test environments of all the application programs; executing the automated test cases at regular time intervals; if an exception occurs in the execution of the automated test cases, analyzing the source of the fault according to the connection relationship between the respective application programs and generating a prompt message according to the source of the fault.
2. The method of claim 1, wherein, The establishment of the application test environments subordinate to the respective application programs and the communication connections between the respective application test environments comprises the following steps: establishing the application test environments and the communication connections between the respective application test environments according to the respective application production environments and the communication connections between the respective application production environments.
3. The method according to claim 1 or 2, characterized in that, after the establishment of the communication connections between the respective application test environments, the following steps are further included: if the application production environments and / or the communication connections between the respective application production environments change, re-establishing the application test environments and / or the communication connections between the respective application test environments and sending a change prompt to the application programs in communication.
4. A test apparatus for an application program, characterized by comprising: The application comprises the following steps: a test environment establishing module for establishing application test environments subordinate to respective application programs and communication connections between the respective application test environments, wherein the respective application test environments are deployed with test versions of the corresponding application programs; a test environment determining module for determining a first application test environment from the application test environments subordinate to the respective application programs and determining a second application test environment in communication with the first application test environment from the communication connections in response to a test request for a first application program; The development environment replacement module is configured to replace the first application test environment with a first application development environment, and replace a test version of a first application program deployed in the first application test environment with a development version of the first application program, and establish a communication connection between the first application development environment and the second application test environment. The application environment test module is configured to test the communication connection between the development version of the first application program and the test version of the second application program, and obtain a connection relationship test result of the first application program. The communication connection monitoring module is specifically configured to obtain an automated test case. The automated test case is used to test the calling relationship between the application programs. The management platform organizes the automated test case to form a multi-level calling relationship view, and the common service environment platform executes each automated test case at a regular time to test the communication connection of the application test environment of all the application programs.
5. The apparatus of claim 4, wherein, The automated test case is executed at a regular time. If an exception occurs in the execution of the automated test case, a fault source is analyzed according to the connection relationship between the application programs, and a prompt message is generated according to the fault source.
6. The apparatus of claim 5, wherein, The environment establishment module includes a production environment replication unit. The production environment replication unit is configured to establish a communication connection between each application production environment and each application production environment, and establish a communication connection between each application test environment and each application test environment.
7. A server, characterized by The environment establishment module further includes a test environment reconstruction unit. The test environment reconstruction unit is configured to reestablish a communication connection between each application test environment and each application test environment, and send a change prompt to an application program of the communication connection, if a change occurs in the communication connection between each application production environment and each application production environment. The server includes: one or more processors; 8. A computer-readable storage medium having stored thereon a computer program, characterized in that a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the application program test method of any one of claims 1-3. The program is executed by the processor to implement the application program test method of any one of claims 1-3.
Citation Information
Patent Citations
Method and device for determining test environment connectivity
CN112134764A
Program testing method and program testing device
CN113360379A