An application testing method, device, electronic device and storage medium
By obtaining action and voice testing instructions on the application test page and stress testing of the application, the problem of insufficient applicability in the existing technology is solved, and a comprehensive test of voice and touch screen interactive devices is realized, which improves the applicability and efficiency of the test.
Patent Information
- Application Number
- CN202111421726.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-11-26
AI Technical Summary
Existing application testing methods cannot be applied to devices with voice interaction and touch screen interaction capabilities, resulting in less applicability of stress testing.
By obtaining action test instructions and voice test instructions on the application test page, stress test applications are conducted on the test application, including determining the application test page, generating test instructions, setting test weights and proportions, and judging the repeatability of the test path to avoid invalid tests.
It improves the applicability and efficiency of application stress testing, can meet the comprehensive stress testing needs of different equipment types, and improves the authenticity and quality of the test.
Smart Images

Figure CN114116479B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and particularly to the field of automated testing technologies. Background Art
[0002] In order to ensure that an application has good compatibility, various tests are often required before the application is officially launched. Stress testing is an important test link for application testing, which can detect various performances of the application, such as usability, reliability, robustness, and stability. Summary of the Invention
[0003] Embodiments of the present disclosure provide an application testing method, apparatus, electronic device, and storage medium, which can meet the comprehensive stress testing requirements of an application, thereby improving the applicability of application stress testing.
[0004] In a first aspect, an embodiment of the present disclosure provides an application testing method, including:
[0005] Determine an application test page of the application to be tested;
[0006] Obtain an application test instruction of the application to be tested according to the application test page; wherein, the application test instruction includes an action test instruction and a voice test instruction;
[0007] Perform stress testing on the application to be tested according to the application test instruction.
[0008] In a second aspect, an embodiment of the present disclosure provides an application testing apparatus, including:
[0009] An application test page determination module, configured to determine an application test page of the application to be tested;
[0010] An application test instruction obtaining module, configured to obtain an application test instruction of the application to be tested according to the application test page; wherein, the application test instruction includes an action test instruction and a voice test instruction;
[0011] An application stress testing module, configured to perform stress testing on the application to be tested according to the application test instruction.
[0012] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0013] At least one processor; and
[0014] A memory communicatively connected to the at least one processor; wherein,
[0015] 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 execute the application program testing method provided in the embodiments of the first aspect.
[0016] In a fourth aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause the computer to execute the application program testing method provided in the embodiments of the first aspect.
[0017] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, where the computer program, when executed by a processor, implements the application program testing method provided in the embodiments of the first aspect.
[0018] In the embodiments of the present disclosure, after determining the application test page of the application program to be tested, the application test instructions of the application program to be tested are obtained according to the determined application test page, and then the application program to be tested is stress-tested according to the application program test instructions. Since the application test instructions can include various instruction types such as action test instructions and voice test instructions, the stress test requirements of application programs of different device types can be met, the problem of low applicability existing in the existing application program testing method can be solved, the comprehensive stress test requirements of the application program can be satisfied, and thus the applicability of the application program stress test can be improved.
[0019] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:
[0021] Figure 1 is a flowchart of an application program testing method provided by an embodiment of the present disclosure;
[0022] Figure 2 is a schematic flowchart of performing Monkey testing on the application program to be tested according to action test instructions and voice test instructions provided by an embodiment of the present disclosure;
[0023] Figure 3 is a flowchart of an application program testing method provided by an embodiment of the present disclosure;
[0024] Figure 4 is a flowchart of an application program testing method provided by an embodiment of the present disclosure;
[0025] Figure 5It is a schematic diagram of a Monkey test process provided by an embodiment of the present disclosure;
[0026] Figure 6 It is a structural diagram of an application testing device provided by an embodiment of the present disclosure;
[0027] Figure 7 It is a schematic structural diagram of an electronic device for implementing the application testing method of an embodiment of the present disclosure. Specific embodiments
[0028] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0029] The stress testing of an application is a basic quality assurance behavior and is part of the testing work for each important application. The stress testing of an application typically uses dedicated testing tools to simulate random user operation events for the application, such as key input, touch screen input, and gesture input, etc., to verify the stability and robustness of the application.
[0030] In the prior art, Monkey and Smart_monkey (both are monkey testing tools) are two commonly used tools for stress testing applications. Among them, Monkey testing is mainly applied to applications on the Android system. Its principle is to use the socket communication method to simulate user key input, touch screen input, gesture input, etc., to see how long it takes for the device to have an exception. When the Monkey program is running on the emulator or device, if the user triggers events such as clicks, touches, gestures, or some system-level events, it will generate random pulses. Therefore, Monkey can be used to load test the developed application in a random and repetitive manner.
[0031] Smart_monkey testing is mainly applied to applications on the IOS (iPhone Operation System) system. Similar to the Monkey testing principle, it is essentially a large-scale automated test case that deeply traverses activity and operation nodes, and can randomly simulate user operation events for applications on the iOS system, including functions such as setting the test time, the number of test events, taking screenshots for each click event, and generating reports.
[0032] However, the above two stress testing methods can only simulate operation events of user actions for testing, and are only applicable to the stress testing requirements of application programs for touch screen interaction function devices, and cannot be applicable to the stress testing requirements of application programs for devices with both voice interaction and touch screen interaction functions.
[0033] In one example, Figure 1 FIG. is a flowchart of an application program testing method provided by an embodiment of the present disclosure. This embodiment is applicable to the situation of stress testing an application program by using both action test instructions and voice test instructions. This method can be executed by an application program testing device, and the device can be implemented in a software and / or hardware manner and is generally integrated in an electronic device. The electronic device can be a terminal device or a server device. The embodiments of the present disclosure do not limit the specific device type of the electronic device. Correspondingly, as Figure 1 shown, the method includes the following operations:
[0034] S110. Determine an application test page of the application program to be tested.
[0035] Among them, the application program to be tested can be an application program that needs to be stress tested. In the embodiments of the present disclosure, the application program to be tested can be an application program installed on any operating system type. The embodiments of the present disclosure do not limit the operating system type applicable to the application program to be tested. The application test page can be a test entry page for stress testing the application program to be tested.
[0036] It can be understood that before stress testing the application program to be tested, the application test page of the application program to be tested can be first determined as the test entry of the application program to be tested. Optionally, the application test page can be a display interface of the application program to be tested on the device to be tested, for example, it can be the desktop page of the device to be tested, or it can also be a page including a list of application programs to be tested, such as a page for configuring each application program. As long as the application test page can enter the application program to be tested to perform stress testing on the application program to be tested, the embodiments of the present disclosure do not limit the specific page type of the application test page.
[0037] S120. Obtain an application test instruction of the application program to be tested according to the application test page; wherein, the application program test instruction includes an action test instruction and a voice test instruction.
[0038] Among them, the application test instruction can be an instruction for stress testing the application program to be tested.
[0039] Correspondingly, after determining the application test page of the application to be tested, the application test instructions for performing a stress test on the application to be tested can be further obtained based on the determined application test page. Optionally, the page type of the application test page and all available cascading operations thereof can be analyzed, so as to count all available instructions output to the application to be tested, and obtain the application test instructions of the application to be tested.
[0040] It should be noted that, in the embodiments of the present disclosure, the application test instructions can include both action test instructions and voice test instructions. Among them, the action test instructions are the instructions related to simulating the operation actions of the user on the application to be tested, such as action test instructions for simulating the user's key input, touch screen input, or gesture input, etc. The voice test instructions are the instructions related to simulating the voice interaction operation of the user on the application to be tested, such as voice test instructions like "return, open music, or exit the current page".
[0041] It can be understood that, if the application test page is different, the application test instructions of the application to be tested obtained according to the application test page can also be different. Exemplarily, if the desktop page of the device to be tested is used as the application test page, the voice test instructions corresponding to this application test page usually do not include instructions such as "exit the current page". If the page of the device to be tested including the list of applications to be tested is used as the application test page, the voice test instructions corresponding to this application test page usually can include instructions such as "exit the current page".
[0042] S130. Perform a stress test on the application to be tested according to the application test instructions.
[0043] In the embodiments of the present disclosure, after obtaining the application test instructions of the application to be tested, the application test page can be used as the test entry, and the application to be tested can be stress-tested according to the application test instructions in the application test page.
[0044] Figure 2 FIG. 16 is a schematic flowchart of a Monkey test for an application to be tested according to action test instructions and voice test instructions provided by an embodiment of the present disclosure. In a specific example, as Figure 2 shown, taking the Monkey test as an example for specific illustration. When performing a Monkey test on the application to be tested of the device to be tested, the voice interaction and operation actions of the user can be randomly simulated to perform actions on the application to be tested. During the process of stress-testing the application to be tested according to the application test instructions, the device to be tested can be monitored in real time, and a test log can be generated in real time according to the test results. During the process of generating the test log, screenshots of the test process can also be taken at regular intervals, so as to generate a report according to the test log and the generated screenshots after the test ends.
[0045] In summary, since two types of application test instructions, i.e., action test instructions and voice test instructions, can be obtained according to the application test page of the application to be tested, the stress test method for the application to be tested can be applied to devices with both voice interaction and touch screen interaction functions, and the applicability of the application stress test is stronger.
[0046] In an embodiment of the present disclosure, after determining the application test page of the application to be tested, the application test instructions of the application to be tested are obtained according to the determined application test page, and then the application to be tested is stress-tested according to the application test instructions. Since the application test instructions can include multiple instruction types such as action test instructions and voice test instructions, the stress test requirements of applications of different device types can be met, the problem of low applicability existing in the existing application test method can be solved, the comprehensive stress test requirements of the application can be satisfied, and thus the applicability of the application stress test can be improved.
[0047] In one example, Figure 3 is a flowchart of an application test method provided by an embodiment of the present disclosure. On the basis of the technical solutions of the above embodiments, the embodiment of the present disclosure is optimized and improved, and various specific optional implementation manners for determining the application test page of the application to be tested and obtaining the application test instructions of the application to be tested according to the application test page are given.
[0048] Such as Figure 3 shown, an application test method includes:
[0049] S310. Obtain the desktop page of the device under test where the application to be tested is installed.
[0050] Wherein, the device under test is the device where the application to be tested is installed. The device under test can be any device with an installed operation type, as long as it can achieve voice interaction and action interaction with the user. The embodiment of the present disclosure does not limit the device type of the device under test and the applicable operating system. The desktop page is the desktop including application icons displayed after the device under test is powered on, and can also be called the home page.
[0051] S320. Determine the desktop page as the application test page.
[0052] It can be understood that for a device, its desktop page usually includes all user-operable applications. Usually, the user also operates on each application with the desktop page as the entry point. Therefore, in order to most realistically imitate the interaction behavior between the user and the device under test to effectively test the application under test, the desktop page of the device under test where the application under test is installed can be determined as the application test page of the application under test.
[0053] S330. Obtain the desktop elements of the desktop page.
[0054] Among them, the desktop elements can be the elements displayed by the application on the desktop page. Exemplarily, the desktop elements can include but are not limited to the identification of the application, the system notification bar (the system notification bar can display information of the application), and the picture links provided by each application, etc. As long as it can display relevant information of the application, the embodiments of the present disclosure do not limit the type of the desktop elements and the specific element content.
[0055] S340. Generate the action test instruction and the voice test instruction of the application under test according to the desktop elements.
[0056] When the user interacts with the device under test, it is often necessary to send interaction instructions to the device under test according to the page elements displayed on the application test page. Therefore, in the embodiments of the present disclosure, after obtaining the desktop elements of the desktop page, the action test instruction and the voice test instruction of the application under test can be further generated according to the type and content of the desktop elements.
[0057] Exemplarily, assuming that the desktop elements include the notification bar, Application 1, and Application 2, the action test instructions for generating the application under test according to the desktop elements can include: sliding down the notification bar, clicking on Application 1 or Application 2, triggering the keys on the home page (including physical keys and / or virtual keys), and inputting the set gesture for opening the application on the home page, etc.; the voice test instructions for generating the application under test according to the desktop elements can include: "Open Application 1 or Open Application 2" and "Open the first message in the notification bar", etc.
[0058] The above technical solution can effectively simulate the situation where the user operates on each application under test through the desktop page by generating the action test instruction and the voice test instruction of the application under test according to the desktop elements, thereby improving the authenticity and effectiveness of the application test.
[0059] Optionally, the number of applications under test can be multiple. Correspondingly, after generating the action test instruction and the voice test instruction according to the desktop elements, the following operations can also be performed:
[0060] S350. Determine the test weights of each of the desktop elements according to the element types of the desktop elements.
[0061] Among them, the test weight can be the degree of emphasis on stress testing each application to be tested by the desktop element. The test weights of each desktop element can directly reflect the test weights of each application to be tested. It can be understood that the higher the test weight of the application to be tested, the greater the probability or proportion of stress testing for the application to be tested.
[0062] It can be understood that different types of applications to be tested have different degrees of importance in stress testing. Exemplarily, commonly used instant messaging applications by users can be set with relatively high test weights to increase the test proportion of instant messaging applications in the stress testing of each application to be tested.
[0063] Since the desktop elements can reflect the display situation of each application to be tested on the desktop, therefore, the test weights of each desktop element can be determined according to the element types of the desktop elements, so as to indirectly determine the test weights of each application to be tested according to the test weights of each desktop element, thereby realizing stress testing with different test degrees for different types of applications to be tested.
[0064] Exemplarily, the test weight of the button-type desktop element can be set relatively lower, the test weight of the communication-type desktop element can be set relatively higher, and the test weight of the picture-type desktop element can be set in the middle. Correspondingly, the test weight of the application to be tested involving button operations is relatively lower, the test weight of the application to be tested with communication functions is relatively higher, and the test weight of the application to be tested with image processing functions is in the middle.
[0065] S360. Determine the action test instruction ratio of each of the desktop elements according to the test weights of the desktop elements.
[0066] Among them, the action test instruction ratio is also the ratio of the action test instructions occupied by a certain desktop element among all desktop elements.
[0067] Since the action test instructions are usually set according to the element types of the desktop elements, it can also be understood that they need to be set according to the program types of the applications to be tested. Therefore, after determining the test weights of each desktop element, the action test instruction ratio of each desktop element can be further determined according to the test weights of each desktop element. The action test instruction ratio of each desktop element can determine the number of available action test instructions for each desktop element.
[0068] Exemplarily, assuming that the test weight of the desktop element 1 is 10%, the proportion of the action test instructions for the desktop element 1 can be set to 10%. Correspondingly, if there are a total of 100 action test instructions, the number of action test instructions for the desktop element 1 is 10.
[0069] S370. Determine the test proportions of the action test instructions and the voice test instructions according to the device type of the device to be tested.
[0070] Among them, the test proportion can be the proportion of the number of stress test for the action test instructions and the voice test instructions respectively. Exemplarily, assuming that the test proportion is 1:10, the number of test times for the voice test instructions can be 10 times that of the action test instructions.
[0071] Considering that the number of voice test instructions input by the user to the device to be tested in the initial state (usually the desktop state or the home page state) is relatively less than the number of action test instructions input to the device to be tested. However, for some devices to be tested, the user usually interacts with the device through voice instructions in the initial state. If the stress test is only performed on each application to be tested in the device to be tested according to the original number of instructions, it will result in less stress test content corresponding to the voice test instructions, and it is difficult to effectively cover the stress test of the device for voice interaction in the initial state.
[0072] Therefore, in the embodiments of the present disclosure, in addition to setting different proportions of action test instructions for different applications to be tested, corresponding test proportions can also be set between the action test instructions and the voice test instructions to balance the total number of test times of the action test instructions and the voice test instructions. Specifically, after determining the action test instructions and the voice test instructions of the application to be tested, the test proportion between the action test instructions and the voice test instructions can be further determined according to the device type of the device to be tested, so as to truly simulate the interaction situation of different types of devices to be tested in the initial state.
[0073] Exemplarily, assuming that the device to be tested focuses on voice interaction, such as a smart screen device, the user usually uses voice interaction more often. At this time, after determining the action test instructions and the voice test instructions of the application to be tested, if the number of voice test instructions is relatively small, the test proportion of the voice test instructions can be increased. Assuming that the device to be tested focuses on action interaction, such as a smart phone device, the user usually uses action interaction more often. At this time, after determining the action test instructions and the voice test instructions of the application to be tested, the test proportion between the action test instructions and the voice test instructions can be adaptively adjusted according to the proportion of action interaction and voice interaction in the device to be tested.
[0074] In the above technical solution, by setting an action test ratio for the action test instruction and setting test ratios for the action test instruction and the voice test instruction, it is possible to truly simulate the situation where a user interacts with each application under test in the device under test, thereby improving the authenticity and effectiveness of the application stress test.
[0075] It should be noted that Figure 3 is only a schematic diagram of one implementation manner, and there is no sequential execution order between steps S350 - S360 and step S370. That is, steps S350 - S360 can be executed first, and then step S370; or step S370 can be executed first, and then steps S350 - S360; or they can also be executed in parallel. The embodiments of the present disclosure do not limit this.
[0076] S380. Perform a stress test on the application under test according to the application test instruction.
[0077] In the above technical solution, by determining the desktop page of the application under test as the application test page, generating an action test instruction and a voice test instruction for the application under test based on the desktop elements of the desktop page, setting an action test ratio for the action test instruction, and setting test ratios for the action test instruction and the voice test instruction, it is possible to perform a stress test on each application under test of the device under test according to the device type of the device under test, and truly simulate the situation where a user interacts with each application under test in the device under test, thereby improving the authenticity and effectiveness of the application stress test.
[0078] In one example, Figure 4 is a flowchart of an application test method provided by an embodiment of the present disclosure. Based on the technical solutions of the above embodiments, the embodiment of the present disclosure has been optimized and improved, and various specific optional implementation manners for performing a stress test on the application under test according to the application test instruction are given.
[0079] Such as Figure 4 shown, an application test method includes:
[0080] S410. Determine the application test page of the application under test.
[0081] S420. Obtain the application test instruction of the application under test according to the application test page.
[0082] Among them, the application test instruction includes an action test instruction and a voice test instruction.
[0083] S430. Determine the current application test instruction according to the application test instruction.
[0084] Among them, the current application test instruction can be an application test instruction for performing a stress test on the current application to be tested, can be an action test instruction, or can be a voice test instruction. The embodiments of the present disclosure do not limit the instruction type of the current application test instruction.
[0085] The stress test on the application to be tested is a process of repeatedly testing according to different application test instructions. Since the application test instructions are randomly generated, the application test instructions of different test processes can be the same or different.
[0086] Correspondingly, before performing a stress test on the application to be tested, since the application test instructions available for the stress test are preset, each stress test process can select the current application test instruction from each set application test instruction according to the test ratio of the set action test instruction and voice test instruction as the application test instruction for the current stress test process.
[0087] It should be noted that the current application test instruction can be one of the action test instruction and voice test instruction generated according to the desktop elements. When starting to test the application to be tested according to the current application test instruction, as the test process progresses, the subsequent test instructions need to be specifically generated in real time according to the current display interface of the current application to be tested.
[0088] S440. Determine the current program test path of the current application test instruction.
[0089] Among them, the current program test path can be the current test path generated by each test step in the current test process when performing a stress test on the application to be tested.
[0090] S450. Determine whether the current program test path is repeated with the program storage path. If so, return to execute S430; otherwise, execute S460.
[0091] Among them, the program storage path can be the test path generated after completing the stress test on the application to be tested according to different test instructions. The test paths corresponding to each program storage path do not repeat each other and are used to determine whether the current test path has been tested as the stored path.
[0092] Although stress testing methods such as Monkey testing and Smart_monkey testing can use the method of random repetition to load test the developed application, due to the overly random test instructions, it is often easy to fall into repeated ineffective test processes. For example, when entering the application to be tested, problems often occur such as being unable to click out on a page for a long time or taking a long time to enter the same control page. Such ineffective testing often reduces the efficiency and quality of stress testing.
[0093] To solve the problem of ineffective testing during stress testing, before each test instruction is executed, it is possible to first determine whether the program test path corresponding to the test instruction has been tested. If it is determined that the program test path corresponding to the test instruction has been tested, there is no need to repeat the test, and the current test process can be exited, and a new application test instruction for the desktop page can be obtained to restart the test process. If it is determined that the program test path corresponding to the test instruction has not been tested, the test can continue until the current test process is completed.
[0094] Correspondingly, when the current application test instruction is determined according to the application test instruction set on the application test page, the current test process can be determined. It can be understood that in the current test process, the current application test instruction can determine the current program test path. That is, after executing the current program test path, the first test step corresponding to the current test process can be generated, and this first test step can independently form the current program test path. A test path can be composed of multiple test steps. If all other test steps under the first test step have been tested, the complete test path composed of the first test step does not need to be tested repeatedly. Therefore, after determining the current program test path of the current application test instruction, it is possible to determine whether the current program test path duplicates the program storage path. It should be noted that since the current program test path only includes the first test step, determining whether the current program test path duplicates the program storage path can be to determine whether all available subsequent test processes corresponding to the test steps included in the current program test path have been tested. If it is determined that the current program test path duplicates the program storage path, indicating that all available test processes corresponding to the test steps included in the current program test path have been tested, then all test processes corresponding to the current application test instruction have been tested. At this time, there is no need to repeat the test for the current application test instruction, and the operation of determining the current application test instruction according to the application test instruction can be returned to execute to update the current application test instruction, and the stress test of the application to be tested can be restarted according to the updated current application test instruction.
[0095] S460. Determine the current cascaded application test page according to the instruction response result of the current application test instruction for the application to be tested.
[0096] Among them, the current cascaded application test page may be the next page entered by the application to be tested in response to the current application test instruction. It should be noted that the number of current cascaded application test pages may be at least one.
[0097] Correspondingly, if it is determined that the current program test path does not repeat the program storage path, it indicates that not all of the available test processes corresponding to the test steps included in the current program test path have been fully tested. Then, the stress test can continue to be performed on the application to be tested according to the current application test instruction.
[0098] When performing a stress test on the application to be tested according to the current application test instruction, it may involve multiple levels of cascaded test links. The so-called cascaded test link means that after entering a test instruction on the current test page, the next test page is entered to continue the test. Therefore, at least one current cascaded application test page can be determined according to the instruction response result of the application to be tested for the current application test instruction.
[0099] S470. Perform a stress test on the application to be tested according to the current cascaded application test page.
[0100] In the embodiments of the present disclosure, a stress test can be performed on the application to be tested according to the current cascaded application test page obtained from the instruction response results of the application to be tested for different test instructions.
[0101] Exemplarily, assuming that the test depth requirement for the stress test is 3, after testing the application to be tested according to the current application test instruction, the first response page can be entered as the first current cascaded application test page. Based on the first current cascaded application test page, a first real-time test instruction can be generated in real time according to the page content of the first current cascaded application test page. Continuing to test the first current cascaded application test page according to the first real-time test instruction, the second response page can be entered as the second current cascaded application test page. Based on the second current cascaded application test page, a second real-time test instruction can be generated in real time according to the page content of the second current cascaded application test page. Continuing to test the second current cascaded application test page according to the second real-time test instruction, the third response page can be entered as the third current cascaded application test page. It can be understood that each real-time test instruction may include an action test instruction or a voice test instruction.
[0102] In the above technical solution, by determining whether there is a repeated test path based on the current application test instruction determined in the application test page of the application to be tested, it is determined whether to continue to perform the stress test on the application to be tested according to the current application test instruction based on the determination result of the repeated test path, which can effectively avoid the stress test process of a large number of repeated test paths, thereby improving the test efficiency of the stress test of the application to be tested.
[0103] In an alternative embodiment of the present disclosure, the stress testing of the application to be tested according to the current cascaded application test page may include: obtaining a blacklist page list; matching the current cascaded application test page with the blacklist page list; when it is determined that the current cascaded application test page matches the target blacklist page in the blacklist page list, storing the current program test path matched by the current cascaded application test page; returning to perform the operation of determining the current application test instruction according to the application test instruction until it is determined that the test termination condition is reached; when it is determined that the current cascaded application test page does not match the blacklist page list, performing a stress test on the application to be tested according to the current cascaded application test page.
[0104] Among them, the blacklist page list can be used to store the pages of the application to be tested that do not need to be stress-tested. The target blacklist page is also the page that matches the current cascaded application test page. The so-called matching can be understood as that the current cascaded application test page is the same as the target blacklist page. The current program test path matched by the current cascaded application test page is the test path composed of all test steps between the application test page and the current cascaded application test page that matches the target blacklist page. Exemplarily, assuming that the current cascaded application test page is the third response page of the application to be tested, the current program test path corresponding to this current cascaded application test page may be: current application test instruction - first real-time test instruction - second real-time test instruction. Among them, the current application test instruction is used to operate on the application test page to enter the first response page, the first real-time test instruction is used to operate on the first response page to enter the second response page, and the second real-time test instruction is used to operate on the second response page to enter the third response page. The test termination condition may be a condition for determining that the stress test can be terminated. For example, it may be that the number of tests reaches a set number, etc. The present disclosure embodiment does not limit the specific content of the test termination condition.
[0105] It is understandable that during the continuous hierarchical testing of the application under test, some test pages do not need to be stress-tested. For example, if the device under test is tested in a non-networked state, the device under test cannot effectively respond to test instructions that require network operations. Therefore, before testing the application under test, test pages that do not need to be stress-tested can be collected for the application under test first, and these collected test pages can be added to the blacklist page list. During the process of stress-testing the application under test according to the current cascaded application test page, every time a new current cascaded application test page is entered, the current cascaded application test page can be matched with the blacklist page list. If it is determined that the current cascaded application test page matches the target blacklist page in the blacklist page list, it indicates that the current cascaded application test page does not need to be tested. To avoid subsequent repeated testing of the test path corresponding to the current cascaded application test page, the current program test path corresponding to the current cascaded application test page can be stored, and the operation of determining the current application test instruction according to the application test instruction can be returned and executed to start testing the application under test again from the application test page until it is determined that the test termination condition is reached. If it is determined that the current cascaded application test page does not match the target blacklist page in the blacklist page list, it indicates that the current cascaded application test page needs to be tested, and then the stress-testing of the application under test can continue according to the current cascaded application test page.
[0106] By setting up a blacklist page list to detect in real time whether the current cascaded application test page needs to be stress-tested, a large number of invalid tests can be effectively avoided, thereby improving the test quality and test efficiency of the stress-testing of the application under test.
[0107] In an alternative embodiment of the present disclosure, the stress testing of the application under test according to the current cascaded application test page may include: determining the current page elements of the current cascaded application test page; obtaining the current element test instructions of the current cascaded application test page according to the current page elements of the current cascaded application test page; wherein the current element test instructions include current element action test instructions and / or current element voice test instructions; determining the current program test path according to the current element test instructions; in the case where it is determined that the current program test path coincides with the program storage path, returning to execute the operation of obtaining the current element test instructions of the current cascaded application test page according to the current page elements of the current cascaded application test page until it is determined that the current program test path does not coincide with the program storage path; in the case where it is determined that the current program test path matched by the current element test instructions does not coincide with the program storage path, performing stress testing on the current cascaded application test page according to the current element test instructions and the current page elements.
[0108] Among them, the current page elements may be the elements displayed by the application under test in the current cascaded application test page, and may be any elements in the page that can perform operations, such as controls, links, pictures, audio and video in the page, and any icons that can control operations, etc., as long as they can be operated to enter the next response page. The embodiments of the present disclosure do not limit the specific element type and element content of the current page elements. It can be understood that the number of elements included in the current page elements may be at least one. The current element test instructions may be instructions that can operate on the current page elements, and the operation types may include but are not limited to action operations or voice operations. Correspondingly, the current element action test instructions are also the relevant instructions for simulating the operation actions of the user on the current page elements, and the current element voice test instructions are also the relevant instructions for simulating the voice interaction operations of the user on the current page elements. It can be understood that as the test depth continues to deepen, the length of the current program test path will also increase accordingly. Exemplarily, assuming that the current page element is element 1 of the first response page of the application under test, the current program test path corresponding to the current page element may be: the current application test instruction - the first current element test instruction. Among them, the current application test instruction is used to operate on the application test page to enter the first response page, and the first current element test instruction is used to operate on element 1 of the first response page to enter the second response page.
[0109] Correspondingly, after the current application test instruction is executed on the application under test to enter the cascaded application test page, the test instructions for the subsequent stress test process need to be generated in real time according to the current application test page. Specifically, all operable current page elements in the current cascaded application test page can be determined, and the current element test instructions for the current cascaded application test page can be obtained according to the current page elements of the current cascaded application test page, so as to determine the current program test path corresponding to the current element test instructions. To avoid repeated and ineffective stress tests caused by page elements, the current program test path can be matched with the program storage path. If it is determined that the current program test path is repeated with the program storage path, the operation of obtaining the current element test instructions for the current cascaded application test page according to the current page elements of the current cascaded application test page is returned for execution until it is determined that the current program test path is not repeated with the program storage path. If it is determined that the current program test path is not repeated with the program storage path, the current cascaded application test page can be stress-tested according to the current element test instructions and the current page elements, that is, the current element test instructions are executed on the current page elements. It should be noted that determining whether the current program test path is repeated with the program storage path can be to determine whether all available test processes corresponding to the test steps included in the current program test path have been fully tested, or whether the current program test path is the same as the program storage path. The embodiments of the present disclosure do not limit this.
[0110] Optionally, when stress-testing the current cascaded application test page according to the current element test instructions and the current page elements, the current element action test instructions and / or the current element voice test instructions can be used to stress-test the current cascaded application test page in combination with the current page elements. It can be understood that since the instruction types of the current element action test instructions and the current element voice test instructions are different, the corresponding ways of generating the current program test path are also different.
[0111] In an optional embodiment of the present disclosure, if the current element test instructions include current element action test instructions, the obtaining of the current element test instructions for the current cascaded application test page according to the current page elements of the current cascaded application test page may include: randomly selecting a target page element according to the current page elements; determining the current element action test instruction matched by the target page element according to the element type of the target page element; wherein the current element action test instruction includes a system action test instruction or an element action test instruction. Correspondingly, the determining of the current program test path according to the current element test instructions may include: randomly selecting a target element action test instruction according to the current element action test instructions; generating the current program test path according to the target element action test instruction.
[0112] Among them, the target page element can be any one of the current page elements. The current element action test instruction can be each action test instruction applicable to the current page element and / or the current cascaded application test page. The system action test instruction can be an action test instruction for operating the system that is independent of the page element. Exemplarily, the system action test instruction can be a gesture instruction to return to the main page, etc. The element action test instruction can be an action test instruction for operating the target page element that is related to the page element. Exemplarily, the element action test instruction can be an instruction to click on the target page element, etc. It can be understood that the number of system action test instructions can be at least 1, and the number of element action test instructions can also be at least 1. The target element action test instruction can be one of the test instructions randomly selected from the current element action test instructions.
[0113] In the embodiments of the present disclosure, when it is determined that the instruction type of the current element test instruction is the current element action test instruction, a page element can be randomly selected from the current page elements as the target page element. It can be understood that different page elements correspond to different executable action test instructions. Therefore, after determining the target page element, it is necessary to parse the element type of the target page element to determine the current element action test instruction matched by the target page element according to the element type of the target page element. Optionally, the instruction type of the current element action test instruction can be a system action test instruction or an element action test instruction, etc., where the number of system action test instructions can be at least one, and the number of element action test instructions can also be at least one. Exemplarily, assuming that the target page element is a video link element, the current element action test instruction executable by the target page element can be: returning to the desktop according to a preset gesture instruction (a system action test instruction) or clicking to open the video link (an element action test instruction).
[0114] Correspondingly, after determining the current element action test instruction matched by the target page element, one of the current element action test instructions can be randomly selected as the target element action test instruction, and then the current program test path can be generated according to the randomly selected target element action test instruction.
[0115] Through the above technical solution, by randomly selecting the target page element and the target element action test instruction corresponding to the target page element, and generating the current program test path according to the randomly selected target element action test instruction, it is possible to perform a stress test on the application under test by randomly selecting action test instructions in a random and repeated manner, thereby improving the test quality and test effect of the stress test on the application under test.
[0116] In an alternative embodiment of the present disclosure, if the current element test instruction includes a current element voice test instruction, then obtaining the current element test instruction of the current cascaded application test page according to the current page element of the current cascaded application test page may include: determining the voice instruction test type of the current element voice test instruction; determining the current element voice test instruction according to the voice instruction test type and / or the current page element; wherein, the current element voice test instruction includes a system voice test instruction or an element voice test instruction; determining the current program test path according to the current element test instruction may include: in the case where it is determined that the current element voice test instruction is the system voice test instruction, randomly selecting a target system voice test instruction according to the current system voice test instruction; in the case where it is determined that the current element voice test instruction is the element voice test instruction, randomly selecting a target page element according to the current page element, and randomly selecting a target element voice test instruction according to the current element voice test instruction matched by the target page element; generating the current program test path according to the target system voice test instruction or the target element voice test instruction.
[0117] Among them, the voice instruction test type may be the instruction type of the current element voice test instruction. The current element voice test instruction may be each voice test instruction applicable to the current page element and / or the current cascaded application test page. The system voice test instruction is also an instruction for performing a voice operation on the system, and the element voice test instruction is also an instruction for performing a voice operation on the page element. The current system voice test instruction may be each system voice test instruction applicable to the current cascaded application test page. The target system voice test instruction may be one of the test instructions randomly selected from the current system voice test instructions. The current page element voice test instruction may be each element voice test instruction applicable to the target page element. The target element voice test instruction may be one of the test instructions randomly selected from the current page element voice test instructions.
[0118] In the embodiments of the present disclosure, when it is determined that the instruction type of the current element test instruction is the current element voice test instruction, the voice instruction test type of the current element voice test instruction can be determined first. Optionally, the voice instruction test type of the current element voice test instruction can be the instruction type of the system voice test instruction or the instruction type of the element voice test instruction. After determining the voice instruction test type of the current element voice test instruction, the current element voice test instruction can be determined according to the voice instruction test type and / or the current page element. Specifically, if the voice instruction test type is the instruction type of the system voice test instruction, the current element voice test instruction can be directly determined according to the voice test instruction applicable to the operating system of the device under test. For example, the system voice test instruction of "Please return to the desktop" is determined as the current element voice test instruction. Correspondingly, if the voice instruction test type is the instruction type of the element voice test instruction, the current element voice test instruction can be determined according to the voice test instruction applicable to the current page element. For example, if the current page element is a video link element, the element voice test instruction of "Please open the video" can be determined as the current element voice test instruction.
[0119] Correspondingly, after determining the current element voice test instruction, the current program test path can be generated according to the current element voice test instruction. Due to the different voice instruction test types of the current element voice test instruction, the corresponding ways of generating the current program test path are also different. Specifically, if it is determined that the current element voice test instruction is a system voice test instruction, the limitation of the current page element does not need to be considered, and the operating system of the device under test can be directly operated. Therefore, one of the system voice test instructions can be randomly selected as the target system voice test instruction according to the current system voice test instruction. If it is determined that the current element voice test instruction is an element voice test instruction, the limitation of the current page element needs to be considered. A page element can be randomly selected from the current page elements as the target page element, and the current page element voice test instruction matching the target page element is determined. Then, one of the element voice test instructions matching the target page element is randomly selected as the target element voice test instruction. Further, if the current element test instruction is the target system voice test instruction, the current program test path can be generated according to the target system voice test instruction. If the current element test instruction is the target element voice test instruction, the current program test path can be generated according to the target element voice test instruction.
[0120] In the above technical solution, the current element voice test instruction is determined based on the voice instruction test type and / or the current page element, and the target system voice test instruction or the target element voice test instruction is randomly selected according to the current element test instruction. Furthermore, the current program test path is generated based on the randomly selected target system voice test instruction or target element voice test instruction. It is possible to perform a stress test on the application under test by randomly selecting voice test instructions in a randomly repeated manner, thereby improving the test quality and test effect of the stress test on the application under test.
[0121] In an optional embodiment of the present disclosure, the stress testing of the current cascaded application test page according to the current element test instruction and the current page element may include: determining the current path depth of the current program test path; in the case where it is determined that the current path depth is less than a preset path depth threshold, executing the current element test instruction on the current page element; in the case where it is determined that the current path depth is greater than or equal to the preset path depth threshold, returning to execute the operation of determining the current application test instruction according to the application program test instruction until it is determined that the test termination condition is reached.
[0122] Among them, the current path depth may be the test depth of the current program test path. The test depth can be understood as the total number of tests. The preset path depth threshold may be a preset test depth threshold, and the specific value can be adaptively set according to the stress test requirements, such as 10 or 20, etc. The present disclosure embodiment does not limit the specific value of the preset path depth threshold.
[0123] Generally, before performing a stress test on the application under test, a preset path depth threshold can be set to avoid an infinite loop test for a certain application under test. Correspondingly, during the process of stress testing the current cascaded application test page according to the current element test instruction and the current page element, the current path depth of the current program test path can be determined in real time, and the current path depth is compared with the preset path depth threshold. If it is determined that the current path depth is less than the preset path depth threshold, indicating that the test can continue, the current element test instruction can be executed on the current page element. For example, after randomly selecting one of the page elements according to the current page element, a random available current element test instruction is executed on the randomly selected page element. If it is determined that the current path depth is greater than or equal to the preset path depth threshold, indicating that the current test process has ended, the operation of determining the current application test instruction according to the application program test instruction can be executed until it is determined that the test termination condition is reached.
[0124] After determining the application test page of the application to be tested, the above technical solution performs a stress test on the application to be tested in combination with randomly determined test instructions and the current program test path, which can meet the comprehensive stress test requirements of the application, thereby improving the applicability, test efficiency, and test quality of the application stress test.
[0125] It should be noted that any permutation and combination of the technical features in the above embodiments also belong to the protection scope of the present disclosure.
[0126] In one example, Figure 5 is a schematic diagram of a Monkey test process provided by an embodiment of the present disclosure. As Figure 5 shown, the application test method provided by the embodiments of the present disclosure is specifically described by taking the Monkey test method as an example.
[0127] After starting to enter the Monkey test process, the desktop page of the application to be tested installed in the device to be tested can be first obtained, and the desktop page is determined as the application test page. Further, the desktop elements of the desktop page are obtained, and action test instructions and voice test instructions for the application to be tested are generated based on the desktop elements. In the embodiments of the present disclosure, the action test instructions can include system - type instructions and element - type instructions, and the voice test instructions can also include system - type instructions and element - type instructions. An element, that is, a display object on the page, can include the application to be tested, or an object that can control the application to be tested, such as a control or a notification bar, etc. Correspondingly, after generating the action test instructions and voice test instructions for the application to be tested, the action test instruction ratio can be set for different types of applications to be tested according to the test weights of each desktop element, so as to adjust the test importance of different types of applications to be tested. At the same time, the test ratio between the action test instructions and the voice test instructions can also be set to meet the stress test requirements for different device types of different devices to be tested by adjusting the ratio of different types of instructions.
[0128] Further, the formal streaming process begins. When starting the test, one instruction can be randomly selected from the previously generated action test instruction and voice test instruction as the current application program test instruction, and it is determined whether the current program test path duplicates the program storage path. If it is determined that the current program test path does not duplicate the program storage path, the test can continue, the current test instruction is executed, and the current cascaded application test page corresponding to the current test instruction is entered. If it is determined that the current program test path duplicates the program storage path, the current test process is exited and a new test process is entered. After entering the current cascaded application test page corresponding to the current test instruction, it is necessary to match the current cascaded application test page with the blacklist page list to ensure that the current cascaded application test page can continue the test. If it is determined that the current cascaded application test page matches the blacklist page list, the current program test path needs to be stored and the current test process is exited, and a new test process is entered.
[0129] Correspondingly, in the case where it is determined that the current cascaded application test page does not match the blacklist page list, the current page element of the current cascaded application test page can be determined, and the type of the current element test instruction of the current cascaded application test page is selected according to the current page element of the current cascaded application test page. If the current element test instruction is the current element action test instruction, that is, an instruction of the UI (User Interface Design) operation type, a target page element can be randomly selected from the current page elements, and a target element action test instruction can be randomly selected according to the element type of the target page element.
[0130] If the current program test path corresponding to the target element action test instruction duplicates the storage path, it is necessary to return to execute the operation of obtaining the current element test instruction of the current cascaded application test page according to the current page element of the current cascaded application test page until it is determined that the current program test path does not duplicate the program storage path. If the current program test path corresponding to the target element action test instruction does not duplicate the storage path, the current program test path needs to be stored, and it is determined whether the current path depth of the current program test path exceeds the preset path depth threshold. In the case where it is determined that the current path depth is less than the preset path depth threshold, the target element action test instruction can be executed on the target page element, otherwise the current test process is exited and a new test process is entered.
[0131] Correspondingly, if the current element test instruction is the current voice action test instruction, that is, an instruction of the Query (query, usually referring to user interaction voice) type, then the voice instruction test type of the current element voice test instruction can be used. If the voice instruction test type of the current element voice test instruction is the system voice test instruction, then the target system voice test instruction can be randomly selected according to the current system voice test instruction. If the voice instruction test type of the current element voice test instruction is the element voice test instruction, then the target page element can be randomly selected according to the current page element, and the target element voice test instruction can be randomly selected according to the current page element voice test instruction matched by the target page element. Correspondingly, the current program test path can be generated according to the randomly selected target system voice test instruction or target element voice test instruction.
[0132] If the current program test path corresponding to the target system voice test instruction or target element voice test instruction is repeated with the stored path, it is necessary to return to the operation of obtaining the current element test instruction of the current cascade application test page according to the current page element of the current cascade application test page until it is determined that the current program test path is not repeated with the program storage path. If the current program test path corresponding to the target element action test instruction is not repeated with the stored path, then the current program test path needs to be stored, and it is necessary to determine whether the current path depth of the current program test path exceeds the preset path depth threshold. When it is determined that the current path depth is less than the preset path depth threshold, the target element action test instruction can be executed on the target page element, otherwise, the current test process is exited and a new test process is entered.
[0133] It can be seen that the above Monkey test process can randomly select action test instructions or voice test instructions at the same time to perform stress testing on the application under test, and can judge in real time whether the current stored path has been tested, avoiding repeated testing of the tested path, and can meet the comprehensive stress testing requirements of the application, improving the applicability, test efficiency and test quality of the application stress testing.
[0134] In one example, Figure 6 is the structural diagram of an application test device provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation of simultaneously using action test instructions and voice test instructions to perform stress testing on an application. The device is implemented by software and / or hardware and is specifically configured in an electronic device. The electronic device can be a terminal device or a server device. The embodiment of the present disclosure does not limit the specific device type of the electronic device.
[0135] Such as Figure 6An application testing device 600 shown in the figure includes: an application test page determination module 610, an application test instruction acquisition module 620, and an application stress testing module 630. Among them,
[0136] The application test page determination module 610 is used to determine the application test page of the application to be tested;
[0137] The application test instruction acquisition module 620 is used to obtain the application test instructions of the application to be tested according to the application test page; among them, the application test instructions include action test instructions and voice test instructions;
[0138] The application stress testing module 630 is used to perform stress testing on the application to be tested according to the application test instructions.
[0139] In the embodiment of the present disclosure, after determining the application test page of the application to be tested, the application test instructions of the application to be tested are obtained according to the determined application test page, and then stress testing is performed on the application to be tested according to the application test instructions. Since the application test instructions can include various instruction types such as action test instructions and voice test instructions, the stress testing requirements of applications of different device types can be met, the problem of low applicability existing in the existing application testing methods can be solved, the comprehensive stress testing requirements of the application can be satisfied, and thus the applicability of the application stress testing can be improved.
[0140] Optionally, the application test page determination module 610 is specifically used for: obtaining the desktop page of the device to be tested where the application to be tested is installed; determining the desktop page as the application test page.
[0141] Optionally, the application test instruction acquisition module 620 is specifically used for: obtaining the desktop elements of the desktop page; generating the action test instructions and the voice test instructions of the application to be tested according to the desktop elements.
[0142] Optionally, the application testing device further includes: a test weight determination module, which is used to determine the test weights of the desktop elements according to the element types of the desktop elements; an action test instruction ratio determination module, which is used to determine the action test instruction ratios of the desktop elements according to the test weights of the desktop elements; a test ratio determination module, which is used to determine the test ratios of the action test instructions and the voice test instructions according to the device type of the device to be tested.
[0143] Optionally, the application stress testing module 630 is specifically configured to: determine the current application test instruction according to the application test instruction; determine the current program test path of the current application test instruction; when it is determined that the current program test path does not duplicate the program storage path, determine the current cascaded application test page according to the instruction response result of the current application test instruction of the application to be tested; perform stress testing on the application to be tested according to the current cascaded application test page.
[0144] Optionally, the application stress testing module 630 is specifically configured to: obtain a blacklist page list; match the current cascaded application test page with the blacklist page list; when it is determined that the current cascaded application test page matches the target blacklist page in the blacklist page list, store the current program test path corresponding to the current cascaded application test page; return to execute the operation of determining the current application test instruction according to the application test instruction until it is determined that the test termination condition is reached; when it is determined that the current cascaded application test page does not match the blacklist page list, perform stress testing on the application to be tested according to the current cascaded application test page.
[0145] Optionally, the application stress testing module 630 is specifically configured to: determine the current page element of the current cascaded application test page; obtain the current element test instruction of the current cascaded application test page according to the current page element of the current cascaded application test page; wherein, the current element test instruction includes a current element action test instruction and / or a current element voice test instruction; determine the current program test path according to the current element test instruction; when it is determined that the current program test path duplicates the program storage path, return to execute the operation of obtaining the current element test instruction of the current cascaded application test page according to the current page element of the current cascaded application test page until it is determined that the current program test path does not duplicate the program storage path; when it is determined that the current program test path does not duplicate the program storage path, perform stress testing on the current cascaded application test page according to the current element test instruction and the current page element.
[0146] Optionally, if the current element test instruction includes a current element action test instruction, the application stress testing module 630 is specifically configured to: randomly select a target page element according to the current page element.
[0147] Determine the current element action test instruction matched by the target page element according to the element type of the target page element; wherein, the current element action test instruction includes a system action test instruction or an element action test instruction; randomly select a target element action test instruction according to the current element action test instruction; generate the current program test path according to the target element action test instruction.
[0148] Optionally, if the current element test instruction includes a current element voice test instruction, the application program stress test module 630 is specifically configured to: determine the voice instruction test type of the current element voice test instruction; determine the current element voice test instruction according to the voice instruction test type and / or the current page element; wherein, the current element voice test instruction includes a system voice test instruction or an element voice test instruction; in the case where it is determined that the current element voice test instruction is the system voice test instruction, randomly select a target system voice test instruction according to the current system voice test instruction; in the case where it is determined that the current element voice test instruction is the element voice test instruction, randomly select a target page element according to the current page element, and randomly select a target element voice test instruction according to the current page element voice test instruction matched by the target page element; generate the current program test path according to the target system voice test instruction or the target element voice test instruction.
[0149] Optionally, the application program stress test module 630 is specifically configured to: determine the current path depth of the current program test path; in the case where it is determined that the current path depth is less than a preset path depth threshold, execute the current element test instruction on the current page element; in the case where it is determined that the current path depth is greater than or equal to the preset path depth threshold, return to execute the operation of determining the current application program test instruction according to the application program test instruction until it is determined that the test termination condition is reached.
[0150] The above application program test device can execute the application program test method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the application program test method provided in any embodiment of the present disclosure.
[0151] Since the application program testing apparatus introduced above is an apparatus capable of executing the application program testing method in the embodiments of the present disclosure, based on the application program testing method introduced in the embodiments of the present disclosure, those skilled in the art can understand the specific implementation manners and various variations of the application program testing apparatus in this embodiment. Therefore, the implementation of how the application program testing apparatus realizes the application program testing method in the embodiments of the present disclosure will not be described in detail herein. As long as the apparatus adopted by those skilled in the art to implement the application program testing method in the embodiments of the present disclosure belongs to the scope protected by the present disclosure.
[0152] In one example, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0153] Figure 7 FIG. shows a schematic block diagram of an exemplary electronic device 700 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, a personal digital processor, a cellular phone, a smart phone, a wearable device, 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.
[0154] As Figure 7 shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0155] A plurality of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0156] The computing unit 701 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated 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 701 executes the various methods and processes described above, such as the application testing method. For example, in some embodiments, the application testing method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the application testing method described above can be executed. Alternatively, in other embodiments, the computing unit 701 can be configured to execute the application testing method by any other suitable means (e.g., by means of firmware).
[0157] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-a-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0158] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program codes can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0159] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection 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 include, 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 a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0160] For purposes of providing an interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide for 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 acoustic, speech, or tactile input).
[0161] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0162] A computer system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services. The server can also be a server of a distributed system or a server combined with a blockchain.
[0163] In an embodiment of the present disclosure, after determining an application test page of the application to be tested, application test instructions of the application to be tested are obtained according to the determined application test page, and thus the application to be tested is subjected to a stress test according to the application test instructions. Since the application test instructions can include various instruction types such as action test instructions and voice test instructions, the stress test requirements of application programs of different device types can be met, the problem of low applicability existing in the existing application program test methods can be solved, the comprehensive stress test requirements of application programs can be satisfied, and thus the applicability of the application program stress test can be improved.
[0164] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added, or deleted. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and no limitations are imposed herein.
[0165] The above specific embodiments do not constitute a limitation on the protection scope of the present 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 the present disclosure shall be included within the protection scope of the present disclosure.
Claims
1. An application testing method, comprising: Determining an application test page of the application to be tested; Obtaining an application test instruction of the application to be tested according to the application test page; wherein, the application test instruction includes an action test instruction and a voice test instruction; Performing a stress test on the application to be tested according to the application test instruction; Wherein, the performing a stress test on the application to be tested according to the application test instruction includes: Determining a current application test instruction according to the application test instruction; Determining a current program test path of the current application test instruction; In the case where it is determined that the current program test path does not duplicate the program storage path, determining a current cascaded application test page according to the instruction response result of the current application test instruction of the application to be tested; Performing a stress test on the application to be tested according to the current cascaded application test page; The performing a stress test on the application to be tested according to the current cascaded application test page includes: Determining current page elements of the current cascaded application test page; Obtaining a current element test instruction of the current cascaded application test page according to the current page elements of the current cascaded application test page; wherein, the current element test instruction includes a current element action test instruction and / or a current element voice test instruction; Determining a current program test path according to the current element test instruction; In the case where it is determined that the current program test path duplicates the program storage path, returning to execute the operation of obtaining the current element test instruction of the current cascaded application test page according to the current page elements of the current cascaded application test page until it is determined that the current program test path does not duplicate the program storage path; In the case where it is determined that the current program test path does not duplicate the program storage path, performing a stress test on the current cascaded application test page according to the current element test instruction and the current page elements.
2. The method according to claim 1, wherein The determining an application test page of the application to be tested includes: Obtaining a desktop page of the device to be tested on which the application to be tested is installed; Determining the desktop page as the application test page.
3. The method according to claim 2, wherein The obtaining an application test instruction of the application to be tested according to the application test page includes: Obtaining desktop elements of the desktop page; Generating the action test instruction and the voice test instruction of the application to be tested according to the desktop elements.
4. The method according to claim 3, further comprising: Determining a test weight of each of the desktop elements according to the element type of each of the desktop elements; Determining an action test instruction ratio of each of the desktop elements according to the test weight of each of the desktop elements; Determining a test ratio of the action test instruction and the voice test instruction according to the device type of the device to be tested.
5. The method according to claim 1, wherein, The performing a stress test on the application to be tested according to the current cascaded application test page includes: Obtaining a blacklist page list; Matching the current cascaded application test page with the blacklist page list; When it is determined that the current cascaded application test page matches the target blacklist page in the blacklist page list, store the current program test path matched by the current cascaded application test page; Return to perform the operation of determining the current application test instruction according to the application program test instruction until it is determined that the test termination condition is reached; When it is determined that the current cascaded application test page does not match the blacklist page list, perform a stress test on the application under test according to the current cascaded application test page.
6. The method according to claim 1, wherein If the current element test instruction includes a current element action test instruction, then obtaining the current element test instruction of the current cascaded application test page according to the current page element of the current cascaded application test page includes: Randomly select a target page element according to the current page element; Determine the current element action test instruction matched by the target page element according to the element type of the target page element; wherein, the current element action test instruction includes a system action test instruction or an element action test instruction; The determining the current program test path according to the current element test instruction includes: Randomly select a target element action test instruction according to the current element action test instruction; Generate the current program test path according to the target element action test instruction.
7. The method according to claim 1, wherein If the current element test instruction includes a current element voice test instruction, then obtaining the current element test instruction of the current cascaded application test page according to the current page element of the current cascaded application test page includes: Determine the voice instruction test type of the current element voice test instruction; Determine the current element voice test instruction according to the voice instruction test type and / or the current page element; wherein, the current element voice test instruction includes a system voice test instruction or an element voice test instruction; The determining the current program test path according to the current element test instruction includes: When it is determined that the current element voice test instruction is the system voice test instruction, randomly select a target system voice test instruction according to the current system voice test instruction; When it is determined that the current element voice test instruction is the element voice test instruction, randomly select a target page element according to the current page element, and randomly select a target element voice test instruction according to the current page element voice test instruction matched by the target page element; Generate the current program test path according to the target system voice test instruction or the target element voice test instruction.
8. The method according to claim 1, wherein The performing a stress test on the current cascaded application test page according to the current element test instruction and the current page element includes: Determine the current path depth of the current program test path; When it is determined that the current path depth is less than the preset path depth threshold, execute the current element test instruction on the current page element; When it is determined that the current path depth is greater than or equal to the preset path depth threshold, return to execute the operation of determining the current application test instruction according to the application program test instruction until it is determined that the test termination condition is reached.
9. An application program test device, comprising: An application test page determination module, configured to determine an application test page of an application program to be tested; An application test instruction acquisition module, configured to acquire an application test instruction of the application program to be tested according to the application test page; wherein, the application program test instruction includes an action test instruction and a voice test instruction; An application program stress test module, configured to perform a stress test on the application program to be tested according to the application program test instruction; Wherein, the application program stress test module is specifically configured to: Determine a current application program test instruction according to the application program test instruction; Determine the current program test path of the current application program test instruction; When it is determined that the current program test path does not duplicate the program storage path, determine a current cascaded application test page according to the instruction response result of the current application program test instruction of the application program to be tested; Perform a stress test on the application program to be tested according to the current cascaded application test page; The application program stress test module is further configured to: Determine the current page element of the current cascaded application test page; Acquire a current element test instruction of the current cascaded application test page according to the current page element of the current cascaded application test page; wherein, the current element test instruction includes a current element action test instruction and / or a current element voice test instruction; Determine the current program test path according to the current element test instruction; When it is determined that the current program test path duplicates the program storage path, return to execute the operation of acquiring the current element test instruction of the current cascaded application test page according to the current page element of the current cascaded application test page until it is determined that the current program test path does not duplicate the program storage path; When it is determined that the current program test path does not duplicate the program storage path, perform a stress test on the current cascaded application test page according to the current element test instruction and the current page element.
10. The apparatus according to claim 9, wherein, The application test page determination module is specifically configured to: Acquire a desktop page of the application program to be tested installed in the device to be tested; Determine the desktop page as the application test page.
11. The apparatus according to claim 10, wherein, The application test instruction acquisition module is specifically configured to: Acquire desktop elements of the desktop page; Generate the action test instruction and the voice test instruction of the application program to be tested according to the desktop elements.
12. The device according to claim 11, further comprising: A test weight determination module, configured to determine a test weight of each of the desktop elements according to the element type of each of the desktop elements; An action test instruction ratio determination module, configured to determine an action test instruction ratio of each of the desktop elements according to the test weight of each of the desktop elements; A test ratio determination module, configured to determine the test ratios of the action test instruction and the voice test instruction according to the device type of the device to be tested.
13. The apparatus according to claim 9, wherein, The application program stress test module is specifically configured to: Obtain a blacklist page list; Match the current cascaded application test page with the blacklist page list; When it is determined that the current cascaded application test page matches the target blacklist page in the blacklist page list, store the current program test path matched by the current cascaded application test page; Return to execute the operation of determining the current application program test instruction according to the application program test instruction until it is determined that the test termination condition is reached; When it is determined that the current cascaded application test page does not match the blacklist page list, perform a stress test on the application program to be tested according to the current cascaded application test page.
14. The device according to claim 9, wherein, If the current element test instruction includes a current element action test instruction, the application program stress test module is specifically configured to: Randomly select a target page element according to the current page element; Determine the current element action test instruction matched by the target page element according to the element type of the target page element; wherein, the current element action test instruction includes a system action test instruction or an element action test instruction; Randomly select a target element action test instruction according to the current element action test instruction; Generate the current program test path according to the target element action test instruction.
15. The apparatus according to claim 9, wherein, If the current element test instruction includes a current element voice test instruction, the application program stress test module is specifically configured to: Determine the voice instruction test type of the current element voice test instruction; Determine the current element voice test instruction according to the voice instruction test type and / or the current page element; wherein, the current element voice test instruction includes a system voice test instruction or an element voice test instruction; When it is determined that the current element voice test instruction is the system voice test instruction, randomly select a target system voice test instruction according to the current system voice test instruction; When it is determined that the current element voice test instruction is the element voice test instruction, randomly select a target page element according to the current page element, and randomly select a target element voice test instruction according to the current page element voice test instruction matched by the target page element; Generate the current program test path according to the target system voice test instruction or the target element voice test instruction.
16. The device according to claim 9, wherein, The application program stress test module is specifically configured to: Determine the current path depth of the current program test path; When it is determined that the current path depth is less than the preset path depth threshold, execute the current element test instruction on the current page element; When it is determined that the current path depth is greater than or equal to the preset path depth threshold, return to execute the operation of determining the current application program test instruction according to the application program test instruction until it is determined that the test termination condition is reached.
17. 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 when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the application program testing method according to any one of claims 1-8.
18. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the application program testing method according to any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the application program testing method according to any one of claims 1-8.
Citation Information
Patent Citations
Pressure test method and device and computer readable storage medium
CN110442525A
Application program testing method and device, terminal equipment and storage medium
CN111309622A
Page testing method, page testing device, electronic equipment and readable storage medium
CN112965916A