Program test control, execution method and its corresponding devices, equipment and media

By obtaining and transmitting installation packages and test cases on terminal devices, the automated testing framework is used to solve the problem of inefficient testing of terminal devices, and efficient automated testing is achieved, suitable for applications with frequent version updates.

CN112199283BActive Publication Date: 2024-11-26GUANGZHOU FANGGUI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011079355.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-10
Publication Date
2024-11-26
Estimated Expiration
2040-10-10

AI Technical Summary

Technical Problem

The prior art is difficult to realize automated testing of terminal device applications, especially in frequent version updates and human-computer interaction testing, which leads to inefficient testing and affects the user experience.

Method used

By obtaining the installation package and test cases of the target program, the automated test is performed using different communication links, including the first communication link for the transmission of the installation package and the second communication link for the transmission and execution of the test cases, simulated interaction Events to automate testing of the application.

Benefits of technology

It realizes the automated testing framework of the application, improves testing efficiency, reduces manual operations, is suitable for multiple versions of testing, and saves development costs and memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112199283B_ABST
    Figure CN112199283B_ABST
Patent Text Reader

Abstract

The present application discloses a program test control and execution method and its corresponding device, equipment, and medium. The control method includes the following steps: obtaining an installation package of a target program; enabling a first communication link to transmit the installation package to a target device, and driving the installation package to complete installation in the target device; enabling a second communication link to transmit a test case corresponding to the target program to the target device, and driving the target program to be tested and run under the control of an instruction set for simulating a series of interactive events contained in the test case. The present application implements an application automation test solution, which helps to improve the efficiency of automated testing of the tested application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer software testing, and in particular to a program testing control method, device, and corresponding electronic equipment and non-volatile storage medium, and also to a program testing execution method, device, and corresponding electronic equipment and non-volatile storage medium. Background Art

[0002] After the development is completed, the application (APP) for the terminal device needs to be tested before it can be released, so as to test the various performances of the application during its operation in the terminal device and promptly discover various potential operating problems, such as whether the pop-up window is normal, whether the business logic is correct, whether the human-computer interaction function is smooth, whether any abnormalities occur, etc.

[0003] The testing requirements of applications on the terminal device side are more concerned about the interactive experience of applications due to environmental factors such as touch interaction and screen size differences. Therefore, it is different from the software testing on traditional desktop computers, and more attention is paid to the touch response test of human-computer interaction. Another problem with applications on the terminal device side is that the versions are frequently updated. Sometimes a new version is released in a week or a few days. The code involved in the new version is modified in all aspects. These modifications sometimes affect the whole system. Therefore, the program testing team often has to face a lot of testing work. Considering the randomness of human-computer interaction itself, program testing usually relies on manual work. Although manual testing can maximize the restoration of user usage habits and implement some touch interaction tests, the efficiency of manual testing can be imagined. Therefore, every time a new version is released, considering factors such as timeliness and low manual efficiency, it is often hastily released without comprehensive testing, which often leads to new problems and affects the user experience.

[0004] In addition, in practice, each development team may be responsible for the development of multiple applications. From the perspective of software engineering management, it is obviously unscientific to add a large number of testers to run tests and troubleshoot problems on each version in response to the frequent updates of each application.

[0005] There are various platforms and tools in the prior art that assist in implementing software run tests. These tools generally only focus on individual links or aspects of the test project, are difficult to integrate organically, and cannot provide a unified framework for efficient testing of applications. Therefore, it is difficult to meet the application testing needs in a large number of frequent development situations.

[0006] In view of the above common problems faced by the industry, some effective solutions are urgently needed. Summary of the invention

[0007] The primary purpose of the present application is to solve at least one of the above problems and provide a program test control method and its corresponding device, electronic device, and non-volatile storage medium, so as to realize the control of the application program to complete automated testing on the device side.

[0008] Another object of the present application is to provide a program test execution method and its corresponding device, electronic device, and non-volatile storage medium to adapt to the previous object, so that the automated test can be executed on the device side.

[0009] In order to meet the various objectives of this application, this application adopts the following technical solutions:

[0010] A program test control method provided for one of the purposes of this application comprises the following steps:

[0011] Get the installation package of the target program;

[0012] Enable the first communication link to transmit the installation package to the target device, and drive the installation package to complete installation in the target device;

[0013] The second communication link is enabled to transmit a test case corresponding to the target program to the target device, and the target program is driven to run under the control of an instruction set for simulating a series of interactive events contained in the test case.

[0014] In a further embodiment, the method includes the following steps before enabling the second communication link: controlling the target device through the first communication link to complete the configuration of the second communication link.

[0015] In a further embodiment, before the step of completing the configuration of the second communication link through the first communication link control target device, the method controls the target device to run a process for supporting the operation of the second communication link through the first communication link control target device.

[0016] In a further embodiment, before the step of controlling the target device to run a process for supporting the operation of the second communication link through the first communication link, the method transmits a program installation file corresponding to the process to the target device through the first communication link, and drives the program installation file to complete the installation in the target device.

[0017] In a preferred embodiment, in the step of obtaining the installation package of the target program, the installation package of the latest version of the target program is obtained from a remote server.

[0018] In a further embodiment, in the step of enabling the second communication link to transmit the test case adapted to the target program to the target device, the test case corresponding to the installation package is determined by querying from a local database using the uniqueness feature of the installation package.

[0019] In some embodiments, the instruction set of the test case includes a description of a conventional test business process, in which the time sequence relationship in which multiple interactive events are applied conforms to the scheduling sequence relationship between interface components displayed by the target program at runtime.

[0020] In some embodiments, the instruction set of the test case includes a description of an exception handling business process, in which at least one of the interaction events causes an interface component of the target program to switch from an inactive state to an active state.

[0021] In a further embodiment, the method comprises the following post-processing steps:

[0022] Format the test case running result data fed back by the target device and output the corresponding result information.

[0023] A program test execution method provided for one of the purposes of this application comprises the following steps:

[0024] Receiving an installation package of the target program from the server through the first communication link to complete local installation of the target program;

[0025] Receiving a test case corresponding to the installation package from the server via a second communication link;

[0026] The instruction set in the test case is parsed and executed, so as to simulate a series of interactive events acting on the target program through the execution of the instruction set to complete the running test.

[0027] In a further embodiment, the method comprises the following steps:

[0028] A process for supporting the operation of the second communication link is started to complete the configuration of the second communication link.

[0029] In a further embodiment, before starting a process for supporting the operation of the second communication link, the method receives a program installation file corresponding to the process through the first communication link to complete local installation of the program installation file.

[0030] In a further embodiment, the method further comprises the following post-processing steps:

[0031] The process of the target program uploads test data to the cloud server according to its pre-installed points.

[0032] In some embodiments, in the step of implementing the operation test of the target program, when the operation of the target program triggers an exception handling business process, at least one of the interaction events is generated according to the description of the exception handling business process contained in the instruction set of the test case, so that an interface component of the target program is switched from an inactive state to an active state.

[0033] A program test control device provided for one of the purposes of the present application comprises:

[0034] A program acquisition module is used to obtain the installation package of the target program;

[0035] An installation control module is used to enable the first communication link to transmit the installation package to the target device, and drive the installation package to complete the installation in the target device;

[0036] The test control module is used to enable the second communication link to transmit the test case corresponding to the target program to the target device, and drive the target program to run under the control of the instruction set for simulating a series of interactive events contained in the test case.

[0037] A program test execution device provided for one of the purposes of the present application includes:

[0038] A program receiving module, used to receive an installation package of a target program from a server via a first communication link, and complete local installation of the target program;

[0039] A test case receiving module, configured to receive a test case corresponding to the installation package from a server via a second communication link;

[0040] The program testing module is used to parse and execute the instruction set in the test case, so as to simulate a series of interactive events acting on the target program through the execution of the instruction set to complete the running test.

[0041] An electronic device provided to meet one of the purposes of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the program test control method / program test execution method described in the present application.

[0042] A non-volatile storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the program test control method / program test execution method in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the method are executed.

[0043] Compared with the prior art, the advantages of this application are as follows:

[0044] First, through the automatic execution of each step of the present application, the installation package of the target program is first obtained, and then the installation package is transmitted to the target device through the first communication link to complete the installation, and then the test case corresponding to the target program implemented by the installation package is transmitted to the target device through the second communication link to realize operation. The instruction set written by the test case controls the running test of the target program on the target device, providing a technical framework for automated testing of application programs, which can eliminate manual links and greatly improve the testing efficiency of the application program when it is running in the actual environment of the terminal device.

[0045] Secondly, the test cases of the present application can be pre-written and centrally managed so as to adapt and call the target program. The test cases contain instruction sets, so various interactive events can be simulated. After the test cases are sent to the target device for execution, the test cases can implement various interface controls on the target program by passing various interactive events to the process of the target program, thereby realizing the simulation of user manipulation of the target program. In this case, all manual operations can be included in a test case, and the manual operation process can also be pre-planned in the test case. In theory, the same test case can also be applied to multiple different versions of the same application with small upgrades. For some changes in the new version of the application, it is only necessary to adapt quickly by adaptively modifying part of the content of the test case. Therefore, it can be understood that the present application is particularly suitable for handling a large number of applications that require centralized and frequent testing. In this case, the efficiency achieved by the present application will be more significantly improved.

[0046] In addition, the present application assigns the control of the installation of the installation package on the target device and the control of the calling and running of the test case on the target device to different communication links respectively. The former is convenient to implement using the adaptation and debugging tools inherent in the operating system. After an installation package is transmitted, the first communication link is no longer needed. The latter can concentrate its advantages on defining and enriching its functions by the developer. During the entire testing process, the communication interaction between the server and the target device can be carried out at any time through the second communication link. Therefore, it is beneficial to save the development cost required to implement the present application as a whole, and can optimize the interface calls to optimize the memory usage and network overhead of the server and the target device.

[0047] Additional aspects and advantages of the present application will be partially given in the following description, which will become apparent from the following description, or will be understood through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0049] Figure 1A schematic diagram of a typical deployment architecture related to implementing the technical solution of this application;

[0050] Figure 2 A flowchart of a typical embodiment of the program test control method of the present application;

[0051] Figure 3 A flowchart of another embodiment of the program test control method of the present application;

[0052] Figure 4 A flowchart of a typical embodiment of the program test execution method of the present application;

[0053] Figure 5 A block diagram of a typical embodiment of a program test control device for the present application;

[0054] Figure 6 It is a functional block diagram of a typical embodiment of the program test execution device of the present application. DETAILED DESCRIPTION

[0055] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0056] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0057] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0058] It will be understood by those skilled in the art that the "client", "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of two-way communication on a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication system), which can combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant, personal digital assistant), which may include a radio frequency receiver, pager, Internet / intranet access, web browser, notepad, calendar and / or GPS (Global Positioning System, global positioning system) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with and / or including a radio frequency receiver. The "client", "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or suitable for and / or configured to run locally, and / or in a distributed form, at any other location on the earth and / or in space. The "client", "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, for example, a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.

[0059] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.

[0060] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.

[0061] See also Figure 1 , the hardware foundation required for the implementation of the relevant technical solutions of this application can be deployed according to the architecture shown in the figure. The server 80 referred to in this application can be used as a front-end application server, which is responsible for further connecting the relevant data servers to form a logically associated service cluster to provide services for related terminal devices such as the smart phone 81 and personal computer shown in the figure. Both the smart phone and the personal computer can establish a data communication link with the server 80 through a well-known network access method. The functions implemented by the server of this application can be preferably implemented by Tomcat, but those skilled in the art should know that Tomcat is only a deployment tool that is convenient for development using J2EE and is for reference only. Those skilled in the art can flexibly choose different tools to achieve the same deployment, which does not affect the implementation of the technical solutions of this application.

[0062] The terminal device of the present application is equipped with relevant operating systems, such as IOS, HMS (Hongmeng), Android and other operating systems that provide equivalent functions. With the support of such operating systems, data communication can be carried out between the server and the terminal device through a communication link agreed upon by both parties, and application programs adaptively developed for these operating systems can also run normally in the terminal device, realizing human-computer interaction and remote interaction through the terminal device.

[0063] Of course, the servers and terminal devices involved in the architecture of this application can all be connected to the public network to perform various data communications and interactions with other communication objects.

[0064] The application of the present application, in its general meaning, refers to an application running on an electronic device such as a server or a terminal device. These applications implement the relevant technical solutions of the present application in a programming manner, and their program codes can be stored in a non-volatile storage medium recognizable by a computer in the form of computer executable instructions, and can be loaded into the memory by the central processing unit for execution. The relevant devices of the present application are constructed by the operation of the application on the computer.

[0065] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality with each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.

[0066] See also Figure 2 A program test control method of the present application is implemented by an application program on the server side. In its typical embodiment, it includes the following steps:

[0067] Step S11, obtaining the installation package of the target program:

[0068] The target program is the application program to be tested in this application, which is suitable for running in electronic devices such as smart phones and tablet computers, and the electronic device used to test the target program is the target device referred to in this application. As a special case, if an application environment equivalent to a smart phone, tablet computer, etc. is virtualized through a personal computer, so that the application environment is suitable for supporting the operation of the target program, then in this case, the personal computer can also be regarded as the target device referred to in this application.

[0069] To adapt to the different operating systems running on the target device, the corresponding form of the target program's installation package is also different. For example, the installation package with the suffix APK in the Android system and the installation package with the suffix IPA in the IOS operating system are naturally different in expression, and technical personnel in this field should be aware of this.

[0070] In practice, after developers complete the development of an application, they will publish the latest version of the application to various application stores or application distribution systems built by the development team. The application distribution system usually organizes and manages multiple versions of various applications formed at different times in an orderly manner. The present application can obtain the installation package of at least one version of the application from these application distribution systems. Generally speaking, the installation package obtained by the present application is the installation package of the latest version of the application.

[0071] The installation package used in this application to test the target program is usually the installation package corresponding to the latest development version of the target program. The installation package can be obtained from a server related to the application issuance system or pre-stored in a local server. The source of acquisition does not affect the normal implementation of this application.

[0072] In an embodiment adapted for obtaining the installation package from an application distribution system, a user may access an application list, determine a target program, and issue a download instruction to a remote server, thereby obtaining the latest version of the installation package of the target program from the remote server and completing the download of the installation package.

[0073] Step S12: activating the first communication link to transmit the installation package to the target device, and driving the installation package to complete installation in the target device:

[0074] The server responsible for running the application program implementing the method can be a desktop computer, which can communicate with the target device after running the application program implementing the method. First, the first communication link needs to be enabled to communicate with the target device to transmit the installation package.

[0075] The first communication link can be adapted to the operating system running on the target device and suggested with the help of corresponding system debugging tools. For example, for the Android operating system, it provides the server with an adb debugging tool to establish the first communication link between the server and the target device; for the IOS operating system, it similarly provides the server with an ideviceinstaller tool to achieve the same function.

[0076] adb (Android Debug Bridge) is a general command line tool that allows a computer acting as a server to communicate with an emulator instance or a connected Android device, and facilitates the management and operation of these Android devices, such as installing and debugging applications on the target device. The specific operation method of using adb commands to communicate with Android devices is a technical content well known to those skilled in the art, so it will not be repeated here.

[0077] Similarly, ideviceinstaller is a command line tool that runs mainly on a computer that acts as a server and is used to manage the installation and uninstallation of applications on iOS devices. Since this tool is an open tool equipped by the operating system, those skilled in the art are already familiar with its application, so it will not be described in detail.

[0078] In addition, other different operating systems generally provide similar command line tools to provide a means for a computer acting as a server to control terminal devices running the operating system.

[0079] In terms of communication media, currently, a data cable is mostly used to directly connect the server and the target device. Android's adb can also support wireless connection and even remote connection. In any case, the server and the target device form a communication link between a certain port agreed upon by each other to facilitate data communication between the two parties.

[0080] To adapt to the situation where the target device uses a different operating system, a corresponding debugging tool can be used in this step to enable the first communication link established in advance, and transmit the installation package of the target program to the target device through the communication link.

[0081] After confirming that the installation package has been successfully received by the target device, an installation command may be further called to drive the target device to execute the installation of the installation package on its local device, or even control its operation.

[0082] It should be understood that this step can be implemented as a program code for automatic execution through programming, so that once the target device is successfully connected and identified, this step can be automatically executed in response to the user's instructions. Of course, in an alternative embodiment, before this step is executed, a manual configuration link can also be provided for the user, so that the user can input various configuration information about the target device by himself, and then establish and enable the first communication link according to the configuration information to complete the execution of this step. Such alternatives should be understood by those skilled in the art.

[0083] Step S13: activating the second communication link to transmit the test case corresponding to the target program to the target device, and driving the target program to run under the control of the instruction set for simulating a series of interactive events contained in the test case:

[0084] The second communication link, different from the first communication link, is established in order to control the target device to test the target program.

[0085] A custom developed communication process that can communicate with each other is run in the server and the target device respectively, and the two communication processes establish the second communication link through the same agreed port, and realize data communication between each other through the second communication link. Among them, the communication process on the server side can push pre-written test cases to the process of the target device and send various instructions to the target device; while the communication process on the target device side can receive and parse and execute the test cases, respond to the instructions, and feedback information related to the test case execution results.

[0086] In order to more efficiently implement the second communication link between the server and the target device, Appium open source software well known in the art may be used to assist in the implementation.

[0087] Appium is an open source test automation framework that can be used for native, hybrid and mobile web application testing. It uses the WebDriver protocol to drive iOS, Android and Windows applications. Appium can support Android and iOS across platforms and multiple languages: java, python, php, Ruby, etc. Appium provides a client-side Clients component (WebDriverAgent in IOS and UiAutomator in Android) for the server-side Server component. Therefore, it is suitable for running corresponding processes at the server and the target device respectively to support the establishment of the second communication link.

[0088] It should be noted that although Appium itself can provide technical support for automated testing, the automation referred to here is not the automated process embodied in the various steps of the method of this application. According to Appium's open source documentation, it requires complex and multiple configurations when used for testing. Therefore, it does not originally have the ability to solve the problems existing in the prior art disclosed in this application. Moreover, Appium is only cited as an example component that can be used in this application. Therefore, it is not appropriate to limit the scope of protection that this application should cover based on the disclosure here.

[0089] The test cases described can be written in a variety of computer languages, as long as the corresponding processes at the target device can be parsed and executed, for example, they can be written in Python. The process on the terminal device side in the Appium framework in the aforementioned example can also be used to interpret and execute such test cases. Each test case, by writing code to form an instruction set, can exist in the form of a code file to form a script. As its basic function, the main task of these instruction sets is to simulate a series of interactive events so that the computer system can recognize these interactive events, thereby triggering the corresponding functional modules to make further responses to the corresponding interactive events. It can be understood that the test case converts complicated manual operations into automatically executed operation commands, greatly reducing the repetitive operations of testers and improving test efficiency.

[0090] There are many ways to simulate interactive events. One way is to broadcast event messages to the system. For example, in the Android system, broadcasting a message related to a touch event will cause it to be recognized by the corresponding process and trigger the execution of the corresponding code in the process. In another way, when a certain interactive event needs to be simulated, it is actually necessary to execute the method (function) in response to the interactive event. Therefore, by directly monitoring the execution of the process of the target program under test, when a certain interactive event needs to be simulated, the method (function) in response to the interactive event can be directly called. Different operating systems and development tools may allow different technical means to be used to implement this simulation method, and may not even be limited to the two methods given above. Those skilled in the art can flexibly apply the technical means provided by the operating system or operating tool according to the disclosure here to achieve the purpose of simulation.

[0091] When writing test cases, programmers generally need to write them according to a certain business process. For example, in order to test whether the switching between the various interface components of the application complies with a certain design logic, a regular test business process can be compiled according to the corresponding operation steps and the change relationship between the interface component activities; for example, in order to handle exceptions that occur during the test process, an exception handling business process can be compiled according to the logic required for troubleshooting during exception handling.

[0092] For example, the conventional test business process, when the application is running normally, when the user touches the "Submit" button in the login interface component, a button touch event will be generated in theory, which will cause the application to perform user identity authentication, enter the program main interface after the user identity authentication is successful, and pop up a window prompt after the authentication fails. After the user cancels the pop-up window, he returns to the login interface and re-enters his user authentication information to try again. If you need to write a test case for this process, you can follow the process disclosed here to write a corresponding instruction set for the test case, so that when the login interface is monitored, a first interactive event generated by the touch of the "Submit" button is simulated, and then the change of the interface component is detected. When the interface switches to the program main interface, the interactive event corresponding to the main interface can be simulated to perform the next test; when the interface switches to the pop-up window, the second interactive event corresponding to closing the pop-up window can be simulated. It can be seen that the test case simulates a series of interactive events in the form of an instruction set based on this business process to test the program under test. In this case, a test case usually contains multiple interactive events. The organizational relationship between these interactive events has a temporal order relationship, and there may also be a branch relationship, depending on the specific business process required for the test, and is written in computer statements that can be parsed and executed by the target device. It can be understood that in a conventional test business process, there is at least one execution branch, in which the temporal order relationship of the multiple interactive events applied conforms to the scheduling order relationship between the interface components displayed by the target program at runtime, that is, the interactive events are deployed according to the normal switching order of the interface components when the target program is running normally.

[0093] For example, the exception handling business process described above, sometimes, during the routine testing of the target program, due to logical confusion or other loopholes caused by poor programming considerations, exceptions may occur, and some exceptions often cause the test process to fail to complete smoothly as expected. In this case, it is necessary to consider it in the test case, so that the instruction set written in the test case has the business process related to executing exception handling, so that when the tested program has an exception, the smooth progress of the entire test process can still be ensured. In the login interface of the aforementioned example, if it is not possible to provide it with legal user login information, it may lead to the inability to enter the main interface of the tested program, and thus it is impossible to carry out subsequent conventional test business processes. This situation is common for the tested application provided by the newly set up service, because this newly set up service may not have established a valid user account. In view of this situation, it is necessary to try to skip the login interface and enter the main interface of the tested program. At this time, the exception handling business process of the test case needs to simulate the interaction event that has been successfully logged in, so that the tested program can switch to its main interface. In addition, in another scenario, the data collection interface of the tested program needs to obtain compliance information input by the user, but it is unable to provide effective compliance information during the test. In this case, the tested program will also throw an exception. At this time, the exception handling business process can capture the exception, and then retry with new data until the data is considered as compliance information. The exception handling can be completed and the regular test business process can continue. It can be seen that in the exception handling business process, due to the occurrence of an exception, the interface component that should have become active may be turned into an inactive state by the background due to the throwing of an exception or the appearance of a pop-up window, and placed in the lower layer of the interface component stack. In this case, the interface component needs to be switched from the inactive state back to the active state. Therefore, an interaction event can be triggered to change the inactive interface component from the inactive state to the active state by closing the currently active interface component or directly acting on the interface component that is in the inactive state.

[0094] From the above description of test cases, it can be understood that test cases are essentially a program text consisting of an instruction set, which needs to be developed in a personalized manner to adapt to different test business processes. On the other hand, for frequently iterated applications, test cases developed for their old versions are usually also suitable for testing their new versions if the interface switching business process of the relevant parts does not produce significant changes. Therefore, the test cases can be stored and managed on the server to avoid repeated development of test cases, thereby improving the efficiency of software engineering management.

[0095] In order to store and manage multiple test cases of multiple target programs, a database can be established to maintain the mapping relationship between the unique characteristics of the target program and its test cases. A test case and its corresponding unique characteristic information of the target program together form a data record of the database. In this way, the unique characteristics of a certain application to be tested can be used to query and obtain one or more test cases associated with the application from the database for subsequent testing of the application. Generally speaking, the package name of the application is its unique characteristic, which can be used as the unique characteristic information for storage associated with the test case. The database can be stored in the server of the present application, or in other servers deployed in the cloud, as long as it can be called by the present application. It can be seen that the present application not only helps to realize the automated testing of the application, but also is suitable for improving the management capabilities of software engineering. For the development team or organization responsible for developing a large number of applications, the management of test cases through the technical solution of the present application can greatly improve the ability of the entire organization to cope with the testing needs of its large number of software products, and further greatly save its technical development costs.

[0096] In order to ensure that the instruction set of the test case can perform relevant tests on the target program when the target device is parsed and executed, the program hook-related code can be embedded in the test case, that is, the Hook technology can be applied therein, so that during the running of the test case, the specific running process of the target program can be timely identified through the Hook-related functions, so that the simulation can be used as a basis to trigger relevant interaction events and handle relevant exceptions, thereby promoting the entire test process. The application of the Hook technology is known to those skilled in the art and will not be described in detail.

[0097] It can be known that in each operating system, in order to support program development and testing, various information during the program running process can be encapsulated into objects that can be obtained, so that developers can obtain various states and data of the program running through these objects, thereby supporting various program control technologies including Hook technology.

[0098] In order to make the test case run better, a class can be customized to expand and encapsulate the state and data related to the operation process provided by the target device operating system for the application running therein, and on this basis, an instance object is provided to more conveniently reference the relevant state and data through the instance object, so that the test case can call various states and data of the target program during the operation process more efficiently. This class can be implemented by the developer according to actual needs when implementing this application.

[0099] As a special case, since the Appium technology framework itself extends the WebDriver API and basically meets the test case call requirements of this application, when this application parses and executes test cases, as long as the WebDriver instance object provided by Appium can meet the requirements of the test case and provide relevant status and data, it can save the trouble of self-development for this purpose.

[0100] It can be understood that when the test case is transmitted to the target device and the target device is driven to parse and execute the instruction set of the test case, the relevant technical support on the target device has been pre-installed, so it will not affect the embodiment and development of the creative spirit of this application.

[0101] When this step is executed, the test cases provided by the user that match the target program, or the relevant test cases thereof can be called from the database according to the package name of the target program, and these test cases can be transmitted to the target device through the second communication link. After the target device completes the reception of the test case, the target device is automatically driven to start parsing and executing the test case, or in response to the instruction issued by the server through the second communication link, and the target program is tested and run under the action of the instruction set of the test case. The corresponding process responsible for implementing the test in the target device triggers various interactive events in advance according to the conventional test business process contained in the instruction set, controls and guides the target program to complete the switching of various interface components, and if an exception occurs in the middle, the corresponding disaster recovery processing can also be performed according to the exception handling business process contained in the instruction set, and finally the execution of the entire test case is completed. Taking the Appium technical framework as an example, this process can be completed by its Clients end process, as long as the relevant basic configuration is completed in advance in response to the needs of the implementation of this application, so that it is suitable for cooperating with the technical solution of the implementation of this application.

[0102] From the above disclosure of various embodiments of the program test control method of this application, it can be known that under the control of this method, the operation test of the target program can be finally realized in the target device. This test process can be manually observed and the results can be recorded on the target device side to obtain the test output.

[0103] Considering the need to further improve automation integration, such as Figure 3 In another embodiment shown, the present application integrates a post-step S14 into the method: formatting the test case running result data fed back by the target device and outputting corresponding result information.

[0104] The relevant data generated during the test process can be flexibly defined. Here is an example, which mainly includes log data and even screen recording data generated after each test case is executed. Of course, these data can be uploaded to the cloud server by the relevant process on the target device side, and only the relevant storage address is returned to the server used to run this method of this application, and then the server responds to the user's access to obtain detailed information from the storage address for the customer. It can be understood that after the server obtains these result information, it can be sent to the relevant users through the interface provided by known communication tools such as emails and enterprise WeChat robots.

[0105] Similarly, in order to further improve the degree of automation and minimize manual intervention, in another embodiment, before enabling the second communication link, the method controls the target device through the first communication link to complete the configuration of the second communication link.

[0106] In order to realize the second communication link between the target device and the server, the configuration between each other can be standardized. The server side usually does not require additional configuration because it is in a service open state, but the target device as a client needs to adapt to the protocol configured on the server side and configure according to certain configuration information to establish the second communication link with the server. These configuration information generally include a communication port for monitoring data, and may also include certificate setting information, network environment information, trust mechanism, etc., which is essentially a protocol communication mechanism, depending on the specifications of the service opened by the server. Those skilled in the art should be able to understand it based on the disclosure here. Specifically, with regard to the aforementioned application example of the Appium technology framework, at the target device, through configuration, it can monitor the second communication link through the FBWebServer process provided by it according to the 8100 port specified in the configuration information, thereby establishing communication based on the second communication link with the preparer.

[0107] Taking into account different machine models, different operating systems, and different operating system versions, etc., which may result in different processes installed on the target device to support the operation of the second communication link and require different configuration information, it is best to organize and access a variety of such configuration information in an orderly manner. Therefore, the server of the present application can provide a database for storing the correspondence data between the model information of the target device and its corresponding second communication link configuration information, so that after the server of the present application obtains the model information of the target device through the first communication link, it uses the version information of the operating system running in the target device contained in the model information to query and determine the corresponding configuration information in the database, and then transmits the configuration information to the target device through the first communication link, driving the target device to use the configuration information to complete the configuration and establishment of the second communication link, so as to ensure that the server can subsequently automatically execute the subsequent steps of the present application through the second communication link smoothly, avoiding human intervention.

[0108] In order to control the target device to implement the configuration of the second communication link, in a further embodiment, before the step of controlling the target device through the first communication link to complete the configuration of the second communication link, the method controls the target device through the first communication link to run a process for supporting the operation of the second communication link, such as the process on the target device side that needs to be custom developed by the developer for this application, or the Clients side process provided by the Appium technical framework. After ensuring that the process is running in the target device, the target device can subsequently pass the received configuration information to the process, so that the process can complete the specific configuration and establishment of the second communication link.

[0109] If the target device does not have the application program of the process supporting the operation of the second communication link, then in a further embodiment, before the step of controlling the target device to run the process supporting the operation of the second communication link through the first communication link, the method transmits the program installation file corresponding to the process to the target device through the first communication link, and drives the program installation file to complete the installation in the target device. In this way, it is ensured that the target device can first use the program installation file to implement the installation of the application program corresponding to the process supporting the operation of the second communication link, then start it, and then receive the configuration information to complete the configuration, and finally cooperate with the server to establish the second communication link.

[0110] A program test execution method of the present application is implemented by a target device that cooperates with the program test control method of the present application to cooperate in completing the test of the target program. Its working principle has been disclosed through the aforementioned implementation on the server side. In order to make the detailed process clearer, it is further explained here.

[0111] See also Figure 4A program test execution method of the present application, in its typical embodiment, comprises the following steps:

[0112] Step S21: receiving the installation package of the target program from the server via the first communication link to complete the local installation of the target program:

[0113] As mentioned above, an underlying connection has been established between the target device and the server via wired or wireless means, and on this basis, the first communication link can be established between the two parties under the control of the server.

[0114] In conjunction with the operation of the aforementioned server, after the target device of the present application establishes the first communication link with the server in a wireless or wired manner, under the control of the instructions of the debugging tool provided by its operating system, it can receive the installation package of the target program transmitted by the server and complete the local installation and startup of the installation package.

[0115] Step S22: Receive a test case corresponding to the installation package from the server via the second communication link:

[0116] On the basis that the target device has started the process for supporting the operation of the second communication link and completed the configuration of the second communication link, it can receive the test cases for testing the operation of the target program transmitted from the server via the second communication link, which will be parsed and executed by the process.

[0117] Before this step, in order to improve the degree of automation, the target device can receive the control instructions sent by the server through the first communication link, and first start the process that supports the operation of the second communication link, receive the configuration information about the second communication link pushed through the first communication link, and let the process complete the configuration of the second communication link to ensure that the second communication link can work normally.

[0118] If the application corresponding to the process supporting the second communication link is not installed, the target device can also receive the corresponding program installation file through the first communication link in advance, install it locally under control, start it and then perform the other post-processing tasks mentioned above.

[0119] Step S23: parse and execute the instruction set in the test case, so as to simulate a series of interactive events acting on the target program and complete the running test through the execution of the instruction set:

[0120] As mentioned above, after the target device receives the test case that matches the target program, the relevant process will parse it and execute the instruction set contained therein, thereby completing the regular testing business process and / or the exception handling business process. During the execution process, a series of interactive events simulated by its instruction set are applied to the target program to complete the running test.

[0121] As mentioned above, the relevant process of the target device for parsing and executing test cases can use hook technology to implement the operation test of the target program, capture the exceptions generated therein, and finally form the relevant test operation result data, which is reported to the server as result information. In order to obtain the relevant result data, the target device can form a log file with the data generated during the test, and can also record the test process to form a screen recording file. These test data encapsulated in files can be uploaded to the cloud server first, and when the result information is fed back to the server of this application, the storage address of these files on the cloud server can be fed back as the result information.

[0122] It can be understood that, in accordance with the above-mentioned special case regarding exception handling, when the operation of the target program triggers the exception handling business process, at least one of the interaction events is generated according to the description of the exception handling business process contained in the instruction set of the test case, so that an interface component of the target program is switched from an inactive state to an active state. With this exception handling capability, even if there are some development vulnerabilities or abnormal business logic in the target program, it can be compatible with the exception handling business process during its testing, thereby ensuring that the entire testing process will not be interrupted or error-prone, greatly improving the testing efficiency.

[0123] In order to more comprehensively collect data during the operation of the target program under test, the developer of the target program can also pre-embed points in the source code of the target program. This is a common method in programming debugging. The programmer sets it on demand to obtain the intermediate state data of the program operation. These data are also specified by the programmer on demand. Therefore, the so-called embedding point means implanting code for collecting certain data into the program source code. When the code is run, the test data collected here can be uploaded to the designated cloud server for further analysis. Therefore, through the tested operation of the target program in the target device, not only the relevant results of the interface test can be obtained, but also the relevant content data. The two can usually verify each other, which is conducive to developers to determine the various hidden dangers of the target program through comprehensive analysis, thereby improving the error correction efficiency of the target program.

[0124] The server of the present application can further utilize the various data generated by the tracking points of the target program to implement effective organization and management of these data so as to provide them to developers for reference.

[0125] Furthermore, by functionalizing each step in the method disclosed in the above embodiments, a program test control device of the present application can be constructed. According to this idea, please refer to Figure 5 In a typical embodiment, the device comprises:

[0126] A program acquisition module 11 is used to acquire the installation package of the target program;

[0127] An installation control module 12 is used to enable the first communication link to transmit the installation package to the target device, and drive the installation package to complete the installation in the target device;

[0128] The test control module 13 is used to enable the second communication link to transmit the test case corresponding to the target program to the target device, and drive the target program to run under the control of the instruction set for simulating a series of interactive events contained in the test case.

[0129] Furthermore, by functionalizing each step in the method disclosed in the above embodiments, a program test execution device of the present application can be constructed. Figure 6 In a typical embodiment, the device comprises:

[0130] The program receiving module 21 is used to receive the installation package of the target program from the server through the first communication link to complete the local installation of the target program;

[0131] A test case receiving module 22, configured to receive a test case corresponding to the installation package from a server via a second communication link;

[0132] The program testing module 23 is used to parse and execute the instruction set in the test case, so as to simulate a series of interactive events acting on the target program through the execution of the instruction set to complete the running test.

[0133] Furthermore, to facilitate the execution of the present application, the present application provides an electronic device, including a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the program test control method / program test execution method described in the aforementioned embodiments.

[0134] It can be seen that the memory is suitable for using a non-volatile storage medium. By implementing the aforementioned method as a computer program and installing it in an electronic device such as a mobile phone or a computer, the relevant program code and data are stored in the non-volatile storage medium of the electronic device. The program is further run by the central processor of the electronic device, and it is transferred from the non-volatile storage medium to the memory for execution, so that the desired purpose of the present application can be achieved. Therefore, it can be understood that in one embodiment of the present application, a non-volatile storage medium can also be provided, in which a computer program implemented according to each embodiment of the program test control method / program test execution method is stored. When the computer program is called and executed by the computer, the steps included in the method are executed.

[0135] In summary, this application implements an application automation testing solution, which helps to improve the efficiency of automated testing of the tested application.

[0136] It will be understood by those skilled in the art that the present application includes devices for performing one or more of the operations and methods described in the present application. These devices may be specially designed and manufactured for the desired purpose, or may also include known devices in general-purpose computers. These devices have computer programs stored in their memory, which are selectively activated or reconstructed. Such computer programs may be stored in a device (e.g., computer) readable medium or in any type of medium suitable for storing electronic instructions and coupled to a bus, respectively, the computer readable medium including but not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the readable medium includes any medium that stores or transmits information in a readable form by a device (e.g., computer).

[0137] Those skilled in the art will appreciate that each block in these structure diagrams and / or block diagrams and / or flow charts and combinations of blocks in these structure diagrams and / or block diagrams and / or flow charts can be implemented using computer program instructions. Those skilled in the art will appreciate that these computer program instructions can be provided to a general-purpose computer, a professional computer, or a processor of other programmable data processing methods to implement, thereby executing the scheme specified in the block or multiple blocks of the structure diagrams and / or block diagrams and / or flow charts disclosed in this application through the processor of the computer or other programmable data processing method.

[0138] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.

[0139] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A program test control method, characterized in that: Applied to the server, including the following steps: Get the installation package of the target program; The first communication link is enabled to transmit the installation package to the target device, and the installation package is driven to complete the installation in the target device; the target device is controlled to complete the configuration of the second communication link through the first communication link, wherein the corresponding configuration information is queried in the database using the model information of the target device, and then the configuration information is transmitted to the target device through the first communication link, and the target device is driven to complete the configuration and establishment of the second communication link using the configuration information; the target device is controlled to run a process for supporting the operation of the second communication link through the first communication link, wherein custom-developed communication processes that can communicate with each other are respectively run in the server and the target device, and the two communication processes establish the second communication link through the same agreed port, and realize data communication between each other through the second communication link; Enable the second communication link to transmit the test case corresponding to the target program to the target device, and drive the target program to run under the control of the instruction set for simulating a series of interactive events contained in the test case; wherein the instruction set of the test case includes a description of a conventional test business process, in which the time sequence relationship of the application of multiple interactive events conforms to the scheduling sequence relationship between the interface components displayed by the target program when running; the instruction set of the test case includes a description of an exception handling business process, in which at least one of the interactive events causes an interface component of the target program to switch from an inactive state to an active state.

2. The method according to claim 1, characterized in that Before controlling the target device to run a process for supporting the second communication link through the first communication link, the program installation file corresponding to the process is transmitted to the target device through the first communication link to drive the program installation file to complete installation in the target device.

3. The method according to claim 1 or 2, characterized in that: In the step of enabling the second communication link to transmit the test case adapted to the target program to the target device, the test case corresponding to the installation package is determined by querying from the local database using the uniqueness feature of the installation package.

4. A program test execution method, characterized in that: Applied to the target device, including the following steps: Receiving the installation package of the target program from the server through the first communication link to complete the local installation of the target program; completing the configuration of the second communication link by accepting the control of the server through the first communication link, wherein the corresponding configuration information is queried in the database using the model information of the target device, and then the configuration information is transmitted to the target device through the first communication link, and the target device is driven to complete the configuration and establishment of the second communication link using the configuration information; accepting the control of the server through the first communication link to run a process for supporting the operation of the second communication link, wherein custom-developed communication processes that can communicate with each other are respectively run in the server and the target device, and the two communication processes establish the second communication link through the same agreed port, and realize data communication between each other through the second communication link; The test case corresponding to the installation package is received from the server through the second communication link; wherein the instruction set of the test case includes a description of a conventional test business process, in which the time sequence relationship of applying multiple interactive events conforms to the scheduling sequence relationship between the interface components displayed by the target program when running; the instruction set of the test case includes a description of an exception handling business process, in which at least one of the interactive events causes an interface component of the target program to switch from an inactive state to an active state; The instruction set in the test case is parsed and executed, so as to simulate a series of interactive events acting on the target program through the execution of the instruction set to complete the running test.

5. The method according to claim 4, characterized in that It includes the following steps: A process for supporting the operation of the second communication link is started to complete the configuration of the second communication link.

6. The method according to claim 5, characterized in that Before starting a process for supporting the operation of the second communication link, a program installation file corresponding to the process is received through the first communication link to complete local installation of the program installation file.

7. The method according to any one of claims 4 to 6, characterized in that In the step of implementing the operation test of the target program, when the operation of the target program triggers an exception handling business process, at least one of the interaction events is generated according to the description of the exception handling business process contained in the instruction set of the test case, so that an interface component of the target program is switched from an inactive state to an active state.

8. A program test control device, characterized in that: It is applied to servers, including: A program acquisition module is used to obtain the installation package of the target program; An installation control module is used to enable the first communication link to transmit the installation package to the target device, and drive the installation package to complete the installation in the target device; control the target device to complete the configuration of the second communication link through the first communication link, wherein the corresponding configuration information is queried in the database using the model information of the target device, and then the configuration information is transmitted to the target device through the first communication link, and the target device is driven to complete the configuration and establishment of the second communication link using the configuration information; control the target device to run a process for supporting the operation of the second communication link through the first communication link, wherein custom-developed communication processes that can communicate with each other are respectively run in the server and the target device, and the two communication processes establish the second communication link through the same agreed port, and realize data communication between each other through the second communication link; A test control module is used to enable a second communication link to transmit a test case corresponding to the target program to a target device, and drive the target program to run under the control of an instruction set for simulating a series of interactive events contained in the test case; wherein the instruction set of the test case includes a description of a conventional test business process, in which the time sequence relationship in which multiple interactive events are applied conforms to the scheduling sequence relationship between the interface components displayed by the target program when it is running; and the instruction set of the test case includes a description of an exception handling business process, in which at least one of the interactive events causes an interface component of the target program to switch from an inactive state to an active state.

9. A program test execution device, characterized in that: It is applied to target devices including: A program receiving module, used to receive the installation package of the target program from the server through the first communication link to complete the local installation of the target program; accept the control of the server through the first communication link to complete the configuration of the second communication link, wherein the corresponding configuration information is queried in the database using the model information of the target device, and then the configuration information is transmitted to the target device through the first communication link, and the target device is driven to complete the configuration and establishment of the second communication link using the configuration information; accept the control of the server through the first communication link to run a process for supporting the operation of the second communication link, wherein custom-developed communication processes that can communicate with each other are respectively run in the server and the target device, and the two communication processes establish the second communication link through the same agreed port, and realize data communication between each other through the second communication link; A use case receiving module, used to receive a test case corresponding to the installation package from a server via a second communication link; wherein the instruction set of the test case includes a description of a conventional test business process, in which a time sequence relationship of applying multiple interactive events conforms to a scheduling sequence relationship between interface components displayed by the target program at runtime; the instruction set of the test case includes a description of an exception handling business process, in which at least one of the interactive events causes an interface component of the target program to switch from an inactive state to an active state; The program testing module is used to parse and execute the instruction set in the test case, so as to simulate a series of interactive events acting on the target program through the execution of the instruction set to complete the running test.

10. An electronic device, comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run a computer program stored in the memory to execute the steps of the program test control method as described in any one of claims 1 to 3, or to execute the steps of the program test execution method as described in any one of claims 4 to 7.

11. A non-volatile storage medium, characterized in that: It stores a computer program implemented according to the program test control method described in any one of claims 1 to 3, or according to the program test execution method described in any one of claims 4 to 7 in the form of computer-readable instructions. When the computer program is called and executed by a computer, it executes the steps included in the corresponding method.