Application program testing method, related device and medium
By generating continuous jump scene sequences and determining test paths in application testing, the problem of low scene coverage in tests is solved, and more efficient test coverage is achieved.
Patent Information
- Application Number
- CN202310637428.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
In application testing, random trigger controls may repeatedly enter the scenes that have been tested or controls that will not produce operation effects, resulting in low test coverage.
By triggering the untriggered control in the scene to be investigated, a sequence of continuous jump scenes is generated, and the first path from the start scene to the end scene is determined in the jump relationship diagram, thereby guiding the test from exploring sufficient scene to inadequate exploration of insufficient exploration The scene is redirected.
Increase the number of scenarios covered by the test within a limited testing time, improve the test coverage, and ensure more comprehensive application testing.
Smart Images

Figure CN119065952A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of testing, and in particular to an application testing method, related devices and media. Background Art
[0002] During the application testing process, a control (such as a button or interactive item) in the scene is generally triggered randomly. After the trigger, no matter whether the scene jumps or not, another control is selected in the application interface to trigger. Every time a new scene is reached, the parameters in the new scene are collected for testing. The more scenes explored in the test, the higher the test coverage. However, randomly triggered controls may repeatedly enter scenes that have been tested, or trigger controls that will not produce operational effects, resulting in fewer test coverage scenarios and low test coverage. Summary of the invention
[0003] The embodiments of the present disclosure provide an application testing method, related devices, and media, which can test more scenarios within a limited testing time and improve test coverage.
[0004] According to one aspect of the present disclosure, there is provided an application testing method, comprising:
[0005] Trigger an untriggered control in the scene to be examined in the application program to jump to the next scene for testing, and use the next scene as the scene to be examined until the number of untriggered controls in the scene to be examined is 0, so as to obtain a continuous jump scene sequence;
[0006] In the jump relationship graph, obtaining a first path from the starting scene to the ending scene;
[0007] Starting from the starting scene, scene jumps and tests are performed according to the first path.
[0008] According to one aspect of the present disclosure, there is provided an application testing device, comprising:
[0009] A control triggering unit, used for triggering an untriggered control in the scene to be examined in the application program, so as to jump to the next scene for testing, and taking the next scene as the scene to be examined, until the number of untriggered controls in the scene to be examined is 0, so as to obtain a continuous jump scene sequence;
[0010] A jump relationship graph generating unit, configured to generate a jump relationship graph based on the jump relationship between multiple scenes in the continuous jump scene sequence;
[0011] A path determination unit, configured to obtain, in the jump relationship graph, a first path from a starting scene to an ending scene;
[0012] A scene testing unit is used to start from the starting scene, perform scene jumps and tests along the first path.
[0013] Optionally, the starting scene has fewer untriggered controls than the ending scene, and the application testing device further includes:
[0014] A first scene determination unit, configured to obtain a scene in which all the controls have been triggered in the continuous jump scene sequence as the starting scene;
[0015] The second scene determination unit is used to obtain a scene in which the number of untriggered controls in the continuous jump scene sequence meets the first condition as the end scene.
[0016] Optionally, the scenario testing unit is specifically used for:
[0017] Triggering a control in the starting scene to perform scene jump and test, and comparing the jumped scene with the first path;
[0018] If the scene jumped to does not conform to the first path, the scene jumped to is used as the scene to be examined, and the process returns to the step of triggering an untriggered control in the scene to be examined.
[0019] Optionally, the control triggering unit jumps to the next scene specifically includes:
[0020] Acquire the first interface before triggering the untriggered control;
[0021] Acquire a second interface after triggering the untriggered control;
[0022] The controls in the first interface are compared with the controls in the second interface. If they are completely consistent, continue to trigger an untriggered control in the scene to be examined until the controls in the first interface are no longer completely consistent with the controls in the second interface.
[0023] Optionally, each scene in the application corresponds to a scene storage information body, and the scene storage information body includes a scene identifier, a control identifier in the scene, and a control triggering count; the control triggering unit is specifically used to:
[0024] According to the scene identifier of the scene to be examined, searching for the scene storage information body containing the scene identifier;
[0025] Obtain the control identifier of the control triggering times of 0 in the scene storage information body;
[0026] A control identifier is selected from the control identifiers whose control triggering times is 0, and a control corresponding to the control identifier is triggered.
[0027] Optionally, the application program testing device further includes a first counting unit, and the first counting unit is specifically configured to:
[0028] According to the scene identifier of the scene to be examined, searching for the scene storage information body containing the scene identifier;
[0029] The number of control triggering times corresponding to the control identifier in the scene storage information body is increased by 1.
[0030] Optionally, the scene storage information body further includes a candidate next scene identifier to which each control jumps after being triggered, and a number of arrivals corresponding to the candidate next scene identifier; the application testing device further includes a second counting unit, which is specifically used to:
[0031] Comparing the scene identifier of the next scene with each of the candidate next scene identifiers;
[0032] If the scene identifier of the next scene is consistent with one of the candidate next scene identifiers, the number of arrivals corresponding to the candidate next scene identifier is increased by 1;
[0033] If the scene identifier of the next scene is inconsistent with each of the candidate next scene identifiers, the scene identifier of the next scene is added to the scene storage information body as the candidate next scene identifier, and the arrival count corresponding to the added candidate next scene identifier is set to 1.
[0034] Optionally, the jump relationship graph generating unit is specifically used for:
[0035] Using the scene in the continuous jump scene sequence as a node in the jump relationship graph;
[0036] If a jump occurs between two of the scenes in the continuous jump scene sequence, adding an edge between the nodes corresponding to the scenes, wherein the two scenes include a pre-jump scene and a post-jump scene;
[0037] Searching for the scene storage information body of the scene identifier of the scene before the jump;
[0038] In the scene storage information body, searching for the arrival number corresponding to the jump scene identified by the control;
[0039] In the scene storage information body, searching for the control triggering times of the control identifier;
[0040] The edge weight of the edge is determined based on the found number of arrivals and the found number of control triggerings.
[0041] Optionally, the path determination unit includes:
[0042] A candidate path determination unit, used to determine a plurality of candidate paths from the starting scene to the ending scene in the jump relationship graph;
[0043] A selection unit is configured to select the first path from a plurality of the candidate paths based on the edge weights of the edges on the candidate paths.
[0044] Optionally, the selection unit specifically includes:
[0045] A first weight determination subunit, configured to determine a path weight of the candidate path based on the edge weights of the edges on the candidate path;
[0046] A first selection subunit, configured to determine, from among the plurality of candidate paths, the candidate path whose path weight is greater than a first threshold, as a target candidate path;
[0047] The second selection subunit is used to randomly select one of the target candidate paths as the first path.
[0048] Optionally, the selection unit specifically includes:
[0049] A second weight determination subunit, configured to determine a path weight of the candidate path based on the edge weights of the edges on the candidate path;
[0050] A total number of controls obtaining subunit, used to obtain the total number of untriggered controls of each of the scenes on the candidate path;
[0051] The third selection subunit is used to select the first path from a plurality of the candidate paths based on the path weights of the plurality of the candidate paths and the total number of the untriggered controls.
[0052] Optionally, the third selection subunit is specifically configured to:
[0053] Obtain the total number of untriggered controls of each of the scenes on the candidate path;
[0054] determining a first sub-score of the candidate path based on the path weight of the candidate path;
[0055] determining a second sub-score of the candidate path based on the total number of the untriggered controls of the candidate path;
[0056] determining a score of the candidate path based on the first sub-score and the second sub-score of the candidate path;
[0057] The first path is selected among a plurality of the candidate paths based on the scores of the candidate paths.
[0058] Optionally, the selection unit is specifically used to:
[0059] Determine the negative logarithm of the edge weight of each of the edges on the candidate path;
[0060] An accumulator is set for each candidate path to accumulate the negative logarithms of the edge weights on the candidate path;
[0061] The candidate path with the smallest accumulated result of the accumulator is used as the first path.
[0062] Optionally, the second scene determination unit is specifically configured to:
[0063] From the continuous jump scene sequence, select scenes that can be reached by the starting scene after one or more continuous jumps as the target scene sequence;
[0064] Sorting the scenes in the target scene sequence in descending order according to the number of untriggered controls;
[0065] One of the scenes with a predetermined first ranking in the ranking is randomly selected as the ending scene.
[0066] Optionally, the control triggering unit specifically includes:
[0067] A position acquisition unit, used for acquiring the positions of a plurality of untriggered controls in the scene to be examined;
[0068] A size acquisition unit, used for acquiring the sizes of a plurality of untriggered controls in the scene to be examined;
[0069] The trigger unit is used to select one of the multiple untriggered controls to trigger based on the positions and sizes of the multiple untriggered controls, so as to perform scene jump and test.
[0070] Optionally, the trigger unit is specifically used for:
[0071] Determining a first score of the plurality of untriggered controls based on the positions of the plurality of untriggered controls;
[0072] determining a second score of the plurality of untriggered controls based on the sizes of the plurality of untriggered controls;
[0073] determining a weighted sum of the first scores and the second scores of a plurality of the untriggered controls;
[0074] Based on the weighted sum of the multiple untriggered controls, the selected untriggered control is determined to be triggered among the multiple untriggered controls to perform scene jump and test.
[0075] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the application program testing method as described above when executing the computer program.
[0076] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the application program testing method as described above is implemented.
[0077] According to one aspect of the present disclosure, a computer program product is provided. The computer program product includes a computer program. The computer program is read and executed by a processor of a computer device, so that the computer device executes the application program testing method as described above.
[0078] The disclosed embodiment first triggers scene jumps continuously. An untriggered control is triggered in the scene to be examined to trigger the scene jump. After the jump, another untriggered control is triggered in the new scene to trigger a new scene jump, and this is performed continuously multiple times. The scene jump in the application often returns to the previously browsed scene, so that new untriggered controls will be triggered in the same scene multiple times, resulting in a small number of untriggered controls in a certain scene. Such a scene is a fully explored scene. The disclosed embodiment takes this fully explored scene as the starting scene. The scene with a large number of untriggered controls, that is, the scene with insufficient exploration, is taken as the ending scene. A first path is determined between the starting scene and the ending scene. It is easy to explore previously unexplored scenes by guiding from the fully explored scene along the first path to the insufficiently explored scene, so that more scenes can be tested within a limited test time, thereby improving test coverage.
[0079] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0081] Figure 1 is a schematic diagram of the system architecture of a system to which the application program testing method according to an embodiment of the present disclosure is applied;
[0082] Figure 2A -I is a schematic diagram of an application program testing method according to an embodiment of the present disclosure being applied in a mini-game testing scenario;
[0083] Figure 3 is a flowchart of an application testing method according to an embodiment of the present disclosure;
[0084] Figure 4 Shows Figure 3 Step 310 triggers a flowchart of an untriggered control in a scene to be examined in an application;
[0085] Figure 5 Shows Figure 3 Step 310 triggers another flow chart of an untriggered control in the scene to be examined in the application;
[0086] Figure 6 Shows Figure 3 Step 310 jumps to the next scene flow chart;
[0087] Figure 7 is a flowchart of an application testing method according to another embodiment of the present disclosure;
[0088] Figure 8 Shown in Figure 3 A flowchart of updating the scene storage information body after step 310;
[0089] Fig. 9 Shows Figure 3 Step 320 generates a flow chart of a jump relationship diagram;
[0090] Fig.10 Shows Figure 3 A schematic diagram of the structure of the jump relationship diagram generated in step 320;
[0091] Fig.11 Shows Figure 3 Flow chart of determining the end scene before step 330;
[0092] Fig.12 Shows Figure 3 Step 330 is a flowchart of selecting a first path based on multiple candidate paths from the starting scene to the ending scene;
[0093] Fig.13A -C shows Fig.12 A schematic diagram of an implementation process of multiple candidate paths determined in step 1210;
[0094] Fig.14 Shows Fig.12Flowchart of step 1220 selecting a first path from a plurality of candidate paths;
[0095] Fig.15 Shows Fig.14 A schematic diagram of an implementation process of determining the path weight of the candidate path in step 1410;
[0096] Fig.16 Shows Fig.12 Another flow chart of selecting a first path from a plurality of candidate paths in step 1220;
[0097] Fig.17 Shows Fig.12 Another flow chart of selecting a first path from a plurality of candidate paths in step 1220;
[0098] Fig.18 Shows Fig.12 Flowchart of determining the first path based on the edge weight in step 1220;
[0099] Fig.19 Shows Figure 3 Step 340 is a flowchart of starting from the starting scene, performing scene jump and testing according to the first path;
[0100] Fig. 20A -C shows Figure 3 A schematic diagram of an implementation process of step 340 starting from the starting scene, performing scene jump and testing according to the first path;
[0101] Fig.21 is a schematic diagram of implementation details of an application testing method according to an embodiment of the present disclosure;
[0102] Fig. 22 A schematic diagram showing the total number of scenarios covered by two Monkey tests provided in an embodiment of the present disclosure;
[0103] Fig.23 is a module diagram of an application testing device according to an embodiment of the present disclosure;
[0104] Fig.24 is a terminal structure diagram of an application program testing method according to an embodiment of the present disclosure;
[0105] Fig.25 The server structure diagram of the application program testing method according to one embodiment of the present disclosure. DETAILED DESCRIPTION
[0106] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0107] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0108] Artificial intelligence: It is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain target results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0109] Monkey testing: refers to a standardized automatic testing tool that can automatically explore the operation mode of the application under test without human intervention, and perform different clicks, swipes and other operations to cover different scene interfaces of the application under test. The purpose of Monkey testing is to enable the game to render more types of pictures and enter more scenes through operations.
[0110] During the application testing process, a control (such as a button or interactive item) in the scene is generally triggered randomly. After the trigger, no matter whether the scene jumps or not, another control is selected in the application interface to trigger. Every time a new scene is reached, the parameters in the new scene are collected for testing. The more scenes explored in the test, the higher the test coverage. However, randomly triggered controls may repeatedly enter scenes that have been tested, or trigger controls that will not produce operational effects, resulting in fewer test coverage scenarios and low test coverage.
[0111] System architecture and scenario description of the application of the embodiments of the present disclosure
[0112] Figure 1 It is a system architecture diagram used by the application testing method according to the embodiment of the present disclosure. It includes an object terminal 140, the Internet 130, a gateway 120, an application testing platform server 110 and an application server 160, etc., wherein the application testing platform server 110 includes a database 150, and the database is used to store log data generated during the application testing process.
[0113] The target terminal 140 includes various forms such as desktop computers, laptop computers, PDAs (personal digital assistants), mobile phones, vehicle-mounted terminals, home theater terminals, and dedicated terminals. In addition, it can be a single device or a collection of multiple devices. The target terminal 140 and the server 110 can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0114] The application testing platform server 110 and the application server 160 refer to computer systems that can provide certain services to the object terminal 140. Compared with the ordinary object terminal 140, the application testing platform server 110 and the application server 160 have higher requirements in terms of stability, security, performance, etc. The application testing platform server 110 and the application server 160 can be a high-performance computer in the network platform, a cluster of multiple high-performance computers, a part of a high-performance computer (such as a virtual machine), a combination of parts of multiple high-performance computers (such as virtual machines), etc.
[0115] The gateway 120 is also called an internetwork connector or a protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. The gateway is a translator between two systems that use different communication protocols, data formats or languages, or even have completely different architectures. At the same time, the gateway can also provide filtering and security functions. The message sent by the object terminal 140 to the application test platform server 110 and the application server 160 must be sent to the corresponding application test platform server 110 and the application server 160 through the gateway 120. The message sent by the application test platform server 110 and the application server 160 to the object terminal 140 must also be sent to the corresponding object terminal 140 through the gateway 120.
[0116] In the actual application testing process, first, the object can send an application testing request to the application testing platform server 110 through the object terminal 140, and the application testing platform server 110 determines the application to be tested and the test type according to the received application testing request. Then, the application testing platform server 110 sends a control instruction to the application server 160 corresponding to the application to be tested to control the operation of the application server 160 and perform application testing on the application server 160. After the application testing is completed, the application testing platform server 110 will store the data generated during the application testing process in the database 150, and will also send the test results to the object terminal 140 through the gateway 120.
[0117] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2A -The mini-game test scene shown in I, etc.
[0118] like Figure 2A As shown, when object A needs to test whether the game scene of a certain game meets the requirements, object A logs in to the application test platform on the object terminal 140. At this time, an application test platform homepage will be displayed on the front-end interface of the object terminal 140, and the application test platform homepage displays controls corresponding to multiple different application test types such as "scenario test" and "compatibility test". When object A clicks the "scenario test" button, the scene test process is entered, and when object A clicks the "compatibility test" button, the compatibility test process is entered. Since it is necessary to test whether the game scene of a certain game meets the requirements, object A will click the "scenario test" button to enter the game scene test process.
[0119] like Figure 2BAs shown, when subject A clicks the "Scene Test" button, the interface will display the input box corresponding to the game name and the input box corresponding to the game scene. At the same time, the interface also displays a prompt field "Please enter the game name of the game to be tested and the first game scene to be tested" to remind subject A to enter the specific game name and scene name in the input box. At this time, subject A enters "Xxx" in the input box corresponding to the game name and enters "Scene 3" in the input box corresponding to the game scene. After completing the input, subject A clicks the "OK" button to confirm the game test with the game name "Xxx" and use scene 3 as the first game scene to be tested.
[0120] like Figure 2C As shown, when the object A clicks the "OK" button, the front-end interface of the object terminal 140 will load and display the scene 3 of the game named "Xxx". Scene 3 displays multiple interactive buttons such as "Role", "Task", "Activity", "Settings", "More" and "Chat" for the object A to click. Scene 3 also displays non-operable scene elements such as the current character and other characters.
[0121] It should be noted that a game contains multiple scenes, and a scene contains multiple scene elements, which can be characters, buttons, etc. Among them, operable elements refer to scene elements that can be clicked in the scene, for example, the "role", "task" and other buttons in the above scene 3, and inoperable elements refer to scene elements that cannot be clicked in the scene, for example, the current character and other characters in the above scene 3.
[0122] Since different controls often have different corresponding trigger events, when object A clicks different buttons, it often enters different scenes, and different scenes contain different buttons. For example, when object A clicks the "Chat" button, the interface will display a chat box, a text input box, and a soft keyboard; when object A clicks the "Activity" button, the interface will display various types of game activities, as well as the activity introduction and "Register" button for each game activity. Based on this, the scenes that object A jumps to when clicking the "Chat" button and the "Activity" button are different.
[0123] When the application testing platform server 110 detects that the only untriggered button in scene 3 is the “Role” button, the application testing platform server 110 automatically clicks the “Role” button in scene 3 by default to jump to the role setting scene.
[0124] like Figure 2DAs shown, when the application testing platform server 110 automatically clicks the "Role" button in scene 3 by default, the character setting scene will be displayed on the interface, wherein the character setting scene is scene 4. Scene 4 includes "Equipment", "Appearance", "Pet", "Mall", and "Exit" buttons. Since scene 4 is a new scene, the "Equipment", "Appearance", "Pet", "Mall", and "Exit" buttons in scene 4 are all untriggered buttons. Therefore, the application testing platform server 110 will randomly select a button as the button clicked by object A to jump to the next scene. At this time, the application testing platform server 110 randomly selects the "Appearance" button as the button clicked by object A, and automatically clicks the "Appearance" button to jump to the appearance setting scene.
[0125] like Figure 2E As shown, when the application test platform server 110 automatically clicks the "Appearance" button in scene 4 by default, the appearance setting scene will be displayed on the interface, where the appearance setting scene is scene 5. Scene 4 includes "Preview", "OK", various hairstyle selection buttons in the hairstyle column, and various clothing selection buttons in the clothing column. At this time, the clothes equipped on the current character are clothes 1, and the hairstyle is hairstyle 1. The application test platform server 110 will randomly select a button as the button clicked by object A to jump to the next scene.
[0126] like Figure 2F As shown, the application testing platform server 110 randomly selects the clothes selection button corresponding to "clothes 2" as the button clicked by object A, automatically clicks the "clothes 2" button, and changes the clothes equipped on the current character to clothes 2. At this time, the scene on the interface does not jump, and scene 5 is still displayed on the interface.
[0127] Further, when the application testing platform server 110 automatically clicks the "clothes 2" button and changes the clothes equipped on the current character to clothes 2, the application testing platform server 110 continues to randomly select a button in scene 5 as the button clicked by object A to jump to the next scene. At this time, the application testing platform server 110 randomly selects the "preview" button as the button clicked by object A, and automatically clicks the "preview" button to enter the preview interface.
[0128] like Figure 2GAs shown, when the application testing platform server 110 automatically clicks the "Preview" button, it enters the preview interface, where the preview interface is scene 6. Scene 6 contains two buttons, "Save" and "Exit". At this time, the application testing platform server 110 randomly selects a button in scene 6 as the button clicked by object A to jump to the next scene. Specifically, the application testing platform server 110 randomly selects the "Save" button as the button clicked by object A and automatically clicks the "Save" button.
[0129] like Figure 2H As shown, when the application testing platform server 110 automatically clicks the "Save" button, it jumps from scene 6 to scene 4, and the interface displays scene 4. At this time, in scene 4, the clothes equipped by the current character change from clothes 1 to clothes 2. The interactive buttons in scene 4 are still the "Equipment", "Appearance", "Pet", "Mall", and "Exit" buttons.
[0130] Furthermore, since the application testing platform server 110 detects that the untriggered buttons in scene 4 are the "Equipment", "Pet", "Mall", and "Exit" buttons. In order to make the game test cover more game scenes, the application testing platform server 110 will randomly select one of the four buttons as the button clicked by object A to jump to the next scene. At this time, the application testing platform server 110 randomly selects the "Exit" button as the button clicked by object A, and automatically clicks the "Exit" button to exit scene 4.
[0131] like Fig.2I As shown, when object A clicks the "Exit" button, the interface jumps back to scene 3 and displays the prompt field "There are no untriggered controls in the scene, and this scene will be used as the initial scene for scene testing." At this time, object A clicks the "OK" button to confirm that scene 3 will be used as the initial scene and start a series of scene tests.
[0132] General description of the disclosed embodiments
[0133] According to an embodiment of the present disclosure, a method for testing an application is provided.
[0134] The application testing method can be used to Figure 2A -I shown in the small game test scene, etc. At present, the embodiment of the present disclosure provides a solution for determining the test path based on continuous triggering of scene jumps, and guiding the scene jumps and tests in the test according to the test path, which can test more scenes within a limited test time and improve the test coverage. The application test method of the embodiment of the present disclosure can be executed by the application test platform server (such as Figure 1 ), can also be executed by the client in the scenario of testing a stand-alone application.
[0135] like Figure 3 As shown, the application testing method according to an embodiment of the present disclosure may include:
[0136] Step 310: trigger an untriggered control in the scene to be examined in the application program to jump to the next scene for testing, and use the next scene as the scene to be examined until the number of untriggered controls in the scene to be examined is 0, so as to obtain a continuous jump scene sequence;
[0137] Step 320: Generate a jump relationship graph based on the jump relationship between multiple scenes in the continuous jump scene sequence;
[0138] Step 330: In the jump relationship diagram, obtain the first path from the start scene to the end scene;
[0139] Step 340: Starting from the starting scene, jump to the scene and test according to the first path.
[0140] Steps 310 - 340 are briefly described below.
[0141] In step 310, the scene in the embodiment of the present disclosure refers to the virtual scene displayed (or provided) when the application is running on the terminal. The virtual scene can be a simulation environment of the real world, a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. The embodiment of the present disclosure does not limit the dimension of the virtual scene. For example, the virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities, and objects can control virtual objects to move in the virtual scene.
[0142] In some embodiments, the scene to be examined is a scene that needs to be tested with Monkey. The scene to be examined is each application screen with different rendering content and functions in the application. For example, different screen scenes such as the application main interface, setting interface, game match, and battle.
[0143] In some embodiments, the above application can be set on the terminal in the form of an independent client, or loaded and run through the parent application in the form of a sub-application, for example, it can be a small game loaded and run through an instant messaging client. Among them, the small game here refers to a game product implemented using JavaScript attached to an instant messaging client, a social network client, etc., which can be compiled by an engine such as Cocos, Laya, Egret, etc., and is usually small in size, does not need to be installed, and can be played immediately after opening.
[0144] Controls refer to elements in a scene that can be operated by users, such as buttons, interactive items, etc. Usually, the jump of the game scene is caused by operating a certain control.
[0145] Untriggered controls refer to controls that have not been operated in a scene.
[0146] The continuous jump scene sequence is a scene ordering determined based on the explored scenes and the jump relationship between the scenes. For example, the scene to be examined is scene 1, the untriggered control in scene 1 is triggered to jump to scene 2, and an untriggered control is randomly triggered in scene 2 to jump to scene 3, and there is no untriggered control in scene 3, then the generated continuous jump scene sequence is [scene 1, scene 2, scene 3].
[0147] In step 320, the jump relationship graph is a directed graph representing each scene and the jump relationship between scenes, wherein the nodes of the jump relationship graph are determined according to each scene, and the edges of the jump relationship graph are determined according to the jump relationship between scenes.
[0148] In order to guide the application test from the fully explored scenario to the inadequately explored scenario as much as possible, the selected starting scenario often has fewer untriggered controls than the selected ending scenario. Before step 330, the application test method further includes:
[0149] Get the scene in which all controls are triggered in the continuous jump scene sequence as the starting scene;
[0150] Get the scene in which the number of untriggered controls in the continuous jump scene sequence meets the first condition as the end scene.
[0151] The starting scene is a scene where all the controls in the scene have been triggered. The starting scene is a scene that has been fully explored. When determining the starting scene, first obtain the scene where all the controls in the continuous jump scene sequence have been triggered; then, use the scene where all the controls have been triggered as the starting scene.
[0152] It should be noted that, in general, there is only one scene in which all controls have been triggered in the continuous jump scene sequence. Therefore, this scene in which all controls have been triggered can be directly used as the starting scene. In some cases, there will be at least two scenes in which all controls have been triggered in the continuous jump scene sequence. When there are at least two scenes in which all controls have been triggered, one is randomly selected as the starting scene.
[0153] For example, the scene to be examined is scene 1, and there are untriggered controls m1 and triggered controls m2 in scene 1. First, trigger control m2 in scene 1 and jump to scene 2. There are untriggered controls p1 and p2 in scene 2. Next, take scene 2 as the scene to be examined, trigger control p1 in scene 2, and jump to scene 3. There is only one untriggered control n1 in scene 3. Next, take scene 3 as the scene to be examined, trigger control n1 in scene 3, and jump to scene 1. Since controls m1 and m2 in scene 1 have been triggered, the number of untriggered controls in scene 1 is 0, so stop the scene jump and get the continuous jump scene sequence [scene 1, scene 2 and scene 3]. In the continuous jump scene sequence [scene 1, scene 2 and scene 3], the scenes where all controls have been triggered are scene 1 and scene 3, and the scenes where all controls have been triggered are not unique. At this time, randomly select scene 1 or scene 3 as the starting scene.
[0154] The end scene is a scene that is not fully explored. There are many untriggered controls in the end scene. Triggering the untriggered controls in the end scene can make it easier to explore scenes that have not been explored before.
[0155] The first condition is used to determine whether each scene in the continuous jump scene sequence is suitable as an end scene.
[0156] In step 330, the first path is a path that guides the application test to explore from a fully explored scenario to an insufficiently explored scenario. The first path is composed of a starting scenario, an ending scenario, and other scenarios that jump from the starting scenario to the ending scenario.
[0157] In step 340, when jumping and testing scenes starting from the starting scene according to the first path, since the first path is composed of the starting scene, the ending scene, and other scenes passing through from the starting scene to the ending scene. When the control to be triggered is triggered in the starting scene, it will generally jump to the next scene determined by the first path. However, there is randomness in the jumping of scenes. When jumping and testing scenes according to the first path, it is also necessary to determine whether the scene jumped to each time conforms to the first path.
[0158] Furthermore, when determining whether the scene to be jumped to conforms to the first path, the rendering content and function of the scene to be jumped to and the next scene determined by the first path may be compared. If the rendering content and function of the scene to be jumped to and the next scene determined by the first path are the same, it is considered that the scene to be jumped to and the next scene determined by the first path are the same scene, and the scene to be jumped to conforms to the first path; if the rendering content and function of the scene to be jumped to and the next scene determined by the first path are different, it is considered that the scene to be jumped to and the next scene determined by the first path are not the same scene, and the scene to be jumped to does not conform to the first path.
[0159] Through steps 310-340, the disclosed embodiment first triggers scene jumps continuously. An untriggered control is triggered in the scene to be examined to trigger the scene jump. After the jump, another untriggered control is triggered in the new scene to trigger the new scene jump, and this is performed continuously multiple times. The scene jump in the application often returns to the previously browsed scene, so that new untriggered controls will be triggered in the same scene multiple times, resulting in a small number of untriggered controls in a certain scene. Such a scene is a fully explored scene. The disclosed embodiment takes this fully explored scene as the starting scene. The scene with a large number of untriggered controls, that is, the scene with insufficient exploration, is taken as the ending scene. A first path is determined between the starting scene and the ending scene. It is easy to explore scenes that have not been explored before by guiding from the fully explored scene along the first path to the insufficiently explored scene, so that more scenes can be tested within a limited test time, thereby improving test coverage.
[0160] The above is a general description of steps 310 to 340. The following will describe in detail the specific implementation of steps 310, 320, 330, and 340.
[0161] Detailed description of step 310
[0162] In step 310, an untriggered control is triggered in the scene to be examined in the application to jump to the next scene for testing, and the next scene is used as the scene to be examined until the number of untriggered controls in the scene to be examined is 0, so as to obtain a continuous jump scene sequence.
[0163] In the specific implementation of this embodiment, since most of the scenes to which the triggered control in the scene to be investigated jumps are known scenes. In order to explore more unknown scenes, an untriggered control can be triggered in the scene to be investigated in the application program, and jump to the next scene for testing. Then, the next scene is used as the scene to be investigated, and an untriggered control is triggered in the new scene to be investigated, and the next scene is continued to be tested. Then, the next scene is used as the latest scene to be investigated, and an untriggered control is triggered in the latest scene to be investigated, and the next scene is continued to be tested. And so on, until the number of untriggered controls in the latest scene to be investigated is 0, at this time, the controls in the latest scene to be investigated have all been triggered, there are no untriggered controls, and the triggering controls and scene jumps are stopped. Further, the scenes that have appeared in the aforementioned triggering controls and scene jump processes are counted, and a continuous jump scene sequence is obtained according to the order of occurrence of this series of scenes and the jump relationship between the scenes. Among them, the continuous jump scene sequence contains all scenes that appeared in the previous triggering controls and scene jump processes and the jump relationship between each scene.
[0164] It should be noted that each scene in the application corresponds to a scene storage information body. The scene storage information body is a data structure that stores various information in the scene. In one embodiment, the scene storage information body contains a scene identifier for each scene and a list for recording the operation information of each control of the scene. Among them, the scene identifier is used to distinguish different scenes, and the scene identifier of each scene is different. The list used to record the operation information of each control of the scene contains the control identifier in the scene, the number of control triggers, the candidate next scene identifier to which each control jumps after being triggered, and the number of arrivals corresponding to the candidate next scene identifier. The control identifier in the scene is used to distinguish different controls, and the control identifier of each control is different. The number of control triggers refers to the total number of times this control is triggered. The candidate next scene identifier to which each control jumps after being triggered refers to the scene identifier of the next scene to which each control in the triggering scene jumps. The number of arrivals corresponding to the candidate next scene identifier refers to the number of times the next scene to which each control in the triggering scene jumps is this scene.
[0165] For example, the scene storage information body of the scene with the scene identifier XXXXXX. The scene storage information body records the scene identifier "XXXXXX" of the scene and a list for recording the operation information of each control of the scene. Among them, in the scene storage information body, the scene identifier "XXXXXX" of the scene is expressed as "scene wuid: XXXXXX", and the scene storage information body also includes a list "nodes" for recording the operation information of each control of the scene, and the list includes the following specific information: "node_uuid:YYYY,times:8", "next_scene.uuid:aaaaa,next times:6", "next_scene.uuid:Bbbb,next times:2". According to this list for recording the operation information of each control of the scene, it can be seen that the scene with the scene identifier XXXXXX contains a control with the control identifier YYYY. The control with the control identifier YYYY has been triggered 8 times. In these 8 triggering processes, 6 times will jump from the scene with scene identifier XXXXXX to the scene with scene identifier aaaaa, and 2 times will jump from the scene with scene identifier XXXXXX to the scene with scene identifier Bbbb. Based on this, the candidate next scene identifiers to which each control jumps after being triggered include aaaaa and Bbbb, and the number of arrivals corresponding to the candidate next scene identifier "aaaaa" is 6, and the number of arrivals corresponding to the candidate next scene identifier "Bbbb" is 2.
[0166] like Figure 4As shown, in some embodiments, the process of triggering an untriggered control in a scene to be examined in an application includes but is not limited to the following steps 410 to 430.
[0167] Step 410: searching for a scene storage information body containing the scene identifier according to the scene identifier of the scene to be examined;
[0168] Step 420: Obtain the control identifier of the control triggering count of 0 in the scene storage information body;
[0169] Step 430: Select a control identifier from the control identifiers whose control triggering times are 0, and trigger the control corresponding to the control identifier.
[0170] Steps 410 - 430 are described in detail below.
[0171] In step 410, since the scene storage information body of each scene is often stored in a preset database, and each scene storage information body contains the scene identifier of the scene, the scene identifier of the scene to be examined can be compared with the scene identifier contained in each scene storage information body, and the scene storage information body containing the scene identifier is found in the preset database, and the found scene storage information body is the scene storage information body of the scene to be examined.
[0172] In step 420, since the control triggering count of each control can clearly reflect whether the control is triggered. When the control triggering count of a control is not 0, it indicates that the control is not an untriggered control; when the control triggering count of a control is 0, it indicates that the control is an untriggered control. Based on this, in the scene storage information body, the control identifiers whose control triggering count is 0 in the scene storage information body are obtained, and the controls corresponding to these control identifiers whose control triggering count is 0 are all untriggered controls in the scene to be examined.
[0173] In step 430, when one of the multiple untriggered controls in the scene to be examined is selected for triggering, a control identifier can be randomly selected from multiple control identifiers with a control triggering count of 0 or a control identifier can be selected according to a preset selection condition, and the control corresponding to the control identifier is triggered to jump to the next scene and perform a scene test. The preset selection condition can be set according to actual needs without limitation.
[0174] For example, in the scene storage information body corresponding to the scene to be examined, the control identifiers with a control triggering count of 0 include control identifier A1, control identifier A2, and control identifier A3. At this time, the control corresponding to control identifier A3 is randomly selected for triggering.
[0175] Through the above steps 410-430, the embodiment of the present disclosure can determine the scene storage information body of the scene to be examined according to the scene identifier of the scene to be examined; then, according to the control triggering times of each control recorded in the scene storage information body, all untriggered controls included in the scene to be examined are determined. Finally, one of the untriggered controls can be selected for triggering. This method can more conveniently determine which untriggered controls are included in the scene to be examined, and can improve the determination efficiency and accuracy of the untriggered controls.
[0176] Since different controls correspond to different triggering events, the importance of controls is different depending on the triggering events. When the controls corresponding to different triggering events are more important events in the application, triggering the control can often explore more scenarios. If a control corresponding to a control identifier is randomly selected from the control identifiers with a control triggering count of 0 for triggering, the triggering of the untriggered controls will often have greater randomness, which is not conducive to triggering more important untriggered controls. In addition, in actual application test scenarios, when the importance of a control is high, the size of the control is often set larger, and the control is often set in a position that is easier to notice, so that the operating object can trigger it. Based on this, the embodiment of the present disclosure proposes a scheme for selecting untriggered controls for triggering based on the position and size of the untriggered controls, which can increase the probability of untriggered controls with higher importance being triggered, thereby increasing the possibility of exploring previously unexplored scenes.
[0177] like Figure 5 As shown, in some embodiments, the process of selecting an untriggered control for triggering based on the position and size of the untriggered control may include but is not limited to the following steps 510 to 530 .
[0178] Step 510, obtaining positions of multiple untriggered controls in the scene to be examined;
[0179] Step 520, obtaining the sizes of multiple untriggered controls in the scene to be examined;
[0180] Step 530: Based on the positions and sizes of the multiple untriggered controls, one of the multiple untriggered controls is selected for triggering to perform scene jump and testing.
[0181] Steps 510 - 530 are described in detail below.
[0182] In step 510, first, a two-dimensional coordinate system is established on the scene interface of the scene to be examined, with the upper left corner of the scene interface as the origin, the horizontal direction of the scene interface as the x-axis, the vertical direction of the scene interface as the y-axis, and a preset value as the coordinate unit length. Next, the minimum bounding rectangle area of each untriggered control is determined. Next, in the two-dimensional coordinate system, the coordinate data of the center of the rectangle of each minimum bounding rectangle area is determined, and the coordinate data of the center of the rectangle is used as the position of each untriggered control.
[0183] In step 520, the methods for obtaining the sizes of multiple untriggered controls in the scene to be examined include but are not limited to the following two methods:
[0184] Method 1: First, obtain the total number of pixels and the area of a single pixel in the area corresponding to each untriggered control. Then, multiply the total number of pixels and the area of a single pixel to obtain the area of the untriggered control. Finally, the area of the untriggered control is used as the size of the untriggered control.
[0185] Method 2: First, determine the minimum bounding rectangle area of each untriggered control. Then, calculate the area of the minimum bounding matrix area of each untriggered control. Finally, use the area of the minimum bounding matrix area of each untriggered control as the size of the untriggered control.
[0186] In step 530, when selecting one untriggered control to trigger from among multiple untriggered controls based on their positions and sizes, the selected one may be selected based only on the position of the untriggered control; the selected one may be selected based only on the size of the untriggered control; or the selected one may be selected based on a combination of the position and size of the untriggered control, without limitation.
[0187] In one embodiment, only based on the positions of multiple untriggered controls, one is selected from multiple untriggered controls for triggering, so as to perform scene jump and test. Specifically, since a two-dimensional coordinate system is established on the scene interface of the scene to be examined, the coordinate data of the center of the scene interface of the scene to be examined is determined in the two-dimensional coordinate system, and the distance from the position of each untriggered control to the center of the scene interface of the scene to be examined is calculated. Then, each untriggered control is scored according to the distance to obtain a first score for each untriggered control. Finally, according to the first score, the untriggered control with the highest first score is selected for triggering; or, according to the first score, one is randomly selected from the untriggered controls whose first scores are higher than a preset threshold for triggering. Among them, each untriggered control is scored according to the distance to obtain the first score, including but not limited to the following two methods:
[0188] Method 1: Determine the first score of each untriggered control by looking up a table. Specifically, first sort the untriggered controls in ascending order according to the size of the distance. In the sorting, the untriggered controls with smaller distances are ranked at the front, and the untriggered controls with larger distances are ranked at the back. Next, query the preset distance score table, assign a score to each untriggered control in the sorting according to the distance score table, and obtain the first score of each untriggered control. Among them, the preset distance score table is used to characterize the correspondence between each sorting rank and score. In the distance score table, the higher the sorting rank, the higher the score.
[0189] For example, in a preset distance score table, when sorting by distance, the score of the untriggered control ranked first is 15, the score of the untriggered control ranked second is 12, the score of the untriggered control ranked third is 9, and so on, and each ranking corresponds to a preset score. The closer the distance between the position of the untriggered control and the center of the scene interface of the scene to be examined is, the higher the first score of the untriggered control is.
[0190] Method 2: Determine the first score of each untriggered control by function calculation. Specifically, first, preset a function with the distance from the position of the untriggered control to the center of the scene interface of the scene to be examined as the independent variable and the first score as the dependent variable. Then, substitute the distance of each untriggered control into the preset first function to obtain the first score of the untriggered control. Among them, the preset function can be an inverse proportional function, and the first score will decrease as the distance from the position of the untriggered control to the center of the scene interface of the scene to be examined increases.
[0191] This embodiment can more conveniently use the distance between the center position of each untriggered control and the center of the scene interface of the scene to be examined to determine the first score of each untriggered control. The smaller the distance between the center position of the untriggered control and the center of the scene interface of the scene to be examined, the closer the untriggered control is to the center of the interface, and the higher its first score. A higher score can be given to the untriggered controls close to the center of the interface, so that when selecting untriggered controls based on the first score, untriggered controls close to the center of the interface can be preferentially selected, thereby improving the rationality and accuracy of the selected untriggered controls.
[0192] In another embodiment, only based on the size of multiple untriggered controls, one of the multiple untriggered controls is selected for triggering to perform scene jump and test. Specifically, each untriggered control is scored according to the size of the area of the untriggered control to obtain a second score for each untriggered control. Then, based on the second score, the untriggered control with the highest second score is selected for triggering; or, based on the second score, one of the untriggered controls whose second score is higher than a preset threshold is randomly selected for triggering. Among them, scoring each untriggered control according to the size of the area to obtain the second score includes but is not limited to the following two methods:
[0193] Method 1: Determine the second score of each untriggered control by table lookup. The specific implementation process of this method is similar to the specific implementation process of determining the first score of each untriggered control by table lookup in the above-mentioned method of selecting one of multiple untriggered controls to trigger only based on the position of the untriggered control. The difference is that in this method 1, the untriggered controls are sorted in descending order according to the size of the area. In the sorting, the untriggered controls with larger areas are ranked at the front. The larger the area of the untriggered control, the higher the ranking of the untriggered control and the higher the second score. In the above-mentioned method 1, the untriggered controls are sorted in ascending order according to the size of the distance. In the sorting, the untriggered controls with smaller distances are ranked at the front. The distance between the untriggered control and the center of the scene interface is smaller, the higher the ranking of the untriggered control and the higher the first score. To save space, it will not be repeated.
[0194] Method 2: Determine the second score of each untriggered control by function calculation. The specific implementation process of this method is similar to the specific implementation process of determining the first score of each untriggered control by function calculation in the above-mentioned method of selecting one of multiple untriggered controls for triggering only according to the position of the untriggered control. The difference is that the preset function in this method 2 is a direct proportional function, and the second score will increase with the increase of area, while the preset function in the above-mentioned method 2 is an inverse proportional function, and the first score will decrease with the increase of distance. To save space, it will not be repeated.
[0195] This embodiment can conveniently use the area of each untriggered control to determine the second score of each untriggered control. The larger the area of the untriggered control, the more important the untriggered control is and the higher its second score is. A higher score can be given to untriggered controls with larger areas. When selecting untriggered controls based on the second score, untriggered controls with larger areas can be selected first, thereby improving the rationality and accuracy of the selected untriggered controls.
[0196] In another embodiment, in combination with the positions and sizes of the multiple untriggered controls, one of the multiple untriggered controls is selected for triggering to perform scene jump and testing. Specifically, the process of selecting the untriggered control in combination with the positions and sizes of the multiple untriggered controls may include but is not limited to the following steps:
[0197] Determining a first score for the plurality of untriggered controls based on the positions of the plurality of untriggered controls;
[0198] determining a second score of the plurality of untriggered controls based on the sizes of the plurality of untriggered controls;
[0199] determining a weighted sum of first scores and second scores for a plurality of untriggered controls;
[0200] Based on the weighted sum of multiple untriggered controls, a selected untriggered control is determined to be triggered among the multiple untriggered controls to perform scene jump and testing.
[0201] In the specific implementation of this embodiment, the specific implementation process of determining the first score of the untriggered control based on the position of the untriggered control is similar to the specific process of determining the first score when one is selected from multiple untriggered controls for triggering only based on the position of the untriggered control. The specific implementation process of determining the second score of the untriggered control based on the size of the untriggered control is similar to the specific process of determining the second score when one is selected from multiple untriggered controls for triggering only based on the size of the untriggered control. To save space, it will not be repeated.
[0202] Further, after determining the first score and the second score of the untriggered control, first determine the position weight and size weight of the untriggered control, the position weight is used to indicate the importance of the position of the untriggered control in the selection of the untriggered control, and the size weight is used to indicate the importance of the size of the untriggered control in the selection of the untriggered control. Then, for each untriggered control, multiply the position weight and the first score to obtain a weighted first score, and multiply the size weight and the second score to obtain a weighted second score. Finally, add the weighted first score and the weighted second score to obtain the weighted sum of the first score and the second score of each untriggered control. Finally, based on the weighted sum of each untriggered control, select the untriggered control with the highest weighted sum to trigger; or, based on the weighted sum, randomly select one of the untriggered controls whose weighted sum is higher than a preset threshold to trigger.
[0203] Through the above steps 510-530, the embodiment of the present disclosure selects untriggered controls for triggering based on the position and size of the untriggered controls, which can increase the probability of untriggered controls with higher importance being triggered, thereby increasing the possibility of exploring previously unexplored scenarios, thereby testing more scenarios within a limited test time and improving test coverage. Compared with selecting untriggered controls for triggering based solely on the position of untriggered controls and selecting untriggered controls for triggering based solely on the size of untriggered controls, this method can further improve the rationality and accuracy of selecting untriggered controls.
[0204] Since the scenes to be examined are the application screens with different rendering content and functions in the application, when the difference between two application screens is large, the two application screens can be considered to be different scenes. Based on this, the embodiment of the present disclosure provides a solution for judging whether the triggered and untriggered controls have performed scene jumps based on the difference between the controls in each scene, which can improve the accuracy of judging scene jumps.
[0205] like Figure 6 As shown, in some embodiments, an untriggered control is triggered in a scene to be examined in an application, and a process of jumping to the next scene includes but is not limited to the following steps 610 to 630.
[0206] Step 610, obtaining the first interface before triggering the untriggered control;
[0207] Step 620, obtaining the second interface after the control is triggered and not triggered;
[0208] Step 630: Compare the controls in the first interface with the controls in the second interface. If they are completely consistent, continue to trigger an untriggered control in the scene to be examined until the controls in the first interface are not completely consistent with the controls in the second interface.
[0209] Steps 610-630 are described in detail below.
[0210] In step 610, since each scene has a corresponding scene identifier, first, according to the scene identifier of the scene before the untriggered control is triggered, the first interface before the untriggered control is triggered is obtained according to the scene identifier. Then, the scene storage information body corresponding to the first interface is obtained, wherein the scene storage information body includes the control identifiers of each control on the first interface.
[0211] In step 620, first, the second interface after the untriggered control is triggered can be obtained according to the scene identifier of the scene after the untriggered control is triggered. Then, the scene storage information body corresponding to the second interface is obtained, wherein the scene storage information body includes the control identifiers of each control on the second interface.
[0212] In step 630, the control identifiers of each control in the first interface are compared with the control identifiers of each control in the second interface. If the control identifiers of each control in the first interface are exactly the same as the control identifiers of each control in the second interface, it is considered that the first interface and the second interface are application interfaces corresponding to the same scene, and no scene jump occurs after the untriggered control is triggered. Therefore, it is necessary to continue to trigger another untriggered control in the scene to be examined, and use the same method to determine whether the first interface and the second interface before triggering the untriggered control are the same scene. If the first interface and the second interface before triggering the untriggered control are the same scene, continue to trigger the next untriggered control in the scene to be examined, and repeat this process until the control identifiers of each control in the first interface are not exactly the same as the control identifiers of each control in the second interface. At this time, the first interface and the second interface are not application interfaces corresponding to the same scene, and a scene jump occurs after triggering the untriggered control.
[0213] Through the above steps 610-630, the embodiment of the present disclosure can determine whether the triggered and untriggered controls have performed a scene jump according to the differences in the controls in each scene, thereby achieving a quick judgment of the scene jump and improving the accuracy of the judgment of the scene jump.
[0214] After an untriggered control is triggered in the scene to be examined, the number of control triggers of the untriggered control will change. If the scene storage information body is not updated, the information of the scene storage information body will be inaccurate, which will affect the accuracy of the application test based on the scene storage information body. Based on this, the embodiment of the present disclosure provides a solution for updating the scene storage information body based on real-time counting, which can improve the timeliness of the information update of the scene storage information body, and further improve the accuracy of the information of the scene storage information body.
[0215] Combine the following Figure 7 The process of updating the scene storage information body after triggering an untriggered control in the scene to be examined is described in detail.
[0216] In some embodiments, the process of updating the scene storage information body may include but is not limited to the following steps 710 to 720.
[0217] Step 710: searching for a scene storage information body containing the scene identifier according to the scene identifier of the scene to be examined;
[0218] Step 720: Increase the number of control triggering times corresponding to the control identifier in the scene storage information body by 1.
[0219] Steps 710 - 720 are described in detail below.
[0220] In step 710, the specific implementation process of searching for a scene storage information body containing the scene identifier according to the scene identifier of the scene to be examined is similar to the specific implementation process of the above step 410. To save space, it will not be repeated.
[0221] For example, the scene identifier of the scene to be examined is Xxxx11. According to the scene identifier "Xxxx11", the scene storage information body of the scene to be examined with the scene identifier Xxxx11 is found. In the scene storage information body, the scene identifier "Xxxx11" of the scene is expressed as "scene wuid: Xxxx11". The scene storage information body also includes a list "nodes" for recording the operation information of each control of the scene. The list includes the following specific information: "node_uuid:Y1,times:6", "next_scene.uuid:aa1,next times:2", "next_scene.uuid:bb12,next times:4"; "node_uuid:Y33,times:2", "next_scene.uuid:m1,next times:2". It can be seen that in the scene storage information body, the number of operations of the control with the control identifier Y1 is recorded as 6, and the number of operations of the control with the control identifier Y33 is recorded as 2. Among them, the number of times the control with trigger control identification Y1 reaches the scene with scene identification aa1 is 2, the number of times the control with trigger control identification Y1 reaches the scene with scene identification bb12 is 4, and the number of times the control with trigger control identification Y33 reaches the scene with scene identification m1 is 2.
[0222] In step 720, the control identifiers and control triggering times of all untriggered controls in the scene to be examined are recorded in the scene storage information body of the scene to be examined. Specifically, in the scene storage information body, before each untriggered control is triggered, the control triggering times of the untriggered control is 0. When an untriggered control is triggered in the scene to be examined, the control triggering times of the triggered untriggered control is increased by 1 according to the control identifier of the triggered untriggered control in the scene storage information body. At this time, the control triggering times of the triggered untriggered control is 1.
[0223] For example, when a control with control identification Y1 is triggered in the scene to be examined with scene identification Xxxx11, the control triggering times of this control are increased by 1 according to the control identification Y1 of the control. At this time, the control triggering times of the control with control identification Y1 is 7, and the "node_uuid:Y1,times:6" recorded in the list in the scene storage information body is updated to "node_uuid:Y1,times:7". Furthermore, since the control with control identification Y1 is triggered to jump to the scene with scene identification aa1, the arrival times of the scene with scene identification aa1 are increased by 1. At this time, the arrival times of the scene with scene identification aa1 is 3, and the "next_scene.uuid:aa1,next times:2" in the list in the scene storage information body is updated to "next_scene.uuid:aa1,next times:3".
[0224] Through the above steps 710-720, after triggering an untriggered control in the scene to be examined, the embodiment of the present disclosure can promptly add 1 to the control triggering count corresponding to the control identifier in the scene storage information body, thereby realizing real-time updating of the scene storage information body and improving the information accuracy of the scene storage information body.
[0225] After triggering an untriggered control in the scene to be examined, if the relevant information of the next scene to be jumped to is not recorded in the scene storage information body in time, the information of the scene storage information body will be inaccurate, which will affect the accuracy of the application test based on the scene storage information body. Based on this, the embodiment of the present disclosure provides a solution for updating the scene storage information body based on scene identification comparison, which can record the relevant information of the next scene to be jumped to in the scene storage information body in time, improve the information accuracy of the scene storage information body, and further improve the accuracy of the application test based on the scene storage information body.
[0226] Combine the following Figure 8 The process of updating the scene storage information body after triggering an untriggered control in the scene to be examined is described in detail.
[0227] In some embodiments, the process of updating the scene storage information body may include but is not limited to the following steps 810 to 830.
[0228] Step 810: Compare the scene identifier of the next scene with each candidate next scene identifier;
[0229] Step 820: If the scene identifier of the next scene is consistent with a candidate next scene identifier, the arrival count corresponding to the candidate next scene identifier is increased by 1;
[0230] Step 830: If the scene identifier of the next scene is inconsistent with any of the candidate next scene identifiers, the scene identifier of the next scene is added to the scene storage information body as a candidate next scene identifier, and the arrival count corresponding to the added candidate next scene identifier is set to 1.
[0231] Steps 810-830 are described in detail below.
[0232] In step 810, the next scene is a scene to which an untriggered control is jumped in the scene to be examined. The candidate next scene identifier is the scene identifier of each scene recorded in the scene storage information body.
[0233] Specifically, after the scene to be examined triggers an untriggered control to jump to the next scene, first, obtain the scene identifier of the next scene. Then, compare the scene identifier of the next scene with the identifiers of each candidate next scene. If the next scene is a scene that has already appeared, the scene identifier of the next scene will be recorded in the scene storage information body, and the scene identifier of the next scene will be consistent with the identifier of a candidate next scene in the scene storage information body. If the next scene is a new scene that has not appeared, the scene identifier of the next scene is not recorded in the scene storage information body, and the scene identifier of the next scene will be inconsistent with the identifiers of all candidate next scenes in the scene storage information body.
[0234] In step 820, if the scene identifier of the next scene is consistent with a candidate next scene identifier, it means that the next scene is a scene that has already appeared, and the scene identifier of the next scene has been recorded in the scene storage information body. Therefore, the number of arrivals corresponding to the candidate next scene identifier can be directly increased by 1 to determine that if the above-mentioned untriggered control is triggered once, it will jump to the candidate next scene.
[0235] For example, when a control with control identification Y33 is triggered in the scene to be examined with scene identification Xxxx11, the number of control triggering of this control is increased by 1 according to the control identification Y33. At this time, the number of control triggering of the control with control identification YY3 is 3, and the "node_uuid:YY1,times:2" recorded in the list in the scene storage information body is updated to "node_uuid:YY3,times:3".
[0236] Furthermore, since the trigger control identified as Y33 jumps to the next scene identified as m1, at this time, the scene identifier of the next scene is consistent with a candidate next scene identifier, so the arrival count of the scene identified as m1 is increased by 1. At this time, the arrival count of the scene identified as m1 is 3, and the "next_scene.uuid:m1,next times:2" recorded in the list in the scene storage information body is updated to "next_scene.uuid:m1,next times:3".
[0237] In step 830, if the scene identifier of the next scene is inconsistent with each candidate next scene identifier, it means that the next scene is a new scene that has not appeared before, and the scene identifier of the next scene is not recorded in the scene storage information body. Therefore, the next scene is used as a newly added scene in the scene storage information body, and the scene identifier of the next scene is used as a newly added candidate next scene identifier, and this newly added candidate next scene identifier is added to the scene storage information body. Furthermore, the arrival count corresponding to the added candidate next scene identifier is set to 1 to determine that if the above-mentioned untriggered control is triggered once, it will jump to the candidate next scene.
[0238] For example, when a control with a control identifier of Y33 is triggered in the scene to be examined with a scene identifier of Xxxx11, the control trigger count of this control is increased by 1 according to the control identifier of the control Y33. At this time, the control trigger count of the control with a control identifier of Y,3 is 3, and the "node_uuid:YY1,times:2" recorded in the list in the scene storage information body is updated to "node_uuid:YY3,times:3". Furthermore, since the control with the control identifier of Y33 is triggered to jump to the next scene with a scene identifier of pp12. At this time, the scene identifier of the next scene is inconsistent with each candidate next scene identifier, therefore, the scene identifier pp12 of the next scene is added to the scene storage information body as a candidate next scene identifier, and the arrival count corresponding to the added candidate next scene identifier pp12 is set to 1. At this time, the arrival count of the scene with the scene identifier pp12 is 1, and a new record "next_scene.uuid:pp12,next times:1" is added to the list in the scene storage information body.
[0239] Through the above steps 810-830, after triggering an untriggered control in the scene to be examined, the embodiment of the present disclosure can promptly record the scene identifier and arrival count of the next scene to be jumped to into the scene storage information body, which is conducive to timely recording the scene identifier and arrival count of the newly appeared scene, realizing real-time updating of the scene storage information body, improving the information accuracy of the scene storage information body, and further improving the accuracy of application testing based on the scene storage information body.
[0240] Detailed description of step 320
[0241] In step 320, a jump relationship graph is generated based on the jump relationship between multiple scenes in the continuous jump scene sequence.
[0242] In the specific implementation of this embodiment, firstly, the nodes of the jump relationship graph are determined according to the multiple scenes in the continuous jump scene sequence. Then, the edges between the nodes are constructed according to the jump relationship between the multiple scenes. Finally, the jump relationship graph can be obtained more conveniently according to each node and the edge connecting each two nodes.
[0243] Combine the following Fig. 9 , Fig.10 A process of generating a jump relationship graph based on jump relationships between multiple scenes in a continuous jump scene sequence is described in detail.
[0244] In some embodiments, the process of generating a jump relationship graph may include but is not limited to the following steps 910 to 960 .
[0245] Step 910: Use a scene in the continuous jump scene sequence as a node in the jump relationship graph;
[0246] Step 920: If a jump occurs between two scenes in the continuous jump scene sequence, add an edge between the nodes corresponding to the scenes;
[0247] Step 930: search for the scene storage information body of the scene identifier of the scene before the jump;
[0248] Step 940: Search the scene storage information body for the arrival number corresponding to the scene after the jump, which is identified by the control;
[0249] Step 950: Search the control triggering times of the control identifier in the scene storage information body;
[0250] Step 960: Determine the edge weight of the edge based on the found number of arrivals and the found number of control triggers.
[0251] Steps 910-960 are described in detail below.
[0252] In step 910, when determining the nodes of the jump relationship graph, all scenes in the continuous jump scene sequence may be used as nodes in the jump relationship graph; or some scenes in the continuous jump scene sequence may be selected as nodes in the jump relationship graph.
[0253] In step 920, the scene before the jump in the continuous jump scene sequence is used as the pre-jump scene, and the scene reached after the jump of the pre-jump scene in the continuous jump scene sequence is used as the post-jump scene. Specifically, in the continuous jump scene sequence, a jump occurs between the pre-jump scene and the post-jump scene, and an edge is added between the node corresponding to the pre-jump scene and the node corresponding to the post-jump scene. The edge is a directed line segment from the node corresponding to the pre-jump scene to the node corresponding to the post-jump scene.
[0254] In step 930, since the scene storage information body of the scene is often stored in a preset database, when searching for the scene storage information body of the scene identifier of the scene before the jump, the application test platform server first sends a data access request to the preset database, and after the database responds and agrees to the data access request, the application test platform server can search for the scene storage information body of the scene before the jump in the preset database according to the scene identifier of the scene before the jump.
[0255] In step 940, since the scene storage information body includes the control identifier in the scene, the control triggering times, the candidate next scene identifier to which each control jumps after being triggered, and the arrival times corresponding to the candidate next scene identifier, the candidate next scene identifier to which each control jumps after being triggered and the scene identifier of the scene after the jump can be compared, and the arrival times corresponding to the candidate next scene whose candidate next scene identifier is consistent with the scene identifier of the scene after the jump are selected as the arrival times of the scene after the jump.
[0256] In step 950, first, the control that enables the scene before the jump to the scene after the jump can be determined according to each control identifier in the scene storage information body and the candidate next scene identifier to which each control jumps after being triggered. Then, the control triggering number of the control is found according to the control identifier of the control, and the control triggering number of the control is used as the found control triggering number.
[0257] In step 960, the edge weight is used to represent the probability that the control can reach the post-jump scene when the pre-jump scene triggers it. Specifically, for each edge, the number of arrivals found is divided by the number of control triggers found, and the division result is used as the edge weight of the edge.
[0258] like Fig.10As shown, first, according to the scenes included in the continuous jump scene sequence, it is determined that the jump relationship graph includes eight nodes, namely scene A, scene B, scene C, scene D, scene E, scene F, scene G, and scene H. Next, for scene A, scene A includes controls A1 and A2. When control A1 is triggered, it jumps to scene C, and when control A2 is triggered, it jumps to scene B. Based on this, an edge is added between the node corresponding to scene A and the node corresponding to scene B, and an edge is also added between the node corresponding to scene A and the node corresponding to scene C. Further, according to the number of control triggers of control A1 and the number of times control A1 is triggered to reach scene B, the edge weight of the edge between scene A and scene B is calculated to be 0.5; according to the number of control triggers of control A2 and the number of times control A2 is triggered to reach scene C, the edge weight of the edge between scene A and scene C is calculated to be 1. Next, for scene B, scene B contains control B1 and control B2. When control B1 is triggered, it jumps to scene F, and when control B2 is triggered, it jumps to scene D. Based on this, an edge is added between the node corresponding to scene B and the node corresponding to scene F, and an edge is also added between the node corresponding to scene B and the node corresponding to scene D. Further, according to the number of control triggers of control B1 and the number of times control B1 is triggered to reach scene F, the edge weight of the edge between scene B and scene F is calculated to be 0.5; according to the number of control triggers of control B2 and the number of times control B2 is triggered to reach scene D, the edge weight of the edge between scene B and scene D is calculated to be 1. And so on, for each scene, the edge and edge weight of the scene to be jumped to are constructed to obtain the final jump relationship graph.
[0259] Through the above steps 910-960, the embodiment of the present disclosure can use the scenes in the continuous jump scene sequence as nodes, connect the nodes corresponding to the scenes where the jump occurs to form edges, and construct the edge weight of each edge through the control triggering times of each control recorded in the scene storage information body and the arrival times corresponding to the jump scene, and obtain a jump relationship graph composed of nodes, edges and edge weights, so that each scene and the jump relationship between scenes can be intuitively presented in a graphical manner, which can provide a basis for the subsequent determination of the end scene and the first path, and can improve the selection accuracy and selection efficiency of the end scene and the first path, which is conducive to exploring more unexamined scenes based on the selected end scene and first path, thereby improving the coverage and richness of the test scenes.
[0260] Get a detailed description of the ending scene
[0261] Before step 330, a scene in which the number of untriggered controls in the continuous jump scene sequence meets the first condition is obtained as an end scene.
[0262] When this embodiment is implemented, if a scene is randomly selected as the end scene in the connection jump scene sequence, it is often impossible to determine whether the number of untriggered controls in the end scene can meet the demand of covering more scenes. Specifically, when the number of untriggered controls in the scene is small, most of the scenes that the controls that trigger the scene can jump to are known scenes. If the untriggered controls of the scene are triggered, the number of unexamined scenes that can be jumped to will be relatively limited. Based on this, the embodiment of the present disclosure provides a solution for selecting an end scene based on conditional judgment, which can explore more unexamined scenes and improve the coverage of test scenarios.
[0263] Combine the following Fig.11 Describe in detail the process of determining the ending scene.
[0264] In some embodiments, the process of determining the ending scene may include but is not limited to the following steps 1110 to 1130 .
[0265] Step 1110: From the continuous jump scene sequence, select a scene that can be reached by the starting scene after one or more continuous jumps as the target scene sequence;
[0266] Step 1120: sort the scenes in the target scene sequence in descending order according to the number of untriggered controls;
[0267] Step 1130: randomly select one of the scenes with a predetermined ranking in the sorting as the ending scene.
[0268] Steps 1110 - 1130 are described in detail below.
[0269] In step 1110, because the jump relation that jump has occurred between two scenes is recorded in the continuous jump scene sequence.Therefore, from the continuous jump scene sequence, when selecting the scene that the starting scene can reach after one or more continuous jumps, according to the jump relation between the two scenes, first select the scene that the starting scene can reach after one jump as the first target scene.Then, select the scene that the first target scene can reach after one jump as the second target scene, wherein, the second target scene is the scene that the starting scene can reach after two jumps.Then, select the scene that the second target scene can reach after one jump as the third target scene, wherein, the third target scene is the scene that the starting scene can reach after three jumps.By analogy, finally determine that the starting scene in the continuous jump scene sequence can reach all scenes after one or more continuous jumps.Further, all scenes that the starting scene in the continuous jump scene sequence can reach after one or more continuous jumps are sorted to obtain the target scene sequence.
[0270] like Fig.10As shown, it is a jump relationship diagram determined based on the continuous jump scene sequence. If the starting scene is scene A, according to the jump relationship diagram corresponding to the continuous jump scene sequence, the scenes that scene A can reach after one or more continuous jumps include scene B, scene C, scene D, scene E, scene F, scene G, and scene H. At this time, the target scene sequence is [scene B, scene C, scene D, scene E, scene F, scene G, scene H]. If the starting scene is scene E, according to the jump relationship diagram corresponding to the continuous jump scene sequence, the scenes that scene E can reach after one or more continuous jumps include scene H. At this time, the target scene sequence is [scene H].
[0271] In some embodiments, when a scene in which the number of untriggered controls in the target scene sequence meets the first condition is obtained as the end scene, the first condition includes but is not limited to the following two situations:
[0272] Scenario 1: The first condition is to use the scene with the largest number of untriggered controls in the target scene sequence as the end scene;
[0273] Case 2: The first condition is to select scenes in the target scene sequence whose number of untriggered controls is greater than a preset threshold as candidate scenes, and randomly select one of the candidate scenes as the end scene.
[0274] Since the scene with the largest number of untriggered controls in the target scene sequence is directly selected as the end scene, the selection of the end scene is often limited. In addition, when the end scene is selected by threshold comparison, the accuracy of the selection of the end scene is often limited by the value of the preset threshold. Based on this, the embodiment of the present disclosure provides a solution for selecting the end scene by combining sorting and random methods, which can flexibly select the scene with a large number of untriggered controls as the end scene, thereby improving the coverage and richness of the test scenarios.
[0275] In other embodiments, the process of determining the ending scene includes but is not limited to steps 1120 to 1130 described above.
[0276] In step 1120, for each scene in the target scene sequence, the scenes in the target scene sequence are sorted in descending order according to the number of untriggered controls. In the sorting, scenes with more untriggered controls are ranked at the front, and scenes with fewer untriggered controls are ranked at the back.
[0277] In step 1130, the predetermined ranking is set according to actual needs and is not limited. Since the number of untriggered controls in the scenes with the first predetermined ranking in the sorting is large, triggering the untriggered controls in these scenes can jump to more unexamined scenes. Therefore, one of the scenes with the first predetermined ranking in the sorting can be randomly selected as the ending scene. For example, the predetermined ranking is set to 3, and the scenes in the top 3 in the sorting are selected, and one of these 3 scenes is randomly selected as the ending scene.
[0278] Through the above steps 1110-1130, the disclosed embodiment sorts the scenes according to the number of untriggered controls, and randomly selects one of the scenes with a large number of untriggered controls as the end scene. The scene with a large number of untriggered controls can be selected as the end scene, achieving the purpose of selecting a scene with greater exploration potential as the end scene, so that starting from the end scene, more unexamined scenes can be explored, thereby improving the coverage and richness of the test scenes. In addition, the disclosed embodiment adopts the method of randomly selecting one of the scenes with a large number of untriggered controls as the end scene, which has greater flexibility than directly using the scene with the largest number of untriggered controls as the end scene.
[0279] Detailed description of step 330
[0280] In step 330, in the jump relationship graph, a first path from the start scene to the end scene is obtained.
[0281] When this embodiment is specifically implemented, since the jump relationship graph is a directed graph, in the jump relationship graph, according to the node corresponding to the starting scene, the node corresponding to the ending scene, and the directed edge between the two scene nodes, it is relatively convenient to determine multiple directed line segments from the node corresponding to the starting scene to the node corresponding to the ending scene. Therefore, each directed line segment can be used as a candidate path from the starting scene to the ending scene. Then, the multiple candidate paths from the starting scene to the ending scene are screened to obtain the first path from the starting scene to the ending scene.
[0282] Combine the following Fig.12 , Fig.13A -C describes in detail the process of selecting the first path from the starting scene to the ending scene.
[0283] In some embodiments, the process of selecting the first path from the starting scene to the ending scene in the jump relationship graph may include but is not limited to the following steps 1210 to 1220.
[0284] Step 1210: determine multiple candidate paths from the starting scene to the ending scene in the jump relationship graph;
[0285] Step 1220: Select a first path from multiple candidate paths based on the edge weights of the edges on the candidate paths.
[0286] Steps 1210 - 1220 are described in detail below.
[0287] In step 1210, since the jump relationship graph includes nodes corresponding to each scene and directed edges formed by jumps between scenes, the node corresponding to the starting scene and the node corresponding to the ending scene can be first determined in the jump relationship graph. Then, based on the directed edges between the node corresponding to the starting scene and the node corresponding to the ending scene, multiple candidate paths from the starting scene to the ending scene are determined.
[0288] like Fig.13A As shown, in a candidate path, the starting scene is scene A, the ending scene is scene H, and the candidate path contains scene A, scene C, scene E, and scene H. Among them, the edge weight between scene A and scene C is 1, the edge weight between scene C and scene E is 0.5, and the edge weight between scene E and scene H is 0.25.
[0289] like Fig. 13B As shown, in a candidate path, the starting scene is scene A, the ending scene is scene H, and the candidate path includes scene A, scene C, scene F, and scene H. Among them, the edge weight between scene A and scene C is 1, the edge weight between scene C and scene F is 0.75, and the edge weight between scene F and scene H is 0.75.
[0290] like Fig. 13C As shown, in a candidate path, the starting scene is scene A, the ending scene is scene H, and the candidate path includes scene A, scene B, scene D, scene G, and scene H. Among them, the edge weight between scene A and scene B is 0.5, the edge weight between scene B and scene D is 1, the edge weight between scene D and scene G is 0.75, and the edge weight between scene G and scene H is 1.
[0291] In step 1220, based on the edge weights of the edges on the candidate paths, one of the multiple candidate paths may be randomly selected as the first path, or a candidate path with a higher edge weight may be selected as the first path, or the first path may be selected from the multiple candidate paths based on other selection methods without limitation.
[0292] Through the above steps 1210-1220, the embodiment of the present disclosure can determine multiple candidate paths from the starting scene to the ending scene according to the directed edges between the starting scene and the ending scene, and then select a suitable candidate path as the first path according to the edge weights of the edges on each candidate path, which can improve the selection efficiency and accuracy of the first path.
[0293] Since randomly selecting one of multiple candidate paths as the first path often makes the selected first path have a large degree of randomness, the selected first path may not be the best, which will result in relatively few explored scenarios, which is not conducive to improving the coverage of test scenarios. Based on this, the embodiment of the present disclosure provides a solution for selecting the first path based on the size of the edge weights of each edge on the candidate path, which can select a better candidate path as the first path, improve the rationality of the selection of the first path, and explore as many scenarios as possible based on the first path, thereby improving the coverage of the test scenario.
[0294] Combine the following Fig.14 , Fig.15 The process of selecting the first path based on the edge weights of each edge on the candidate path is described in detail.
[0295] In some embodiments, the process of selecting the first path based on the edge weights of the edges on the candidate paths may include but is not limited to the following steps 1410 to 1420 .
[0296] Step 1410: Determine the path weight of the candidate path based on the edge weight of each edge on the candidate path;
[0297] Step 1420: Select a first path from the multiple candidate paths based on the path weights of the multiple candidate paths.
[0298] Steps 1410-1420 are described in detail below.
[0299] In step 1410, for each candidate path, the edge weights of the edges on the candidate path are multiplied to obtain the path weight of the candidate path.
[0300] In step 1420, since a larger path weight indicates that it is easier to explore more scenarios by exploring the candidate path, the candidate path with the largest path weight may be selected as the first path.
[0301] like Fig.15As shown, the edge weights of each edge of the candidate path [scene A→scene C→scene E→scene H] are cumulatively multiplied, and the path weight is 1×0.5×0.25=0.125. The edge weights of each edge of the candidate path [scene A→scene C→scene F→scene H] are cumulatively multiplied, and the path weight is 1×0.75×0.75=0.5625. The edge weights of each edge of the candidate path [scene A→scene B→scene F→scene H] are cumulatively multiplied, and the path weight is 0.5×0.5×0.75=0.1875. The edge weights of each edge of the candidate path [scene A→scene B→scene D→scene G→scene H] are cumulatively multiplied, and the path weight is 0.5×1×0.75×1=0.375. The edge weights of each edge of the candidate path [scene A→scene B→scene F→scene D→scene G→scene H] are multiplied to obtain a path weight of 0.5×0.5×1×0.75×1=0.1875. Further, by comparing the path weights of each candidate path, the largest path weight is 0.5625, so the candidate path [scene A→scene C→scene F→scene H] is selected as the first path.
[0302] Through the above steps 1410-1420, the embodiment of the present disclosure obtains the path weight of each candidate path through the edge weights of each edge of each candidate path, and then selects a candidate path as the first path according to the size of the path weight. A better candidate path can be selected as the first path, which improves the rationality of the selection of the first path, so that as many scenarios as possible can be explored based on the first path, thereby improving the coverage of the test scenarios.
[0303] Since directly selecting the candidate path with the largest path weight as the first path often makes the selection of the first path more absolute, this method may cause other candidate paths that may explore more scenarios to be discarded. Based on this, the embodiment of the present disclosure also provides a solution for selecting the first path based on threshold comparison, which can improve the rationality and accuracy of the selection of the first path.
[0304] like Fig.16 As shown, in some embodiments, the process of selecting the first path based on the edge weights of the edges on the candidate paths may include but is not limited to the following steps 1610 to 1630.
[0305] Step 1610: Determine the path weight of the candidate path based on the edge weight of each edge on the candidate path;
[0306] Step 1620: Determine a candidate path with a path weight greater than a first threshold from among the multiple candidate paths as the target candidate path;
[0307] Step 1630: randomly select one of the target candidate paths as the first path.
[0308] Steps 1610-1630 are described in detail below.
[0309] In step 1610, the specific implementation process of determining the path weight of the candidate path is similar to step 1410, and will not be repeated here for the sake of space saving.
[0310] In step 1620, since the larger the path weight of the candidate path is, the more suitable the candidate path is for the scenario test, the path weight of each candidate path is compared with the first threshold, and the candidate path with a path weight greater than the first threshold is selected, and the candidate path with a path weight greater than the first threshold is used as the target candidate path. Among them, the target candidate path is a path that is more suitable for scenario testing, and the first threshold can be set according to actual needs without limitation.
[0311] In step 1630, since the target candidate paths are all paths that are relatively suitable for scenario testing, one of the target candidate paths can be randomly selected as the first path.
[0312] like Fig.15 As shown, first, the first threshold is set to 0.2, and the path weights of each candidate path are compared with the first threshold, and the candidate path [scene A→scene B→scene D→scene G→scene H] and the candidate path [scene A→scene C→scene F→scene H] are taken as the target candidate paths. Then, one of the candidate paths [scene A→scene B→scene D→scene G→scene H] and the candidate path [scene A→scene C→scene F→scene H] is randomly selected as the first path.
[0313] Through the above steps 1610-1620, the embodiment of the present disclosure selects candidate paths with path weights greater than the first threshold as target candidate paths, thereby achieving preliminary screening of candidate paths. Then, one is randomly selected from the target candidate paths as the first path, and the first path is flexibly selected from the candidate paths with higher path weights, thereby improving the rationality and accuracy of the selection of the first path, so that as many scenarios as possible can be explored based on the first path, thereby improving the coverage of the test scenarios.
[0314] Since selecting the first path based on the path weight of each candidate path as a single indicator will result in a problem of low selection accuracy, the total number of untriggered controls in each scenario will also affect the coverage of the test scenario. Based on this, the disclosed embodiment provides a solution for selecting the first path based on the total number of untriggered controls and path weight of each scenario on the candidate path, which can select the first path in combination with the path weight and the total number of untriggered controls of the candidate path, further improving the rationality and accuracy of the selection of the first path, and thus improving the coverage of the test scenario when performing scenario testing based on the first path.
[0315] like Fig.17 As shown, in some embodiments, the process of selecting the first path based on the edge weights of each edge on the candidate path may include but is not limited to the following steps 1710 to 1730.
[0316] Step 1710: Determine the path weight of the candidate path based on the edge weight of each edge on the candidate path;
[0317] Step 1720: Obtain the total number of untriggered controls of each scene on the candidate path;
[0318] Step 1730: Select a first path from the multiple candidate paths based on the path weights of the multiple candidate paths and the total number of untriggered controls.
[0319] Steps 1710-1730 are described in detail below.
[0320] In step 1710, the specific implementation process of determining the path weight of the candidate path is similar to step 1410, and will not be repeated here for the sake of space saving.
[0321] In step 1720, for each candidate path, the scene storage information body of each scene in the candidate path is first obtained. Then, according to the scene storage information body, the total number of control identifiers with a control triggering count of 0 is counted, and the total number is used as the total number of untriggered controls in the candidate path.
[0322] In step 1730, when selecting the first path based on the path weights of multiple candidate paths and the total number of untriggered controls, the first path can be selected from the multiple candidate paths based only on the total number of untriggered controls, or the first path can be selected from the multiple candidate paths based on a combination of the path weights and the total number of untriggered controls, without restriction.
[0323] In one embodiment, the first path may be selected from multiple candidate paths based only on the total number of untriggered controls. Specifically, based on the total number of untriggered controls in each candidate path, the candidate path with the largest number of untriggered controls is selected as the first path. Alternatively, one of the candidate paths with a total number of untriggered controls greater than a preset threshold is randomly selected as the first path.
[0324] like Fig.15 As shown, the total number of untriggered controls in the candidate path [scene A→scene C→scene E→scene H] is 6. The total number of untriggered controls in the candidate path [scene A→scene C→scene F→scene H] is 5. The total number of untriggered controls in the candidate path [scene A→scene B→scene F→scene H] is 2. The total number of untriggered controls in the candidate path [scene A→scene B→scene D→scene G→scene H] is 3. The total number of untriggered controls in the candidate path [scene A→scene B→scene F→scene D→scene G→scene H] is 7. Further, the candidate path with the largest number of untriggered controls is selected as the first path. Since 2<3<5<6<7, the first path selected is [scene A→scene B→scene F→scene D→scene G→scene H].
[0325] In another embodiment, the process of selecting a first path from a plurality of candidate paths by combining the path weight and the total number of untriggered controls includes but is not limited to the following steps.
[0326] Determining a first sub-score of the candidate path based on the path weight of the candidate path;
[0327] Determining a second sub-score of the candidate path based on the total number of untriggered controls of the candidate path;
[0328] determining a score for the candidate path based on the first sub-score and the second sub-score of the candidate path;
[0329] A first path is selected among the plurality of candidate paths based on the scores of the candidate paths.
[0330] In the specific implementation of this embodiment, the specific implementation process of determining the first sub-score of the candidate path based on the path weight of the candidate path is similar to the specific implementation process of determining the second scores of multiple untriggered controls based on the size of multiple untriggered controls in the above step 530. The specific implementation process of determining the second sub-score of the candidate path based on the total number of untriggered controls in the candidate path is similar to the specific implementation process of determining the second scores of multiple untriggered controls based on the size of multiple untriggered controls in the above step 530. The specific implementation process of determining the score of the candidate path based on the first sub-score and the second sub-score of the candidate path is similar to the specific implementation process of determining the weighted sum of the first score and the second score of multiple untriggered controls in the above step 630. The specific implementation process of selecting the first path from multiple candidate paths based on the score of the candidate path is similar to the specific implementation process of determining the selected untriggered control to be triggered from multiple untriggered controls based on the weighted sum of multiple untriggered controls in the above step 630 to perform scene jump and test. To save space, it will not be repeated.
[0331] Through the above steps 1710-1730, the embodiment of the present disclosure can select the first path in combination with the path weight of the candidate path and the total number of untriggered controls. Compared with selecting the first path based on the path weight alone or selecting the first path based on the total number of untriggered controls alone, the rationality and accuracy of the selection of the first path are improved, thereby improving the coverage of the test scenario when performing scenario testing based on the first path.
[0332] Since the calculation amount of calculating the path weight of the candidate path by the cumulative multiplication method is large, the efficiency of the application test will be low. Based on this, the embodiment of the present disclosure provides a solution for selecting the first path based on the cumulative method, which can effectively reduce the calculation amount, improve the selection efficiency of the first path, and thus improve the efficiency of the application test.
[0333] like Fig.18 As shown, in some embodiments, the process of selecting the first path based on the accumulation method may include but is not limited to the following steps 1810 to 1830.
[0334] Step 1810: determine the negative logarithm of the edge weight of each edge on the candidate path;
[0335] Step 1820: Set an accumulator for each candidate path, and accumulate the negative logarithm of each edge weight on the candidate path;
[0336] Step 1830: Use the candidate path with the smallest accumulated result of the accumulator as the first path.
[0337] Steps 1810-1830 are described in detail below.
[0338] In step 1810, when determining the negative logarithm of the edge weight of each edge on the candidate path, the edge weight of each edge may be substituted into a preset negative logarithm function to obtain the negative logarithm of the edge weight of each edge. The preset negative logarithm function is expressed as -ln(p), and p is the edge weight of each edge.
[0339] In step 1820, since the edge weight p of each edge on the candidate path is not greater than 1, the negative logarithm of each edge weight -ln(p) is greater than zero. Since the logarithmic function is a monotonically increasing function, the negative logarithmic function -ln(p) is a monotonically decreasing function. Based on this, the disclosed embodiment can more conveniently convert the above-mentioned process of multiplying the edge weights of each edge to determine the candidate path with the largest cumulative result into a process of accumulating the negative logarithms of the edge weights of each edge to determine the candidate path with the smallest cumulative result. Specifically, first, an accumulator is set for each candidate path; then, the accumulator is used to accumulate the negative logarithms of the edge weights on the candidate path to obtain the accumulated result of the candidate path.
[0340] In step 1830, since the smaller the accumulated result is, the shorter the path length of the candidate path is, the fewer the number of jumps required to jump from the starting scene to the ending scene is, and it is easier to jump from the starting scene to the ending scene. Therefore, the candidate path with the smallest accumulated result of the accumulator can be selected as the first path.
[0341] Through the above steps 1810-1830, the embodiment of the present disclosure first determines the negative logarithm of the edge weight of each edge on the candidate path, and then accumulates the negative logarithms of the candidate paths, which can more conveniently obtain the accumulated result, thereby selecting the candidate path with the smallest accumulated result as the first path, which can effectively reduce the amount of calculation, improve the efficiency of selecting the first path, and thus improve the efficiency of application testing.
[0342] Detailed description of step 340
[0343] In step 340, starting from the starting scene, scene jumps are performed and tested according to the first path.
[0344] In the specific implementation of this embodiment, after the first path is determined, the scenes that need to be passed through to jump from the starting scene to the ending scene and the controls to be triggered in each scene are determined. In theory, after triggering the control to be triggered in the starting scene, the scene to be jumped to should be the scene determined in the first path, but there is a certain randomness in the scene jump in the application test, and the scene to be jumped to may also be other scenes. Based on this, after triggering a control in the starting scene, performing scene jump and testing, it is also necessary to determine whether the scene to be jumped to meets the first path.
[0345] Combine the following Fig.19 and Fig. 20A -C describes in detail the process of jumping scenes and testing according to the first path starting from the starting scene. In some embodiments, the process of jumping scenes and testing according to the first path starting from the starting scene includes but is not limited to the following steps 1910-1920.
[0346] Step 1910: trigger a control in the starting scene to perform scene jump and test, and compare the jumped scene with the first path;
[0347] Step 1920: If the scene jumped to does not conform to the first path, the scene jumped to is used as the scene to be examined, and the process returns to the step of triggering an untriggered control in the scene to be examined.
[0348] Steps 1910-1920 are described in detail below.
[0349] In some embodiments, step 1910 includes:
[0350] According to the first path, determining the control to be triggered in the starting scene;
[0351] Trigger the control to be triggered in the starting scene, jump to the scene and test;
[0352] The scene identifier of the scene to be jumped to is compared with the scene identifier of the candidate next scene in the first path.
[0353] In the specific implementation of this embodiment, the candidate next scene in the first path refers to the scene that will be jumped to after the scene before the jump triggers the control to be triggered in the first path.
[0354] In step 1910, first determine the various scenes involved in jumping from the starting scene to the ending scene and the controls to be triggered in each scene according to the first path. Then, trigger a control to be triggered in the starting scene, perform a scene jump and test. Further, after jumping to the next scene, compare the scene identifier of the scene to be jumped to and the scene identifier of the candidate next scene in the first path. If the scene identifier of the scene to be jumped to is consistent with the scene identifier of the candidate next scene, the scene actually jumped to and the candidate next scene determined to be jumped to in the first path are the same scene, and the scene to be jumped to complies with the first path. Further, according to the first path, continue to trigger the controls to be triggered in this scene to be jumped to, perform a scene jump and test.
[0355] In step 1920, if the scene identifier of the scene to be jumped to is inconsistent with the scene identifier of the candidate next scene, the scene to be actually jumped to and the candidate next scene to be jumped to in the first path are not the same scene, and the scene to be jumped to does not conform to the first path. At this time, it is necessary to start from the current scene, re-explore the scene and plan the path, that is, restart the Monkey test decision process. Specifically, the scene to be jumped to is used as the scene to be examined, and return to the step of triggering an untriggered control in the scene to be examined in the application. If there is an untriggered control in the scene to be jumped to, start from triggering an untriggered control in the scene to be examined in the application in step 310, and continue to execute the above steps 310-340; if there is no untriggered control in the scene to be jumped to, start from obtaining a continuous jump scene sequence in step 310, and continue to execute the above steps 310-340. Repeat the above process until the application test duration reaches the preset test duration.
[0356] like Fig. 20AAs shown, the first path is [Scene A→Scene C→Scene F→Scene H]. The starting scene is Scene A, the ending scene is Scene H, triggering the control A2 in Scene A jumps to Scene C, triggering the control C2 in Scene C jumps to Scene F, and triggering the control F1 in Scene F jumps to Scene H. Based on this, first, on the scene interface corresponding to Scene A, trigger the control A2 on the right.
[0357] like Fig. 20B As shown, after triggering control A2, the scene is jumped to scene C, and the scene interface corresponding to scene C is displayed on the interface. Since it is determined in the first path to jump from scene A to scene C, the actual jump scene is consistent with the expected jump scene, and the jump scene meets the first path. Further, according to the first path, the control C2 at the upper left position is triggered on the scene interface corresponding to scene C to jump to the next scene for testing. After jumping to the next scene, it is continued to determine whether the next scene to be jumped to is scene F.
[0358] like Fig. 20C As shown, after triggering control A2, it jumps to scene K, and the scene interface corresponding to scene K is displayed on the interface. Since it is determined in the first path to jump from scene A to scene C, the actual jump scene is inconsistent with the expected jump scene, and the jump scene does not conform to the first path. At this time, scene K is taken as the scene to be investigated to determine whether there are untriggered controls in the scene K. After judgment, controls K1, K2, K3, K4, and K5 in scene K are all untriggered controls. According to the size and position of this series of untriggered controls, control K2 is selected to trigger for scene jump and testing. Repeat the above steps 310-360 until the application test duration reaches the preset test duration.
[0359] Through the above steps 1910-1920, the embodiment of the present disclosure can perform Monkey testing according to the first path, and can continuously guide the Monkey from the fully explored scenario along the first path to the inadequately explored scenario. This method makes it easier to explore previously unexplored scenarios, thereby testing more scenarios within a limited test time and improving test coverage.
[0360] Implementation details of the application testing method of the present disclosure embodiment
[0361] Refer to the following Fig.21 , describing in detail a specific usage process of the application testing method of the embodiment of the present disclosure, which process includes but is not limited to the following steps 2101 to 2112.
[0362] In step 2101, the target terminal 140 sends an application test request to the application test platform server 110;
[0363] In step 2102, the application testing platform server 110 searches for a scene storage information body containing the scene identification according to the scene identification of the scene to be examined, and determines the untriggered controls in the scene to be examined according to the control identification of the control triggering times of 0 in the scene storage information body;
[0364] In step 2103, the application testing platform server 110 selects one of the multiple untriggered controls to trigger according to the position and size of each untriggered control in the scene to be examined, and jumps to the next scene to perform scene testing;
[0365] In step 2104, the application testing platform server 110 increases the number of control triggering times corresponding to the control identification in the scene storage information body by 1;
[0366] In step 2105, the application testing platform server 110 compares the scene identifier of the next scene with each candidate next scene identifier. If the scene identifier of the next scene is consistent with a candidate next scene identifier, the arrival count corresponding to the candidate next scene identifier is increased by 1; if the scene identifier of the next scene is inconsistent with each candidate next scene identifier, the scene identifier of the next scene is added to the scene storage body as a candidate next scene identifier, and the arrival count corresponding to the added candidate next scene identifier is set to 1;
[0367] In step 2106, the application testing platform server 110 uses the next scene as the scene to be examined, and continues to select an untriggered control in the scene to be examined for triggering, until it is determined that there is no untriggered control in the last next scene, thereby generating a continuous jump scene sequence;
[0368] In step 2107, the application testing platform server 110 generates a jump relationship graph based on the jump relationship between multiple scenes in the continuous jump scene sequence;
[0369] In step 2108, the application testing platform server 110 obtains a scene in which all controls in the continuous jump scene sequence have been triggered as a starting scene;
[0370] In step 2109, the application testing platform server 110 obtains a scene in which the number of untriggered controls in the continuous jump scene sequence meets the first condition as an end scene;
[0371] In step 2110, the application testing platform server 110 determines multiple candidate paths from the starting scene and the ending scene in the jump relationship graph, takes the negative logarithm of the edge weight of each edge in the candidate scene and accumulates them to obtain the path weight of the candidate path, and selects the candidate path with the smallest path weight as the first path;
[0372] In step 2111, the application testing platform server 110 triggers a control in the starting scene according to the first path, and jumps to the next scene to perform scene testing;
[0373] In step 2112, the application testing platform server 110 determines whether the scene to be jumped to conforms to the first path. When the scene to be jumped to does not conform to the first path, the next scene to be jumped to is used as the scene to be examined, and the process returns to step 2102. When the scene to be jumped to conforms to the first path, the untriggered controls in the scene to be jumped to are continuously triggered according to the first path, and the next scene is continuously jumped to perform the scene test, and it is continuously determined whether the next scene to be jumped to conform to the first path. The aforementioned steps are repeated until the actual test duration reaches the preset test duration, and the application test is stopped.
[0374] It can be understood that the specific process of steps 2101-2103 is similar to steps 510-530 in the above embodiment. The specific process of step 2104 is similar to step 720 in the above embodiment. The specific process of step 2105 is similar to steps 810-830 in the above embodiment. The specific process of step 2106 is similar to step 310 in the above embodiment. The specific process of step 2107 is similar to steps 910-960 in the above embodiment. The specific process of step 2108 is similar to step 330 in the above embodiment. The specific process of step 2109 is similar to steps 1110-1130 in the above embodiment. The specific process of step 2110 is similar to steps 1210-1220 in the above embodiment. The specific process of steps 2111-2112 is similar to step 340 in the above embodiment. In order to save space, it will not be repeated here.
[0375] Comparison of the total number of scenarios covered by the two Monkey tests in the embodiments of the present disclosure
[0376] The application testing method proposed in the embodiment of the present disclosure helps to explore more game scenarios in the Monkey testing tool of the mini-game during the testing process, thereby helping the Monkey test to better decide the operation mode and perform more operations that can change the game scene, thereby improving the coverage of the overall game scene. Specifically, the Monkey test provided by the embodiment of the present disclosure was compared with the Monkey test not provided by the embodiment of the present disclosure. First, the top 18 mini-games with the highest daily active users were selected as test objects, and each game was tested for 10 minutes on five object terminals. Then, the number of scenes covered overall was counted. Among them, the Monkey test provided by the embodiment of the present disclosure can give priority to the untriggered controls in each scene for operation based on the judgment results of the embodiment of the present disclosure.
[0377] See also Fig. 22 , Fig. 22 Schematic diagram of the total number of scenarios covered by the two Monkey tests provided in the embodiments of the present disclosure. Fig. 22 It can be seen from the data that the Monkey test based on the game testing method proposed in the embodiment of the present disclosure can achieve a higher number of scene coverage than the Monkey test without using the game testing method proposed in the embodiment of the present disclosure, with an average improvement of more than 50% in terms of improvement, and some games can be improved by more than 100%.
[0378] Description of the apparatus and device of the present disclosure
[0379] It is to be understood that, although the steps in the above-mentioned flowcharts are sequentially displayed according to the characterization of arrows, these steps are not necessarily executed in sequence according to the order of arrow characterization. Unless there is a clear description in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0380] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present application is obtained.
[0381] Fig.23 This is a schematic diagram of the structure of an application testing device 2300 provided in an embodiment of the present disclosure. The device includes:
[0382] The control triggering unit 2310 is used to trigger an untriggered control in the scene to be examined in the application program to jump to the next scene for testing, and use the next scene as the scene to be examined until the number of untriggered controls in the scene to be examined is 0, so as to obtain a continuous jump scene sequence;
[0383] A jump relationship graph generating unit 2320, configured to generate a jump relationship graph based on the jump relationship between multiple scenes in a continuous jump scene sequence;
[0384] A path determination unit 2630, configured to obtain a first path from a start scene to an end scene in a jump relationship graph;
[0385] The scene testing unit 2640 is used to start from the starting scene, perform scene jump and test according to the first path.
[0386] Optionally, the starting scene has fewer untriggered controls than the ending scene, and the application testing apparatus 2300 further includes:
[0387] A first scene determination unit (not shown), used to obtain a scene in which all controls in the continuous jump scene sequence are triggered as a starting scene;
[0388] The second scene determination unit (not shown) is used to obtain a scene in which the number of untriggered controls in the continuous jump scene sequence meets the first condition as the end scene.
[0389] Optionally, the scenario testing unit 2340 is specifically configured to:
[0390] Trigger a control in the starting scene to jump to the scene and test it, and compare the jumped scene with the first path;
[0391] If the scene jumped to does not conform to the first path, the scene jumped to is used as the scene to be examined, and the process returns to the step of triggering an untriggered control in the scene to be examined.
[0392] Optionally, the jump to the next scene by the control triggering unit 2310 specifically includes:
[0393] Get the first interface before triggering the untriggered control;
[0394] Get the second interface after triggering the untriggered control;
[0395] The controls in the first interface are compared with the controls in the second interface. If they are completely consistent, continue to trigger an untriggered control in the scene to be examined until the controls in the first interface are not completely consistent with the controls in the second interface.
[0396] Optionally, each scene in the application corresponds to a scene storage information body, and the scene storage information body includes a scene identifier, a control identifier in the scene, and a control triggering count; the control triggering unit 2610 is specifically used to:
[0397] According to the scene identifier of the scene to be examined, searching for the scene storage information body containing the scene identifier;
[0398] Get the control ID of the control whose trigger times is 0 in the scene storage information body;
[0399] From the control identifiers whose control triggering times are 0, select a control identifier and trigger the control corresponding to the control identifier.
[0400] Optionally, the application testing device 2300 further includes a first counting unit (not shown), and the first counting unit (not shown) is specifically used for:
[0401] According to the scene identifier of the scene to be examined, searching for the scene storage information body containing the scene identifier;
[0402] Increase the number of control triggering times corresponding to the control identifier in the scene storage information body by 1.
[0403] Optionally, the scene storage information body also includes a candidate next scene identifier to which each control jumps after being triggered, and the number of arrivals corresponding to the candidate next scene identifier; the application testing device 2300 also includes a second counting unit (not shown), and the second counting unit (not shown) is specifically used to:
[0404] comparing the scene identifier of the next scene with each candidate next scene identifier;
[0405] If the scene identifier of the next scene is consistent with a candidate next scene identifier, the arrival count corresponding to the candidate next scene identifier is increased by 1;
[0406] If the scene identifier of the next scene is inconsistent with each candidate next scene identifier, the scene identifier of the next scene is added to the scene storage information body as a candidate next scene identifier, and the arrival count corresponding to the added candidate next scene identifier is set to 1.
[0407] Optionally, the jump relationship graph generating unit 2320 is specifically used for:
[0408] The scene in the continuous jump scene sequence is used as a node in the jump relationship graph;
[0409] If a jump occurs between two scenes in a continuous jump scene sequence, an edge is added between the nodes corresponding to the scenes, where the two scenes include a pre-jump scene and a post-jump scene;
[0410] Find the scene storage information body of the scene identifier of the scene before jumping;
[0411] In the scene storage information body, find the arrival count corresponding to the scene after the jump, which is identified by the control;
[0412] In the scene storage information body, find the number of control triggers of the control identifier;
[0413] The edge weight of the edge is determined based on the found number of arrivals and the found number of control triggers.
[0414] Optionally, the path determination unit 2350 includes:
[0415] A candidate path determination unit (not shown), used to determine a plurality of candidate paths from the starting scene to the ending scene in the jump relationship graph;
[0416] A selection unit (not shown) is configured to select a first path from a plurality of candidate paths based on an edge weight of each edge on the candidate paths.
[0417] Optionally, the selection unit (not shown) specifically includes:
[0418] A first weight determination subunit (not shown), configured to determine a path weight of a candidate path based on an edge weight of each edge on the candidate path;
[0419] A first selection subunit (not shown), configured to determine a candidate path having a path weight greater than a first threshold value from among a plurality of candidate paths as a target candidate path;
[0420] The second selection subunit (not shown) is used to randomly select one of the target candidate paths as the first path.
[0421] Optionally, the selection unit (not shown) specifically includes:
[0422] A second weight determination subunit (not shown), configured to determine a path weight of the candidate path based on an edge weight of each edge on the candidate path;
[0423] A total number of controls acquisition subunit (not shown), used to acquire the total number of untriggered controls for each scene on the candidate path;
[0424] The third selection subunit (not shown) is configured to select a first path from the plurality of candidate paths based on the path weights of the plurality of candidate paths and the total number of untriggered controls.
[0425] Optionally, the third selection subunit (not shown) is specifically configured to:
[0426] Get the total number of untriggered controls for each scene on the candidate path;
[0427] Determining a first sub-score of the candidate path based on the path weight of the candidate path;
[0428] Determining a second sub-score of the candidate path based on the total number of untriggered controls of the candidate path;
[0429] determining a score for the candidate path based on the first sub-score and the second sub-score of the candidate path;
[0430] A first path is selected among the plurality of candidate paths based on the scores of the candidate paths.
[0431] Optionally, the selection unit (not shown) is specifically configured to:
[0432] Determine the negative logarithm of the edge weight of each edge on the candidate path;
[0433] An accumulator is set for each candidate path to accumulate the negative logarithm of each edge weight on the candidate path;
[0434] The candidate path with the smallest accumulated result of the accumulator is used as the first path.
[0435] Optionally, the second scene determination unit (not shown) is specifically configured to:
[0436] From the continuous jump scene sequence, select the scene that can be reached after one or more continuous jumps from the starting scene as the target scene sequence;
[0437] Sort the scenes in the target scene sequence in descending order according to the number of untriggered controls;
[0438] A scene is randomly selected from the scenes with the highest predetermined ranking in the sorting as the ending scene.
[0439] Optionally, the control triggering unit 2310 specifically includes:
[0440] A position acquisition unit (not shown), used to acquire positions of a plurality of untriggered controls in the scene to be examined;
[0441] A size acquisition unit (not shown), used to acquire the sizes of multiple untriggered controls in the scene to be examined;
[0442] A trigger unit (not shown) is used to select one of the multiple untriggered controls to trigger based on the positions and sizes of the multiple untriggered controls, so as to perform scene jump and test.
[0443] Optionally, the trigger unit (not shown) is specifically used for:
[0444] Determining a first score for the plurality of untriggered controls based on the positions of the plurality of untriggered controls;
[0445] determining a second score of the plurality of untriggered controls based on the sizes of the plurality of untriggered controls;
[0446] determining a weighted sum of first scores and second scores for a plurality of untriggered controls;
[0447] Based on the weighted sum of multiple untriggered controls, a selected untriggered control is determined to be triggered among the multiple untriggered controls to perform scene jump and testing.
[0448] Reference Fig.24 , Fig.24The structural block diagram of the terminal part for implementing the application testing method of the embodiment of the present disclosure includes: a radio frequency (RF) circuit 2410, a memory 2415, an input unit 2430, a display unit 2440, a sensor 2450, an audio circuit 2460, a wireless fidelity (WiFi) module 2470, a processor 2480, and a power supply 2490. Those skilled in the art can understand that Fig.24 The terminal structure shown does not constitute a limitation on the mobile phone or computer, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0449] The RF circuit 2410 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 2480 for processing; in addition, the designed uplink data is sent to the base station.
[0450] The memory 2415 may be used to store software programs and modules. The processor 2480 executes various functional applications and data processing of the target terminal by running the software programs and modules stored in the memory 2415 .
[0451] The input unit 2430 may be used to receive input digital or character information and generate key signal input related to the setting and function control of the target terminal. Specifically, the input unit 2430 may include a touch panel 2431 and other input devices 2432.
[0452] The display unit 2440 may be used to display input information or provided information and various menus of the target terminal. The display unit 2440 may include a display panel 2441.
[0453] The audio circuit 2460, the speaker 2461, and the microphone 2462 may provide an audio interface.
[0454] In this embodiment, the processor 2480 included in the terminal can execute the application testing method of the previous embodiment.
[0455] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to data security, blockchain, data storage, information technology, etc.
[0456] Fig.25A block diagram of the structure of a portion of a server for implementing the application testing method of an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 2522 (e.g., one or more processors) and memory 2532, and one or more storage media 2530 (e.g., one or more mass storage devices) storing application programs 2542 or data 2544. Among them, the memory 2532 and the storage medium 2530 may be temporary storage or permanent storage. The program stored in the storage medium 2530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 2522 may be configured to communicate with the storage medium 2530 and execute a series of instruction operations in the storage medium 2530 on the server.
[0457] The server may also include one or more power supplies 2528, one or more wired or wireless network interfaces 2550, one or more input and output interfaces 2558, and / or one or more operating systems 2541, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0458] The central processor 2522 in the server can be used to execute the transaction chaining method of the embodiment of the present disclosure.
[0459] The embodiments of the present disclosure also provide a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the application program testing methods of the aforementioned embodiments.
[0460] The embodiment of the present disclosure also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned application program testing method.
[0461] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0462] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0463] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.
[0464] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0465] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0466] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0467] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0468] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0469] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. An application testing method, characterized in that: include: Trigger an untriggered control in the scene to be examined in the application program to jump to the next scene for testing, and use the next scene as the scene to be examined until the number of untriggered controls in the scene to be examined is 0, so as to obtain a continuous jump scene sequence; Generate a jump relationship graph based on the jump relationship between multiple scenes in the continuous jump scene sequence; In the jump relationship graph, obtaining a first path from the starting scene to the ending scene; Starting from the starting scene, scene jumps and tests are performed according to the first path.
2. The application testing method according to claim 1, characterized in that: The starting scene has fewer untriggered controls than the ending scene. Before obtaining a first path from the starting scene to the ending scene in the jump relationship graph, the application testing method further includes: Acquire a scene in which all the controls are triggered in the continuous jump scene sequence as the starting scene; A scene in which the number of untriggered controls in the continuous jump scene sequence meets a first condition is obtained as the end scene.
3. The application testing method according to claim 1, characterized in that: Starting from the starting scene, performing scene jump and testing according to the first path includes: Triggering a control in the starting scene to perform scene jump and test, and comparing the jumped scene with the first path; If the scene jumped to does not conform to the first path, the scene jumped to is used as the scene to be examined, and the process returns to the step of triggering an untriggered control in the scene to be examined.
4. The application testing method according to claim 1, characterized in that: The jump to the next scene includes: Acquire the first interface before triggering the untriggered control; Acquire a second interface after triggering the untriggered control; The controls in the first interface are compared with the controls in the second interface. If they are completely consistent, continue to trigger an untriggered control in the scene to be examined until the controls in the first interface are no longer completely consistent with the controls in the second interface.
5. The application testing method according to claim 1, characterized in that: Each scene in the application corresponds to a scene storage information body, and the scene storage information body includes a scene identifier, a control identifier in the scene, and a control triggering count; The triggering of an untriggered control in the to-be-investigated scenario in the application program includes: According to the scene identifier of the scene to be examined, searching for the scene storage information body containing the scene identifier; Obtain the control identifier of the control triggering times of 0 in the scene storage information body; A control identifier is selected from the control identifiers whose control triggering times is 0, and a control corresponding to the control identifier is triggered.
6. The application testing method according to claim 5, characterized in that: After triggering an untriggered control in the scene to be examined in the application to jump to the next scene for testing, the application testing method further includes: According to the scene identifier of the scene to be examined, searching for the scene storage information body containing the scene identifier; The number of control triggering times corresponding to the control identifier in the scene storage information body is increased by 1.
7. The application testing method according to claim 5, characterized in that: The scene storage information body also includes a candidate next scene identifier to which each control jumps after being triggered, and the number of arrivals corresponding to the candidate next scene identifier; After jumping to the next scenario, the application testing method further includes: Comparing the scene identifier of the next scene with each of the candidate next scene identifiers; If the scene identifier of the next scene is consistent with one of the candidate next scene identifiers, the number of arrivals corresponding to the candidate next scene identifier is increased by 1; If the scene identifier of the next scene is inconsistent with each of the candidate next scene identifiers, the scene identifier of the next scene is added to the scene storage information body as the candidate next scene identifier, and the arrival count corresponding to the added candidate next scene identifier is set to 1.
8. The application testing method according to claim 7, characterized in that: The step of generating a jump relationship graph based on the jump relationship between multiple scenes in the continuous jump scene sequence includes: Using the scene in the continuous jump scene sequence as a node in the jump relationship graph; If a jump occurs between two of the scenes in the continuous jump scene sequence, adding an edge between the nodes corresponding to the scenes, wherein the two scenes include a pre-jump scene and a post-jump scene; Searching for the scene storage information body of the scene identifier of the scene before the jump; In the scene storage information body, searching for the arrival number corresponding to the jump scene identified by the control; In the scene storage information body, searching for the control triggering times of the control identifier; The edge weight of the edge is determined based on the found number of arrivals and the found number of control triggerings.
9. The application testing method according to claim 8, characterized in that: In the jump relationship graph, obtaining a first path from the starting scene to the ending scene includes: Determine a plurality of candidate paths from the starting scene to the ending scene in the jump relationship graph; The first path is selected from a plurality of the candidate paths based on the edge weights of the edges on the candidate paths.
10. The application testing method according to claim 9, characterized in that: The selecting the first path from a plurality of the candidate paths based on the edge weights of the edges on the candidate paths comprises: Determining a path weight of the candidate path based on the edge weights of the edges on the candidate path; Obtain the total number of untriggered controls of each of the scenes on the candidate path; The first path is selected from the plurality of candidate paths based on the path weights of the plurality of candidate paths and the total number of untriggered controls.
11. The application testing method according to claim 10, characterized in that: The selecting the first path from the plurality of candidate paths based on the path weights of the plurality of candidate paths and the total number of untriggered controls comprises: determining a first sub-score of the candidate path based on the path weight of the candidate path; determining a second sub-score of the candidate path based on the total number of the untriggered controls of the candidate path; determining a score of the candidate path based on the first sub-score and the second sub-score of the candidate path; The first path is selected among a plurality of the candidate paths based on the scores of the candidate paths.
12. The application testing method according to claim 9, characterized in that: The selecting the first path from a plurality of the candidate paths based on the edge weights of the edges on the candidate paths comprises: Determining a path weight of the candidate path based on the edge weights of the edges on the candidate path; Determine, from among the plurality of candidate paths, the candidate path whose path weight is greater than a first threshold as the target candidate path; One of the candidate target paths is randomly selected as the first path.
13. The application testing method according to claim 9, characterized in that: The selecting the first path from a plurality of the candidate paths based on the edge weights of the edges on the candidate paths comprises: Determine the negative logarithm of the edge weight of each of the edges on the candidate path; An accumulator is set for each candidate path to accumulate the negative logarithms of the edge weights on the candidate path; The candidate path with the smallest accumulated result of the accumulator is used as the first path.
14. The application testing method according to claim 2, characterized in that: The step of obtaining a scene in which the number of untriggered controls in the continuous jump scene sequence meets a first condition as the end scene includes: From the continuous jump scene sequence, select scenes that can be reached by the starting scene after one or more continuous jumps as the target scene sequence; Sorting the scenes in the target scene sequence in descending order according to the number of untriggered controls; One of the scenes with a predetermined first ranking in the ranking is randomly selected as the ending scene.
15. The application testing method according to claim 1, characterized in that: The triggering of an untriggered control in the to-be-tested scene in the application program to jump to the next scene for testing includes: Obtaining positions of a plurality of untriggered controls in the scene to be examined; Obtaining the sizes of a plurality of untriggered controls in the scene to be examined; Based on the positions and sizes of the multiple untriggered controls, one of the multiple untriggered controls is selected for triggering to perform scene jump and testing.
16. The application testing method according to claim 15, characterized in that: The selecting one of the plurality of untriggered controls to trigger based on the positions and sizes of the plurality of untriggered controls to perform scene jump and testing includes: Determining a first score of the plurality of untriggered controls based on the positions of the plurality of untriggered controls; determining a second score of the plurality of untriggered controls based on the sizes of the plurality of untriggered controls; determining a weighted sum of the first scores and the second scores of a plurality of the untriggered controls; Based on the weighted sum of the multiple untriggered controls, the selected untriggered control is determined to be triggered among the multiple untriggered controls to perform scene jump and test.
17. An application testing device, characterized in that: include: A control triggering unit, used for triggering an untriggered control in the scene to be examined in the application program, so as to jump to the next scene for testing, and taking the next scene as the scene to be examined, until the number of untriggered controls in the scene to be examined is 0, so as to obtain a continuous jump scene sequence; A jump relationship graph generating unit, configured to generate a jump relationship graph based on the jump relationship between multiple scenes in the continuous jump scene sequence; A path determination unit, configured to obtain, in the jump relationship graph, a first path from a starting scene to an ending scene; A scene testing unit is used to start from the starting scene, perform scene jumps and tests along the first path.
18. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the application program testing method according to any one of claims 1 to 16 is implemented.
19. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the application program testing method according to any one of claims 1 to 16 is implemented.
20. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the application program testing method according to any one of claims 1 to 16.
