A method and apparatus for determining test cases
By constructing and optimizing a tree structure diagram, test cases are automatically determined based on the number of operations and correlation factors, solving the problem of low efficiency in existing technologies and achieving efficient and accurate test case determination.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WEBANK (CHINA)
- Filing Date
- 2021-08-30
- Publication Date
- 2026-06-02
Smart Images

Figure CN113722220B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology (Fintech), and more particularly to a method and apparatus for determining test cases. Background Technology
[0002] With the development of computer technology, more and more technologies (such as blockchain, cloud computing or big data) are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology, and big data technology is no exception. However, due to the security and real-time requirements of the financial and payment industries, higher requirements are also placed on the technology for determining test cases in big data.
[0003] In existing technologies, a page includes multiple page elements and a certain function implemented based on the page elements. Taking a login page as an example, the page elements include a username input box, a password input box, and a login click box. One example is to first enter the username in the "username input box", then enter the password in the "password input box", and finally click the "login click box" to realize the login function.
[0004] Currently, to determine whether a page can perform a certain function, test cases for that page are typically determined manually. These test cases are then used to determine if the page meets the requirements. This manual determination of test cases involves first identifying potential test cases from the page itself, and then manually selecting the test cases that need to be executed on the page.
[0005] This demonstrates that the existing method of determining test cases is inefficient and wastes human resources. Summary of the Invention
[0006] This invention provides a method and apparatus for determining test cases, which is used to automatically determine the test cases that need to be executed on the page to be tested, thereby improving the efficiency of determining test cases and saving human resources.
[0007] In a first aspect, embodiments of the present invention provide a method for determining test cases, including:
[0008] Each page element is obtained from the logic code of the page to be tested, and a first tree structure diagram is determined based on each page element; the first tree structure diagram includes each page element and a directed edge between any two page elements; the direction of the directed edge is used to indicate the operation order between page elements;
[0009] For any directed edge, determine the number of operations on the directed edge from the historical operation data of the page to be tested, and obtain the association factor of the directed edge based on the number of operations on the directed edge;
[0010] From the first tree structure graph, the directed edges that do not meet the preset conditions of the association factors are removed to obtain the second tree structure graph;
[0011] Test cases are determined based on the directed edges of each page element in the second tree structure diagram.
[0012] In the above technical solution, a first tree structure diagram is created based on page elements. This first tree structure diagram can display all possible test cases. Then, by determining the association factors and preset conditions of each first directed edge in the first tree structure diagram, directed edges that do not meet the preset conditions are removed, thereby eliminating test cases that will not be executed on the page to be tested, thus obtaining a second tree structure diagram. The second tree structure diagram is then used to determine the test cases that need to be executed on the page to be tested. This achieves automated determination of test cases that need to be executed on the page to be tested, improves the efficiency of test case determination, and saves human resources.
[0013] Optionally, the number of operations on the directed edge is determined from the historical operation data of the page to be tested, including:
[0014] Historical operation data of each page element is obtained by using preset tracking points in the page to be tested;
[0015] The number of operations in which the operation order is first the first page element and then the second page element is determined from the historical operation data, and is used as the number of operations of the directed edge from the first page element to the second page element; the first page element and the second page element are any two of the page elements.
[0016] In the above technical solution, the number of operations on directed edges is used to determine the test steps that need to be executed on the page to be tested. That is, the test steps are to operate on the first page element first and then the second page element. This achieves automated determination of the test cases that need to be executed on the page to be tested, improves the efficiency of determining test cases, and saves human resources.
[0017] Optionally, the association factor of the directed edge is obtained based on the number of operations performed on the directed edge, including:
[0018] For any directed edge, determine the sum of the number of operations on each directed edge corresponding to the starting page element of the directed edge; determine the association factor of the directed edge based on the number of operations on the directed edge and the sum of the number of operations; wherein, the two page elements corresponding to any directed edge are the starting page element and the pointing page element, respectively; the pointing page element is the page element pointed to by the directed edge.
[0019] In the above technical solution, the test cases to be executed on the page to be tested are determined by the directed edge association factor determined by the sum of the number of operations. This improves the accuracy of determining test steps, increases the efficiency of determining test cases, and saves human resources.
[0020] Optionally, after determining the first tree structure diagram based on the page elements, and before determining the number of operations on the directed edges from the historical operation data of the page to be tested, the method further includes:
[0021] For any page element, the tag type of the page element is determined according to the logic code; the tag type includes click type and input type;
[0022] Remove the directed edges from click-type page elements that point to input-type page elements to obtain the updated first tree structure graph.
[0023] In the above technical solution, the first directed edge reduction is performed on the first tree structure graph by the tag type of the page elements. That is, the test steps that will not be executed on the page to be tested are determined for the first time in the first tree structure graph. This reduces the computational resources for calculating the association factors of each directed edge, reduces the computation time, and improves the efficiency of determining test cases.
[0024] Optionally, the preset condition is that the association factor is not less than the association threshold; the association threshold is determined based on the associated pages that have an association relationship with the page to be tested.
[0025] In the above technical solution, when adding a new page element, the association threshold is determined in real time based on the associated pages that are related to the page to be tested. This ensures that the association threshold determination process is dynamically consistent with the associated pages, rather than being fixed. This improves the real-time performance of directed edge deletion and also improves the accuracy of determining test cases.
[0026] Optionally, test cases are determined based on the directed edges of each page element in the second tree structure diagram, including:
[0027] In the second tree structure diagram, the page elements that are not pointed to by the directed edge are determined as the first page elements;
[0028] Page elements that have directed edges with related pages are identified as end page elements;
[0029] Test cases are determined from the first page element to the last page element according to the direction of each directed edge in the second tree diagram.
[0030] Optionally, after obtaining the second tree structure diagram, the method further includes:
[0031] Retrieve new page elements added to the page to be tested;
[0032] The new page element is added to the second tree structure diagram to obtain the third tree structure diagram;
[0033] Update the test case based on the third tree structure diagram.
[0034] In the above technical solution, the test cases are updated based on the user's preset test cases to increase the flexibility in determining the test cases.
[0035] Optionally, after obtaining the second tree structure diagram, the method further includes:
[0036] Obtain preset test cases; the preset test cases include preset page elements and preset directed edges;
[0037] The association factor of the preset directed edge is determined by the second tree structure diagram;
[0038] Determine the first sum of the association factors of each preset directed edge in the preset test case and the second sum of the association factors of each directed edge in any test case in the second tree structure diagram;
[0039] Based on the first sum and each of the second sums, determine the test cases that do not meet the similarity conditions;
[0040] In test cases where the similarity condition is not met, the directed edges pointing to the end page element are deleted, resulting in the updated second tree structure graph.
[0041] In this embodiment, by deleting test cases that do not meet the similarity criteria, irrelevant interference with the subsequent test case generation process is prevented, thereby improving accuracy.
[0042] Secondly, embodiments of the present invention provide an apparatus for determining test cases, comprising:
[0043] The acquisition module is used to acquire each page element from the logic code of the page to be tested, and determine a first tree structure diagram based on each page element; the first tree structure diagram includes each page element and a directed edge between any two page elements; the direction of the directed edge is used to indicate the operation order between page elements;
[0044] The processing module is used to determine the number of operations of any directed edge from the historical operation data of the page to be tested, and to obtain the association factor of the directed edge based on the number of operations of the directed edge;
[0045] From the first tree structure graph, the directed edges that do not meet the preset conditions of the association factors are removed to obtain the second tree structure graph;
[0046] Test cases are determined based on the directed edges of each page element in the second tree structure diagram.
[0047] Optionally, the processing module is specifically used for:
[0048] Historical operation data of each page element is obtained by using preset tracking points in the page to be tested;
[0049] The number of operations in which the operation order is first the first page element and then the second page element is determined from the historical operation data, and is used as the number of operations of the directed edge from the first page element to the second page element; the first page element and the second page element are any two of the page elements.
[0050] Optionally, the processing module is specifically used for:
[0051] For any directed edge, determine the sum of the number of operations on each directed edge corresponding to the starting page element of the directed edge; determine the association factor of the directed edge based on the number of operations on the directed edge and the sum of the number of operations; wherein, the two page elements corresponding to any directed edge are the starting page element and the pointing page element, respectively; the pointing page element is the page element pointed to by the directed edge.
[0052] Optionally, the processing module is further configured to:
[0053] After determining the first tree structure diagram based on each page element, and before determining the number of operations on the directed edges from the historical operation data of the page to be tested, for any page element, the tag type of the page element is determined according to the logic code; the tag type includes click type and input type.
[0054] Remove the directed edges from click-type page elements that point to input-type page elements to obtain the updated first tree structure graph.
[0055] Optionally, the preset condition is that the association factor is not less than the association threshold; the association threshold is determined based on the associated pages that have an association relationship with the page to be tested.
[0056] Optionally, the processing module is specifically used for:
[0057] In the second tree structure diagram, the page elements that are not pointed to by the directed edge are determined as the first page elements;
[0058] Page elements that have directed edges with related pages are identified as end page elements;
[0059] Test cases are determined from the first page element to the last page element according to the direction of each directed edge in the second tree diagram.
[0060] Optionally, the processing module is further configured to:
[0061] After obtaining the second tree structure diagram, acquire the new page elements added to the page to be tested;
[0062] The new page element is added to the second tree structure diagram to obtain the third tree structure diagram;
[0063] Update the test case based on the third tree structure diagram.
[0064] Optionally, the processing module is further configured to:
[0065] After obtaining the second tree structure diagram, a preset test case is obtained; the preset test case includes preset page elements and preset directed edges;
[0066] The association factor of the preset directed edge is determined by the second tree structure diagram;
[0067] Determine the first sum of the association factors of each preset directed edge in the preset test case and the second sum of the association factors of each directed edge in any test case in the second tree structure diagram;
[0068] Based on the first sum and each of the second sums, determine the test cases that do not meet the similarity conditions;
[0069] In test cases where the similarity condition is not met, the directed edges pointing to the end page element are deleted, resulting in the updated second tree structure graph.
[0070] Thirdly, embodiments of the present invention also provide a computer device, comprising:
[0071] Memory, used to store program instructions;
[0072] The processor is used to call program instructions stored in the memory and execute the method for determining test cases as described above, according to the obtained program.
[0073] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the above-described method for determining test cases. Attached Figure Description
[0074] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0075] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present invention;
[0076] Figure 2 A flowchart illustrating a method for determining test cases provided in an embodiment of the present invention;
[0077] Figure 3 A schematic diagram of a system login page provided in an embodiment of the present invention;
[0078] Figure 4 This is a schematic diagram of a first tree structure provided in an embodiment of the present invention;
[0079] Figure 5 A schematic diagram of an updated first tree structure provided in an embodiment of the present invention;
[0080] Figure 6 A schematic diagram of an associated page provided in an embodiment of the present invention;
[0081] Figure 7 This is a schematic flowchart of obtaining a second tree structure diagram provided by an embodiment of the present invention;
[0082] Figure 8 This is a schematic diagram of a first tree structure provided in an embodiment of the present invention;
[0083] Figure 9 This is a schematic diagram illustrating how a third tree structure diagram is obtained, as provided in an embodiment of the present invention.
[0084] Figure 10 This is a schematic diagram of an updated second tree structure diagram provided in an embodiment of the present invention;
[0085] Figure 11 This is a schematic diagram of an updated second tree structure diagram provided in an embodiment of the present invention;
[0086] Figure 12 An updated second tree structure diagram is provided for an embodiment of the present invention;
[0087] Figure 13 This is a schematic diagram of a device for determining test cases provided in an embodiment of the present invention. Detailed Implementation
[0088] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0089] In existing technologies, a page includes multiple page elements. These elements are linked together through underlying code to achieve a specific function based on those elements. For example, a QQ login page might include a QQ number input box, a password input box, a checkbox for saving username and password, and a login click box. One possible approach is to first enter the QQ number in the "QQ number input box," then enter the corresponding password in the "password input box," then check the "save username and password" checkbox, and finally click the "login click box" to achieve the QQ login function.
[0090] In another scenario, users can first enter their QQ number in the "QQ Number Input Box," then enter the corresponding password in the "Password Input Box," and then directly click the "Login Click Box" to log in to QQ.
[0091] After the "QQ Login Page" was designed, the developers tested it by using it in practice. They could log in using the two methods mentioned above or other methods (such as first entering the password corresponding to the QQ number in the "Password Input Box", then entering the QQ number in the "QQ Number Input Box", and then clicking the "Login Click Box". However, this method is not part of the "QQ Login Page" designed by the developers, so it cannot achieve QQ login).
[0092] After reviewing the actual operational history of the R&D personnel, for the designed "QQ login page," testers still need to construct test cases to determine whether the "QQ login page" contains the aforementioned implementation of QQ login. Currently, test cases are generally determined manually. This manual determination of test cases requires first identifying possible test cases from the page, and then manually selecting the test cases that need to be executed on the page.
[0093] Taking the aforementioned "QQ login page" as an example, we define the "QQ number input box" as page element 1, the "password input box" as page element 2, the "checkbox for saving username and password" as page element 3, and the "login click box" as page element 4. Possible test cases include: 1. "Page element 1 → Page element 2 → Page element 3 → Page element 4"; 2. "Page element 1 → Page element 2 → Page element 4"; 3. "Page element 1 → Page element 4"; 4. "Page element 2 → Page element 3 → Page element 4"; 5. "Page element 2 → Page element 4"; etc.
[0094] As shown in test case 5 above, this test demonstrates whether the QQ login function can be achieved by directly entering the password corresponding to the QQ number in the password input box on the "QQ Login Page" and then clicking the "Login Click Box". For any of the above possible test cases, the test cases to be executed on the "QQ Login Page" can include test cases 1, 2, and 5 above.
[0095] It is evident that existing methods for determining test cases are inefficient and wasteful of human resources. Therefore, a method is needed to automatically identify test cases that need to be executed on the page to be tested, thereby improving the efficiency of test case determination and saving human resources.
[0096] Figure 1 An exemplary system architecture applicable to an embodiment of the present invention is shown. The system architecture includes a server 100, which may include a processor 110, a communication interface 120, and a memory 130.
[0097] The communication interface 120 is used to obtain the embedded data in the page to be tested.
[0098] The processor 110 is the control center of the server 100, connecting various parts of the server 100 through various interfaces and routes. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 130, and by calling data stored in the memory 130. Optionally, the processor 110 may include one or more processing units.
[0099] The memory 130 can be used to store software programs and modules. The processor 110 executes various functional applications and data processing by running the software programs and modules stored in the memory 130. The memory 130 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created according to business processing, etc. In addition, the memory 130 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0100] It should be noted that the above Figure 1 The structure shown is merely an example, and the embodiments of the present invention are not limited thereto.
[0101] Based on the above description Figure 2 An exemplary flowchart of a method for determining test cases provided by an embodiment of the present invention is shown, which can be executed by a device for determining test cases.
[0102] like Figure 2 As shown, the process specifically includes:
[0103] Step 210: Obtain each page element from the logic code of the page to be tested, and determine the first tree structure diagram based on each page element.
[0104] In this embodiment of the invention, the first tree structure diagram includes each page element and a directed edge between any two page elements; the direction of the directed edge is used to indicate the operation order between page elements.
[0105] Step 220: For any directed edge, determine the number of operations of the directed edge from the historical operation data of the page to be tested, and obtain the association factor of the directed edge based on the number of operations of the directed edge.
[0106] In this embodiment of the invention, any directed edge is a directed edge from the first page element to the second page element, and the number of operations on the directed edge is the number of operations performed on the first page element first and then on the second page element.
[0107] Step 230: Remove directed edges from the first tree structure graph that do not meet the preset conditions for the association factors to obtain the second tree structure graph.
[0108] In this embodiment of the invention, the preset condition is that the correlation factor is not less than the correlation threshold.
[0109] Step 240: Determine test cases based on the directed edges of each page element in the second tree structure diagram.
[0110] In this embodiment of the invention, the first page element and the last page element are determined in the second tree structure diagram, and then test cases are determined based on the first page element and the last page element.
[0111] In step 210, the page elements in the page to be tested are implemented through logic code, such as HTML (Hypertext Markup Language). The HTML code includes various tags, such as the tag for "defining input controls". <input> "Define a click button" <button>wait.
[0112] Therefore, the operable page elements on the page can be determined through the logic code in the page. Specifically, the logic code of the page to be tested is obtained; and the first page element of the page is determined based on the logic code.
[0113] Figure 3 An exemplary diagram of a system login page is shown, such as... Figure 3 As shown, the page elements include "Please enter username", "Please enter password" and "Log in".
[0114] by Figure 3 For example, a program labeled "input" <input autocomplete="off"spellcheck="false"type="text"placeholder="请输入用户名"class="ivu-input ivu-input-large"> From this input program, we can identify the included page element as "Please enter username". Similarly, in programs with a button tag...< / button> <button type="button"class="ivu-btn ivu-btn-primary ivu-btn-longivu-btn-circle ivu-btn-large"><!----><!----> Log in < / button> The page element included in this button program is "Login".
[0115] Among them, programs labeled "input" are page elements of the input box type, such as "Please enter username", "Please enter password", "Please enter phone number", etc., while programs labeled "button" are page elements of the click box type, such as "Login", "Cancel", "Check whether to save username and password", etc.
[0116] After identifying the page elements, construct the first tree structure graph using the page elements as nodes and the directed edges between any two page elements. Figure 4 An exemplary schematic diagram of a first tree structure diagram is shown, such as... Figure 4 As shown, the first tree structure diagram includes "username", "password" and "login", where "username" corresponds to the "please enter username" page element mentioned above, and "password" corresponds to the "please enter password" page element mentioned above; and there are two directed edges between any two page elements, namely a1, a2, a3, a4, a5 and a6.
[0117] In step 220, after obtaining the first tree structure graph, redundant directed edges need to be automatically deleted to improve the accuracy of determining test cases.
[0118] In one feasible approach, the first tree structure graph is updated by determining the association factor of any directed edge, which needs to be determined based on the historical operation data of the developers for the page to be tested.
[0119] Specifically, directed edges with association factors less than the association threshold are identified as directed edges to be deleted, thereby updating the first tree structure graph.
[0120] Specifically, the first page element and the second page element that form the directed edge are first determined, wherein the first page element points to the second page element. Then, the historical operation data of each page element is obtained through preset tracking points in the page to be tested. The number of operations in the order of first page element followed by second page element is determined from the historical operation data, and the number of operations in the order of first page element followed by second page element is taken as the number of operations of the directed edge from the first page element to the second page element.
[0121] It should be noted that the first page element and the second page element are any two of the page elements.
[0122] After obtaining the number of operations for the directed edge pointing from the first page element to the second page element, the association factor of the directed edge is determined.
[0123] In one feasible approach, the number of operations on a directed edge pointing from a first page element to a second page element is determined as the association factor of that directed edge, as described above. Figure 4 Taking directed edge a1 as an example, within a preset period, based on the preset tracking points in the page to be tested, the number of operations that first operate on "username" and then on "password" is determined to be 77. Therefore, the number of operations on directed edge a1 is determined to be 77, and the association factor of directed edge a1 is also determined to be 77.
[0124] In another feasible approach, for any directed edge, the sum of the number of operations on each directed edge corresponding to the starting page element of the directed edge is determined; the association factor of the directed edge is determined based on the number of operations on the directed edge and the sum of the number of operations; wherein, the two page elements corresponding to any directed edge are the starting page element and the pointing page element, respectively; the pointing page element is the page element pointed to by the directed edge.
[0125] In this embodiment of the invention, data collection is a method that can collect the number of times and the order in which users click on various page elements during the use of the page under test, which is equivalent to historical operation data. Based on the above... Figure 4 For example, according to the direction of the directed edge a1 mentioned above, the first page element clicked is "username" and the second page element clicked is "password". Based on the preset tracking points, the number of clicks for clicking "username" first and then "password" is determined to be 98.
[0126] Using the same method, determine the number of operations performed on the first page element first and then the second page element, which means determining the number of operations performed on each directed edge. For example, the number of operations performed on directed edge a2 is 0, the number of operations performed on directed edge a3 is 100, the number of operations performed on directed edge a4 is 0, the number of operations performed on directed edge a5 is 2, and the number of operations performed on directed edge a6 is 0.
[0127] Then, for any directed edge, determine the sum of the number of operations for each directed edge corresponding to the starting page element of the directed edge; based on the above... Figure 4 Taking directed edge a1 as an example, the starting page element to be operated on first is "username", and the page elements to be operated on later include "username" and "login". Therefore, the sum of the number of operations is the sum of the number of operations corresponding to directed edge a1 and directed edge a5, that is, the sum of the number of operations is 98 + 2 = 100.
[0128] After determining the sum of the number of operations, the first ratio of the number of operations on a directed edge to the sum of the number of operations can be determined as the association factor of the directed edge. For example, if the first ratio is determined to be 98 / 100, then the association factor of directed edge a1 is 98%. It should be noted that the unit of the association factor can be a decimal (such as 0.98) or a percentage (such as 98), and no specific limitation is made here.
[0129] In one possible scenario, the number of operations on a directed edge is equal to the sum of the number of operations. That is, the starting page element corresponds to only one page element. For example, in directed edge a3, the first page element to be operated on is "password". The page element "password" corresponds to only one page element "login". Therefore, the association factor of directed edge a3 can be 100%. The specific value can be preset by the user and is not specifically limited here.
[0130] For example, if in the historical operation data there is an instance where a user enters a password and then immediately closes the login page, this operation is identified as an abnormal operation. Then, the sum of the operation counts of directed edges is included in the number of abnormal operations. If the operation count of directed edge a3 is 99, and the operation count of the user entering a password and immediately closing the login page (i.e., an abnormal operation) is 1, then the sum of the operation counts of directed edge a3 is 100, resulting in the association factor of directed edge a3 being 99, which is less than 100%.
[0131] In summary, based on the same technical solution, and using percentage as the unit of association factor, the association factors of each directed edge are determined respectively. For example, the association factor of directed edge a2 is 0, the association factor of directed edge a3 is 100, the association factor of directed edge a4 is 0, the association factor of directed edge a5 is 2, and the association factor of directed edge a6 is 0.
[0132] In another feasible approach, after determining the first tree structure diagram based on each page element, and before determining the number of operations of the directed edges from the historical operation data of the page to be tested, for any page element, the tag type of the page element is determined according to the logic code; the tag type includes click type and input type; the directed edges pointing from click type page elements to input type page elements are removed to obtain the updated first tree structure diagram.
[0133] Based on the above Figure 4 For example, since "Login" is a click-type page element, and "Username" and "Password" are input-type page elements, the directed edge a6 pointing from "Login" to "Username" and the directed edge a4 pointing from "Login" to "Password" are removed to obtain the updated first tree structure graph.
[0134] Figure 5 An exemplary schematic diagram of an updated first tree structure diagram is shown, such as... Figure 5 As shown, the directed edges only include directed edges a1, a2, a3, and a5.
[0135] In step 230, the preset condition is that the association factor is not less than the association threshold; the association threshold is determined based on the associated pages that have an association relationship with the page to be tested.
[0136] For example, the second ratio of the sum of the association factors of directed edges between page elements in the test page and page elements in associated pages to the number of associated pages is determined as the association threshold. The associated pages that are related to the test page can be directly or indirectly related.
[0137] Figure 6An exemplary diagram of an associated page is shown, such as... Figure 6 As shown, Figure 6 Image a in the middle is the page to be tested. Figure 6 Figure b in the middle and Figure 6 The middle C diagram is related to Figure 6 Figure a shows a diagram with a direct correlation. Figure 6 The middle d diagram is related to Figure 6 The diagram in Figure a illustrates an indirect relationship; further, it will be related to the page to be tested (such as...). Figure 6 Pages that have a direct relationship with the page to be tested (as shown in Figure a) (e.g., ...) Figure 6 Figure b in the middle and Figure 6 The page shown in Figure c is identified as an associated page, meaning the number of associated pages is 2.
[0138] Then determine the sum of the association factors of the directed edges between page elements in the test page and page elements in related pages, based on the above. Figure 6 As shown, in the page to be tested, the page elements with directed edges to the page elements of the associated page include page element "B" and page element "C"; in the associated page, the page element with directed edges to page element "B" is page element "I", and the page element with directed edges to page element "C" is page element "E". Therefore, the directed edges between the page elements in the page to be tested and the page elements in the associated page are "BI" and "CE" respectively.
[0139] Assuming the association factors of directed edges “BI” and “CE” are 10 and 20 respectively, the second ratio is determined to be (10+20) / 2 = 15, and the association threshold of the page to be tested is determined to be 15.
[0140] If the association relationship is a direct association relationship and an indirect association relationship, then the number of associated pages is 3, and the second ratio is determined to be (10+20) / 3=10. Therefore, the association threshold of the page to be tested is determined to be 10. This embodiment of the invention does not specifically limit the association relationship.
[0141] After determining the association threshold, directed edges with association factors less than the association threshold are removed to obtain the second tree structure graph. Figure 7 An exemplary flowchart illustrating a process for obtaining a second tree structure diagram is shown, such as... Figure 7 As shown, assuming the association threshold is 1, based on the example above, directed edges a2, a4, and a6 need to be deleted to obtain the second tree structure graph; where, Figure 7 Figure a shows the first tree structure diagram. Figure 7 Figure b shows the second tree structure diagram.
[0142] In one feasible approach, the first tree structure diagram can be updated first by using the tag type of the page elements. After determining the association factors of each directed edge in the updated first tree structure diagram, the updated first tree structure diagram can be updated again based on the association factors of each directed edge in the updated first tree structure diagram to obtain the second tree structure diagram.
[0143] For example, the above can be determined by the tag type of the page element. Figure 4 The first tree structure diagram shown (including directed edges a1, a2, a3, a4, a5, and a6) is updated for the first time to obtain the above. Figure 5 The updated first tree structure diagram shown (including directed edge a1, directed edge a2, directed edge a3, and directed edge a5) is then determined. Figure 5 The updated first tree structure graph shows the association factors of each directed edge, combined with the association threshold, for... Figure 5 In the updated first tree structure diagram shown, directed edges that do not meet the preset conditions are removed to obtain the second tree structure diagram.
[0144] In another feasible approach, instead of updating the first tree structure graph based on the tag type of page elements, the association factors of each directed edge in the first tree structure graph are directly determined, as described above. Figure 4 For example, the association factors of directed edges a1, a2, a3, a4, a5, and a6 are determined. By using the association threshold, directed edges that do not meet the preset conditions are deleted, resulting in the second tree structure graph.
[0145] For example, when determining the first tree structure diagram based on the logic code of the page to be tested, if page elements in different pages are distinguished based on the logic code, the resulting first tree structure diagram of the page to be tested will not include page elements from other pages. As described above... Figure 6 For example, targeting Figure 6 The page element "C" shown in Figure a is defined in the logic code as redirecting to [the page after clicking on "C"]. Figure 6 In the page shown in Figure b, page element "E" can be identified as page element "C" based on the logical code. Figure 6 The page to be tested shown in Figure a has element "E" belonging to... Figure 6 The page shown in Figure b, therefore, in obtaining Figure 6 The first tree structure diagram of the page to be tested, shown in Figure a, does not include page element "E".
[0146] If the logic code does not distinguish between page elements on different pages, the resulting first tree structure diagram of the page under test will include page elements from other pages. Combining this with the example above, it can be determined that... Figure 6 In the first tree structure diagram of the page to be tested shown in Figure a, page element "E" that is not a page to be tested is included.
[0147] In combination with the above Figure 4 , Figure 8 An exemplary schematic diagram of a first tree structure diagram is shown, such as... Figure 8 As shown, the page element "Prompt" indicates that a prompt page will appear when the user enters a username.
[0148] If the first tree structure diagram contains page elements that are not the page to be tested (such as...) Figure 8 If the page element "hint" is selected, then page elements not on the page being tested will be removed. Specifically, the directed edge between the page element "username" and the page element "hint" will be deleted, and the page element "hint" will also be deleted, resulting in the second tree structure diagram.
[0149] In step 240, page elements not pointed to by the directed edges in the second tree structure diagram are identified as first page elements; page elements with directed edges to associated pages are identified as last page elements; and test cases are determined from the first page elements to the last page elements according to the directions of the directed edges in the second tree structure diagram.
[0150] As mentioned above Figure 6 As shown in Figure a, page element "A" is pointed to by any directed edge, page element "B" is pointed to by the directed edge "A→B", and page element "C" is pointed to by the directed edge "A→C". Therefore, page element "A" is determined to be the first page element; because page element "C" points to the related page ( Figure 6 If we consider the related pages shown in Figure a, then we determine that page element "C" is the last page element. Based on the direction of each directed edge, the test cases from the first page element to the last page element include "A→B→C" and "A→C".
[0151] In one feasible approach, page elements that do not point to other page elements can also be defined as the end page element. Figure 7 Taking the middle page (b) as an example, the page element "Login" does not point to any other page element, so the page element "Login" is determined to be the last page element.
[0152] In one scenario, a new page element is added to the page to be tested and used by the developers. To test the page after the addition of the new page element, it is necessary to obtain the new page element based on the second tree structure diagram and add it to the second tree structure diagram to obtain a third tree structure diagram. Then, the association threshold is re-determined, and an updated second tree structure diagram is obtained based on the third tree structure diagram. The method for obtaining the new page element can be a breadth-first search algorithm, etc., and no specific limitation is made here.
[0153] Specifically, a breadth-first search algorithm is used to obtain new page elements to be added to the page to be tested; the new page elements are added to the second tree structure diagram to obtain a third tree structure diagram; and the test case is updated according to the third tree structure diagram.
[0154] The new page element can be any type of page element. For example, if the new page element is a clickable box type page element, the program would be: <button type="button"class="ivu-btn ivu-btn-primary ivu-btn-long ivu-btn-circle ivu-btn-large"><!----><!----> Remember username < / button> The new page element will then be "Remember Username".
[0155] Then, the new page element is added to the second tree structure graph. By constructing directed edges between each second page element in the second tree structure graph and the new page element, a third tree structure graph is obtained. Then, by determining the third association factor of each third directed edge in the third tree structure graph, the updated second tree structure graph is obtained.
[0156] To better illustrate the above technical solution, in conjunction with the above... Figure 7 Figure b in the middle, Figure 9 An exemplary schematic diagram of obtaining a third tree structure diagram is shown, such as... Figure 9 As shown, Figure 7 Figure b in the middle and Figure 9 The diagram in image b is the same second tree structure diagram, with "Save" representing the new page element "Remember Username". "Save" is added to... Figure 9 In the graph b, a third directed edge is constructed based on "Save" and "Username", "Password", and "Login" respectively, resulting in... Figure 9 The third tree structure diagram shown in Figure c.
[0157] Then, the association threshold of the third tree structure graph is determined. Following the method described above for determining each directed edge, the third association factor for each third directed edge is determined. Finally, the third association factors greater than the association threshold of the third tree structure graph are determined, thus obtaining... Figure 9 The updated second tree structure diagram is shown in Figure d.
[0158] For example, if "Save" does not have directed edges connecting related pages, then the association threshold of the third tree structure graph shown in Figure 9c is... Figure 9The association thresholds of the second tree structure diagram shown in Figure b are the same, meaning that... Figure 9 The association threshold of the second tree structure diagram shown in Figure b remains unchanged.
[0159] Based on preset embedding points, the number of operations for each directed edge in the third tree structure graph is determined, thereby identifying the association factor for each directed edge. Directed edges whose association factors do not meet preset conditions are then removed, resulting in... Figure 9 The updated second tree structure diagram is shown in Figure d.
[0160] In combination with the above Figure 9 To continue with examples, specifically regarding Figure 9 The second tree structure diagram shown in Figure d, when searching the page to be tested, yields the following new program: <button type="button"class="ivu-btn ivu-btn-primary ivu-btn-long ivu-btn-circle ivu-btn-large"><!----><!----> Cancel < / button> This means that the new page element is "Cancel".
[0161] Then "Cancel" adding the new page element to Figure 9 The second tree structure diagram shown in Figure d is obtained by... Figure 9 In the second tree structure diagram shown in Figure d, directed edges are constructed between each second page element (including "username", "password", "login" and "save") and the new page element ("cancel") to obtain a third tree structure diagram. Then, by determining the association factors of each directed edge in the third tree structure diagram, the updated second tree structure diagram is obtained.
[0162] Specifically, in combination with the above Figure 9 , Figure 10 An exemplary schematic diagram of updating a second tree structure diagram is shown, such as... Figure 10 As shown, add "Cancel" to Figure 9 In the d-graph, directed edges are constructed between "username", "password", "login", and "save" and "cancel" respectively, resulting in... Figure 10 The third tree structure diagram shown in Figure e.
[0163] And re-confirm based on "Username", "Password", "Login", "Save", and "Cancel". Figure 10 The association threshold of the third tree structure diagram shown in Figure e is then determined based on the preset embedding points. Figure 10 The number of operations on each directed edge in the third tree structure diagram shown in Figure e is used to determine the... Figure 10 The association factors of each directed edge in the third tree structure graph shown in Figure e are finally in Figure 10 In the third tree structure diagram shown in Figure e, directed edges that do not meet the preset conditions for association thresholds are removed, thus obtaining... Figure 10 The updated second tree structure diagram is shown in Figure f.
[0164] In obtaining Figure 10Following the second tree structure diagram shown in Figure f, according to Figure 10 The directed edges in the second tree structure diagram shown in Figure f are used to determine the test cases.
[0165] Based on the above Figure 10 Taking the diagram in Figure f as an example, the first page element is determined to be "Username". If the page elements with directed edges to related pages are determined to be the last page elements, then the last page elements include "Cancel" and "Login". Therefore, the test cases include the following five types:
[0166] f1, "Username" → "Password" → "Login" → "Cancel";
[0167] f2, "Username" → "Password" → "Save" → "Cancel";
[0168] f3, "Username" → "Password" → "Save" → "Login" → "Cancel";
[0169] f4, "Username" → "Password" → "Login";
[0170] F5, "Username" → "Password" → "Save" → "Login".
[0171] If a page element that does not point to other page elements is determined as the end page element, then the only way to determine the end page element is "Cancel". Therefore, the test cases only include the following three types:
[0172] f6, "Username" → "Password" → "Login" → "Cancel";
[0173] F7, "Username" → "Password" → "Save" → "Cancel";
[0174] F8, "Username" → "Password" → "Save" → "Login" → "Cancel".
[0175] For example, the second tree structure diagram can be further updated based on user-preset test cases.
[0176] Specifically, a preset test case is obtained; the preset test case includes preset page elements and preset directed edges; the association factors of the preset directed edges are determined through the second tree structure diagram; the first sum of the association factors of each preset directed edge in the preset test case and the second sum of the association factors of each directed edge in any test case in the second tree structure diagram are determined; based on the first sum and the second sum, test cases that do not meet the similarity condition are determined; in the test cases that do not meet the similarity condition, the directed edges pointing to the end page element are deleted to obtain the updated second tree structure diagram.
[0177] In this embodiment of the invention, the preset test cases are customized by the tester based on the page elements included in the page to be tested, including multiple preset page elements and preset directed edges; in the preset test cases, preset directed edges that are inconsistent with each directed edge in the second tree structure graph do not have an association factor; the association factor of a preset directed edge that is consistent with a directed edge in the second tree structure graph is the association factor of the directed edge.
[0178] In combination with the above Figure 10 , Figure 11 An exemplary schematic diagram of updating a second tree structure diagram is shown, such as... Figure 11 As shown, Figure 11 The middle g diagram shows the preset test cases set by the testers, where... Figure 11 In the preset test case shown in graph g, the preset directed edge g2 between "password" and "cancel" is in Figure 10 In the second tree structure diagram shown in Figure f, there is no directed edge that is consistent with the preset directed edge g2; therefore, the preset directed edge g2 does not have an association factor, that is, the association factor of the preset directed edge g2 is 0.
[0179] Figure 11 In the preset test case shown in graph g, the preset directed edge g1 between "username" and "password" is connected to... Figure 10 The directed edges in the second tree structure diagram shown in Figure f are consistent with the preset directed edges. Therefore, the association factor of the preset directed edge g1 is 98.
[0180] Then, the first sum of the association factors of each pre-set directed edge in the pre-set test case is determined to be 98 + 0 = 98.
[0181] Based on the above Figure 10 Taking the f-graph as an example, determine the second sum of the association factors of each directed edge in any test case.
[0182] Because the methods for determining the end page element differ, in one feasible approach, if the page element with a directed edge to the associated page is determined as the end page element, then the five test cases shown in f1 to f5 above are obtained. For the five test cases shown in f1 to f5, in f1 to f5, only the second sum of the association factors of each directed edge of the test cases that have the same first page element and end page element as the preset test cases can be determined.
[0183] Specifically, the default test case uses "Username" as the first page element and "Cancel" as the last page element. Figure 11 As can be seen from the h-graph, with Figure 11 The preset test cases shown in Figure g have the following three test cases with consistent first and last page elements:
[0184] F1: "Username → Password → Save → Login → Cancel".
[0185] f2: "Username → Password → Save → Cancel".
[0186] f3: "Username → Password → Login → Cancel".
[0187] In another feasible approach, if the page element that does not point to other page elements is determined as the end page element, then the three test cases shown in f6 to f8 above are obtained; for the three test cases shown in f6 to f8, the second sum of the association factors of each directed edge of any test case can be determined.
[0188] For example, the second sum of test case h1 is determined to be 193; the second sum of test case h2 is 123; and the second sum of test case h3 is 188.
[0189] After determining the first sum and each second sum, test cases that do not meet the similarity condition are identified based on the first sum and each second sum. The similarity condition is that the second ratio of the first sum to any second sum is greater than the similarity threshold. The similarity threshold is a value preset by the R&D personnel based on experience, such as 60%.
[0190] Furthermore, the second ratio of the first sum of the preset test cases to the second sum of test case h1 is 50.77%, the second ratio of the first sum of the preset test cases to the second sum of test case h2 is 79.67%, and the second ratio of the first sum of the preset test cases to the second sum of test case h3 is 52.13%. Assuming the preset similarity threshold is 60%, since test cases h1 and h3 do not meet the similarity condition, the directed edges pointing to the "Cancel" element on the last page in test cases h1 and h3 are removed to obtain the updated second tree structure diagram. Figure 12 For an updated second tree structure graph, after removing directed edges that do not meet the similarity condition, it is about to... Figure 11 In the graph h, the directed edge from "Login" to "Cancel" is removed, resulting in the following: Figure 12 The updated second tree structure diagram is shown.
[0191] In obtaining such Figure 12 Following the updated second tree structure diagram shown, the test cases for the pages to be tested are identified as follows:
[0192] w1: "Username → Password → Save → Login"
[0193] w2: "Username → Password → Save → Cancel";
[0194] w3: "Username → Password → Login";
[0195] w4: "Username → Password → Cancel".
[0196] Based on the same technological concept Figure 13 An exemplary schematic diagram of a device for determining test cases provided in an embodiment of the present invention is shown. This device can perform a method for determining test cases.
[0197] like Figure 13 As shown, the device specifically includes:
[0198] The acquisition module 1310 is used to acquire each page element from the logic code of the page to be tested, and determine a first tree structure diagram based on each page element; the first tree structure diagram includes each page element and a directed edge between any two page elements; the direction of the directed edge is used to indicate the operation order between page elements;
[0199] The processing module 1320 is used to determine the number of operations of any directed edge from the historical operation data of the page to be tested, and to obtain the association factor of the directed edge based on the number of operations of the directed edge.
[0200] From the first tree structure graph, the directed edges that do not meet the preset conditions of the association factors are removed to obtain the second tree structure graph;
[0201] Test cases are determined based on the directed edges of each page element in the second tree structure diagram.
[0202] Optionally, the processing module 1320 is specifically used for:
[0203] Historical operation data of each page element is obtained by using preset tracking points in the page to be tested;
[0204] The number of operations in which the operation order is first the first page element and then the second page element is determined from the historical operation data, and is used as the number of operations of the directed edge from the first page element to the second page element; the first page element and the second page element are any two of the page elements.
[0205] Optionally, the processing module 1320 is specifically used for:
[0206] For any directed edge, determine the sum of the number of operations on each directed edge corresponding to the starting page element of the directed edge; determine the association factor of the directed edge based on the number of operations on the directed edge and the sum of the number of operations; wherein, the two page elements corresponding to any directed edge are the starting page element and the pointing page element, respectively; the pointing page element is the page element pointed to by the directed edge.
[0207] Optionally, the processing module 1320 is further configured to:
[0208] After determining the first tree structure diagram based on each page element, and before determining the number of operations on the directed edges from the historical operation data of the page to be tested, for any page element, the tag type of the page element is determined according to the logic code; the tag type includes click type and input type.
[0209] Remove the directed edges from click-type page elements that point to input-type page elements to obtain the updated first tree structure graph.
[0210] Optionally, the preset condition is that the association factor is not less than the association threshold; the association threshold is determined based on the associated pages that have an association relationship with the page to be tested.
[0211] Optionally, the processing module 130 is specifically used for:
[0212] In the second tree structure diagram, the page elements that are not pointed to by the directed edge are determined as the first page elements;
[0213] Page elements that have directed edges with related pages are identified as end page elements;
[0214] Test cases are determined from the first page element to the last page element according to the direction of each directed edge in the second tree diagram.
[0215] Optionally, the processing module 1320 is further configured to:
[0216] After obtaining the second tree structure diagram, acquire the new page elements added to the page to be tested;
[0217] The new page element is added to the second tree structure diagram to obtain the third tree structure diagram;
[0218] Update the test case based on the third tree structure diagram.
[0219] Optionally, the processing module 1320 is further configured to:
[0220] After obtaining the second tree structure diagram, a preset test case is obtained; the preset test case includes preset page elements and preset directed edges;
[0221] The association factor of the preset directed edge is determined by the second tree structure diagram;
[0222] Determine the first sum of the association factors of each preset directed edge in the preset test case and the second sum of the association factors of each directed edge in any test case in the second tree structure diagram;
[0223] Based on the first sum and each of the second sums, determine the test cases that do not meet the similarity conditions;
[0224] In test cases where the similarity condition is not met, the directed edges pointing to the end page element are deleted, resulting in the updated second tree structure graph.
[0225] Based on the same technical concept, embodiments of the present invention also provide a computer device, including:
[0226] Memory, used to store program instructions;
[0227] The processor is used to call program instructions stored in the memory and execute the method for determining test cases as described above, according to the obtained program.
[0228] Based on the same technical concept, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the above-described method for determining test cases.
[0229] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0230] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0231] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0232] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0233] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for determining test cases, characterized in that, include: Obtain each page element from the logic code of the page to be tested, and determine the first tree structure diagram based on each page element; The first tree structure diagram includes each page element and the directed edges between any two page elements; The direction of the directed edges is used to indicate the order of operations between page elements; For any directed edge, determine the number of operations of the directed edge from the historical operation data of the page to be tested, including: obtaining the historical operation data of each page element through preset tracking points in the page to be tested; determining the number of operations with the operation order of first page element followed by second page element from the historical operation data, and using this as the number of operations of the directed edge from the first page element to the second page element; the first page element and the second page element are any two of the page elements; The association factor of a directed edge is obtained based on the number of operations performed on the directed edge, including: for any directed edge, determining the sum of the number of operations performed on each directed edge corresponding to the starting page element of the directed edge; determining the association factor of the directed edge based on the number of operations performed on the directed edge and the sum of the number of operations performed; wherein, the two page elements corresponding to any directed edge are the starting page element and the pointing page element, respectively; the pointing page element is the page element pointed to by the directed edge; From the first tree structure graph, the directed edges that do not meet the preset conditions of the association factors are removed to obtain the second tree structure graph; Test cases are determined based on the directed edges of each page element in the second tree structure diagram.
2. The method as described in claim 1, characterized in that, After determining the first tree structure diagram based on the page elements, and before determining the number of operations on the directed edges from the historical operation data of the page to be tested, the process further includes: For any page element, the tag type of the page element is determined according to the logic code; the tag type includes click type and input type; Remove the directed edges from click-type page elements that point to input-type page elements to obtain the updated first tree structure graph.
3. The method as described in claim 1, characterized in that, The preset condition is that the association factor is not less than the association threshold; the association threshold is determined based on the associated pages that have an association relationship with the page to be tested.
4. The method as described in claim 1, characterized in that, Based on the directed edges of each page element in the second tree structure diagram, test cases are determined, including: In the second tree structure diagram, the page elements that are not pointed to by the directed edge are determined as the first page elements; Page elements that have directed edges with related pages are identified as end page elements; Test cases are determined from the first page element to the last page element according to the direction of each directed edge in the second tree structure diagram.
5. The method according to any one of claims 1 to 4, characterized in that, After obtaining the second tree structure diagram, the method further includes: Retrieve new page elements added to the page to be tested; The new page element is added to the second tree structure diagram to obtain the third tree structure diagram; Update the test case based on the third tree structure diagram.
6. The method according to any one of claims 1 to 4, characterized in that, After obtaining the second tree structure diagram, the method further includes: Obtain preset test cases; the preset test cases include preset page elements and preset directed edges; The association factor of the preset directed edge is determined by the second tree structure diagram; Determine the first sum of the association factors of each preset directed edge in the preset test case and the second sum of the association factors of each directed edge in any test case in the second tree structure diagram; Based on the first sum and each of the second sums, determine the test cases that do not meet the similarity conditions; In test cases where the similarity condition is not met, the directed edges pointing to the end page element are deleted, resulting in the updated second tree structure graph.
7. An apparatus for determining test cases, characterized in that, include: The acquisition module is used to acquire each page element from the logic code of the page to be tested, and determine the first tree structure diagram based on each page element; The first tree structure diagram includes each page element and the directed edges between any two page elements; The direction of the directed edges is used to indicate the order of operations between page elements; The processing module is used to determine the number of operations of any directed edge from the historical operation data of the page under test, including: obtaining the historical operation data of each page element through preset points in the page under test; determining the number of operations with the operation order of first page element followed by second page element from the historical operation data, and using this as the number of operations of the directed edge from the first page element to the second page element; the first page element and the second page element are any two of the page elements; The association factor of a directed edge is obtained based on the number of operations performed on the directed edge, including: for any directed edge, determining the sum of the number of operations performed on each directed edge corresponding to the starting page element of the directed edge; determining the association factor of the directed edge based on the number of operations performed on the directed edge and the sum of the number of operations performed; wherein, the two page elements corresponding to any directed edge are the starting page element and the pointing page element, respectively; the pointing page element is the page element pointed to by the directed edge; From the first tree structure graph, the directed edges that do not meet the preset conditions of the association factors are removed to obtain the second tree structure graph; Test cases are determined based on the directed edges of each page element in the second tree structure diagram.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the method according to any one of claims 1 to 6.