Empirical generation method, test script verification method and device
By identifying the target experience characteristics and their associated logical attributes in the experience input interface, experience data for verifying test scripts is generated, solving the problem of low accuracy of experience data in existing technologies and achieving higher accuracy in test script verification.
Patent Information
- Application Number
- CN202411241899.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies suffer from low accuracy of empirical data when generating test scripts, leading to inaccurate user acceptance test results.
By determining the target experience features and their associated logical attributes in the experience entry interface, experience data for verifying test scripts is generated. A first type of control for entering target experience features and a second type of control for selecting logical attributes from multiple candidate logical attributes are provided to represent the logical relationship between related target experience features.
It improves the accuracy of generated experience data, enabling the generation of experience data with complex logical relationships, and enhances the accuracy of test script verification.
Smart Images

Figure CN121681333A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of testing technology, and in particular relates to experience generation methods, test script verification methods based on experience bases, experience generation devices, test script verification devices based on experience bases, electronic devices, and computer-readable storage media. Background Technology
[0002] User Acceptance Test (UAT) is a test conducted on a product after its development.
[0003] Currently, the UAT platform typically generates initial test scripts based on system use cases and a test script generation algorithm. However, since this algorithm may generate conflicting or unreasonable test scripts, after generating the initial test scripts, they are usually validated against experience data in an experience database. If a test script is found to match experience data in the database, it is considered unqualified and deleted. Once the initial test script passes validation, it is retained as a reserve test script. Test scripts are then generated based on these reserved test scripts, and finally, the product is tested using these test scripts.
[0004] As can be seen from the above verification of the initial test script, the more accurate the experience data in the experience base, the more accurate the UAT test results will be after verifying the test script based on the experience data in the experience base.
[0005] Currently, there is a possibility that some experience data may be missed during the generation of experience data, which leads to a lower accuracy of the experience data in the experience base. Summary of the Invention
[0006] This application provides an experience generation method, a test script verification method, and an apparatus, which can solve the problem of low accuracy of experience data generated by existing methods.
[0007] In a first aspect, embodiments of this application provide an experience generation method, including:
[0008] Based on the selected operation in the experience input interface, the target experience features and the logical attributes associated with the target experience features are determined.
[0009] Based on the target experience features and the logical attributes associated with the target experience features, experience data is generated, and the experience data is used to verify the test script;
[0010] The experience input interface provides a first type of control and a second type of control. The first type of control provides the function of inputting target experience features, and the second type of control provides the function of selecting logical attributes associated with the target experience features from multiple candidate logical attributes. The logical attributes are used to characterize the logical relationship between related target experience features.
[0011] Secondly, embodiments of this application provide a test script verification method based on an experience base, wherein at least one piece of experience data in the experience base is generated based on the experience generation method described in any of the first aspects above, and the test script verification method includes:
[0012] The test script corpus is matched with the experience data in the experience base;
[0013] If the experience base contains experience data that matches the corpus, then the test script is determined to have a logical problem.
[0014] Thirdly, embodiments of this application provide an experience generation apparatus, including:
[0015] The target experience feature determination module is used to determine the target experience features and the logical attributes associated with the target experience features based on the selected operation in the experience input interface.
[0016] An experience data generation module is used to generate experience data based on the target experience features and the logical attributes associated with the target experience features. The experience data is used to verify test scripts.
[0017] The experience input interface provides a first type of control and a second type of control. The first type of control provides the function of inputting target experience features, and the second type of control provides the function of selecting logical attributes associated with the target experience features from multiple candidate logical attributes. The logical attributes are used to characterize the logical relationship between related target experience features.
[0018] Optionally, the experience generation device further includes:
[0019] The first display module is used to display information of the corresponding candidate experience features in the options of the first type of control and candidate logical attributes associated with the candidate experience features in the options of the second type of control, based on the verified test script, before determining the target experience features and the logical attributes associated with the candidate experience features by selecting an operation in the experience-based input interface.
[0020] Optionally, the first type of control includes an input control for identifying target experience features. The experience generation apparatus provided in this application embodiment further includes:
[0021] The second display module is used to display the information of the corresponding target experience feature in the experience input interface based on the target experience feature identifier entered in the input control before determining the target experience feature and the logical attributes associated with the target experience feature by selecting an operation in the experience input interface, and to display the candidate logical attributes associated with the target experience feature in the options of the second type of control.
[0022] Optionally, the candidate logical attributes include: existence logical attributes used to characterize the non-existence of the corresponding target empirical features;
[0023] Correspondingly, the experience data generation module is specifically used for:
[0024] If the existence logical attribute is included in the logical attribute associated with the target experience feature, experience data indicating that the target experience feature does not exist is generated.
[0025] Optionally, the candidate logical attributes include: a sequential logical attribute used to characterize the order among relevant target empirical features;
[0026] Correspondingly, the experience data generation module is specifically used for:
[0027] If the logical attribute associated with the target experience feature includes the sequential logical attribute, the experience data is generated based on the target experience feature and the sequential logical attribute.
[0028] Optionally, the candidate logical attribute includes: a first matching logical attribute, which is used to characterize the relevant target experience features being matched in the same step when verifying the test script;
[0029] Correspondingly, the experience data generation module is specifically used for:
[0030] If the first matching logical attribute is included in the logical attribute associated with the target experience feature, the experience data is generated based on the target experience feature and the first matching logical attribute.
[0031] Optionally, the candidate logical attribute includes: a second matching logical attribute, which is used to characterize the relevant target experience features being matched in a manner attached to a specified step when verifying the test script;
[0032] Correspondingly, the experience data generation module is specifically used for:
[0033] If the second matching logical attribute is included in the logical attribute associated with the target experience feature, the experience data is generated based on the target experience feature and the second matching logical attribute.
[0034] Optionally, the candidate logical attribute includes: a third matching logical attribute, which is used to characterize the relevant target experience features being matched in a regular expression manner when verifying the test script;
[0035] Correspondingly, the experience data generation module is specifically used for:
[0036] If the third matching logical attribute is included in the logical attribute associated with the target experience feature, the experience data is generated based on the target experience feature and the third matching logical attribute.
[0037] Optionally, the candidate logical attribute includes: a fourth matching logical attribute, which is used to characterize the relevant target experience features being matched in a rule name matching manner when verifying the test script;
[0038] Correspondingly, the experience data generation module is specifically used for:
[0039] If the fourth matching logical attribute is included in the logical attribute associated with the target experience feature, the experience data is generated based on the target experience feature and the fourth matching logical attribute.
[0040] Fourthly, embodiments of this application provide a test script verification device based on an experience base, wherein at least one piece of experience data in the experience base is generated based on the experience generation method as described in any of the first aspects, and the test script verification device includes:
[0041] An experience feature matching module is used to match the corpus of test scripts with experience data in the experience database;
[0042] The matching result determination module is used to determine that the test script has a logical problem if there is experience data in the experience base that matches the corpus.
[0043] Optionally, the empirical feature matching module is specifically used for:
[0044] If the current experience data used for matching contains experience features including the existence logical attribute and the order logical attribute, then reverse experience data is constructed, and the corpus of the test script is matched based on the reverse experience data. The order logical attribute is used to characterize the order between relevant target experience features, and the reverse experience data is the experience data obtained by removing the existence logical attribute from the current experience data used for matching.
[0045] Optionally, the experience-based test script verification device further includes:
[0046] The test script generation module is used to generate a test script based on the test script after matching the corpus of the test script with the experience data in the experience database. If there is no experience data in the experience database that matches the corpus, the test script is generated.
[0047] The test script cancellation module is used to cancel the generated test script based on the experience data corresponding to the test script when a target condition is detected. The target condition includes at least one of the following: the system test cases corresponding to the test script do not match the test script, the test resources corresponding to the test script are not ready, or the test environment corresponding to the test script has defects.
[0048] Fifthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described in any of the first aspects, or the processor executes the computer program to implement the method as described in any of the second aspects.
[0049] Sixthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any of the first aspects, or, when executed, implements the method as described in any of the second aspects.
[0050] In a seventh aspect, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in any one of the first or second aspects above.
[0051] The beneficial effects of the embodiments in this application compared with the prior art are:
[0052] In this embodiment, based on the selection operation in the experience input interface, target experience features and logical attributes associated with the target experience features are determined. Based on the target experience features and their associated logical attributes, experience data for verifying test scripts is generated. Since the experience input interface provides a first type of control for inputting target experience features, and a second type of control for selecting logical attributes associated with the target experience features from multiple candidate logical attributes, and these logical attributes characterize the logical relationships of related target experience features, the first and second types of controls in the experience input interface facilitate flexible determination of target experience features and their logical relationships. This facilitates the generation of experience data with different logical relationships, and also facilitates the generation of experience data with more complex logical relationships, thereby improving the accuracy of the generated experience data. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0054] Figure 1 This is a flowchart illustrating an experience generation method provided in an embodiment of this application;
[0055] Figure 2 This is a schematic diagram illustrating the relationship between empirical features and corpus provided in an embodiment of this application;
[0056] Figure 3 This is a schematic diagram of an experience input interface provided in one embodiment of this application;
[0057] Figure 4 This is a schematic diagram illustrating, according to an embodiment of this application, information corresponding to a verified test script is displayed on an experience entry interface;
[0058] Figure 5 This is a schematic diagram of a corpus displaying target experience features in an experience input interface, provided by another embodiment of this application;
[0059] Figure 6 This is a schematic diagram of a logical attribute containing a third matching logical attribute in a logical attribute associated with a target experience feature, provided in an embodiment of this application;
[0060] Figure 7 This is a flowchart illustrating a test script verification method based on an experience base, provided in another embodiment of this application.
[0061] Figure 8 This is a schematic diagram of the structure of an experience generation device provided in an embodiment of this application;
[0062] Figure 9 This is a schematic diagram of the structure of a test script verification device based on an experience base provided in an embodiment of this application;
[0063] Figure 10 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0064] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0065] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0066] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0067] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0068] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0069] In User-Aided Testing (UAT), automatically generated test scripts are typically validated based on experience data from an experience database. During validation, the experience data in the database is matched against the test script's corpus. If a match is found, the generated test script has a logical problem and is therefore invalid (or incorrect), and must be deleted. Conversely, if none of the experience data in the database matches the corpus, the generated test script is logically sound and is therefore valid (or correct), and can be retained. Test scripts can then be generated based on these test scripts, and the product can be tested according to the instructions in these test scripts.
[0070] When inputting experience data into the experience database, each piece of experience data is usually input independently. That is, the generated experience data are independent, and the relationship between experience data in the same application scenario (such as payment scenario) is usually simple (such as a simple "and" combination relationship) and there is no complex combination relationship. For example, the two generated experience data can be: (1) whether the result of the judgment of all payment methods of the user of application 1 according to the payment method availability rule is that the payment method is unavailable: yes; (2) verifying that the result of the bank system feedback is that the deduction was successful. Here, the user of application 1 refers to the user who uses application 1.
[0071] Analysis of the product's application scenarios reveals that if all payment methods for User 1 are unavailable, yet the user successfully requests a deduction from the bank system, this is clearly illegitimate (i.e., logically flawed). However, matching the test script corpus solely based on the two empirical data points mentioned above is inadvisable, because if all payment methods for User 1 are unavailable, but the user adds an available payment method and successfully requests a deduction from the bank system, this is legitimate. Therefore, if the generated empirical data only has simple combinational relationships without complex ones, it will be difficult to effectively filter out incorrect test scripts.
[0072] To generate experience data with complex combinations of relationships, this application provides an experience generation method. In this method, a user determines a target experience feature through an experience input interface displayed on an electronic device, and selects the logical attribute corresponding to that target experience feature. The electronic device then generates corresponding experience data based on the determined target experience feature and logical attribute.
[0073] Since logical attributes are used to characterize the logical relationships between relevant target empirical features, different logical attributes can be selected to set different logical relationships between target empirical features, thereby determining empirical data with complex combination relationships and improving the accuracy of the generated empirical data.
[0074] The experience generation method provided in the embodiments of this application is described below with reference to the accompanying drawings.
[0075] Figure 1 A flowchart of an experience generation method provided in an embodiment of this application is shown. This experience generation method can be applied to electronic devices, and is described in detail below:
[0076] S11, based on the selected operation in the experience input interface, determine the target experience features and the logical attributes associated with the aforementioned target experience features.
[0077] S12, Based on the aforementioned target experience features and the logical attributes associated with the aforementioned target experience features, experience data is generated, and the aforementioned experience data is used to verify the test script.
[0078] The aforementioned experience input interface refers to the interface used to determine experience data. This experience input interface provides a first type of control and a second type of control. The first type of control provides the function of inputting target experience features, and the second type of control provides the function of selecting a logical attribute associated with the target experience feature from multiple candidate logical attributes. This logical attribute is used to characterize the logical relationship between the relevant target experience features. Optionally, the logical relationship in this application includes one or more of the following: "or", "and", "excluding", "order of precedence", etc.
[0079] Optionally, the number of controls corresponding to the first type of controls in the experience entry interface is greater than or equal to 1, and the number of controls corresponding to the second type of controls is greater than or equal to 1. Optionally, the number of controls corresponding to the first type of controls is equal to the number of controls corresponding to the second type of controls. When the number of controls corresponding to the first type of controls is greater than 1, the control names of different first type of controls can be different. Similarly, when the number of controls corresponding to the second type of controls is greater than 1, the control names of different second type of controls can also be different.
[0080] Optionally, each first-type control corresponds to an empirical feature. When this empirical feature is subsequently used to generate empirical data, it becomes the aforementioned target empirical feature. Here, the empirical feature is the characteristic of the corpus obtained after extracting features from the corpus. For example... Figure 2 As shown, a schematic diagram illustrating the relationship between corpus and empirical features is provided. Figure 2 In this example, one empirical feature 22 corresponds to three corpora 21. It should be noted that in practice, one empirical feature may correspond to one corpus, or it may correspond to two or more corpora; this is not limited here.
[0081] In this embodiment, the first type of control can provide multiple experience features for the user to select. The user selects the experience feature corresponding to the selected option in the first type of control. At this time, the selected experience feature is the target experience feature mentioned above. In addition, the first type of control can also directly provide the experience feature as the target experience feature. In this case, the user does not need to select each of the displayed experience features, and each of the displayed experience features defaults to the target experience feature mentioned above.
[0082] In this embodiment, considering that the corpus corresponding to an experience feature is more readable than that of an experience feature, the experience input interface can display the corpus corresponding to the experience feature instead of displaying the experience feature itself. Specifically, the first type of control can provide multiple corpora corresponding to experience features for the user to select. The user selects the corpus corresponding to the option in the first type of control, that is, selects the experience feature corresponding to that option. At this time, the selected experience feature is the aforementioned target experience feature. On the other hand, the first type of control can also directly provide the corpus as the target experience feature. In this case, the user does not need to select from the displayed corpora, and the experience feature corresponding to each displayed corpus defaults to the aforementioned target experience feature.
[0083] In this embodiment of the application, in addition to providing the first type of control and the second type of control, the experience entry interface may also provide an add button and / or a delete button. When the add button is triggered, the number of controls of the first type of control and the number of controls of the second type of control will be increased in the experience entry interface; and when the delete button is triggered, the first type of control and the second type of control indicated by the delete button will be deleted in the experience entry interface.
[0084] For example, assuming the add button is "+", after the "+" is triggered once, the controls corresponding to both the first and second types of controls will increase. The number of controls added to the first type of controls is the same as the number of controls added to the first type of controls corresponding to a piece of experience feature information, and the number of controls added to the second type of controls is the same as the number of controls added to the second type of controls corresponding to a piece of experience feature information.
[0085] For example, if the delete button is "-", then after the "-" is triggered once, the first and second type controls corresponding to the "-" will be deleted.
[0086] In this embodiment of the application, the number of candidate logical attributes is greater than or equal to 1. When one or more candidate logical attributes in the second type of control corresponding to the target experience feature are selected, the selected candidate logical attribute is the logical attribute associated with the target experience feature. At this time, the logical attribute is used to characterize the logical relationship of the target experience feature.
[0087] In this embodiment, the logical relationship of the target experience feature includes the logical relationship between the target experience feature and the experience data corresponding to the target experience feature, and may further include the logical relationship between the target experience feature and other target experience features. When the logical relationship of the target experience feature is the logical relationship between the target experience feature and the experience data corresponding to the target experience feature, the relevant target experience feature in this embodiment refers to the target experience feature corresponding to the logical attribute, that is, the target experience feature itself. However, when the logical relationship of the target experience feature is the logical relationship between the target experience feature and other target experience features, the relevant target experience features in this embodiment refer to each target experience feature that corresponds to the same experience data and has the same logical attribute.
[0088] To more clearly describe the experience input interface provided in the embodiments of this application, the following description takes the experience input interface displaying the corpus corresponding to the target experience features as an example.
[0089] exist Figure 3 In the code, the controls corresponding to "Experience Feature ID" and "Corpus" belong to "Category 1 Controls," while the control corresponding to "Advanced Options" belongs to "Category 2 Controls." The control corresponding to "Experience Feature ID" is an input control, where users can enter their experience feature IDs. Figure 3There are three candidate logical attributes: “candidate logical attribute 1”, “candidate logical attribute 2”, and “candidate logical attribute 3”.
[0090] An experience feature ID is used to uniquely identify an experience feature. When the input control corresponding to the experience feature ID is used to input the target experience feature identifier, the control corresponding to the "corpus" in the experience input interface will display the corpus of the experience feature corresponding to that experience feature ID. For example, the experience feature ID "1011" corresponds to the corpus "corpus 2".
[0091] Since the corpus is determined by the experience feature ID, it indicates that the corpus displayed on the experience input interface is the corpus that the user wants to display. Therefore, the experience feature corresponding to this corpus is the target experience feature.
[0092] After the experience input interface displays the corpus corresponding to the target experience feature, the user can select the candidate logical attribute corresponding to that corpus (or the target experience feature corresponding to that corpus) according to actual needs. Specifically, after the electronic device detects that the user clicks the "▽" on the corresponding selection control under "Advanced Options" in the experience input interface, the hidden candidate logical attribute on the corresponding selection control will be displayed. For example... Figure 3 As shown, this displays the three candidate logical attributes hidden by the empirical feature ID "1011".
[0093] When a user needs to add a target experience feature, they can do so by clicking the "+" button in the lower right corner of the experience entry interface. Once the experience entry interface detects that the "+" button has been clicked, it will add an input box for the experience feature ID (e.g., adding a new experience feature ID input control in the row below the input control for experience feature ID "1011"), a display control for the corresponding corpus, and a selection control for the advanced options.
[0094] When a user needs to delete a displayed target experience feature, they can click the "-" button corresponding to that feature. Once the experience entry interface detects that the "-" button has been clicked, it will delete the target experience feature corresponding to that button.
[0095] In this embodiment, based on the selection operation in the experience input interface, target experience features and logical attributes associated with the target experience features are determined. Based on the target experience features and their associated logical attributes, experience data for verifying test scripts is generated. Since the experience input interface provides a first type of control for inputting target experience features, and a second type of control for selecting logical attributes associated with the target experience features from multiple candidate logical attributes, and these logical attributes characterize the logical relationships of related target experience features, the first and second types of controls in the experience input interface facilitate flexible determination of target experience features and their logical relationships. This facilitates the generation of experience data with different logical relationships, and also facilitates the generation of experience data with more complex logical relationships, thereby improving the accuracy of the generated experience data.
[0096] In some embodiments, prior to S11 above, the experience entry interface can determine the information of the experience features to be displayed in two ways. Assuming that the information of the experience features to be displayed is a corpus of experience features, the two ways can be: one way is to display the corpus corresponding to the verified test script; the other way is to display the corpus corresponding to the specified target experience feature identifier.
[0097] Optionally, when determining information about the experiential characteristics to be presented through validated test scripts:
[0098] Based on the validated test script, the options of the first type of control above display the information of the corresponding candidate experience features, and the options of the second type of control above display the candidate logical attributes associated with the candidate experience features.
[0099] The information of the candidate experience feature may include the candidate experience feature itself, or the corpus corresponding to the candidate experience feature.
[0100] In this embodiment of the application, the experience input interface can provide a test script identifier input box (or identifier input control), detect whether the identifier of the test script has been entered into the test script identifier input box, if so, search for all the corpora corresponding to the test script according to the identifier of the test script, and display them in the options of the first type of control on the same page or multiple pages, and display the candidate logical attributes associated with the candidate experience features in the options of the second type of control.
[0101] The identifier for a test script can be its ID or its name, or any other identifier that uniquely represents the test script.
[0102] To more clearly describe the experience entry interface that displays information corresponding to the validated test scripts, the following section will combine... Figure 4 Describe it.
[0103] exist Figure 4 In the test script identifier input box, "1398461" was entered. The experience entry interface displays the corpus corresponding to the test script with ID "1398461" in the first type of control (such as the two display boxes under "corpus"). If the user wants to construct experience data based on the experience feature with ID "10914", they can first select the selection box corresponding to the corpus of that experience feature to select that experience feature, and then select the second type of control corresponding to that experience feature. Figure 4 Select the corresponding candidate logical attribute from the "Association Feature Steps" and "Whether to include this feature" checkboxes.
[0104] It should be noted that the test script includes steps, corpus, and experiential features, as well as the correspondence between each experiential feature and the corpus and steps. Therefore, the experience input interface has already obtained the corresponding steps when displaying experiential features. Thus, when the candidate logical attribute "Associate Feature Steps" is selected, it means that the corresponding experiential feature is associated with the corresponding steps. When the candidate logical attribute "Whether to Include This Feature" (such as "Include") is selected, it means that the subsequently generated experience data will include the corresponding experiential feature.
[0105] Since the information of all the empirical features of a validated test script can be displayed based on the information of the validated test script, the user does not need to input the information of each empirical feature one by one. The target empirical feature and the logical attributes associated with the target empirical feature can be quickly determined based on the displayed empirical feature information, thereby improving the efficiency of generating empirical data.
[0106] Optionally, when determining the information of the target experience features to be displayed through the target experience feature identifier:
[0107] When the first type of control includes an input control for a target experience feature identifier, based on the target experience feature identifier entered in the input control, the corresponding target experience feature information is displayed in the experience input interface, and candidate logical attributes associated with the target experience feature are displayed in the options of the second type of control.
[0108] The information on the target experiential features includes: experiential features, or corpus containing experiential features.
[0109] Specifically, the electronic device detects whether information has been entered into the input control. If information is detected, the detected information is compared with the stored experience feature identifiers. If an experience feature identifier identical to the detected information is found in the stored experience feature identifiers, the corresponding target experience feature information and the candidate logical attributes associated with the target experience feature are displayed based on the experience feature identifier.
[0110] In this embodiment of the application, when multiple experience feature identifiers are entered into the input control, different experience feature identifiers may belong to the same verified test script or may not belong to the same verified test script.
[0111] To more clearly describe the experience entry interface that displays information about the target experience characteristics, the following section will combine... Figure 5 Describe it.
[0112] exist Figure 5 In the middle, the experience input interface displays the corpus of target experience features.
[0113] The first type of control includes controls corresponding to "Experience Feature ID" and "corpus". The control corresponding to "Experience Feature ID" is the aforementioned input control, used to input the target experience feature identifier.
[0114] The second category of controls includes controls corresponding to "Associated Feature Step ID" and "Advanced Options".
[0115] It should be noted that, in addition to providing the associated feature step ID for selecting the target experience feature, the experience entry interface can also display the corpus corresponding to the associated feature step ID for user viewing, which is not limited here.
[0116] Since the target experience feature identifier can be entered into the input control, the experience input interface can accurately display the corresponding target experience feature, thereby improving the accuracy of the generated experience data.
[0117] In this embodiment of the application, whether the information of the displayed experience feature is determined by the verified test script or by the target experience feature identifier, the candidate logical attribute may include at least one of the following: (1) an existence logical attribute for representing the non-existence of the corresponding target experience feature; (2) an order logical attribute for representing the order between related target experience features; (3) a first matching logical attribute for representing the matching of related target experience features in the same step when verifying the test script; and (4) a second matching logical attribute for representing the matching of related target experience features in a specified step when verifying the test script.
[0118] In some embodiments, when the candidate logical attributes include existence logical attributes used to characterize the absence of the corresponding target empirical feature, if a logical attribute associated with the target empirical feature has been determined, then S12 above includes:
[0119] If the logical attribute associated with the aforementioned target empirical feature includes the aforementioned existence logical attribute, empirical data indicating that the aforementioned target empirical feature does not exist is generated.
[0120] Among them, the existence logical attribute can be adopted as follows: Figure 4 The control indicates whether the feature is included. Alternatively, it can be... Figure 5 The control in the "Advanced Options" section indicates, for example, that... Figure 5 Replace “Candidate logical attribute 1” with “Does not contain this feature”.
[0121] For example, suppose there are three identified target experience features: target experience feature 1, target experience feature 2, and target experience feature 3. The logical attributes associated with target experience feature 1 include existence logical attributes, while the logical attributes associated with target experience feature 2 and target experience feature 3 do not include existence logical attributes. Then the generated experience data can be as follows: excluding target experience feature 1, including target experience feature 2, and including target experience feature 3.
[0122] In some scenarios, it is necessary to ensure the existence of certain conditions and the absence of others before determining whether a test script is valid (or correct). Therefore, increasing the selection of existence logic attributes can improve the accuracy of the generated experience data. For example, suppose the scenario meets the following two conditions: (1) The result of the judgment of all payment methods of user 1 according to the payment method availability rule is that the payment method is unavailable: yes; (2) The result of the bank system is verified as successful deduction. As can be seen from the above description, the experience data cannot only include the above two conditions. This is because if the user adds an available payment method and then requests the bank system to deduct the payment successfully, then the test script is valid. Therefore, in order to verify invalid test scripts, the following experience data can be generated by combining existence logic attributes: (1) The result of the judgment of all payment methods of user 1 according to the payment method availability rule is that the payment method is unavailable: yes; (2) [Not including] Adding any valid payment method; (3) The result of the bank system is verified as successful deduction. Since the case of not including is added, that is, the complexity of the logical relationship between the target experience features is increased, it is beneficial to improve the accuracy of the generated experience data.
[0123] In some embodiments, where the candidate logical attributes include a sequential logical attribute for characterizing the order among relevant target empirical features, if a logical attribute associated with the target empirical feature has been determined, then S12 above includes:
[0124] If the logical attributes associated with the aforementioned target experience features include the aforementioned sequential logical attributes, the aforementioned experience data is generated based on the aforementioned target experience features and the aforementioned sequential logical attributes.
[0125] The sequential logical attribute can be used to identify whether the target experience features included in the experience data need to be matched in a specific order by adding corresponding fields to the dimension of the experience data. This specific order includes: a forward-to-back order and a backward-to-forward order. The forward-to-back order means that when subsequently validating the test script corpus based on the experience data, the validation begins with the first target experience feature of the experience data.
[0126] Optionally, the order of the target experience features in the generated experience data can be determined according to the order in which the target experience features are determined. For example, assuming the user first selects target experience feature 2 and then selects target experience feature 1, then in the generated experience data, target experience feature 2 will be listed before target experience feature 1.
[0127] Optionally, the order of each target experience feature in the generated experience data can be determined based on the display order of the target experience feature information in the experience entry interface. For example, assuming that target experience feature 2 is displayed above target experience feature 1 in the experience entry interface, then in the generated experience data, target experience feature 2 will be listed before target experience feature 1.
[0128] Of course, the order of each objective empirical feature in the empirical data can be determined in other ways, which are not limited here.
[0129] In some embodiments, the candidate logical attribute includes a first matching logical attribute, which is used to characterize the relevant target experience features being matched in the same step during the verification test script. In this case, S12 includes:
[0130] If the logical attribute associated with the aforementioned target experience feature includes the aforementioned first matching logical attribute, the aforementioned experience data is generated based on the aforementioned target experience feature and the aforementioned first matching logical attribute.
[0131] The first matching logical attribute can be represented by the "Associate with the same step" option in the second type of control. Optionally, when the logical attribute associated with the target experience feature includes the first matching logical attribute, the target experience feature is associated with its original corresponding step by default. For example, assuming step 1 includes experience feature 1 and experience feature 2, then the original step corresponding to experience feature 1 and experience feature 2 is step 1.
[0132] For example, suppose the same experience data is generated based on the target experience features determined on the same page of the experience input interface. If both target experience feature 1 and target experience feature 2 on the same page are selected to "associate the same step", it means that when the test script is subsequently validated based on the experience data generated based on target experience feature 1 and target experience feature 2, as long as it is determined that the same step in the test script contains corpus that matches the information of both target experience feature 1 and target experience feature 2, the test script will be deemed invalid.
[0133] In this embodiment of the application, since it is possible to set whether each target experience feature is associated with the same step, the complexity of the logical relationship between the target experience features is increased, which is beneficial to improving the accuracy of the generated experience data.
[0134] In some embodiments, the candidate logical attribute includes a second matching logical attribute, which is used to characterize the relevant target experience features being matched in a manner attached to a specified step during the verification test script. In this case, S12 includes:
[0135] If the logical attribute associated with the aforementioned target experience feature includes the aforementioned second matching logical attribute, the aforementioned experience data is generated based on the aforementioned target experience feature and the aforementioned second matching logical attribute.
[0136] The second matching logical attribute can be represented in the second type of control by using the "Associated Feature Step ID" option and / or "Associated Feature Step Corpus".
[0137] Specifically, the corresponding step ID can be entered in "Associated Feature Step ID" to establish the correspondence between the step ID and the target experience feature. Of course, the corresponding corpus can also be entered in "Associated Feature Step Corpus", which is not limited here.
[0138] In this embodiment, since the steps associated with the target experience feature can be specified through the second matching logical attribute, the target experience feature can be associated with its non-original corresponding steps. Therefore, the flexibility of setting the logical relationship of the target experience feature is improved, thereby improving the accuracy of the experience data generated based on the target experience feature.
[0139] In some embodiments, the candidate logical attribute includes a third matching logical attribute, which is used to characterize the relevant target experience features being matched using regular expression matching when verifying the test script. In this case, S12 includes:
[0140] If the logical attribute associated with the aforementioned target experience feature includes the aforementioned third matching logical attribute, the aforementioned experience data is generated based on the aforementioned target experience feature and the aforementioned third matching logical attribute.
[0141] The third matching logical attribute can be represented using the "regular expression matching" option in the second type of control, such as... Figure 5 Replace “candidate logical attribute 1” with “regular expression matching”.
[0142] In this embodiment, considering that as the number of applicable scenarios for a product increases, it is usually necessary to add experience features corresponding to the increased scenarios to improve the comprehensiveness of product testing. However, increasing the number of experience features usually reduces the efficiency of generating experience data, while using regular expression matching can reduce the number of experience features that need to be entered. Therefore, the aforementioned third matching logical attribute can be added to the candidate logical attributes.
[0143] For example, in a payment scenario, if the cashier offers payment methods such as cash, installment, credit card, UnionPay QuickPass, and split payment (i.e., payments from different people), the test script is considered valid only if both the cashier payment method and the rules for selecting the payment method are the same. Otherwise, the test script is considered invalid. For instance, if the test script uses cash as the payment method, but the rules for selecting the payment method are installment, credit card, UnionPay QuickPass, or split payment, then the test script is deemed invalid.
[0144] Considering that entering experience features separately for each of these scenarios would require five experience features, we can reduce the number of features needed by changing "installment payment, credit card, UnionPay QuickPass, or Pay Later" to "non-cash payment". In this case, only one experience feature needs to be entered for "cash payment method is cash," and another for "cash payment method selection rule is non-cash payment". That is, only two experience features need to be entered. Experience data is then generated based on these two features, and regular expression matching is used to match the experience data with the test scenario.
[0145] Figure 6 This diagram illustrates a scenario where a third matching logical attribute is included in the logical attributes associated with the target experience features.
[0146] exist Figure 6In the dataset, one target experience feature is "Is the payment method installment: Yes", and the other target experience feature is the dataset corresponding to the regular expression, which is "Is the result of the cashier payment method selection rule ((?! installment).)+: Yes".
[0147] exist Figure 6 In the generated experience data, the logical attributes associated with the target experience features include both the third and first matching logical attributes. This setting improves the accuracy of subsequent test script validation. For example, if the logical attributes associated with the target experience features do not include the third matching logical attribute, then when validating the test script based on the generated experience data, the validation directly checks whether the test script contains the corpus containing the characters "Is the payment method installment: Yes" and "Is the result of the cashier payment method selection rule ((?! installment).)+: Yes", rather than checking whether the test script contains the logically matched corpus containing the characters "Is the payment method installment: Yes" and "Is the result of the cashier payment method selection rule ((?! installment).)+: Yes".
[0148] In this embodiment, since a regular expression is pre-generated, when it is necessary to generate experience data based on the regular expression, only the target experience feature identifier corresponding to the regular expression needs to be entered. There is no need to enter the identifiers of multiple experience features with the same meaning as the regular expression one by one, thereby improving the efficiency of experience feature entry and thus improving the efficiency of experience data generation.
[0149] In some embodiments, the candidate logical attribute includes a fourth matching logical attribute, which is used to characterize the relevant target experience features being matched in a rule name matching manner when verifying the test script. In this case, S12 includes:
[0150] If the logical attribute associated with the above-mentioned target experience feature includes the above-mentioned fourth matching logical attribute, the above-mentioned experience data is generated based on the above-mentioned target experience feature and the above-mentioned fourth matching logical attribute.
[0151] The fourth matching logical attribute can be represented by the "Rule Name Matching" option in the second type of control, such as... Figure 5 Replace “Candidate logical attribute 1” with “rule name matching”.
[0152] In this embodiment, an experience feature is pre-generated based on the rules applicable to the product's application scenario. Subsequently, the corresponding target experience feature can be entered into the experience entry interface based on the target experience feature identifier (or experience feature identifier) corresponding to this rule. Since a rule typically reflects multiple application scenarios, and each application scenario corresponds to at least one experience feature, the above logical attribute settings can reduce the amount of target experience feature information that needs to be entered, thereby improving the efficiency of experience data generation.
[0153] Suppose the application scenarios corresponding to the "Cashier Payment Method Information Assignment Rules" are: cash payment scenario, Pocket Money payment scenario, debit card payment scenario, and credit card payment scenario. The corresponding empirical features for these scenarios are: "Whether the result of the cashier payment method selection rule is cash," "Whether the result of the cashier payment method selection rule is Pocket Money," "Whether the result of the cashier payment method selection rule is debit card," and "Whether the result of the cashier payment method selection rule is credit card." That is, if no corresponding empirical feature is generated based on the "Cashier Payment Method Information Assignment Rules," four empirical features need to be entered separately in the empirical entry interface. However, if a corresponding empirical feature is directly generated based on the "Cashier Payment Method Information Assignment Rules," then only one empirical feature needs to be entered separately in the empirical entry interface, and then the logical attributes of that empirical feature, including the fourth matching logical attribute, can be set, thus greatly improving the efficiency of empirical data generation.
[0154] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0155] After generating experience data (or experience), the generated experience data is saved to the experience library. Then, the test script can be verified based on the experience data in the experience library.
[0156] Figure 7 This illustration shows a flowchart of a test script verification method based on an experience base provided in an embodiment of this application. At least one piece of experience data in the experience base is generated based on the aforementioned experience generation method. The test script verification method includes:
[0157] S71, match the test script corpus with the empirical data in the aforementioned experience base.
[0158] S72, if there is experience data in the above experience base that matches the above corpus, then it is determined that the above test script has a logical problem.
[0159] Specifically, the system searches for corpus corresponding to the experience data, compares the found corpus with the corpus of the test script, and if the two are the same (i.e., there is experience data in the experience base that matches the corpus of the test script), then the test script is determined to have a logical problem, that is, the test script is determined to be an invalid test script, and the test script is deleted.
[0160] Of course, if there is no experience data in the experience base that matches the corpus of the test script, the test script is determined to be a valid test script and is retained.
[0161] Optionally, after the experience data in the experience base is increased, test scripts that have already passed the original experience base (i.e., the experience base before the addition of experience data) can be re-validated. This is because, after the experience data in the experience base is increased, test scripts that have passed the original experience base validation may not pass the validation of the new experience base with increased experience data. This approach helps improve the accuracy of the final retained test scripts.
[0162] In this embodiment of the application, since at least one piece of experience data in the experience base is generated according to the above-described experience generation method, and the above-described experience generation method can generate experience data with higher accuracy, using this experience base to verify the test script is beneficial to improving the accuracy of the verification results.
[0163] In some embodiments, considering that different matching algorithms typically have different complexities, the corresponding matching algorithm can be selected to match the corpus based on the characteristics of the empirical data. For example, when the empirical data does not include existential logical attributes, a forward matching algorithm is used for matching, while when the empirical data includes existential logical attributes, a reverse matching algorithm is used for matching. In this case, S71 above includes:
[0164] If the current experience data used for matching contains experience features including the aforementioned existence logical attributes and order logical attributes, then reverse experience data is constructed, and the corpus of the aforementioned test script is matched based on the aforementioned reverse experience data. The aforementioned order logical attributes are used to characterize the order between relevant target experience features, and the aforementioned reverse experience data is the experience data obtained by removing the aforementioned existence logical attributes from the current experience data used for matching.
[0165] Specifically, when empirical data contains empirical features that include both existential and sequential logical attributes, it indicates that the empirical data cannot include the empirical feature. In this case, if the forward matching algorithm is still used for matching, it will lead to excessive complexity.
[0166] For example, suppose a piece of empirical data contains A, does not contain B, and contains C. If a forward matching algorithm is used, it is necessary to first determine whether the test script contains A, whether it contains C, and then determine whether B is not present between A and C. That is, if a forward matching algorithm (which matches based on logical attributes) is chosen for searching, every position in the test script needs to be searched. This is because A must be searched first, then C sequentially, and then B must be searched between A and C. If B is not found, the search continues to find the second C, and then B is searched between A and the second C. In other words, when using a forward matching algorithm to search corpora containing empirical features including the aforementioned existence and sequential logical attributes, it is not possible to return after finding a single satisfying sequence. For any combination of empirical features, the complexity of searching for a sequence where B does not exist between A and C is exponential, equal to the number of feature combinations.
[0167] To reduce the complexity of the search, a reverse matching algorithm can be used. That is, it considers the problem from the reverse perspective to determine whether a test scenario does not match the empirical data, rather than considering it from the forward perspective.
[0168] First, reverse empirical data is constructed. This reverse empirical data is obtained by removing the aforementioned existence logical attributes from the current empirical data used for matching. Then, the corpus corresponding to this reverse empirical data is matched with the corpus of the test script. Since the reverse empirical data has removed the existence logical attributes, when it is determined that the corpus of the reverse empirical data matches the corpus of the test script, it means that the corpus of the current empirical data used for matching does not match the test script. That is, when it is determined that the corpus of the reverse empirical data matches the corpus of the test script, the test script is determined to be a valid test script.
[0169] For example, suppose the empirical data is: containing A, not containing B, and containing C, then the reverse empirical data is constructed as: containing A, containing B, and containing C, and the corpus corresponding to this reverse empirical data is matched with the corpus of the test script.
[0170] In some embodiments, when the current empirical data used for matching includes at least two existence logical attributes, the constructed reverse empirical data includes empirical features from which at least one existence logical attribute has been removed.
[0171] Optionally, each reverse empirical data set includes empirical features that do not contain existence logical attributes, and also includes only one empirical feature with existence logical attributes removed. In this case, the number of reverse empirical data sets is equal to the number of empirical features containing existence logical attributes in the current empirical data used for matching. This setting minimizes the number of constructed reverse empirical data sets, and the set obtained by combining the constructed reverse empirical data sets constitutes a complete set. Since the matching process involves matching the corpus corresponding to each reverse empirical data set with the corpus of the test script, the fewer the number of reverse empirical data sets, the lower the complexity of the corresponding search.
[0172] For example, suppose the empirical data is: containing A, not containing B, containing C, not containing D, and containing E. Then, we can construct two subsets of the reverse empirical data: abce and acde. Here, "a" means "containing A", "b" means "containing B", "c" means "containing C", and "d" means "containing D".
[0173] To determine whether the test script's corpus matches the empirical data "contains A, does not contain B, contains C, does not contain D, contains E", we only need to check if "abce" and "acde" appear in the test script's corpus. If neither of these two reverse empirical data appears, then "abcde" will also not appear, because "abce" and "acde" are subsets of "abcde". That is, when using the reverse matching algorithm for searching, we only need to construct m (where m is the number of empirical features containing existential logical attributes) reverse empirical data and sequentially match the test script with these m reverse empirical data. Assuming the complexity of matching the test script once is O(n), then the complexity of matching m is O(n*m), which is far less than the exponential complexity.
[0174] In some embodiments, if none of the empirical features in the empirical data currently used for matching include existence logical attributes, then the corpus of the test script is matched according to the logical attributes that generated the empirical data, whereby the existence logical attributes are used to characterize the absence of the corresponding empirical feature.
[0175] The logical attributes that generate empirical data refer to the logical attributes corresponding to each empirical feature included in the empirical data. These logical attributes can be one or more of the following: existence logical attributes, order logical attributes, first-match logical attributes, etc.
[0176] In this embodiment, matching the test script corpus based on the logical attributes that generated the aforementioned experience data refers to a forward matching algorithm that matches according to the logical attributes themselves. For example, if the logical attribute includes "sequential logical attribute," then during matching, the test script corpus will be compared with the corpus containing the experience features that have the "sequential logical attribute." Through the aforementioned forward matching algorithm, it is possible to accurately determine whether the test script corpus matches the corpus containing the experience features in the experience data.
[0177] For example, suppose the empirical characteristics of the empirical data are: containing a, containing b, and containing c, meaning that the empirical data does not include existence logical attributes. Then, determine whether there exists corpus in the test script that matches the corpus corresponding to a, the corpus that matches the corpus corresponding to b, and the corpus that matches the corpus corresponding to c. If all of these exist, then the test script is deemed invalid.
[0178] In some embodiments, when a test script is determined to be a valid test script, a corresponding test script is generated based on that test script. After the test script is generated, if certain conditions exist, the generated test script needs to be revoked. That is, after S71, the following is also included:
[0179] A1. If there is no experience data matching the above corpus in the above experience base, then generate a test script based on the above test script.
[0180] A2. If the target conditions are detected, the generated test script is revoked based on the experience data corresponding to the test script. The target conditions include at least one of the following: the system test cases corresponding to the test script do not match the test script, the test resources corresponding to the test script are not ready, or the test environment corresponding to the test script has defects.
[0181] Specifically, before running the test script, the test environment can be analyzed for defects, such as whether the network speed meets the requirements. If so, the test environment is determined to be defective. In addition, the test resources can be analyzed to see if they meet the preset resource requirements. For example, is a certain resource missing? If so, the test resources are determined to be unavailable.
[0182] In this embodiment of the application, if during the debugging process of the test script, it is found that the steps executed by the test script do not match the steps recorded in the system test cases, then it is determined that the system test cases corresponding to the test script do not match the test script.
[0183] In this embodiment, when a target condition is detected, the generated test script is revoked based on empirical data. Since the test script is generated from a test playbook, and the test playbook is verified based on empirical data, the generated test script can be accurately revoked based on the empirical data. Furthermore, since only the test script is revoked, and not the corresponding test playbook, a corresponding test script can be quickly constructed based on the test playbook when the target condition does not exist.
[0184] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0185] Corresponding to the experience generation method described in the above embodiments, Figure 8 The diagram shows a structural block diagram of an experience generation apparatus provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0186] Reference Figure 8 The experience generation device 8 includes a target experience feature determination module 81 and an experience data generation module 82.
[0187] in:
[0188] The target experience feature determination module 81 is used to determine the target experience features and the logical attributes associated with the target experience features based on the selection operation in the experience input interface.
[0189] The experience data generation module 82 is used to generate experience data based on the aforementioned target experience features and the logical attributes associated with the aforementioned target experience features. The aforementioned experience data is used to verify the test script.
[0190] The experience input interface provides a first type of control and a second type of control. The first type of control provides the function of inputting target experience features, and the second type of control provides the function of selecting logical attributes associated with the target experience features from multiple candidate logical attributes. The logical attributes are used to characterize the logical relationship of related target experience features.
[0191] In this embodiment, based on the selection operation in the experience input interface, target experience features and logical attributes associated with the target experience features are determined. Based on the target experience features and their associated logical attributes, experience data for verifying test scripts is generated. Since the experience input interface provides a first type of control for inputting target experience features, and a second type of control for selecting logical attributes associated with the target experience features from multiple candidate logical attributes, and these logical attributes characterize the logical relationships of related target experience features, the first and second types of controls in the experience input interface facilitate flexible determination of target experience features and their logical relationships. This facilitates the generation of experience data with different logical relationships, and also facilitates the generation of experience data with more complex logical relationships, thereby improving the accuracy of the generated experience data.
[0192] Optionally, the experience generation apparatus 8 provided in this application embodiment further includes:
[0193] The first display module is used to display the information of the corresponding candidate experience features in the options of the first type of control and the candidate logical attributes associated with the candidate experience features in the options of the second type of control based on the verified test script before the target experience features and the selected operation in the experience input interface are determined.
[0194] Optionally, the first type of control mentioned above includes an input control for target experience feature identifiers. The experience generation device 8 provided in this application embodiment also includes:
[0195] The second display module is used to display the information of the corresponding target experience feature in the experience input interface based on the target experience feature identifier entered in the input control before determining the target experience feature and the logical attributes associated with the target experience feature in the selection operation in the experience input interface, and to display the candidate logical attributes associated with the target experience feature in the options of the second type of control.
[0196] In some embodiments, the above-mentioned candidate logical attributes include: logical attributes used to characterize the existence of the corresponding target empirical features;
[0197] Correspondingly, the aforementioned experience data generation module 82 is specifically used for:
[0198] If the logical attribute associated with the aforementioned target empirical feature includes the aforementioned existence logical attribute, empirical data indicating that the aforementioned target empirical feature does not exist is generated.
[0199] In some embodiments, the above-mentioned candidate logical attributes include: a sequential logical attribute for characterizing the order among relevant target empirical features;
[0200] Correspondingly, the aforementioned experience data generation module 82 is specifically used for:
[0201] If the logical attributes associated with the aforementioned target experience features include the aforementioned sequential logical attributes, the aforementioned experience data is generated based on the aforementioned target experience features and the aforementioned sequential logical attributes.
[0202] In some embodiments, the candidate logical attributes include: a first matching logical attribute, wherein the first matching logical attribute is used to characterize the relevant target experience features being matched in the same step when verifying the test script;
[0203] Correspondingly, the aforementioned experience data generation module 82 is specifically used for:
[0204] If the logical attribute associated with the aforementioned target experience feature includes the aforementioned first matching logical attribute, the aforementioned experience data is generated based on the aforementioned target experience feature and the aforementioned first matching logical attribute.
[0205] In some embodiments, the candidate logical attribute includes a second matching logical attribute, which is used to characterize the relevant target experience features being matched in a manner attached to a specified step when verifying the test script;
[0206] Correspondingly, the aforementioned experience data generation module 82 is specifically used for:
[0207] If the logical attribute associated with the aforementioned target experience feature includes the aforementioned second matching logical attribute, the aforementioned experience data is generated based on the aforementioned target experience feature and the aforementioned second matching logical attribute.
[0208] In some embodiments, the above-mentioned candidate logical attributes include: a third matching logical attribute, wherein the third matching logical attribute is used to characterize the relevant target experience features being matched in a regular expression manner when verifying the test script;
[0209] Correspondingly, the aforementioned experience data generation module 82 is specifically used for:
[0210] If the logical attribute associated with the aforementioned target experience feature includes the aforementioned third matching logical attribute, the aforementioned experience data is generated based on the aforementioned target experience feature and the aforementioned third matching logical attribute.
[0211] In some embodiments, the above candidate logical attributes include: a fourth matching logical attribute, which is used to characterize the relevant target experience features being matched in a rule name matching manner when verifying the test script;
[0212] Correspondingly, the aforementioned experience data generation module 82 is specifically used for:
[0213] If the logical attribute associated with the above-mentioned target experience feature includes the above-mentioned fourth matching logical attribute, the above-mentioned experience data is generated based on the above-mentioned target experience feature and the above-mentioned fourth matching logical attribute.
[0214] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0215] Corresponding to the experience generation method described in the above embodiments, Figure 9 The diagram shows a structural block diagram of a test script verification device based on an experience base provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0216] Reference Figure 9 At least one piece of experience data in the experience database of the experience database-based test script verification device 9 is generated based on the experience generation method described above. The experience database-based test script verification device 9 includes: an experience feature matching module 91 and a matching result determination module 92. Wherein:
[0217] The experience feature matching module 91 is used to match the corpus of the test script with the experience data in the aforementioned experience database.
[0218] The matching result determination module 92 is used to determine that the above test script has a logical problem if there is experience data in the above experience base that matches the above corpus.
[0219] In this embodiment of the application, since at least one piece of experience data in the experience base is generated according to the above-described experience generation method, and the above-described experience generation method can generate experience data with higher accuracy, using this experience base to verify the test script is beneficial to improving the accuracy of the verification results.
[0220] In some embodiments, the empirical feature matching module 91 described above is specifically used for:
[0221] If the current experience data used for matching contains experience features including the aforementioned existence logical attributes and order logical attributes, then reverse experience data is constructed, and the corpus of the aforementioned test script is matched based on the aforementioned reverse experience data. The aforementioned order logical attributes are used to characterize the order between relevant target experience features, and the aforementioned reverse experience data is the experience data obtained by removing the aforementioned existence logical attributes from the current experience data used for matching.
[0222] In some embodiments, the experience-based test script verification device 9 further includes:
[0223] The test script generation module is used to generate a test script based on the test script if, after matching the test script corpus with the experience data in the experience database, there is no experience data in the experience database that matches the corpus.
[0224] The test script cancellation module is used to cancel the generated test script based on the experience data corresponding to the test script when a target condition is detected. The target condition includes at least one of the following: the system test cases corresponding to the test script do not match the test script, the test resources corresponding to the test script are not ready, or the test environment corresponding to the test script has defects.
[0225] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0226] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 10 As shown, the electronic device 10 of this embodiment includes: at least one processor 100 ( Figure 10 The diagram shows only one processor, a memory 101, and a computer program 102 stored in the memory 101 and executable on at least one processor 100. When the processor 100 executes the computer program 102, it implements the steps in any of the above method embodiments.
[0227] The aforementioned electronic device 10 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. This electronic device may include, but is not limited to, a processor 100 and a memory 101. Those skilled in the art will understand that... Figure 10 This is merely an example of electronic device 10 and does not constitute a limitation on electronic device 10. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0228] The processor 100 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0229] In some embodiments, the aforementioned memory 101 may be an internal storage unit of the electronic device 10, such as a hard disk or memory of the electronic device 10. In other embodiments, the aforementioned memory 101 may be an external storage device of the electronic device 10, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 100. Furthermore, the aforementioned memory 101 may include both internal storage units and external storage devices of the electronic device 10. The aforementioned memory 101 is used to store operating systems, applications, bootloaders, data, and other programs, such as the program code of the aforementioned computer programs. The aforementioned memory 101 may also be used to temporarily store data that has been output or will be output.
[0230] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0231] This application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, it implements the steps in any of the above method embodiments.
[0232] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the various method embodiments described above.
[0233] This application provides a computer program product that, when run on an electronic device, enables the electronic device to implement the steps described in the various method embodiments above.
[0234] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0235] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0236] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0237] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0238] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0239] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An experience generation method characterized by comprising: The method comprises: determining a target experience feature and a logical attribute associated with the target experience feature based on a selected operation in an experience entry interface; generating experience data based on the target experience feature and the logical attribute associated with the target experience feature, the experience data being used to verify a test script; wherein the experience entry interface provides a first type of control and a second type of control, the first type of control providing a function of entering the target experience feature, and the second type of control providing a function of selecting a logical attribute associated with the target experience feature from a plurality of candidate logical attributes, the logical attribute being used to represent a logical relationship of the relevant target experience feature.
2. The experience generation method of claim 1, wherein, Before the determining of the target experience feature and the logical attribute associated with the target experience feature based on the selected operation in the experience entry interface, the method further comprises: based on the verified test script, displaying information of a corresponding candidate experience feature in the options of the first type of control, and displaying candidate logical attributes associated with the candidate experience feature in the options of the second type of control.
3. The experience generation method of claim 1, wherein, The first type of control comprises an entry control of a target experience feature identifier, and before the determining of the target experience feature and the logical attribute associated with the target experience feature based on the selected operation in the experience entry interface, the method further comprises: based on the target experience feature identifier entered in the entry control, displaying information of a corresponding target experience feature in the experience entry interface, and displaying candidate logical attributes associated with the target experience feature in the options of the second type of control.
4. The empirical generation method according to any one of claims 1 to 3, characterized in that, The candidate logical attributes comprise a presence logical attribute used to represent absence of the corresponding target experience feature; The generating of the experience data based on the target experience feature and the logical attribute associated with the target experience feature comprises: in a case where the presence logical attribute is included in the logical attribute associated with the target experience feature, generating experience data indicating absence of the target experience feature.
5. The empirical generation method according to any one of claims 1 to 3, characterized in that, The candidate logical attributes comprise a sequence logical attribute used to represent an order between the relevant target experience features; The generating of the experience data based on the target experience feature and the logical attribute associated with the target experience feature comprises: in a case where the sequence logical attribute is included in the logical attribute associated with the target experience feature, generating the experience data based on the target experience feature and the sequence logical attribute.
6. The experience generation method according to any one of claims 1 to 3, wherein The candidate logical attributes comprise a first matching logical attribute used to represent that the relevant target experience features are matched in a manner of being mounted in the same step when verifying the test script; The generating of the experience data based on the target experience feature and the logical attribute associated with the target experience feature comprises: in a case where the first matching logical attribute is included in the logical attribute associated with the target experience feature, generating the experience data based on the target experience feature and the first matching logical attribute.
7. The experience generation method according to any one of claims 1 to 3, wherein The candidate logical attributes comprise a second matching logical attribute used to represent that the relevant target experience features are matched in a manner of being mounted in a specified step when verifying the test script; The generating experience data based on the target experience feature and the logical attribute associated with the target experience feature comprises: In a case where the second matching logical attribute is included in the logical attribute associated with the target experience feature, the experience data is generated based on the target experience feature and the second matching logical attribute.
8. The experience generation method of claim 1 or 3, wherein, The candidate logical attribute comprises a third matching logical attribute, which is used to represent that the related target experience feature is matched in a regular matching manner when the test script is checked. The generating experience data based on the target experience feature and the logical attribute associated with the target experience feature comprises: In a case where the third matching logical attribute is included in the logical attribute associated with the target experience feature, the experience data is generated based on the target experience feature and the third matching logical attribute.
9. The experience generation method of claim 1 or 3, wherein, The candidate logical attribute comprises a fourth matching logical attribute, which is used to represent that the related target experience feature is matched in a rule name matching manner when the test script is checked. The generating experience data based on the target experience feature and the logical attribute associated with the target experience feature comprises: In a case where the fourth matching logical attribute is included in the logical attribute associated with the target experience feature, the experience data is generated based on the target experience feature and the fourth matching logical attribute.
10. An experience base-based test script verification method, characterized by, At least one experience data in the experience library is generated based on the experience generation method in any one of claims 1 to 9, and the test script checking method comprises: matching a corpus of a test script with experience data in the experience library; if there is experience data in the experience library that matches the corpus, determining that the test script has a logical problem.
11. The test script verification method of claim 10, wherein, The matching a corpus of a test script with experience data in the experience library comprises: if there is an experience feature comprising the existence logical attribute and a sequence logical attribute in the experience data currently used for matching, constructing reverse experience data and matching the corpus of the test script according to the reverse experience data, wherein the sequence logical attribute is used to represent the sequence between the related target experience features, and the reverse experience data is experience data obtained by eliminating the existence logical attribute from the experience data currently used for matching.
12. The test script verification method of claim 10 or 11, wherein, After the matching a corpus of a test script with experience data in the experience library, the method further comprises: if there is no experience data in the experience library that matches the corpus, generating a test script according to the test script; in a case where a target condition is detected, revoking the generated test script according to the experience data corresponding to the test script, wherein the target condition comprises at least one of the following: the system use case corresponding to the test script does not match the test script, the test resource corresponding to the test script is not ready, and the test environment corresponding to the test script has a defect.
13. An experience generation apparatus characterized by comprising: comprises: a target experience feature determination module, configured to determine a target experience feature and a logical attribute associated with the target experience feature based on a selected operation in an experience entry interface; An experience data generation module is configured to generate experience data based on the target experience feature and a logical attribute associated with the target experience feature, the experience data being used to verify the test script; The experience input interface provides a first type of control and a second type of control, the first type of control providing a function of inputting the target experience feature, and the second type of control providing a function of selecting a logical attribute associated with the target experience feature from a plurality of candidate logical attributes, the logical attribute being used to represent a logical relationship of the relevant target experience feature.
14. An experience base-based test script verification apparatus, characterized by comprising: At least one experience data in the experience library is generated based on the experience generation method according to any one of claims 1 to 9, and the test script verification device comprises: An experience feature matching module is configured to match a corpus of a test script with experience data in the experience library; A matching result determination module is configured to determine that the test script has a logical problem if there is experience data matching the corpus in the experience library.
15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the method according to any one of claims 1 to 9 when executing the computer program, or the processor implements the method according to any one of claims 10 to 12 when executing the computer program.
16. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to implement the method according to any one of claims 1 to 9, or to implement the method according to any one of claims 10 to 12.
