An application testing method and apparatus
By generating a repair plugin package containing program information, the location of problematic code, and fixes, and utilizing dynamic library files and Xcode integrated development templates, the problem of low efficiency in online application testing was solved, achieving efficient and accurate testing and problem code location.
Patent Information
- Application Number
- CN202310231642.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2043-03-10
AI Technical Summary
In existing technologies, when online issues arise after an application is released, testing efficiency is low, requiring full code compilation and multiple adjustments, resulting in long processing times and difficulty in quickly eliminating problems.
Generate a repair plugin package containing program information, problem code location information, and fix code. It enables efficient testing through dynamic library files, avoids full code compilation, and improves testing efficiency and accuracy by leveraging Xcode's integrated development templates and plugin package generation technology.
It improves the efficiency and accuracy of application testing, reduces the time required to eliminate online issues, and improves the accuracy of locating problematic code.
Smart Images

Figure CN116257450B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, particularly to the field of software technology, and especially to an application testing method and apparatus. Background Technology
[0002] After an application is released and launched, it may encounter online issues such as blank screens or crashes when running on user devices. If an online issue occurs, the developers need to locate the problematic code in the application's code and fix it.
[0003] To ensure the successful elimination of online issues that occur during application runtime, developers need to adjust the problematic code and then test the application with the adjusted code.
[0004] Currently, the general approach is to compile the modified full code of the application and then use the compiled program file for testing. Summary of the Invention
[0005] This disclosure provides an application testing method and apparatus.
[0006] According to one aspect of this disclosure, an application testing method is provided, comprising:
[0007] Obtain the application's program information and the location information of the problematic code in the application;
[0008] Obtain the fix code for the aforementioned problem code;
[0009] A repair plugin package containing the program information, location information, and repair code is generated and sent to a test device with the application installed as the recipient, so that the test device can test the application running based on the repair plugin package.
[0010] According to another aspect of this disclosure, an alternative application testing method is provided, including:
[0011] Obtain a repair plugin package, wherein the repair plugin package is generated based on the application's program information, the location information of the problematic code in the application, and the repair code for the problematic code;
[0012] In response to the application's launch command, the repair plugin package is determined based on the program information recorded in the obtained plugin package, and the application is launched based on the repair plugin package, so that when the application runs the problematic code indicated by the location information during the testing of the application, it jumps to run the repair code in the repair plugin package;
[0013] Obtain information for testing the application.
[0014] According to another aspect of this disclosure, an application testing apparatus is provided, comprising:
[0015] The information acquisition module is used to acquire program information of the application and the location information of the problematic code in the application;
[0016] The code acquisition module is used to obtain fix code for the problematic code.
[0017] The plugin package generation module is used to generate a repair plugin package containing the program information, location information, and repair code, and send the repair plugin package to a test device with the application installed as the recipient, so that the test device can test the application running based on the repair plugin package.
[0018] According to another aspect of this disclosure, another application testing apparatus is provided, comprising:
[0019] A plugin package acquisition module is used to acquire a repair plugin package, wherein the repair plugin package is generated based on the application's program information, the location information of the problematic code in the application, and the repair code for the problematic code;
[0020] The instruction response module is used to respond to the application's startup instruction, determine the repair plugin package based on the program information recorded in the obtained plugin package, and start the application based on the repair plugin package, so that when the application runs the problematic code indicated by the location information during the testing of the application, it jumps to run the repair code in the repair plugin package.
[0021] An information acquisition module is used to acquire information for testing the application.
[0022] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0023] At least one processor; and
[0024] A memory communicatively connected to the at least one processor; wherein,
[0025] The memory stores instructions that can be executed by the at least one processor, which enables the at least one processor to perform the application testing method described above.
[0026] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to execute the above-described application testing method.
[0027] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described application testing method.
[0028] As can be seen from the above, when testing an application using the solution provided in this disclosure, a repair plugin package containing application program information, problem code location information, and repair code can be generated, instead of compiling the entire modified application code as in the prior art. Compared to the entire application code, the amount of data in the repair code is usually smaller. Therefore, generating the repair plugin package is more efficient than compiling the entire application code, and testing the repair code is more efficient. Thus, applying the application testing solution provided in this disclosure can improve the testing efficiency of applications.
[0029] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0030] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0031] Figure 1 A flowchart illustrating the first application testing method provided in this embodiment of the disclosure;
[0032] Figure 2 A flowchart illustrating the second application testing method provided in this disclosure embodiment;
[0033] Figure 3 A schematic diagram of device interaction for application testing provided in this embodiment of the disclosure;
[0034] Figure 4 This is a schematic diagram of the structure of a first application testing device provided in an embodiment of the present disclosure;
[0035] Figure 5 This is a schematic diagram of the structure of a second application testing device provided in an embodiment of the present disclosure;
[0036] Figure 6 This is a block diagram of an electronic device used to implement the application testing method of the embodiments of this disclosure. Detailed Implementation
[0037] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0038] In existing application testing processes, after fixing problematic code, the entire modified codebase is compiled. When the application has a large amount of code, this compilation is time-consuming, leading to lengthy testing times and reduced efficiency. Furthermore, if the application fails tests, developers need to re-identify and fix the problematic code, requiring multiple compilations until the application passes tests and the online issue is resolved. Therefore, using existing technologies to eliminate online application problems is time-consuming and inefficient.
[0039] To address the aforementioned technical problems, this disclosure provides an application testing method and apparatus, which will be described in detail below through specific embodiments.
[0040] See Figure 1 , Figure 1 This is a flowchart illustrating a first application testing method provided in an embodiment of the present disclosure. In this embodiment, the method includes the following steps S101-S103.
[0041] Step S101: Obtain the application's program information and the location information of the problematic code in the application.
[0042] The aforementioned program information may include the application's installation package name, program name, and program identifier, etc.
[0043] Specifically, the local device used by the developer to develop the application and the server providing the application service can record the application's program information. Therefore, when obtaining the application's program information, it can be obtained from the aforementioned local device or server. In addition, program information entered by the developer can also be obtained.
[0044] When an application encounters an online issue, developers can use their experience to locate the problematic code within the application's codebase. This allows them to obtain location information input by the developers, which can then be used as the location of the problematic code.
[0045] In addition, existing problematic code detection technologies can be used to detect application code. After detecting problematic code in the application, the location information of the problematic code in the application can be obtained.
[0046] Step S102: Obtain the fix code for the problematic code.
[0047] Specifically, after developers locate the problematic code or detect it using existing problematic code detection technology, they can obtain the fix code written by the developers for the problematic code.
[0048] In one embodiment of this disclosure, when the fix code written by the developer for the problematic code is obtained, a code project can be created based on a code development toolkit in response to the user's creation instruction. For example, a tweak project can be created based on the Theos development toolkit, and the fix code written by the user for the problematic code can be obtained in the created project.
[0049] In addition, after the application is developed, developers can also write fix codes in advance for different types of code in the application to fix the application when the code is identified as problematic. In this way, when an online problem occurs in the application and the problematic code is identified, the fix code for the identified problematic code can be obtained from the various pre-written fix codes.
[0050] Step S103: Generate a repair plugin package containing program information, location information, and repair code, and send the repair plugin package to the test device with the application installed as the recipient, so that the test device can test the application running based on the repair plugin package.
[0051] The aforementioned test equipment can be understood as a device that simulates an online application problem. For example, the test equipment can be a device with the same model and operating system as the user device, so that when the application on the user device has an online problem, the application on the test equipment will also have an online problem.
[0052] Specifically, after obtaining the application's program information, the location information of the problematic code, and the repair code, a file containing the program information, location information, and repair code can be created. This generated file is then packaged to obtain a packaged repair plugin package. After generating the repair plugin package, it can be sent directly to the test device, or it can be sent to other devices, which will then forward it to the test device. This way, when the test device starts the application, it can load the repair plugin package to test the application running based on the repair plugin package.
[0053] When creating a file containing the above program information, location information, and repair code, the file can be a dynamic library file or other code project file.
[0054] As can be seen from the above, when testing an application using the solution provided in this disclosure, a repair plugin package containing application program information, problem code location information, and repair code can be generated, instead of compiling the entire modified application code as in the prior art. Compared to the entire application code, the amount of data in the repair code is usually smaller. Therefore, generating the repair plugin package is more efficient than compiling the entire application code, and testing the repair code is more efficient. Thus, the application testing solution provided in this disclosure can improve application testing efficiency. Furthermore, when multiple tests are required to eliminate online problems in the application, the application testing solution provided in this disclosure can shorten the time required to eliminate online problems and improve the efficiency of online problem elimination.
[0055] In one embodiment of this disclosure, when generating the above-mentioned repair plugin package, a dynamic library file containing program information, location information, and repair code can be created, and the repair plugin package can be generated based on the dynamic library file.
[0056] In one embodiment of this disclosure, the dynamic library file is in the form of a dylib.
[0057] In one embodiment of this disclosure, the above-mentioned repair plugin package is in deb format.
[0058] Specifically, you can add the above program information and location information to the configuration file, and create a dynamic library file with the information recorded in the configuration file as the configuration information and containing the repair code.
[0059] Based on the information recorded in the configuration file and the repair code, dynamic library files can be created using existing dynamic library creation technologies, which will not be detailed here.
[0060] In one embodiment of this disclosure, when creating a dynamic library file where the above program information includes the program identifier of the application, the IP address of the test device can be obtained, such as the local area network IP address where the test device is located, and the above program identifier, location information and IP address can be added to the configuration file, thereby creating a dynamic library file with the information recorded in the above configuration file as the configuration information and containing repair code.
[0061] In this scenario, when sending a repair plugin package to a test device with the application installed, the IP address recorded in the configuration file can be used to determine that the test device with the application installed is the recipient of the repair plugin package, and thus the repair plugin package can be sent to the test device.
[0062] Alternatively, the repair plugin package can be sent to an intermediate device used for forwarding plugin packages. After the intermediate device receives the repair plugin package, it can send the repair plugin package to the test device according to the IP address recorded in the configuration information of the repair plugin package.
[0063] In this solution, the configuration file contains the program identifier, location information, and IP address. The configuration information of the created dynamic library file is the information recorded in the configuration file. Therefore, the configuration information of the created dynamic library file contains the program identifier, location information, and IP address. Thus, when the repair plugin package generated based on the dynamic library file is sent to the test device, the repair plugin package can be accurately sent to the test device according to the IP address recorded in the configuration file. Furthermore, since the configuration information of the dynamic library file in the repair plugin package contains the program identifier, when the test device starts the application, it can accurately load the dynamic library file according to the program identifier configured for the dynamic library file. This enables accurate testing of applications running based on the dynamic library file. Therefore, applying the application testing solution provided in this embodiment can improve the accuracy of application testing.
[0064] In one embodiment of this disclosure, when generating the dynamic library file if the program information includes the application's program identifier, the IP address of the test device can be obtained, and the program identifier, location information, and IP address can be added to the configuration file.
[0065] In one embodiment of this disclosure, when generating the repair plugin package, based on the aforementioned dynamic library file, it can be generated using any of the following two implementation methods.
[0066] In the first implementation, the application's installation package can be added to the preset Xcode integrated development template to obtain the first development file; a dynamic library file can be added to the compiler of the Xcode integrated development template so that the compiler adds the dynamic library file to the installation package in the first development file to obtain the second development file; the second development file is compiled to obtain the repair plugin package.
[0067] Specifically, the Xcode Integrated Development Template (IDE) is an application development template provided by the Xcode Integrated Development Tool (IDE). After adding the application's installation package to the Xcode IDE, the Xcode IDE can parse and re-sign the installation package, making it editable and resulting in the first development file. The Xcode IDE's compiler is the module within the Xcode IDE that edits the installation package. After adding the dynamic library files to the compiler, the compiler can add the obtained dynamic library files to the installation package of the first development file, resulting in the second development file. Compiling the second development file then yields the repair plugin package.
[0068] In this solution, the Xcode integrated development template and its compiler are used to add dynamic library files to the installation package of the aforementioned application to obtain a second development file. The second development file is then compiled to obtain a repair plugin package. It can be seen that the repair plugin package is obtained based on the installation package and dynamic library files of the aforementioned application. Since the installation package of the aforementioned application is usually a binary file that the computer can recognize, it is not necessary to compile the application source code when compiling the second development file. Therefore, the compilation time of the second development file is shorter, which can shorten the application testing time and improve testing efficiency.
[0069] In the second implementation method, based on dynamic library files, existing plugin package generation technology can also be used to generate repair plugin packages, which will not be described in detail here.
[0070] As can be seen from the above, when testing applications using the solution provided in this disclosure, the repair plugin package is generated based on dynamic library files. After obtaining the repair plugin package, the testing device can parse the dynamic library files. Since a dynamic library file is a code file that can be shared by multiple applications, and the dynamic library file parsed by the testing device contains program information of the application with online issues, when the testing device starts the application with online issues, the application can call the parsed dynamic library files. Therefore, the testing device can accurately test applications running based on the dynamic library files in the repair plugin package. Thus, applying the application testing solution provided in this disclosure can improve the accuracy of application testing.
[0071] If the application tests run based on the fix plugin package fail, developers need to re-identify the problematic code in the application.
[0072] To facilitate developers in locating problematic code, in one embodiment of this disclosure, after obtaining the fix code for the problematic code, the log output node in the fix code can also be identified, and code for outputting logs can be added at the identified log output node.
[0073] The aforementioned log output nodes can be understood as the locations where logs are output in the repair code.
[0074] Specifically, the above log output node can be determined using either of the following two implementation methods.
[0075] In the first implementation, the code location specified by the developer in the code fix can be obtained as the log output node mentioned above.
[0076] For example, the code location specified by the developer could be the location of the output code that the developer is interested in for observing and eliminating online issues.
[0077] In the second implementation, the location of the code containing preset parameters in the repair code can also be determined as the log output node.
[0078] As can be seen from the above, when testing an application using the solution provided in this embodiment, code for outputting logs is added to the log output node of the repair code. When the testing device tests an application running based on the repair plugin package, it can obtain the logs output by the repair code contained in the repair plugin package. In this way, if the application fails the test, the output logs can help developers quickly and accurately locate the actual problem code.
[0079] In one embodiment of this disclosure, see [link to embodiment]. Figure 2 The document provides a flowchart of a second application testing method. In this embodiment, the method is applied to a test device with an application containing problematic code.
[0080] The above method includes the following steps S201-S203.
[0081] Step S201: Obtain the repair plugin package.
[0082] The repair plugin package is based on the application's program information, the location information of the problematic code in the application, and the generation of repair code for the problematic code.
[0083] Specifically, the device that generates the aforementioned repair plugin package can establish a direct wired or wireless communication with the testing device, so that the testing device can receive the repair plugin package directly sent by the generating device.
[0084] In addition, the aforementioned generating device and testing device can be indirectly connected through other devices. In this way, when generating the aforementioned repair plugin package, the generating device can add the IP address of the testing device to the repair plugin package, and after generating the aforementioned repair plugin package, send the aforementioned repair plugin package to the other device. The other device can then determine the testing device based on the IP address carried in the repair plugin package, and thus send the repair plugin package to the determined testing device.
[0085] Step S202: In response to the application's startup command, based on the program information recorded in the obtained plugin package, determine the repair plugin package, and start the application based on the repair plugin package, so that when the application's running location information indicates a problem code during the application's testing process, the application will jump to run the repair code in the repair plugin package.
[0086] Specifically, the testing device can store various existing plugin packages. In response to the application's launch command, it can identify the repair plugin package containing the program information of the application to be launched based on the program information recorded in the existing plugin packages, and launch the application based on the repair plugin package. After the application is launched, the application can be tested.
[0087] In one embodiment of this disclosure, the application can be tested using either of the following two implementation methods.
[0088] In the first implementation, after the application starts, testers can try to use the problematic functions in the application. In this way, the application can respond to user operations and execute the code corresponding to the problematic functions, thereby achieving the testing of the problematic functions.
[0089] In the second implementation, the test device can store test scripts, so that after the application starts, the test scripts can be run, allowing the test device to test the application according to the test scripts.
[0090] During application testing, because the code in the plugin package is optimized for the code within the application, its execution priority is higher than that of the code in the application code at the location where the plugin package is inserted. Therefore, when the application reaches the problematic code indicated by the aforementioned location information during testing, the application can jump to the repair code in the repair plugin package, which has a higher execution priority than the problematic code, because the repair code in the repair plugin package has a higher execution priority.
[0091] Step S203: Obtain information for testing the application.
[0092] Specifically, testing an application can be understood as testing whether problematic functions in the application can be used normally after adding the fix plugin package. Therefore, when testing an application, the code corresponding to the problematic function can be run. When running the code of the problematic function, data generated during the process, information displayed to the user, and status information such as whether the code has completed execution can be obtained.
[0093] Additionally, when the repair code in the aforementioned repair plugin package includes code for outputting logs, running the repair code will also obtain the logs output by the code used for outputting logs, serving as information for testing the application as described above.
[0094] As can be seen from the above, when testing an application using the solution provided in this embodiment, the repair plugin package is generated based on the application's program information, the location information of the problematic code in the application, and the repair code for the problematic code. When the application runs the problematic code indicated by the location information, it jumps to run the repair code in the repair plugin package, which can be understood as replacing the problematic code with the repair code. If the application fails the test after the code is replaced, it means that the aforementioned problematic code is not actually present in the application. If the application passes the test, it means that the aforementioned problematic code is actually present in the application. Therefore, the application testing solution provided in this embodiment can improve the accuracy of locating problematic codes.
[0095] In one embodiment of this disclosure, after obtaining the aforementioned repair plugin package, the repair plugin package can be parsed to obtain the dynamic library files included in the repair plugin package, and the dynamic library files can be stored in a preset folder. In this way, when determining the repair plugin package based on the program information recorded in the obtained plugin package, the dynamic library files included in the repair plugin package can be determined from the preset folder based on the program information recorded in each file in the preset folder, and when starting the application based on the repair plugin package, the application can be started based on the determined dynamic library files.
[0096] The dynamic library file is generated based on program information, location information, and repair code.
[0097] The aforementioned preset folder can be a folder under the operating system folder of the test device used to store dynamic library files, a folder used to store files obtained by decompressing the plugin package, or other pre-set folders.
[0098] Parsing the repair plugin package can be achieved using existing installer package parsing techniques, which will not be detailed here.
[0099] The method for determining dynamic library files from a preset folder is similar to the method for determining repair plugin packages from existing plugin packages; the method for launching an application based on the determined dynamic library files is similar to the method for launching an application based on repair plugin packages, and will not be elaborated here.
[0100] As can be seen from the above, when testing an application using the solution provided in this disclosure, the dynamic library file obtained by parsing and repairing the plugin package is stored in a preset folder. When responding to the application's startup command, the dynamic library file can be accurately determined from the preset folder based on the program information recorded in each file in the preset folder. Thus, the application can be started based on the dynamic library file, enabling accurate testing of the application. Therefore, the application testing solution provided in this disclosure can improve the accuracy of application testing.
[0101] In one embodiment of this disclosure, when the aforementioned preset folder is the system folder of the operating system of the test device used to store dynamic library files, the test device parses the obtained repair plugin package, obtains the dynamic library files included in the repair plugin package, and stores the dynamic library files in the system folder used to store dynamic library files. In this way, when the test device responds to the application's startup command, it can determine the dynamic library files included in the repair plugin package in the folder used to store dynamic library files, and start the application based on the determined dynamic library files. Thus, during the application testing process, when the application runs to the problematic code indicated by the aforementioned location information, the application jumps to run the dynamic library files included in the repair plugin package.
[0102] In one embodiment of this disclosure, see [link to embodiment]. Figure 3 , Figure 3 This is a diagram illustrating device interactions during application testing. Figure 3 In the process, the local device is used for the above applications. Figure 1 The device for the application testing method provided in the illustrated embodiment is a testing device that applies the above-described method. Figure 2 The device for the application testing method provided in the illustrated embodiment.
[0103] from Figure 3 As can be seen, the interaction process between the local device and the test device includes the following 7 steps:
[0104] Step 1: Obtain the fix code;
[0105] Step 2: Create a dynamic library file containing the fix code;
[0106] Step 3: Generate a repair plugin package based on the dynamic library file;
[0107] Step 4: Send the repair plugin package to the test device;
[0108] Step 5: Parse the plugin package;
[0109] Step 6: Load the dynamic library files in response to the application's startup command;
[0110] Step 7: Verify whether the online issue has been fixed.
[0111] Steps 1-4 are performed by the local device, and steps 5-7 are performed by the test device.
[0112] Corresponding to the application testing method described above, this disclosure also provides an application testing apparatus.
[0113] In one embodiment of this disclosure, see [link to embodiment]. Figure 4 A schematic diagram of the structure of a first application testing device is provided. In this embodiment, the device includes:
[0114] The information acquisition module 401 is used to acquire program information of the application and location information of the problematic code in the application;
[0115] The code acquisition module 402 is used to obtain the fix code for the problematic code;
[0116] The plugin package generation module 403 is used to generate a repair plugin package containing the program information, location information and repair code, and send the repair plugin package to the test device with the application installed as the receiver, so that the test device can test the application running based on the repair plugin package.
[0117] As can be seen from the above, when testing an application using the solution provided in this disclosure, a repair plugin package containing application program information, problem code location information, and repair code can be generated, instead of compiling the entire modified application code as in the prior art. Compared to the entire application code, the amount of data in the repair code is usually smaller. Therefore, generating the repair plugin package is more efficient than compiling the entire application code, and testing the repair code is more efficient. Thus, the application testing solution provided in this disclosure can improve application testing efficiency. Furthermore, when multiple tests are required to eliminate online problems in the application, the application testing solution provided in this disclosure can shorten the time required to eliminate online problems and improve the efficiency of online problem elimination.
[0118] In one embodiment of this disclosure, the plug-in package generation module includes:
[0119] The file creation submodule is used to create dynamic library files containing the program information, location information, and repair code.
[0120] The plugin package generation submodule is used to generate a repair plugin package based on the dynamic library file;
[0121] The plugin package sending submodule is used to send the repair plugin package to a test device with the application installed as the recipient.
[0122] As can be seen from the above, when testing applications using the solution provided in this disclosure, the repair plugin package is generated based on dynamic library files. After obtaining the repair plugin package, the testing device can parse the dynamic library files. Since a dynamic library file is a code file that can be shared by multiple applications, and the dynamic library file parsed by the testing device contains program information of the application with online issues, when the testing device starts the application with online issues, the application can call the parsed dynamic library files. Therefore, the testing device can accurately test applications running based on the dynamic library files in the repair plugin package. Thus, applying the application testing solution provided in this disclosure can improve the accuracy of application testing.
[0123] In one embodiment of this disclosure, the plug-in package generation submodule is specifically used for:
[0124] Add the application's installation package to the preset Xcode integrated development template to obtain the first development file;
[0125] Add the dynamic library file to the compiler of the Xcode integrated development template so that the compiler adds the dynamic library file to the installation package of the first development file to obtain the second development file;
[0126] The second development file is compiled to obtain the repair plugin package.
[0127] In this solution, the Xcode integrated development template and its compiler are used to add dynamic library files to the installation package of the aforementioned application to obtain a second development file. The second development file is then compiled to obtain a repair plugin package. It can be seen that the repair plugin package is obtained based on the installation package and dynamic library files of the aforementioned application. Since the installation package of the aforementioned application is usually a binary file that the computer can recognize, it is not necessary to compile the application source code when compiling the second development file. Therefore, the compilation time of the second development file is shorter, which can shorten the application testing time and improve testing efficiency.
[0128] In one embodiment of this disclosure, the program information includes: the program identifier of the application, and the file creation submodule, specifically used for:
[0129] Obtain the IP address of the test device;
[0130] Add the program identifier, the location information, and the IP address to the configuration file;
[0131] Create a dynamic library file that uses the information recorded in the configuration file as configuration information and contains the fix code;
[0132] Sending the repair plugin package to the test device with the application installed includes:
[0133] The repair plugin package is sent to the test device with the application installed, based on the IP address recorded in the configuration file.
[0134] In this solution, the configuration file contains the program identifier, location information, and IP address. The configuration information of the created dynamic library file is the information recorded in the configuration file. Therefore, the configuration information of the created dynamic library file contains the program identifier, location information, and IP address. Thus, when the repair plugin package generated based on the dynamic library file is sent to the test device, the repair plugin package can be accurately sent to the test device according to the IP address recorded in the configuration file. Furthermore, since the configuration information of the dynamic library file in the repair plugin package contains the program identifier, when the test device starts the application, it can accurately load the dynamic library file according to the program identifier configured for the dynamic library file. This enables accurate testing of applications running based on the dynamic library file. Therefore, applying the application testing solution provided in this embodiment can improve the accuracy of application testing.
[0135] In one embodiment of this disclosure, the apparatus further includes:
[0136] The node determination module is used to determine the log output nodes in the fix code after obtaining the fix code for the problem code;
[0137] The code-adding module is used to add code for outputting logs at the defined log output nodes.
[0138] As can be seen from the above, when testing an application using the solution provided in this embodiment, code for outputting logs is added to the log output node of the repair code. When the testing device tests an application running based on the repair plugin package, it can obtain the logs output by the repair code contained in the repair plugin package. In this way, if the application fails the test, the output logs can help developers quickly and accurately locate the actual problem code.
[0139] In one embodiment of this disclosure, see [link to embodiment]. Figure 5 A schematic diagram of a second application testing device is provided. In this embodiment, the device includes:
[0140] The plugin package obtaining module 501 is used to obtain a repair plugin package, wherein the repair plugin package is generated based on the application's program information, the location information of the problematic code in the application, and the repair code for the problematic code;
[0141] The instruction response module 502 is used to respond to the application's startup instruction, determine the repair plugin package based on the program information recorded in the obtained plugin package, and start the application based on the repair plugin package, so that when the application runs the problematic code indicated by the location information during the testing of the application, it jumps to run the repair code in the repair plugin package.
[0142] The information acquisition module 503 is used to acquire information for testing the application.
[0143] As can be seen from the above, when testing an application using the solution provided in this embodiment, the repair plugin package is generated based on the application's program information, the location information of the problematic code in the application, and the repair code for the problematic code. When the application runs the problematic code indicated by the location information, it jumps to run the repair code in the repair plugin package, which can be understood as replacing the problematic code with the repair code. If the application fails the test after the code is replaced, it means that the aforementioned problematic code is not actually present in the application. If the application passes the test, it means that the aforementioned problematic code is actually present in the application. Therefore, the application testing solution provided in this embodiment can improve the accuracy of locating problematic codes.
[0144] In one embodiment of this disclosure, the apparatus further includes:
[0145] The plugin package parsing module is used to parse the repair plugin package after obtaining the repair plugin package to obtain the dynamic library file included in the repair plugin package, wherein the dynamic library file is generated based on the program information, the location information and the repair code;
[0146] The file storage module is used to store the dynamic library files to a preset folder;
[0147] The instruction response module is specifically used for:
[0148] In response to the application's launch command, based on the program information recorded in each file in the preset folder, the dynamic library files included in the repair plugin package are determined from the preset folder, and the application is launched based on the determined dynamic library files.
[0149] As can be seen from the above, when testing an application using the solution provided in this disclosure, the dynamic library file obtained by parsing and repairing the plugin package is stored in a preset folder. When responding to the application's startup command, the dynamic library file can be accurately determined from the preset folder based on the program information recorded in each file in the preset folder. Thus, the application can be started based on the dynamic library file, enabling accurate testing of the application. Therefore, the application testing solution provided in this disclosure can improve the accuracy of application testing.
[0150] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0151] In one embodiment of this disclosure, an electronic device is provided, comprising:
[0152] At least one processor; and
[0153] A memory communicatively connected to the at least one processor; wherein,
[0154] The memory stores instructions that can be executed by the at least one processor, which enables the at least one processor to perform the application testing method described above.
[0155] In one embodiment of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the above-described application testing method.
[0156] In one embodiment of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described application testing method.
[0157] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0158] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0159] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0160] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as application testing methods. For example, in some embodiments, the application testing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the application testing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform application testing methods by any other suitable means (e.g., by means of firmware).
[0161] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0162] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0163] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0164] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0165] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0166] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0167] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0168] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. An application program testing method, comprising: obtaining program information of an application program and location information of a problem code in the application program; obtaining a repair code for the problem code; creating a dynamic library file containing the program information, the location information and the repair code; adding an installation package of the application program in a preset xcode integrated development template to obtain a first development file; adding the dynamic library file in a compiler of the xcode integrated development template, so that the compiler adds the dynamic library file to the installation package in the first development file to obtain a second development file; compiling the second development file to obtain a repair plug-in package, and sending the repair plug-in package to a test device installed with the application program as a receiver, so that the test device tests the application program running based on the repair plug-in package.
2. The method of claim 1, wherein, The program information comprises a program identifier of the application program, and the creating of the dynamic library file containing the program information, the location information and the repair code comprises: obtaining an IP address of the test device; adding the program identifier, the location information and the IP address in a configuration file; creating a dynamic library file containing the repair code and taking information recorded in the configuration file as configuration information; The sending of the repair plug-in package to the test device installed with the application program comprises: sending the repair plug-in package to the test device installed with the application program according to the IP address recorded in the configuration file.
3. The method of any one of claims 1-2, wherein, After the obtaining of the repair code for the problem code, the method further comprises: determining a log output node in the repair code; adding a code for outputting a log at the determined log output node.
4. An application program testing method, comprising: obtaining a repair plug-in package, wherein the repair plug-in package is generated based on program information of an application program, location information of a problem code in the application program and a repair code for the problem code; in response to a start instruction of the application program, determining the repair plug-in package based on the program information recorded in the obtained plug-in package, and starting the application program based on the repair plug-in package to jump to running the repair code in the repair plug-in package when the application program runs the problem code indicated by the location information in a process of testing the application program; obtaining information of testing the application program; The repair plug-in package is generated in the following manner: creating a dynamic library file containing the program information, the location information and the repair code; adding an installation package of the application program in a preset xcode integrated development template to obtain a first development file; adding the dynamic library file in a compiler of the xcode integrated development template, so that the compiler adds the dynamic library file to the installation package in the first development file to obtain a second development file; and compiling the second development file to obtain a repair plug-in package.
5. The method of claim 4, wherein, After the obtaining of the repair plug-in package, the method further comprises: The repair plug-in package is parsed to obtain a dynamic library file included in the repair plug-in package, wherein the dynamic library file is generated based on the program information, the location information and the repair code; The dynamic library file is stored in a preset folder; The repair plug-in package is determined based on the program information recorded in the obtained plug-in package, and the repair plug-in package includes: The dynamic library file included in the repair plug-in package is determined from the preset folder based on the program information recorded by each file in the preset folder; The application program is started based on the determined dynamic library file.
6. An application program testing apparatus, comprising: an information obtaining module configured to obtain program information of an application program and location information of a problem code in the application program; a code obtaining module configured to obtain a repair code for the problem code; a plug-in package generating module configured to generate a repair plug-in package containing the program information, the location information and the repair code, and send the repair plug-in package to a test device installed with the application program as a receiver, so that the test device tests the application program running based on the repair plug-in package; the plug-in package generating module includes: a file creating submodule configured to create a dynamic library file containing the program information, the location information and the repair code; a plug-in package generating submodule configured to add an installation package of the application program in a preset xcode integrated development template to obtain a first development file, add the dynamic library file in a compiler of the xcode integrated development template, so that the compiler adds the dynamic library file to the installation package in the first development file to obtain a second development file, and compile the second development file to obtain a repair plug-in package; a plug-in package sending submodule configured to send the repair plug-in package to the test device installed with the application program as the receiver. The program information includes a program identifier of the application program, and the file creating submodule is specifically configured to:
7. The apparatus of claim 6, wherein, obtain an IP address of the test device; add the program identifier, the location information and the IP address in a configuration file; create a dynamic library file containing the repair code and taking information recorded in the configuration file as configuration information; the repair plug-in package is sent to the test device installed with the application program, including: the repair plug-in package is sent to the test device installed with the application program according to the IP address recorded in the configuration file.
8. The apparatus according to any one of claims 6-7, further comprising: a node determining module configured to determine a log output node in the repair code after the repair code for the problem code is obtained; a code adding module configured to add a code for outputting a log at the determined log output node.
9. An application program testing apparatus, comprising: The plug-in package obtaining module is configured to obtain a repair plug-in package, wherein the repair plug-in package is generated based on program information of an application, location information of a problem code in the application, and a repair code for the problem code; The instruction response module is configured to, in response to a start instruction of the application, determine the repair plug-in package based on the program information recorded in the obtained plug-in package, and start the application based on the repair plug-in package to jump to running the repair code in the repair plug-in package when the application runs the problem code indicated by the location information during testing of the application; The information obtaining module is configured to obtain information about testing of the application; The repair plug-in package is generated in the following manner: A dynamic library file containing the program information, the location information, and the repair code is created; an installation package of the application is added to a preset xcode integrated development template to obtain a first development file; the dynamic library file is added to a compiler of the xcode integrated development template, so that the compiler adds the dynamic library file to the installation package in the first development file to obtain a second development file; and the second development file is compiled to obtain the repair plug-in package.
10. The apparatus of claim 9, further comprising: The plug-in package parsing module is configured to, after obtaining the repair plug-in package, parse the repair plug-in package to obtain a dynamic library file included in the repair plug-in package, wherein the dynamic library file is generated based on the program information, the location information, and the repair code; The file storage module is configured to store the dynamic library file in a preset folder; The instruction response module is specifically configured to: In response to a start instruction of the application, determine the dynamic library file included in the repair plug-in package from the preset folder based on program information recorded by each file in the preset folder, and start the application based on the determined dynamic library file.
11. An electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3 or 4-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-3 or 4-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-3 or 4-5.
Citation Information
Patent Citations
Software vulnerability fixing method and device for terminal
CN107451474A
Application program installation package generation method and application program running method and device
CN107766096A