Software testing method, electronic device, and computer storage medium
By installing test programs developed by non-embedded operating systems in the embedded operating system and using driver control messages for control, the problem of inconvenience in the embedded operating system is solved, and cross-platform black box testing is realized.
Patent Information
- Application Number
- CN202010125964.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-27
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2040-02-27
AI Technical Summary
The enclosed nature of embedded operating systems makes application testing inconvenient and difficult to implement cross-platform testing.
Develop test programs through the development framework of non-embedded operating systems, and use driver control messages to control them in the embedded operating system to achieve cross-platform testing.
It implements black box testing of applications in embedded operating systems, solves the inconvenience of testing under closed systems, and realizes cross-platform testing.
Smart Images

Figure CN113312253B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technologies, and more particularly, to a software testing method, an electronic device, and a computer storage medium. Background Art
[0002] Currently, embedded operating systems such as mobile phone operating systems have relatively high security requirements. Sometimes, to avoid virus or trojan infections, system vendors usually build the operating system as a closed system, or, in the case of connecting to third-party devices, adopt a relatively strict authentication mechanism.
[0003] Such a closed system also controls various applications available for installation, thereby providing a secure usage environment for users and ensuring the smooth operation of applications to a certain extent during use. However, at the same time, it also brings inconvenience to the testing of applications. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a control method, a device, a mobile terminal, an electronic device, and a computer storage medium to solve or alleviate the above problems.
[0005] According to a first aspect of embodiments of the present invention, a software testing method is provided, including: installing a test program developed using a development framework of a first non-embedded operating system in a local embedded operating system, where the test program is used to perform black-box testing on a to-be-tested application installed in the embedded operating system; receiving, through a secure communication connection with a second device, a driver control message sent from a driver program installed in a second non-embedded operating system of the second device, where the driver control message instructs the embedded operating system to drive the test program.
[0006] According to a second aspect of embodiments of the present invention, a software testing method is provided, including: determining a driver program of a test program in a local second non-embedded operating system, where the test program is developed using a development framework of a first non-embedded operating system and installed in an embedded operating system of an embedded device, and is used to perform black-box testing on a to-be-tested application installed in the embedded operating system; sending, through a secure communication connection with the embedded device, a driver control message to the embedded device using the driver program, where the driver control message instructs the embedded operating system to drive the test program.
[0007] According to a third aspect of an embodiment of the present invention, a software testing method is provided, including: obtaining a first confirmation operation of a pairing request sent by a user for a first device on an interaction interface of a local embedded device, where the first device is installed with a first non-embedded operating system; in response to the first confirmation operation, establishing a secure communication connection with the first device to receive an installation program of a software testing program, where the software testing program is used to perform black-box testing on a to-be-tested application program installed in the embedded device; obtaining an installation operation of the user on the interaction interface for the installation program to install the software testing program into the embedded operating system in the embedded device.
[0008] According to a fourth aspect of an embodiment of the present invention, an embedded device is provided, including: a first obtaining module, obtaining a first confirmation operation of a pairing request sent by a user for a first device on an interaction interface, where the first device is installed with a first non-embedded operating system; a communication establishing module, in response to the first confirmation operation, establishing a secure communication connection with the first device to receive an installation program of a software testing program, where the software testing program is used to perform black-box testing on a to-be-tested application program installed in the embedded device; a second obtaining module, obtaining an installation operation of the user on the interaction interface for the installation program to install the software testing program into the embedded operating system in the embedded device.
[0009] According to a fifth aspect of an embodiment of the present invention, an electronic device is provided, including: an installation module, installing a test program developed using a development framework of a first non-embedded operating system in a local embedded operating system, where the test program is used to perform black-box testing on a to-be-tested application program installed in the embedded operating system; a receiving module, receiving, through a secure communication connection with a second device, a driver control message sent by a driver program installed in a second non-embedded operating system of the second device, where the driver control message instructs the embedded operating system to drive the test program.
[0010] According to a sixth aspect of an embodiment of the present invention, an electronic device is provided, including: a determining module, determining a driver program of a test program in a local second non-embedded operating system, where the test program is developed using a development framework of a first non-embedded operating system and installed in an embedded operating system of an embedded device, and is used to perform black-box testing on a to-be-tested application program installed in the embedded operating system; a sending module, sending, through a secure communication connection with the embedded device, a driver control message to the embedded device using the driver program, where the driver control message instructs the embedded operating system to drive the test program.
[0011] According to a seventh aspect of the present invention, there is provided an electronic device, the device comprising: one or more processors; a computer-readable medium configured to store one or more programs, which when executed by the one or more processors cause the one or more processors to implement the software testing method as described in the first aspect or the second aspect.
[0012] According to an eighth aspect of the embodiments of the present invention, there is provided a computer-readable medium having stored thereon a computer program, which when executed by a processor implements the software testing method as described in the first aspect or the second aspect.
[0013] The solution of the embodiments of the present invention can install a test program developed by a development framework of a non-embedded operating system on an embedded operating system and perform control according to a driver control message sent by a driver program installed in the non-embedded operating system. Since the driving is performed by the driver program installed in the non-embedded operating system, cross-platform testing of application programs in the embedded operating system is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings.
[0015] Figure 1A It is a schematic flowchart of the software testing method according to Embodiment 1 of the present invention;
[0016] Figure 1B It is a schematic flowchart of the software testing method according to Embodiment 1 of the present invention;
[0017] Figure 1C It is a schematic flowchart of secure communication according to Embodiment 1 of the present invention;
[0018] Figure 1D It is a schematic flowchart of the background activation method according to Embodiment 1 of the present invention;
[0019] Figure 2A It is a schematic block diagram of the software testing method according to Example 1 of Embodiment 2 of the present invention;
[0020] Figure 2B It is a schematic block diagram of the software testing method according to Example 2 of Embodiment 2 of the present invention;
[0021] Figure 2C It is a schematic diagram of an interaction interface of an example of the software testing method according to Example 2 of Embodiment 2 of the present invention;
[0022] Figure 2D Schematic diagram of an interaction interface for another example of the software testing method in the second example of the second embodiment of the present invention;
[0023] Figure 3A Schematic block diagram of an electronic device according to the third embodiment of the present invention;
[0024] Figure 3B Schematic block diagram of an electronic device according to the third embodiment of the present invention;
[0025] Figure 4 Schematic block diagram of an electronic device according to the fourth embodiment of the present invention;
[0026] Figure 5 Schematic structural diagram of an electronic device according to the fifth embodiment of the present invention;
[0027] Figure 6 Hardware structure of an electronic device according to the sixth embodiment of the present invention. Detailed implementation manners
[0028] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art shall fall within the protection scope of the embodiments of the present invention.
[0029] The following further illustrates the specific implementation of the embodiments of the present invention with reference to the accompanying drawings of the embodiments of the present invention.
[0030] Figure 1A Schematic flowchart of a software testing method according to the first embodiment of the present invention. Figure 1A The software testing method includes:
[0031] 110: Install a test program developed using the development framework of a first non-embedded operating system in a local embedded operating system, where the test program is used to perform black-box testing on a to-be-tested application installed in the embedded operating system;
[0032] 120: Receive a driver control message sent from a driver program installed in a second non-embedded operating system of a second device through a secure communication connection with the second device, where the driver control message instructs the embedded operating system to drive the test program.
[0033] It should be understood that the non-embedded operating systems in the text include, but are not limited to, desktop operating systems or server operating systems. For example, UNIX operating system, LINUX operating system, WINDOWS desktop operating system, WINDOWS server operating system, MAC desktop operating system, MAC server operating system, etc. The embedded operating systems include, but are not limited to, any embedded operating systems such as Android system and IOS system. The embodiments of the present invention do not limit this.
[0034] It should also be understood that the black box testing in the text is a kind of functional testing, different from white box testing such as code-level debugging. The black box testing is used for purposes such as testing the user interface. In addition, the first non-embedded operating system and the second non-embedded operating system can be the same operating system or different operating systems. The embodiments of the present invention do not limit this.
[0035] For example, when the first non-embedded operating system is the MAC system, the development framework is Xcode. For example, the test program is a UI test program developed based on XCUItest. For example, the second non-embedded operating system can be any one of UNIX operating system, LINUX operating system, WINDOWS desktop operating system, WINDOWS server operating system, MAC desktop operating system, MAC server operating system.
[0036] For example, the above connection can be verified based on a mobile communication network or the Internet such as a local area network or a wide area network. After the verification passes, a secure communication connection is completed. For example, the above connection can be based on a secure connection of the server side, for example, a connection to a cloud server. It should be understood that deploying the above secure connection using a cloud server is beneficial to improving the scale and efficiency of testing. For example, the above connection can be a device-to-device (D2D) connection, for example, through near field communication such as the Bluetooth standard. For example, a wired connection implemented through a USB interface or the like. For example, an encrypted connection implemented in a wired or wireless manner.
[0037] It should also be understood that the program installed in the embedded operating system can be implemented through the installer of the installation package. The generation of the installation package can be achieved in any way based on the development framework in the text or other installation package generation programs. The test program can generate a sub-program such as an installation package after being compiled by a compilation program, or the test program can directly generate an installation package without being compiled. The programming process can be implemented through the above development framework or a dedicated compilation program. In one implementation manner of the present invention, the test program is compiled by the development framework to generate an installation package. For example, using this installation package as a base package to test other applications to be tested.
[0038] It should also be understood that the functions of the test program include, but are not limited to, taking screenshots, performing operations, obtaining interface element information, etc. on the embedded operating system. The embodiments of the present invention do not limit this.
[0039] The solution of the embodiment of the present invention can install the test program developed by the development framework of the non-embedded operating system in the embedded operating system and control it according to the driver control message sent by the driver installed in the non-embedded operating system. Since it is driven by the driver installed in the non-embedded operating system, cross-platform testing of the application program in the embedded operating system is realized.
[0040] In one implementation manner of the present invention, the first device does not install the first non-embedded operating system. The first device is connected to the third device, and the third device installs the first non-embedded operating system and develops the test program. The first device obtains the test program from the third device via the connection with the third device. Alternatively, the first device installs the first non-embedded operating system, and the test program is a program developed by using the development framework of the first non-embedded operating system in the first device.
[0041] In one implementation manner of the present invention, before installing the test program developed by using the development framework of the first non-embedded operating system in the local embedded operating system, the method further includes: establishing a secure communication connection with the first device; based on the secure communication connection with the first device, obtaining the installation program of the test program from the first device to the local, and installing the test program developed by using the development framework of the first non-embedded operating system in the local embedded operating system, including: installing the installation program of the test program to install the test program in the local embedded operating system. For example, the secure communication connection is a USB-based secure communication connection.
[0042] In one implementation manner of the present invention, receiving the driver control message sent by the driver installed in the second non-embedded operating system of the second device through the secure communication connection with the second device includes: transmitting the installation information of the test program in the local embedded operating system to the second device through the secure communication connection with the second device; receiving the driver control message sent by the driver based on the installation information. It should be understood that the secure communication connection with the second device and the secure communication connection with the first device can be of the same type of connection. In addition, the above secure communication connections can also be of different types of connections.
[0043] In an implementation of the present invention, before transmitting the installation information of the test program in the local embedded operating system to the second device through a secure communication connection with the second device, the method further includes: receiving a request message for the driver through the secure communication connection with the second device, where the request message includes the identifier of the test program for obtaining the installation information. For example, the installation information includes the method name, program name, installation package name, etc. of the test program. The installation information may further include the installation path of the test program, for example, the installation path in the embedded system. The installation information may further include other information related to the embedded system for the embedded system to call the test program.
[0044] In an implementation of the present invention, the method further includes: establishing a transport layer connection with the second device through a transport layer communication protocol; based on the transport layer connection, using a key negotiation algorithm to establish a secure communication connection with the second device. For example, when the embedded operating system is IOS, the transport layer communication may be the TCP protocol. For example, based on the TCP protocol, the USBMUX service can be started. This service can be connected to the relevant connection through a corresponding program in a non-embedded operating system such as the WINDOWS system. It should be understood that the above embodiments are only exemplary, and the embodiments of the present invention are not limited thereto.
[0045] For example, establishing a secure communication connection with the second device based on the transport layer connection and using a key negotiation algorithm includes: receiving a pairing message transmitted by the second device calling a cross-platform secure communication method based on the transport layer connection; after establishing a pairing in response to the pairing message, using the key negotiation algorithm to determine a shared secret with the second device to establish a secure communication connection with the second device. For example, the key negotiation algorithm can determine a symmetric key or an asymmetric key, and the embodiments of the present invention are not limited thereto. For example, after establishing the transport layer connection and determining the shared secret, a corresponding secure connection can be established through a three-way handshake, and the specific connection interaction can be referred to Figure 1C the corresponding steps.
[0046] Figure 1B It is a schematic diagram of the software testing method of Embodiment 1 of the present invention. In this embodiment, the first non-embedded operating system is the MAC system. The embedded operating system is the IOS system, and the device where it is located is an IOS device. The second non-embedded operating system is the WINDOWS operating system, installed in the target personal computer (PC). The following combines Figure 1C the flowchart of Figure 1B to illustrate the implementation scenario ofFigure 1A The provided descriptions and explanations. It should be understood that in this example, a basic package for automated testing is generated based on the basic functions of XCUITest written under the Mac system. The interaction method of this embodiment includes the following steps:
[0047] Step 101: The IOS device is connected to the operating system of the target PC. For example, it is connected through the USBMUX service, or through other transmission methods.
[0048] Step 102: The IOS device automatically starts the USBMUX service. It should be understood that a program corresponding to this service is installed in the operating system of the target PC. Thus, a service is established in the operating system of the target PC that allows the operating system to communicate with the USB in the IOS device through TCP.
[0049] Step 103: Use the installation service provided by the IOS system step by step to install the written and generated basic package into the IOS device.
[0050] Step 104: Activate the XCUItest-based basic package in the background (i.e., activate on the target PC side) through the automated test driver program written in the operating system of the target PC. Among them, the sub-steps of step 104 are as Figure 1D shown. Figure 1D It is a schematic flowchart of the background activation method of the first embodiment of the present invention, including the following sub-steps:
[0051] Step 1041: The target PC calls the USBMUX service through TCP and initiates a message for pairing with the IOS device.
[0052] Step 1042: After successful pairing, the target PC uses a key negotiation algorithm to exchange encryption communication keys with the IOS device.
[0053] Step 1043: The IOS device creates a message for the automation service, encrypts the handshake information for starting the service using the key obtained in step 1042, and sends a handshake message request to the target PC.
[0054] Step 1044: After receiving the handshake message request, the target PC sends a response message to the handshake message request to the IOS device.
[0055] Step 1045: The IOS device receives the response message. It should be understood that when receiving this response message, a secure connection is established.
[0056] Step 1046: The IOS device starts the automation service, allocates a TCP port for this service, and encrypts and replies to the target PC.
[0057] Step: 1047: The IOS device sends information such as the package name and installation path of the base package to the target PC.
[0058] Step 1048: After the IOS device starts the automated test service, it returns the result to the target PC.
[0059] In one implementation of the present invention, the application under test is a program developed using the development framework of the first non-embedded operating system.
[0060] Figure 2A It is a schematic block diagram of the software testing method of the second embodiment of the present invention; Figure 2A The software testing method includes:
[0061] 210: In the second non-embedded operating system locally, determine the driver program of the test program, where the test program is developed using the development framework of the first non-embedded operating system and is installed in the embedded operating system of the embedded device for black-box testing of the application under test installed in the embedded operating system;
[0062] 220: Through a secure communication connection with the embedded device, use the driver program to send a driver control message to the embedded device, and the driver control message instructs the embedded operating system to drive the test program.
[0063] The solution of the embodiment of the present invention can install the test program developed using the development framework of the non-embedded operating system in the embedded operating system and control it according to the driver control message sent by the driver program installed in the non-embedded operating system. Since it is driven by the driver program installed in the non-embedded operating system, cross-platform testing of applications in the embedded operating system is achieved.
[0064] In one implementation of the present invention, before determining the driver program of the test program in the second non-embedded operating system locally, it includes: installing the obtained portable container in the second non-embedded operating system locally; installing the obtained driver program into the portable container. For example, the portable container is a container such as DOCKER. It should be understood that the portable container can also be other virtual machines or containers, and the embodiment of the present invention does not limit this. Since the portable container is adopted, large-scale test deployment can be carried out, and cross-platform testing is further achieved.
[0065] Figure 2B It is a schematic block diagram of the software testing method of the second embodiment of the present invention; Figure 2B The software testing method includes:
[0066] 260: Obtain a first confirmation operation for a pairing request sent by a user on the interaction interface of a local embedded device for a first device, where the first device is installed with a first non-embedded operating system;
[0067] 270: In response to the first confirmation operation, establish a secure communication connection with the first device to receive an installation program for a software test program, where the software test program is used to perform black-box testing on a to-be-tested application installed in the embedded device;
[0068] 280: Obtain an installation operation of the user on the interaction interface for the installation program to install the software test program into the embedded operating system in the embedded device.
[0069] The solution of the embodiment of the present invention can install a test program developed by the development framework of a non-embedded operating system in the embedded operating system, and perform control according to the driver control messages sent by the driver installed in the non-embedded operating system. Since the driving is performed by the driver installed in the non-embedded operating system, cross-platform testing of the application programs in the embedded operating system is realized.
[0070] It should be understood that obtaining the confirmation operation of the user and / or the installation operation of the user described in the text can be an operation performed by the user on the interaction interface (such as a touch interface) of the embedded device. The confirmation operation and the installation operation in the embodiment of the present invention include, but are not limited to, at least one of sliding touch, click touch, long press touch, and short press touch in the touch area. The embodiment of the present invention includes, but is not limited to, any form of touch operation and includes combinations between different forms. Figure 2C It is a schematic diagram of an interaction interface for an example of the software test method of Example 2 of the present invention. Figure 2D It is a schematic diagram of an interaction interface for another example of the software test method of Example 2 of the present invention. As Figure 2C and Figure 2D shown, the above installation operation and confirmation operation can be performed in the form of touch shown in the diagram.
[0071] It should also be understood that the above interaction operations of the present invention are not limited to the touch method, and methods such as voice interaction or face recognition are equally applicable to the embodiments of the present invention.
[0072] It should also be understood that the specific operation steps and processes of the embodiments of the present invention correspond to those of Example 1, and the corresponding or similar steps are not described herein again.
[0073] For the above-mentioned secure communication connection, for example, a transport layer connection is established with the first device through a transport layer communication protocol; based on the transport layer connection, a secure communication connection with the first device is established by using a key negotiation algorithm. For example, when the embedded operating system is IOS, the transport layer communication can be the TCP protocol. For example, based on the TCP protocol, the USBMUX service can be started. This service can be connected to the relevant connection through a corresponding program in a non-embedded operating system such as the WINDOWS system. It should be understood that the above embodiments are only exemplary, and the embodiments of the present invention are not limited thereto.
[0074] In one implementation manner of the present invention, the method further includes: in response to the second confirmation operation, establishing a secure communication connection with the first device to receive the driver program of the installation program.
[0075] FIG. 3 is a schematic block diagram of an electronic device according to Embodiment 3 of the present invention; the electronic device in FIG. 3 includes:
[0076] An installation module 310 installs a test program developed using the development framework of the first non-embedded operating system in the local embedded operating system, where the test program is used to perform black-box testing on the application program to be tested installed in the embedded operating system;
[0077] A receiving module 320 receives, through a secure communication connection with the second device, a driver control message sent by a driver program installed in the second non-embedded operating system of the second device, and the driver control message instructs the embedded operating system to drive the test program.
[0078] The solution of the embodiment of the present invention can install a test program developed using the development framework of a non-embedded operating system in an embedded operating system and perform control according to a driver control message sent by a driver program installed in the non-embedded operating system. Since the driving is performed through the driver program installed in the non-embedded operating system, cross-platform testing of application programs in the embedded operating system is realized.
[0079] In one implementation manner of the present invention, the test program is a program compiled using the development framework of the first non-embedded operating system and adapted to be installed in the embedded operating system.
[0080] In one implementation manner of the present invention, the first device is installed with the first non-embedded operating system, and the test program is a program developed using the development framework of the first non-embedded operating system in the first device.
[0081] In an implementation of the present invention, the electronic device further includes a communication module, which is configured to: establish a secure communication connection with a first device before installing a test program developed using a development framework of a first non-embedded operating system in a local embedded operating system; based on the secure communication connection with the first device, obtain an installation program of the test program from the first device to the local. The installation module 310 is specifically configured to: install the installation program of the test program to install the test program in the local embedded operating system.
[0082] In an implementation of the present invention, the communication module is specifically configured to: transmit installation information of the test program in the local embedded operating system to the second device through a secure communication connection with the second device; the receiving module 320 is specifically configured to: receive the driver control message sent by the driver based on the installation information.
[0083] In an implementation of the present invention, the receiving module 320 is further configured to: before transmitting the installation information of the test program in the local embedded operating system to the second device through a secure communication connection with the second device, receive a request message of the driver through a secure communication connection with the second device, where the request message includes an identifier of the test program for obtaining the installation information.
[0084] In an implementation of the present invention, the communication module is further configured to: establish a transport layer connection with the second device through a transport layer communication protocol; based on the transport layer connection, use a key negotiation algorithm to establish a secure communication connection with the second device.
[0085] In an implementation of the present invention, the communication module is specifically configured to: based on the transport layer connection, receive a pairing message transmitted by the second device by invoking a cross-platform secure communication method; after establishing a pairing in response to the pairing message, use the key negotiation algorithm to determine a shared secret with the second device to establish a secure communication connection with the second device.
[0086] In an implementation of the present invention, the application to be tested is a program developed using a development framework of the first non-embedded operating system.
[0087] In an implementation of the present invention, the embedded operating system is an IOS system, the first non-embedded operating system is a MAC system, the development framework is Xcode, and the test program is a UI test program developed based on XCUItest.
[0088] In an implementation manner of the present invention, the second non-embedded operating system is any one of a MAC system, a LINUX system, and a WINDOWS system.
[0089] Figure 3B It is a schematic block diagram of the electronic device according to Embodiment 3 of the present invention; Figure 3B The embedded device includes:
[0090] A first acquisition module 360 acquires a first confirmation operation of a pairing request sent by a user for a first device on an interaction interface, where the first device is installed with a first non-embedded operating system;
[0091] A communication establishment module 370 responds to the first confirmation operation and establishes a secure communication connection with the first device, so as to receive an installation program of a software test program, where the software test program is used to perform black-box testing on a to-be-tested application program installed in the embedded device;
[0092] A second acquisition module 380 acquires an installation operation of the installation program by the user on the interaction interface, so as to install the software test program into an embedded operating system in the embedded device.
[0093] The solution of the embodiment of the present invention can install a test program developed by a development framework of a non-embedded operating system in an embedded operating system, and perform control according to a driver control message sent by a driver program installed in the non-embedded operating system. Since the driving is performed by the driver program installed in the non-embedded operating system, cross-platform testing of application programs in the embedded operating system is realized.
[0094] Figure 4 It is a schematic block diagram of the electronic device according to Embodiment 4 of the present invention; Figure 4 The electronic device includes:
[0095] A determination module 410 determines a driver program of a test program in a local second non-embedded operating system, where the test program is developed by using a development framework of the first non-embedded operating system and is installed in an embedded operating system of an embedded device, and is used to perform black-box testing on a to-be-tested application program installed in the embedded operating system;
[0096] A sending module 420 sends a driver control message to the embedded device by using the driver program through a secure communication connection with the embedded device, and the driver control message instructs the embedded operating system to drive the test program.
[0097] The solution of the embodiment of the present invention can install a test program developed by a development framework of a non-embedded operating system in an embedded operating system, and perform control according to a driver control message sent by a driver program installed in the non-embedded operating system. Since the driving is performed by the driver program installed in the non-embedded operating system, cross-platform testing of application programs in the embedded operating system is realized.
[0098] The software testing method of this embodiment can be executed by any suitable electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, PADs, etc.) and PC machines, etc.
[0099] In an implementation manner of the present invention, the electronic device further includes an acquisition module and an installation module. The acquisition module is used to install the acquired portable container in the local second non-embedded operating system before determining the driver program of the test program in the local second non-embedded operating system; the installation module is used to install the acquired driver program into the portable container.
[0100] The electronic device of this embodiment is used to implement the corresponding software testing method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here. In addition, the function implementation of each module in the electronic device of this embodiment can refer to the description of the corresponding part in the foregoing method embodiments, which will not be elaborated here either.
[0101] Figure 5 It is a schematic structural diagram of an electronic device in Embodiment 5 of this application; the electronic device may include:
[0102] One or more processors 501;
[0103] A computer-readable medium 502, which can be configured to store one or more programs,
[0104] When the one or more programs are executed by the one or more processors, the one or more processors implement the software testing method as described in Embodiment 1 or Embodiment 2 above.
[0105] Figure 6 It is the hardware structure of an electronic device in Embodiment 6 of this application; as Figure 4 shown, the hardware structure of the electronic device may include: a processor 601, a communication interface 602, a computer-readable medium 603, and a communication bus 604;
[0106] Wherein, the processor 601, the communication interface 602, and the computer-readable medium 603 complete mutual communication through the communication bus 604;
[0107] Optionally, the communication interface 602 may be an interface of a communication module;
[0108] Among them, the processor 601 can be specifically configured to install a test program developed using the development framework of the first non-embedded operating system in the local embedded operating system, where the test program is used to perform black box testing on the application under test installed in the embedded operating system; through a secure communication connection with a second device, receive a driver control message sent from a driver installed in the second non-embedded operating system of the second device, where the driver control message instructs the embedded operating system to drive the test program, or,
[0109] In the local second non-embedded operating system, determine the driver of the test program, where the test program is developed using the development framework of the first non-embedded operating system and installed in the embedded operating system of the embedded device, and is used to perform black box testing on the application under test installed in the embedded operating system; through a secure communication connection with the embedded device, use the driver to send a driver control message to the embedded device, where the driver control message instructs the embedded operating system to drive the test program.
[0110] The processor 601 can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0111] The computer-readable medium 603 can be, but is not limited to, a random access storage medium (RAM), a read-only storage medium (ROM), a programmable read-only storage medium (PROM), an erasable programmable read-only storage medium (EPROM), an electrically erasable programmable read-only storage medium (EEPROM), etc.
[0112] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program code configured to execute the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are performed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable medium can, for example, but is not limited to, be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable medium can send, propagate, or transmit a program configured to be used by or combined with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0113] Computer program code configured to perform the operations of the present application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions configured to implement a specified logical function. There are specific sequential relationships in the above specific embodiments, but these sequential relationships are only exemplary. In specific implementations, these steps may be fewer, more, or the execution order may be adjusted. That is, in some alternative implementations, the functions marked in the blocks may also occur in a different order than that marked in the accompanying drawings. For example, two consecutively represented blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0115] The modules described in the embodiments of the present application can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes a receiving module and a first display module. Among them, the names of these modules do not constitute a limitation on the module itself in some cases.
[0116] As another aspect, the present application also provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, it implements the software testing method described in the above Embodiment 1 or Embodiment 2.
[0117] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiments; or may exist alone without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device is caused to: install a test program developed using a development framework of a first non-embedded operating system in a local embedded operating system, where the test program is used to perform black box testing on a to-be-tested application installed in the embedded operating system;
[0118] Receive a driver control message sent from a driver program installed in a second non-embedded operating system of a second device through a secure communication connection with the second device, where the driver control message instructs the embedded operating system to drive the test program, or,
[0119] In a local second non-embedded operating system, determine a driver program for the test program, where the test program is developed using a development framework of a first non-embedded operating system and is installed in an embedded operating system of an embedded device for performing black box testing on a to-be-tested application installed in the embedded operating system; through a secure communication connection with the embedded device, send a driver control message to the embedded device using the driver program, where the driver control message instructs the embedded operating system to drive the test program.
[0120] In various embodiments of the present disclosure, the expressions "first", "second", "the first" or "the second" used may modify various components without regard to order and / or importance, but these expressions do not limit the corresponding components. The above expressions are only configured for the purpose of distinguishing an element from other elements. For example, a first user device and a second user device represent different user devices, although both are user devices. For example, without departing from the scope of the present disclosure, the first element may be referred to as the second element, and similarly, the second element may be referred to as the first element.
[0121] When an element (e.g., a first element) is referred to as being "(operatively or communicatively) coupled" or "(operatively or communicatively) coupled to" another element (e.g., a second element) or "connected to" another element (e.g., a second element), it should be understood that the one element is directly connected to the other element or the one element is indirectly connected to the other element via yet another element (e.g., a third element). In contrast, it can be understood that when an element (e.g., a first element) is referred to as being "directly connected" or "directly coupled" to another element (a second element), then no element (e.g., a third element) is inserted between the two.
[0122] The above description is only a preferred embodiment of the present application and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) disclosed in the present application that have similar functions.
Claims
1. A software testing method, comprising: Installing a test program developed using the development framework of a first non-embedded operating system in a local embedded operating system, wherein the test program is used to perform black-box testing on a to-be-tested application installed in the embedded operating system; Receiving, through a secure communication connection with a second device, a drive control message sent by an automated test driver corresponding to the test program installed in a second non-embedded operating system of the second device, where the drive control message instructs the embedded operating system to drive the test program, and the automated test driver is installed in a portable container.
2. The method according to claim 1, wherein, The test program is a program compiled using the development framework of the first non-embedded operating system and adapted to be installed in the embedded operating system.
3. The method according to claim 2, wherein, A first device is installed with the first non-embedded operating system, and the test program is a program developed using the development framework of the first non-embedded operating system in the first device.
4. The method according to claim 1, wherein, Before installing the test program developed using the development framework of the first non-embedded operating system in the local embedded operating system, the method further comprises: Establishing a secure communication connection with the first device; Based on the secure communication connection with the first device, obtaining the installation program of the test program from the first device to the local; The step of installing the test program developed using the development framework of the first non-embedded operating system in the local embedded operating system comprises: Installing the installation program of the test program to install the test program in the local embedded operating system.
5. The method according to claim 1, wherein, The step of receiving, through a secure communication connection with the second device, a drive control message sent by an automated test driver corresponding to the test program installed in a second non-embedded operating system of the second device comprises: Transmitting, through the secure communication connection with the second device, the installation information of the test program in the local embedded operating system to the second device; Receiving the drive control message sent by the automated test driver based on the installation information.
6. The method according to claim 5, wherein, Before transmitting, through the secure communication connection with the second device, the installation information of the test program in the local embedded operating system to the second device, the method further comprises: Receiving, through the secure communication connection with the second device, a request message of the automated test driver, where the request message includes an identifier of the test program for obtaining the installation information.
7. The method according to claim 1, wherein the method further comprises: Establishing a transport layer connection with the second device through a transport layer communication protocol; Based on the transport layer connection, using a key negotiation algorithm to establish a secure communication connection with the second device.
8. The method according to claim 7, wherein the step of using a key negotiation algorithm to establish a secure communication connection with the second device based on the transport layer connection comprises: Based on the transport layer connection, receiving a pairing message transmitted by the second device by invoking a cross-platform secure communication method; After establishing pairing in response to the pairing message, use the key negotiation algorithm to determine a shared secret with the second device to establish a secure communication connection with the second device.
9. The method according to claim 1, wherein, The application under test is a program developed using the development framework of the first non-embedded operating system.
10. The method according to claim 1, wherein The embedded operating system is the IOS system, the first non-embedded operating system is the MAC system, the development framework is Xcode, and the test program is a UI test program developed based on XCUItest.
11. The method according to claim 10, wherein, The second non-embedded operating system is any one of the MAC system, the LINUX system, and the WINDOWS system.
12. A software testing method, comprising: In a local second non-embedded operating system, determine an automated test driver for a test program, wherein the test program is developed using the development framework of a first non-embedded operating system and is installed in an embedded operating system of an embedded device for performing black-box testing on an application under test installed in the embedded operating system, and the automated test driver is installed in a portable container; Via a secure communication connection with the embedded device, use the automated test driver to send a drive control message to the embedded device, the drive control message instructing the embedded operating system to drive the test program.
13. The software testing method according to claim 12, wherein, Before determining the automated test driver for the test program in the local second non-embedded operating system, it includes: Install the obtained portable container in the local second non-embedded operating system.
14. A software testing method, comprising: Obtain a first confirmation operation of a pairing request sent by a user on an interaction interface of a local embedded device for a first device, the first device being installed with a first non-embedded operating system; In response to the first confirmation operation, establish a secure communication connection with the first device to receive an installation program of a software test program, wherein the software test program is a program developed using the development framework of the first non-embedded operating system in the first device and is used for performing black-box testing on an application under test installed in the embedded device; Obtain an installation operation of the user on the interaction interface for the installation program to install the software test program into the embedded operating system in the embedded device; Via a secure communication connection with a second device, receive a drive control message sent by an automated test driver corresponding to the software test program installed in a second non-embedded operating system of the second device, wherein the drive control message instructs the embedded device to drive the software test program, and the automated test driver is installed in a portable container.
15. An embedded device, comprising: A first acquisition module that acquires a first confirmation operation of a pairing request sent by a user on an interaction interface for a first device, the first device being installed with a first non-embedded operating system; A communication establishment module, in response to the first confirmation operation, establishes a secure communication connection with the first device to receive an installation program of a software test program, where the software test program is a program developed using a development framework of the first non-embedded operating system in the first device and is used to perform black-box testing on a to-be-tested application program installed in the embedded device; A second acquisition module acquires an installation operation of the installation program by a user on the interaction interface to install the software test program into an embedded operating system in the embedded device; A receiving module receives, through a secure communication connection with a second device, a drive control message sent by an automated test driver program corresponding to the software test program installed in a second non-embedded operating system of the second device, where the drive control message instructs the embedded device to drive the software test program, and the automated test driver program is installed in a portable container.
16. An electronic device, comprising: An installation module installs a test program developed using a development framework of a first non-embedded operating system in a local embedded operating system, where the test program is used to perform black-box testing on a to-be-tested application program installed in the embedded operating system; A receiving module receives, through a secure communication connection with a second device, a drive control message sent by an automated test driver program corresponding to the test program installed in a second non-embedded operating system of the second device, the drive control message instructing the embedded operating system to drive the test program, and the automated test driver program is installed in a portable container.
17. An electronic device, comprising: A determination module determines an automated test driver program of a test program in a local second non-embedded operating system, where the test program is developed using a development framework of a first non-embedded operating system and is installed in an embedded operating system of an embedded device and is used to perform black-box testing on a to-be-tested application program installed in the embedded operating system; A sending module sends, through a secure communication connection with the embedded device, a drive control message to the embedded device using the driver program, the drive control message instructing the embedded operating system to drive the test program, and the automated test driver program is installed in a portable container.
18. An electronic device, the device comprising: One or more processors; A computer-readable medium configured to store 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 software test method according to any one of claims 1-14.
19. A computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, it implements the software test method according to any one of claims 1-14.
Citation Information
Patent Citations
Automatic test method for realizing different communication modes of embedded device
CN107678949A
Remote operation method and device for testing equipment
CN108282542A