Automatic testing method and device for upgrading operating system of mobile terminal and electronic equipment
By generating and compiling test packages that simulate system interface behavior, the compatibility problem after the update of the mobile operating system version is solved, and upgrading tests on the same device are realized, reducing testing costs and improving efficiency.
Patent Information
- Application Number
- CN202411488323.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The mobile operating system version is frequently updated, which may cause compatibility issues in SDK or applications after the system is upgraded. The existing technology requires the preparation of multiple test equipment, which is relatively high in testing costs.
By obtaining the system interface in the application or software development toolkit that changes behavior due to the mobile operating system upgrade, a library file is generated, and a test package used to simulate the behavior of the system interface on different versions of the operating system is compiled based on these library files, so as to achieve upgrade testing on the same device.
It reduces the testing cost, realizes the completion of operating system upgrade tests on the same device, covers more test scenarios, and improves testing efficiency.
Smart Images

Figure CN119718907A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to an automated testing method, device, and electronic device for upgrading a mobile operating system. Background Art
[0002] Mobile operating systems including Android, iOS, and HarmonyOS are updated frequently. iOS releases two versions every year, and Android releases at least one new version every year. HarmonyOS is a self-developed operating system in my country. After its official commercial use, it is expected to maintain an iteration frequency of 1 to 2 new versions per year. In this context, mobile software development faces a problem: SDKs (Software Development Kits) or applications developed on low-version systems may run abnormally when the system is upgraded to a higher version due to changes in the system interface behavior. Therefore, every time a new system is released, it is necessary to run a compatibility test on the new system.
[0003] Currently, after the mobile operating system is upgraded, once there is a problem with the SDK or application, the developer will fix the problem and find a test device to perform upgrade testing. However, since the mobile operating system version is updated frequently, this testing method of the prior art requires the preparation of multiple test devices, which results in high testing costs. Summary of the invention
[0004] In view of this, the present application provides an automated testing method, device and electronic device for upgrading a mobile operating system, the main purpose of which is to complete the upgrade test of the operating system using only one testing device, thereby reducing the testing cost.
[0005] According to the first aspect of the present application, there is provided an automated testing method for upgrading a mobile terminal operating system, the method comprising:
[0006] Obtain system interfaces in applications or software development kits that have changed behavior due to mobile operating system upgrades;
[0007] Generate a library file corresponding to the system interface;
[0008] Digitally signing the generated library file to obtain a digitally signed library file;
[0009] Based on the digitally signed library file, compile test packages for simulating the behavior of the system interface on different versions of operating systems, wherein the different versions of operating systems are generated by upgrading the mobile terminal operating system;
[0010] According to the test packages corresponding to the different versions of the operating system, it is tested on the same device whether the application or the software development tool can run normally when the mobile operating system is upgraded.
[0011] According to a second aspect of the present application, there is provided an automated testing device for upgrading a mobile terminal operating system, the device comprising:
[0012] An acquisition unit, used to acquire a system interface in an application or software development kit whose behavior has changed due to an upgrade of a mobile terminal operating system;
[0013] A generating unit, used for generating a library file corresponding to the system interface;
[0014] A signature unit, used to digitally sign the generated library file to obtain a digitally signed library file;
[0015] A compiling unit, for compiling test packages for simulating the behavior of the system interface on different versions of operating systems based on the digitally signed library files, wherein the different versions of operating systems are generated by upgrading the mobile terminal operating system;
[0016] The testing unit is used to test whether the application or the software development tool can run normally when the mobile operating system is upgraded on the same device according to the test packages corresponding to the different versions of the operating system.
[0017] According to a third aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the automated testing method for upgrading the mobile terminal operating system is implemented.
[0018] According to the fourth aspect of the present application, an electronic device is provided, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein when the processor executes the program, the automated testing method for upgrading the mobile operating system is implemented.
[0019] By means of the above technical scheme, the present application provides an automated testing method, device and electronic device for upgrading a mobile operating system. Compared with the prior art, by obtaining the system interface in the application or software development kit whose behavior changes due to the upgrade of the mobile operating system, a library file is generated, and based on the library file, test packages for simulating the behavior of the system interface on different versions of the operating system are compiled respectively, so that the application or software development tool can be tested on the same device whether it can run normally on different versions of the operating system. Since the test package compiled by the present application can simulate the behavior of the system interface on different versions of the operating system, the present application does not need to find devices with different versions of the operating system installed for upgrade testing. As long as the test packages corresponding to different versions of the operating system are installed on the same device in sequence, the behavior of the system interface on different operating systems can be simulated, thereby completing the test, thereby reducing the test cost and achieving repeated testing. At the same time, the present application can design various test scenarios by compiling the test package, so that the test case coverage is more comprehensive. In addition, the present application can also be combined with an automated testing platform to perform automated testing and improve test efficiency.
[0020] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 A flow chart of an automated testing method for upgrading a mobile terminal operating system provided in an embodiment of the present application is shown;
[0023] Figure 2 A schematic diagram of the structure of an automated testing device for upgrading a mobile terminal operating system provided in an embodiment of the present application is shown;
[0024] Figure 3 A structural schematic diagram of another automated testing device for upgrading a mobile terminal operating system provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0026] The testing method of the prior art requires the preparation of multiple testing devices, and the testing cost is high.
[0027] In order to solve the above problems, an embodiment of the present invention provides an automated testing method for upgrading a mobile terminal operating system, such as Figure 1 As shown, the method includes:
[0028] Step 101: Obtain a system interface in an application or software development kit whose behavior has changed due to an upgrade of a mobile terminal operating system.
[0029] Among them, mobile operating systems include Android, iOS, HarmonyOS, etc.
[0030] The embodiment of the present invention is mainly applicable to the scenario of testing an application or software development kit when the mobile terminal operating system is upgraded. The execution subject of the embodiment of the present invention is a device or equipment capable of performing a mobile terminal operating system upgrade test.
[0031] According to the embodiment of the present invention, a system upgrade detection may be performed on the device where the application or software development kit is located to obtain the system interface in the application or software development kit whose behavior has changed due to the mobile terminal operating system upgrade, thereby obtaining the interface set ChangeableSetA.
[0032] For example, the toolkit for obtaining device identification on the Android system calls the system's interface for obtaining mac address and interface for obtaining device serial number to generate device identification. The system interface for obtaining mac address can return the mac address normally in Android 6.0 and below, but can only return a fixed value in Android 6.0 and above. In addition, the system interface for obtaining device serial number can return the device serial number normally in Android 9.0 and below, but can only return a fixed value in Android 9.0 and above. It can be concluded that the system interface for obtaining mac address and the system interface for obtaining device serial number will change their behavior when the system is upgraded, so the system interface for obtaining mac address and the system interface for obtaining device serial number are added to the interface set ChangeableSetA.
[0033] In addition, in addition to obtaining the system interfaces whose behaviors have changed due to the system upgrade through system upgrade detection, the system interfaces whose behaviors may have changed due to the system upgrade can also be obtained through other judgments, and these system interfaces are added to the interface set ChangeableSetB.
[0034] Since it has been determined that some system interfaces will change their behavior due to operating system upgrades, resulting in the inability of applications or software development kits to implement business functions, developers are required to adjust business logic so that the applications or software development kits can implement business functions normally when the operating system is upgraded and pass the upgrade test.
[0035] Step 102: Generate a library file corresponding to the system interface.
[0036] For the embodiment of the present invention, after obtaining the system interface, a library file corresponding to the system interface is generated. For this process, step 102 specifically includes: writing the system interface into the target module; packaging the target module to obtain the library file corresponding to the system interface, and the library file includes at least one of the following: jar package, .a static library, .so dynamic library and .framework dynamic library, etc. It should be noted that the type of library file in the embodiment of the present invention is not limited to the above. In addition, an application or a software development toolkit can correspond to a target module, and different applications or different software development toolkits correspond to different target modules.
[0037] Specifically, the target module ChangeableModule will eventually be packaged into a separate jar package, or a .a static library, or a .so dynamic library, or a .framework dynamic library, thereby obtaining the library file libraryA.
[0038] In some embodiments, in order to verify the integrity of the library file in the subsequent testing process, the embodiments of the present invention need to pre-develop a digital signature service or application, the function of which is to generate an asymmetric key pair, digitally sign the incoming data, and display the signature result. The public key of the service or application needs to be exported for use in the development phase. Among them, the asymmetric algorithm can be RSA, SM2, etc.
[0039] An application or software development kit can ultimately be composed of the library file libraryA compiled from the target module and the library files libraryB, libraryC, etc. compiled from the business function module. When the business function module needs to call the system interface in ChangeableSetA or ChangeableSetB, it can be implemented by calling the system interface in libraryA.
[0040] Step 103: digitally sign the generated library file to obtain a digitally signed library file.
[0041] For the embodiment of the present invention, in order to ensure the integrity of the library file and prevent attackers from tampering with and adding malicious code, the library file needs to be digitally signed so that the integrity of the library file can be verified based on the digital signature result when the APP is running. Among them, the digital signature result of the library file is in the corresponding configuration file, and the public key of the library file is built into the business function module that needs to call the library file in the application or software development kit. The business function module can verify the integrity of the library file based on the digital signature result and public key of the library file when calling the library file.
[0042] Step 104: Based on the digitally signed library file, compile test packages for simulating the behavior of the system interface on different versions of operating systems.
[0043] The different versions of operating systems are generated by upgrading the mobile terminal operating system.
[0044] For the embodiment of the present invention, after obtaining the library file, it is necessary to compile test packages corresponding to different versions of operating systems for the library file. For this process, step 103 specifically includes: based on the behavior of the system interface on different versions of operating systems, the system interface in the digitally signed library file is compiled respectively to obtain a test package for simulating the behavior of the system interface on different versions of operating systems.
[0045] For example, based on the library file libraryA, multiple test packages libraryA1, libraryA2 and libraryA3 are compiled, where libraryA1 is used to simulate the behavior of the system interface on operating system 1.0, libraryA2 is used to simulate the behavior of the system interface on operating system 2.0, and libraryA3 is used to simulate the behavior of the system interface on operating system 3.0.
[0046] In some embodiments, in order to ensure the integrity of the test package and prevent attackers from tampering with and adding malicious code, the test package needs to be digitally signed so that the integrity of the test package can be verified based on the digital signature result when the APP is running. Based on this, the method includes: digitally signing the test packages corresponding to the different versions of the operating system respectively, obtaining the digital signature results and public keys of the test packages corresponding to the different versions of the operating system, wherein the digital signature results are in the corresponding configuration files, and the public keys are built into the business function modules in the application or software development kit that need to call the system interface; when the application or software development kit runs on any of the different versions of the operating system, when the business function module needs to call the system interface, the business function module obtains the digital signature results of the test package corresponding to any version of the operating system from the corresponding configuration files, and verifies whether the content of the test package corresponding to any version of the operating system is complete based on the digital signature results and the corresponding public keys; if the content of the test package corresponding to any version of the operating system is complete, a system interface call is made.
[0047] For example, the test package corresponding to operating system 1.0 is libraryA1, the test package corresponding to operating system 2.0 is libraryA2, and the test package corresponding to operating system 3.0 is libraryA3. Before the formal test, the test packages libraryA1, libraryA2, and libraryA3 are digitally signed respectively, and then the public keys corresponding to the test packages libraryA1, libraryA2, and libraryA3 are built into the business function module. At the same time, the signature result corresponding to the test package libraryA1 is written into the configuration file corresponding to the application or software development kit. If the product is an application, the digital signature result is directly written into its configuration file; if the product is a software development kit, the signature result can be written into the APP configuration file by the caller. During the formal test process, when the business function module of the application or software development kit calls the system interface, it will first obtain the public key and the digital signature result corresponding to libraryA1, and verify the integrity of the system interface in libraryA1. If the verification is passed, the business function module will call the system interface in the test package libraryA1; otherwise, an error is returned. After completing the operating system 1.0 test, the signature result corresponding to the test package libraryA2 is written into the configuration file corresponding to the application or software development kit. During the formal test process, when the business function module of the application or software development kit calls the system interface, it will first obtain the public key and the digital signature result corresponding to libraryA2, and verify the integrity of the system interface in libraryA2. If the verification is successful, the business function module will then call the system interface in the test package libraryA2. Similarly, after completing the operating system 2.0 test, the signature result corresponding to the test package libraryA3 is written into the configuration file corresponding to the application or software development kit. During the formal test process, when the business function module of the application or software development kit calls the system interface, it will first obtain the public key and the digital signature result corresponding to libraryA3, and verify the integrity of the system interface in libraryA3. If the verification is successful, the business function module will then call the system interface in the test package libraryA3.
[0048] Step 105: Test, on the same device, whether the application or the software development tool can run normally when the mobile terminal operating system is upgraded according to the test packages corresponding to the different versions of the operating system.
[0049] For the embodiment of the present invention, during formal testing, the test packages corresponding to different versions of operating systems are integrated into the application or software development kit in turn, and installed on the same device to run, and the return results of the application or software development kit running on the different versions of the operating system are obtained; if the return results of the application or software development kit running on the different versions of the operating system are consistent, it is determined that the application or the software development tool can run normally when the mobile terminal operating system is upgraded.
[0050] Following the above example, first integrate the test package libraryA1 into the application or software development kit, then install the application or software development kit integrating libraryA1 into the test device (such as a mobile phone, tablet computer, etc.) for testing. After the application or software development kit runs successfully, replace the test package libraryA1 with the test package libraryA2, and then integrate the test package libraryA2 into the application or software development kit, and install and run it to test whether the application or software development kit can run normally when the operating system is upgraded from 1.0 to 2.0. If the results returned by the application or software development kit are consistent when the operating system is upgraded from 1.0 to 2.0, it means that the application or software development kit can run normally when the operating system is upgraded from 1.0 to 2.0. Similarly, replace the test package libraryA2 with the test package libraryA3 to test whether the application or operating system can run normally when the operating system is upgraded from 2.0 to 3.0. If the results returned by the application or software development kit are consistent when the operating system is upgraded from 2.0 to 3.0, it means that the application or software development kit can run normally when the operating system is upgraded from 2.0 to 3.0. That is, the system upgrade test of the embodiment of the present invention is equivalent to the replacement test of libraryA.
[0051] The successful running of the software development kit refers to the successful running of the application integrated with the software development kit SDK.
[0052] The embodiment of the present invention simulates the behavior of the system interface on different operating systems by compiling test packages corresponding to different operating systems, and can repeat the test on one device. In addition, the embodiment of the present invention can design various test cases by compiling multiple test packages, thereby ensuring that the application or software development kit can run normally during the system upgrade and improving product quality.
[0053] Furthermore, the embodiment of the present invention can complete the replacement operation, packaging operation and installation operation of the test packages corresponding to different versions of operating systems based on the automated testing framework script to realize automated testing.
[0054] Specifically, since the system upgrade test in the embodiment of the present invention is equivalent to the replacement test of libraryA, the replacement, packaging, installation and other operations can be completed through the automated testing framework script such as Appium, thereby realizing automated testing.
[0055] In order to make the technical solution of the embodiment of the present invention clearer, the tool kit for obtaining device identification on the Android system is taken as an example to describe the entire system upgrade test process in detail.
[0056] The toolkit for obtaining device identification on the Android system calls the system's WifiManager interface and Build.SERIAL interface. The WifiManager interface is used to obtain the mac address, and the Build.SERIAL interface is used to obtain the device serial number.
[0057] The WifiManager interface returns normally in systems below Android 6.0, such as bc:d0:74:0d:76:6a, but returns a fixed value of 02:00:00:00:00:00 in systems above Android 6.0. The Build.SERIAL interface returns normally in systems below Android 9.0, such as LKX0217C12001548, but returns a fixed value of unknown in systems above Android 9.0.
[0058] If the toolkit concatenates the MAC address and the device serial number as the device ID, the following problems will occur: 1. When the Android system is upgraded from 5.0 to 6.0, the toolkit will return a different device ID; 2. When the Android system is upgraded from 8.0 to 9.0, the toolkit will return a different device ID.
[0059] Based on this, the embodiment of the present invention can write the WifiManager interface and the Build.SERIAL interface into the target module ChangeableModule, and then package the target module ChangeableModule to generate a library file libraryA.
[0060] At the same time, developers need to modify the logic of obtaining device identification to fix problems that occur during system upgrades. For example, developers can consider obtaining the MAC address and device serial number through other methods provided by the system, or they can abandon these two device information and use other devices, such as file ID, TEE logo, etc. as device identification.
[0061] Furthermore, three test packages libraryA, libraryB and libraryC are compiled according to the library file libraryA. For the test package libraryA, the WifiManager interface returns a normal value, and the Build.SERIAL interface returns a normal value; for the test package libraryB, the WifiManager interface returns 02:00:00:00:00:00, and the Build.SERIAL interface returns a normal value; for the test package libraryC, the WifiManager interface returns 02:00:00:00:00:00, and the Build.SERIAL interface returns unknown.
[0062] Then, digital signatures are processed for the test packages libraryA, libraryB and libraryC respectively, and the digital signature results corresponding to the test packages libraryA, libraryB and libraryC are obtained. The signature results are written in the corresponding configuration files. Then, the test packages libraryA, libraryB and libraryC are integrated into the device identification toolkit in turn, and installed and run on the same device. The installation and replacement order is libraryA1, libraryA2, libraryA3. The content to be tested is: 1. When the Android system is upgraded from 5.0 to 6.0 (libraryA1->libraryA2), whether the device identification returned by the toolkit is consistent; 2. When the Android system is upgraded from 8.0 to 9.0 (libraryA2->libraryA3), whether the device identification returned by the toolkit is consistent. If the above two scenarios can return consistent device identification, it means that the developer has fixed the problem this time.
[0063] Testers can deploy the compiled test packages libraryA, libraryB, and libraryC in an automated testing service such as Appium, and write scripts to automatically complete replacement, packaging, installation, and testing, so that system upgrade testing can be automatically completed during each regression test.
[0064] An automated testing method for upgrading a mobile operating system provided by an embodiment of the present invention generates a library file by acquiring a system interface whose behavior changes due to the upgrade of the mobile operating system in an application or software development toolkit, and compiling test packages for simulating the behavior of the system interface on different versions of the operating system based on the library file, so as to test whether an application or software development tool can run normally on different versions of the operating system on the same device. Since the test package compiled by the embodiment of the present invention can simulate the behavior of the system interface on different versions of the operating system, the embodiment of the present invention does not need to find a device with different versions of the operating system installed for upgrade testing. As long as the test packages corresponding to different versions of the operating system are installed on the same device in sequence, the behavior of the system interface on different operating systems can be simulated, thereby completing the test, thereby reducing the test cost and achieving repeated testing. At the same time, the embodiment of the present invention can design various test scenarios by compiling the test package, so that the test case coverage is more comprehensive. In addition, the embodiment of the present invention can also be combined with an automated testing platform to perform automated testing to improve test efficiency.
[0065] Further, as Figure 1 The specific implementation of the method shown in the embodiment provides an automated testing device for upgrading the operating system of a mobile terminal, such as Figure 2 As shown, the device includes: an acquisition unit 31, a generation unit 32, a signature unit 33, a compilation unit 34 and a testing unit 35.
[0066] The acquisition unit 31 may be used to acquire a system interface in an application or software development kit whose behavior has changed due to an upgrade of the mobile terminal operating system.
[0067] The generating unit 32 may be used to generate a library file corresponding to the system interface.
[0068] The signature unit 33 is used to digitally sign the generated library file to obtain a digitally signed library file.
[0069] The compiling unit 34 can be used to compile test packages for simulating the behavior of the system interface on different versions of operating systems based on the digitally signed library file, wherein the different versions of operating systems are generated by upgrading the mobile terminal operating system.
[0070] The testing unit 35 can be used to test whether the application or the software development tool can run normally when the mobile terminal operating system is upgraded on the same device according to the test packages corresponding to the different versions of the operating system.
[0071] In some embodiments, the acquisition unit 31 can be specifically used to perform system upgrade detection on the device where the application or the software development kit is located, and obtain the system interface of the application or the software development kit whose behavior has changed due to the upgrade of the mobile terminal operating system.
[0072] In some embodiments, the generation unit 32 can be specifically used to write the system interface into the target module; package the target module to obtain a library file corresponding to the system interface, and the library file includes at least one of the following: jar package, .a static library, .so dynamic library and .framework dynamic library.
[0073] In some embodiments, the compilation unit 34 can be specifically used to compile the system interface in the digitally signed library file based on the behavior of the system interface on different versions of the operating system, so as to obtain a test package for simulating the behavior of the system interface on different versions of the operating system.
[0074] In some embodiments, the testing unit 35 can be specifically used to integrate the test packages corresponding to the different versions of the operating system into the application or software development kit in sequence, and install them on the same device for execution, to obtain the return results of the application or software development kit running on the different versions of the operating system; if the return results of the application or software development kit running on the different versions of the operating system are consistent, it is determined that the application or the software development tool can run normally when the mobile operating system is upgraded.
[0075] In some embodiments, Figure 3 As shown, the device further includes: a verification unit 36.
[0076] The signature unit 33 can also be used to digitally sign the test packages corresponding to the different versions of the operating system, respectively, to obtain the digital signature results and public keys of the test packages corresponding to the different versions of the operating system, wherein the digital signature results are in the corresponding configuration files, and the public keys are built into the business function modules in the application or software development kit that need to call the system interface.
[0077] The verification unit 36 can be used when the application or software development kit is running on any version of the operating system among the different versions of the operating systems, and the business function module needs to call the system interface. The business function module obtains the digital signature result of the test package corresponding to the any version of the operating system from the corresponding configuration file, and verifies whether the content of the test package corresponding to the any version of the operating system is complete based on the digital signature result and the corresponding public key; if the content of the test package corresponding to any version of the operating system is complete, a system interface call is made.
[0078] In some embodiments, the testing unit 35 may also be used to complete replacement operations, packaging operations, and installation operations of the test packages corresponding to the different versions of the operating system based on an automated testing framework script to implement automated testing.
[0079] It should be noted that for other corresponding descriptions of the functional units involved in the automatic testing device for upgrading the mobile terminal operating system provided by the embodiment of the present invention, reference can be made to Figure 1 The corresponding description in will not be repeated here.
[0080] Based on the above Figure 1 The method shown in the embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Figure 1 The automated testing method for upgrading the mobile operating system is shown.
[0081] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0082] Based on the above Figure 1 The method shown, and Figure 2 and Figure 3 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, which can be a personal computer, a tablet computer, a server, or other network equipment, etc. The device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 The automated testing method for upgrading the mobile operating system is shown.
[0083] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0084] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0085] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0086] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware.
[0087] The embodiment of the present invention generates a library file by acquiring the system interface in the application or software development kit whose behavior changes due to the upgrade of the mobile terminal operating system, and compiles test packages for simulating the behavior of the system interface on different versions of the operating system based on the library file, so as to test whether the application or software development tool can run normally on the same device on different versions of the operating system. Since the test package compiled by the embodiment of the present invention can simulate the behavior of the system interface on different versions of the operating system, the embodiment of the present invention does not need to find devices with different versions of the operating system installed for upgrade testing. As long as the test packages corresponding to different versions of the operating system are installed on the same device in sequence, the behavior of the system interface on different operating systems can be simulated, thereby completing the test, thereby reducing the test cost and achieving repeated testing. At the same time, the embodiment of the present invention can design various test scenarios by compiling the test package, so that the test case coverage is more comprehensive. In addition, the embodiment of the present invention can also be combined with an automated testing platform to perform automated testing to improve test efficiency.
[0088] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0089] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. An automated testing method for upgrading a mobile operating system, characterized in that: include: Obtain system interfaces in applications or software development kits that have changed behavior due to mobile operating system upgrades; Generate a library file corresponding to the system interface; Digitally signing the generated library file to obtain a digitally signed library file; Based on the digitally signed library file, compile test packages for simulating the behavior of the system interface on different versions of operating systems, wherein the different versions of operating systems are generated by upgrading the mobile terminal operating system; According to the test packages corresponding to the different versions of the operating system, it is tested on the same device whether the application or the software development tool can run normally when the mobile operating system is upgraded.
2. The method according to claim 1, characterized in that The method of obtaining a system interface in an application or software development kit whose behavior has changed due to an upgrade of the mobile terminal operating system includes: A system upgrade detection is performed on the device where the application or the software development kit is located to obtain a system interface in the application or the software development kit whose behavior has changed due to the upgrade of the mobile terminal operating system.
3. The method according to claim 1, characterized in that The generating of the library file corresponding to the system interface comprises: Writing the system interface into a target module; The target module is packaged to obtain a library file corresponding to the system interface, wherein the library file includes at least one of the following: a jar package, a .a static library, a .so dynamic library, and a .framework dynamic library.
4. The method according to claim 1, characterized in that: The test packages for simulating the behavior of the system interface on different versions of operating systems are compiled based on the digitally signed library files, including: Based on the behaviors of the system interface on different versions of operating systems, the system interfaces in the digitally signed library files are compiled respectively to obtain test packages for simulating the behaviors of the system interface on different versions of operating systems.
5. The method according to claim 1, characterized in that The step of testing, on the same device, whether the application or the software development tool can run normally when the mobile terminal operating system is upgraded according to the test packages corresponding to the different versions of the operating system, includes: Integrate the test packages corresponding to the different versions of the operating system into the application or software development kit in sequence, and install them on the same device for running, to obtain return results of the application or software development kit running on the different versions of the operating system; If the returned results of the application or software development toolkit when running on the different versions of the operating systems are consistent, it is determined that the application or the software development toolkit can run normally when the mobile terminal operating system is upgraded.
6. The method according to claim 1, characterized in that The method further comprises: Digitally sign the test packages corresponding to the different versions of the operating system respectively to obtain the digital signature results and public keys of the test packages corresponding to the different versions of the operating system, wherein the digital signature results are in the corresponding configuration files, and the public keys are built into the business function modules in the application or software development kit that need to call the system interface; When the application or software development kit runs on any version of the operating system among the different versions of the operating system, and the business function module needs to call the system interface, the business function module obtains the digital signature result of the test package corresponding to the any version of the operating system from the corresponding configuration file, and verifies whether the content of the test package corresponding to the any version of the operating system is complete based on the digital signature result and the corresponding public key; If the test package corresponding to any version of the operating system is complete, the system interface call will be made.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Based on the automated testing framework script, the replacement operation, packaging operation and installation operation of the test packages corresponding to the different versions of the operating system are completed to realize automated testing.
8. An automated testing device for upgrading a mobile operating system, characterized in that: include: An acquisition unit, used to acquire a system interface in an application or software development kit whose behavior has changed due to an upgrade of a mobile terminal operating system; A generating unit, used for generating a library file corresponding to the system interface; A signature unit, used to digitally sign the generated library file to obtain a digitally signed library file; A compiling unit, for compiling test packages for simulating the behavior of the system interface on different versions of operating systems based on the digitally signed library files, wherein the different versions of operating systems are generated by upgrading the mobile terminal operating system; The testing unit is used to test whether the application or the software development tool can run normally when the mobile operating system is upgraded on the same device according to the test packages corresponding to the different versions of the operating system.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
A continuous integration method and a continuous integration system
CN109408382A
File testing method, device and system, electronic equipment and readable storage medium
CN113342660A
Method for generating and testing internal test program of application program
CN113553271A
Software compatibility testing method and device, storage medium and computer equipment
CN115757140A
Multi-terminal application development method and device, medium and equipment
CN117389567A