Data generation, recommendation and testing methods, electronic devices, and storage media
By generating test value indicators and user value distribution related to the functional modules of the aggregation platform application software and matching the test case distribution, the problem of low testing efficiency and accuracy of the aggregation platform application software is solved, and efficient test case recommendation and regression testing are achieved.
Patent Information
- Application Number
- CN202210038458.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-01-13
AI Technical Summary
The regression testing link of aggregation platform application software is long and the degree of coupling of functional modules is high, resulting in poor testing efficiency and accuracy, and it cannot be applied to conventional mobile automatic testing solutions.
Generate the test value corresponding to the functional modules of the application software and the test value indicators, including the user visits and the degree of user safety correlation, generate the test value conditions corresponding to the test value indicators, and recommend test cases and conduct tests by matching the user value distribution and test case distribution.
It improves the efficiency and accuracy of testing, reduces omissions or misjudgments of test cases, reduces testing costs, and is suitable for aggregation platform application software with a wide range of functional modules and software version iterations quickly.
Smart Images

Figure CN114153748B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a data generation, recommendation and testing method, an electronic device and a storage medium. Background Art
[0002] Aggregation platform application software can integrate various services, not only providing users with rich and fast service interfaces, but also providing service access for some service platforms. These service platforms can also share the user base of the aggregation platform and obtain other resources of the aggregation platform.
[0003] Compared with other application software, aggregation platform application software has the characteristics of numerous functional modules and rapid software version updates, which makes the regression test chain longer.
[0004] On the one hand, for aggregation platform application software, the degree of coupling between various functional modules is high, and the functions of each functional module depend on the implementation of other functional modules. The workload of regression testing is large, and it is not suitable for conventional mobile terminal automatic testing solutions.
[0005] On the other hand, the background of aggregation platform application software has a long server chain. Different servers in the server chain are used to process different types of service data. Functional modules may have deep dependencies with multiple servers, and each functional module cannot be reliably separated, resulting in poor testing efficiency and accuracy. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a data generation, recommendation and testing method, an electronic device and a storage medium to at least partially solve the above problems.
[0007] According to a first aspect of an embodiment of the present invention, a data generation method is provided, comprising: generating test values corresponding to test value indicators for each functional module of application software, wherein the test values at least indicate a positive correlation with the user access volume and / or user security relevance of each functional module; and generating test value conditions corresponding to the test requirements of the application software and the test value indicators.
[0008] In another implementation of the present invention, generating the test value corresponding to the test value indicator for each functional module of the application software includes generating, for each functional module of the application software, a functional importance corresponding to an importance label and a change relevance corresponding to a change relevance label. The functional importance is positively correlated with the user access volume and / or user security relevance of each functional module, and the change relevance indicates the degree of change in the code of each functional module when the application software version changes.
[0009] In another implementation of the present invention, the test value conditions for generating the test requirements of the application software and corresponding to the test value indicators include: generating the functional importance conditions for generating the test requirements of the application software and corresponding to the importance labels, and change correlation conditions corresponding to the change correlation labels.
[0010] In another implementation of the present invention, the generating of the test requirements of the application software and the functional importance conditions corresponding to the importance labels, as well as the change relevance conditions corresponding to the change relevance labels, includes: combining the importance labels and change relevance labels of each functional module to obtain multiple recommended scenarios; and generating the test requirements and the functional importance conditions corresponding to the importance labels, as well as the change relevance conditions corresponding to the change relevance labels based on each recommended scenario.
[0011] In another implementation of the present invention, the generation of functional importance corresponding to importance labels of various functional modules of application software includes: clustering the various functional modules of the application software according to the online visits to the various functional modules to form multiple clusters; sorting the multiple clusters from large to small according to the number of functional modules included in each of the multiple clusters; determining the functional importance corresponding to the importance label of each functional module according to the ranking number of the cluster where the functional module is located, and the ranking number of the cluster where each functional module is located indicates the user value of the functional module.
[0012] In another implementation of the present invention, the generation of change correlations corresponding to the various functional modules of the application software and the change correlation labels includes: obtaining the mapping relationship between the code of the application software and the various functional modules; determining whether the code of the application software changes with the version change of the application software; if so, determining the change correlation label of the functional module whose code has the mapping relationship as being related to the code change; if not, determining the change correlation label of the functional module whose code has the mapping relationship as being unrelated to the code change.
[0013] In another implementation of the present invention, determining whether the code of the application software changes with the version change of the application software includes: determining a first code before the version change of the application software and a second code after the version change; performing a code difference test on the first code and the second code to determine whether the second code has changed relative to the first code.
[0014] According to a second aspect of an embodiment of the present invention, a recommendation method is provided, comprising: matching the user value distribution of each functional module of application software with the test case distribution of each functional module, the user value distribution indicating the distribution of user visits and / or user security relevance of each functional module, and the test case distribution indicating the distribution of the number of test cases of each functional module and / or the distribution of the priority of the test cases; obtaining a recommendation request, the recommendation request including the test requirements of the application software; generating a test value condition of the test requirements of the application software according to the data generation method described in the first aspect; determining at least one functional module whose test value meets the test value condition; and recommending a test case corresponding to the at least one functional module.
[0015] In another implementation of the present invention, the matching of the user value distribution of each functional module of the application software with the test case distribution of each functional module includes: adjusting the division of the functional modules of the application software so that the user value distribution of each module matches the test case distribution of each functional module.
[0016] According to a third aspect of an embodiment of the present invention, a testing method is provided, comprising: obtaining a test request; generating a recommendation request for a test case based on the test request; obtaining a test case recommended by the recommendation method described in the second aspect based on the recommendation request; and testing the application software based on the test case.
[0017] According to a fourth aspect of an embodiment of the present invention, an electronic device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in any one of the first to third aspects.
[0018] According to a fifth aspect of an embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method according to any one of the first to third aspects is implemented.
[0019] In the data generation method of the embodiment of the present invention, the test value at least indicates a positive correlation with the user access volume and / or user security relevance of each functional module, thereby ensuring the reliability of the test value indicator. In addition, through the test value indicator, the test requirements of the application software are associated with each functional module, and modules whose test value meets the test value conditions can be selected for testing, thereby improving the efficiency and accuracy of the test.
[0020] In addition, in the recommendation method of an embodiment of the present invention, the matching degree between test cases and user values is improved by matching the user value distribution of each functional module of the application software with the test case distribution of each functional module. Therefore, when recommending test cases for at least one functional module to be tested, the user value of the test is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0022] Figure 1 FIG. 4 is a network architecture diagram of a test system according to an embodiment of the present invention.
[0023] Figure 2 FIG. 4 is a flowchart of the steps of a testing method according to another embodiment of the present invention.
[0024] Figure 3 The present invention is a flowchart of a test case recommendation method according to another embodiment of the present invention.
[0025] Figure 4 The figure is a flowchart of a data generation method according to another embodiment of the present invention.
[0026] Figure 5 FIG. 4 is a schematic structural diagram of an electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.
[0028] The specific implementation of the embodiment of the present invention is further described below with reference to the accompanying drawings of the embodiment of the present invention.
[0029] Figure 1 FIG. 4 is a network architecture diagram of a test system according to an embodiment of the present invention. Figure 1 The testing system includes a testing device 110 , a recommendation server 120 , a data processing server 130 , and an application server 140 .
[0030] Specifically, the test device 110 can be implemented as a server or a terminal device. The test device 110 can be installed with a client application 112 of the application software and configured with a test module 111. The test module 111 can call the functions of the client application 112 based on preset test cases to implement application software testing, such as regression testing.
[0031] When the client application 112 is called, it interacts with the server application 141 installed in the application server 140 and returns interaction data. The test module 111 further evaluates the test results based on the interaction data.
[0032] Alternatively, the test module 111 of the test device 110 may also interact directly with the server application 141 .
[0033] Furthermore, the testing device 110 can obtain test cases from the recommendation server 120 and input them into the testing module 111 for testing. For example, the testing device 110 can send a recommendation request to the recommendation server 120 to obtain test cases as recommendation results. In one example, the testing device 110 can send the recommendation request based on a test request input by a user. The test request can include application software testing requirements, which are then sent to the recommendation server 120 via the recommendation request.
[0034] Furthermore, the recommendation server 120 may pre-process the test data to obtain test cases that match the test requirements. The recommendation server 120 may pre-process the test data or perform pre-processing via the data processing server 130 and obtain the data from the data processing server 130.
[0035] In an example, the source of the test data may be manual input by a tester into the data processing server 130 , or may be historical data or real-time data obtained by the data processing server 130 from the application server 140 .
[0036] It should be understood that the above-mentioned test system is merely exemplary, and at least two of the recommendation server 120, the data processing server 130 and the application server 140 can be deployed or configured in the same physical server or the same server cluster, and the recommendation server 120, the data processing server 130 and the application server 140 can serve as the same or different nodes in the background server link of the application software.
[0037] It should also be understood that the application server 140 in this example is only shown as a virtual device, but the application server 140 can serve as the background of the aggregation platform type application and be implemented as a server link. The various servers in the server link are coupled to implement the various functional modules of the aggregation platform type application.
[0038] Figure 2 FIG. 1 is a flow chart of steps of a test method according to another embodiment of the present invention. In one example, the test method of this embodiment can be performed by Figure 1 The test device 110 and the application server 140 in the embodiment are implemented.
[0039] The testing method of this embodiment includes:
[0040] S210: Obtain a test request.
[0041] It should be understood that a test request can include test requirements for the application software. In one example, the test request can be implemented by a tester operating the test device 110. For example, the test module 111 of the test device 110 includes a human-computer interaction interface, and the tester triggers the test module 111 via the human-computer interaction interface. Furthermore, the test module 111 can obtain test cases based on the test request and then test the application software based on the test cases.
[0042] It should also be understood that the application software may be an aggregated platform application. The various functional modules of the application software may be coupled to each other. The server link of the application software may include multiple server nodes, with the various functional modules coupled via the server nodes. The server link of the application software may be implemented as application server 140.
[0043] S220: Generate a recommendation request for a test case based on the test request.
[0044] It should be understood that the test requirements may be encapsulated into a recommendation request and then sent to a test case recommendation module or a recommendation platform such as the recommendation server 120 .
[0045] S230: According to the recommendation request, obtain test cases recommended according to the recommendation method.
[0046] It should be understood that the test device 110 can send a recommendation request to the recommendation server 120 via a network interface and obtain test cases. The recommendation server 120 can then determine test cases that match the test requirements included in the recommendation request. The recommendation server 120 can perform the matching based on pre-stored mapping relationships or obtain the mapping relationships from the data processing server 130.
[0047] S240: Test the application software based on the test case.
[0048] It should be understood that, as an example, a test case may be entered into Figure 1 The test module 111 of the test device 110, or the test module 111 obtains a test case and performs a test on the corresponding software.
[0049] It should also be understood that a test case may include an access request based on client application 112. Through interaction between client application 112 and server application 141, the data in the access request is processed by various functional modules of server application 141, and a processing result is returned. Test module 111 evaluates the test result based on the processing result.
[0050] Figure 3 FIG. 1 is a flowchart of a test case recommendation method according to another embodiment of the present invention. In one example, the recommendation method of this embodiment can be performed by Figure 1 The recommendation server 120 in the embodiment is implemented.
[0051] The recommended method of this embodiment includes:
[0052] S310: Match the user value distribution of each functional module of the application software with the test case distribution of each functional module, the user value distribution indicates the distribution of user visits and / or user security relevance of each functional module, and the test case distribution indicates the distribution of the number of test cases of each functional module and / or the distribution of the priority of the test cases.
[0053] It should be understood that the various functional modules include but are not limited to at least one of a payment module, an account module, a navigation module, a positioning module, a search module, a ride-hailing module, a setting module, and a push module.
[0054] It should also be understood that user value can indicate the number of user visits to a functional module. For example, for functional modules such as driving navigation, the number of user visits during a specific period is high, resulting in a higher user value for such functional modules. For another example, functional modules such as payment modules and user privacy-related modules are more relevant to user security and therefore have a lower user value. Conversely, functional modules with low user visits or less relevance to user security have a lower user value.
[0055] Furthermore, the functional modules can be further divided. When the functional modules are further divided, the user value of the further divided functional modules is less than that of the undivided functional modules, and the number of test cases for the further divided functional modules is less than that of the undivided functional modules. The corresponding test case distribution can be adjusted by dividing the functional modules.
[0056] Furthermore, the matching of the distribution of user value of the functional modules with the distribution of test cases of the functional modules may mean that the statistical indicators of the distribution of user value of each functional module are consistent with the statistical indicators of the distribution of test cases of the functional modules. For example, functional modules with greater user value have more test cases and / or more high-priority test cases, while functional modules with lower user value have fewer test cases and / or fewer high-priority test cases.
[0057] S320: Obtain a recommendation request, where the recommendation request includes testing requirements for the application software.
[0058] S330: Generate test value conditions for the test requirements of the application software according to the data generation method.
[0059] S340: Determine at least one functional module whose test value meets the test value condition.
[0060] S350: Recommend a test case corresponding to at least one functional module.
[0061] In the recommendation method of an embodiment of the present invention, the matching degree between test cases and user values is improved by matching the user value distribution of each functional module of the application software with the test case distribution of each functional module. Therefore, when recommending test cases for at least one functional module to be tested, the user value of the test is improved.
[0062] In addition, unlike conventional mobile testing solutions, in the regression testing process of aggregation platform application software, the large number of functional modules leads to a large stock of regression test cases. With the iteration of software products, the increment of regression test cases is also large, and the number of test cases grows rapidly. The recommendation method of this embodiment improves the matching degree between test cases and user value, and avoids the situation where the user value of a large number of test cases is not high.
[0063] In other words, the recommendation method of this embodiment implements automated test case recommendation, improving recommendation accuracy and avoiding test case omissions or misjudgments caused by manual recommendation. Furthermore, the solution of this embodiment of the present invention is universally applicable to a large number of test cases for functional modules and a large number of application software versions. This eliminates the need for extensive software configuration changes tailored to specific application software versions or test case counts, reducing software configuration costs.
[0064] In other examples, matching the user value distribution of each functional module of the application software with the test case distribution of each functional module includes: adjusting the division of the functional modules of the application software so that the user value distribution of each module matches the test case distribution of each functional module. For example, functional modules with low user value can be removed to improve the matching degree between the user value distribution and the test case distribution. In other words, the online user usage data of the application software can be analyzed, and based on at least one of the average number of online users, the rate of change in the number of users, the number of code errors, and the length of time the function has existed, redundant functions of the application software can be identified and the relevant functions can be taken offline, thereby saving testing costs and reducing test quality risks.
[0065] Alternatively, the test case distribution of each functional module can be adjusted so that the user value distribution of each module matches the test case distribution of each functional module. For example, test cases that reduce the match with the user value distribution of each functional module can be removed, or test cases that improve the match with the user value distribution of each functional module can be added.
[0066] More specifically, a first functional module and a second functional module can be identified within the functional modules of the application software. Then, based on the user value difference between the first functional module and the second functional module, as well as the test case difference between the first functional module and the second functional module, the division between the first functional module and the second functional module can be adjusted to match the user value difference with the test case difference. Because the first functional module and the second functional module are part of the functional modules within the application software, adjusting the division between the first functional module and the second functional module to match the user value difference with the test case difference achieves partial adjustment of the functional modules and improves the efficiency of module division adjustment.
[0067] Figure 4 FIG. 1 is a flow chart of steps of a data generation method according to another embodiment of the present invention. In one example, the data generation method of this embodiment can be performed by Figure 1 The data processing server 130 in the embodiment is implemented.
[0068] The data generation method of this embodiment includes:
[0069] S410: Generate test values corresponding to test value indicators for each functional module of the application software, where the test value at least indicates a positive correlation with the user access volume and / or user security relevance of each functional module.
[0070] It should be understood that, on the one hand, the user access volume and / or user security relevance of each functional module reflects user value; the higher the user value, the higher the testing value of the functional module. On the other hand, testing value can also be reflected in the correlation between the functional module code and the version changes of the application software. The greater this correlation, the greater the necessity for testing and the corresponding higher the testing value. In other words, not testing will bring a greater risk of software failure.
[0071] It should also be understood that the test value indicator can be one or more indicators. For example, it can be specifically implemented as one or more tags, such as at least one of a function importance tag and a change relevance tag related to user value. Furthermore, the function importance tag and the change relevance tag can each be implemented as one or more tags.
[0072] S420: Generate test value conditions corresponding to the test requirements of the application software and the test value indicators.
[0073] It should be understood that the test value condition is a condition for the test value of a functional module. If the test value is quantified, the test value condition can be a test value threshold. For example, on a scale of 0-9, which indicates increasing test value, if the test value condition indicates 7, then the test requirement is to test those functional modules with a test value of 7 or higher. Of course, the aforementioned test value numerical value only corresponds to one test value indicator.
[0074] In the solution of the embodiment of the present invention, the test requirements of the application software are associated with each functional module through the test value index, and the modules whose test value meets the test value conditions can be selected for testing, thereby improving the efficiency and accuracy of the test. In addition, the test value at least indicates a positive correlation with the user access volume and / or user security relevance of each functional module, thereby ensuring the reliability of the test value index.
[0075] In other examples, generating test value conditions corresponding to the test requirements of application software and test value indicators includes: generating functional importance conditions corresponding to the test requirements of application software and importance labels. Specifically, the importance label indicates the importance of the functional module. User value can be positively correlated with the number of user visits to the functional module. User value can also be determined based on the number of user visits to the functional module. User value can indicate the value of the test case. Therefore, based on the module importance level and the code change relevance assessment, the objective judgment of the functional module is improved and the factors of the supervisor's judgment are reduced.
[0076] Specifically, first, each functional module of the application software can be clustered based on its online visit volume to form multiple clusters. It should be understood that cluster analysis is a statistical analysis method for studying (sample or indicator) classification problems. Since the functional modules are clustered based on user visit volume, the functional modules can be effectively classified into levels. Therefore, the user value of the functional modules belonging to each cluster is determined to be positively correlated with the ranking number of the cluster, achieving an accurate estimation of the user value. Especially when the number of functional modules is small, the functional modules are clustered, and the multiple clusters obtained are usually less than the number of functional modules, avoiding determining too many levels of user value and reducing data processing efficiency. For example, the above clustering process can be performed using k-means clustering. For a given set of functional modules and the required number of clusters k (k is specified by the user), the k-means algorithm can repeatedly divide the functional modules into k clusters based on the distance function.
[0077] In other words, the user visits to the online tracking points associated with each functional module can be monitored, and the functional modules can be clustered according to the user visits to form multiple clusters. It should be understood that the online tracking points collect information in a specific process in the application software, which is used to track the information of the application software being visited multiple times by one user, the information being visited by multiple users, or the information being visited multiple times by multiple users, and is subsequently used to further optimize the application software or provide operational data support, including the number of visits (Visits), the number of visitors UV (Visitor), the length of stay (Time On Site), the number of page views PV (PageViews) and the bounce rate (Bounce Rate). Information can be collected through page statistics (track this virtual page view) and statistical operation behavior (track this button by an event).
[0078] In one example, the platform application software may include a first module and a second module as multiple functional modules. For example, the first module and the second module may be mini-programs corresponding to different service platforms, such as the first module corresponding to a taxi-hailing mini-program and the second module corresponding to a food mini-program.
[0079] The first module corresponds to the first user, and the second module corresponds to the second user. The test value of the first module corresponding to the first user is greater, and the test value of the first module corresponding to the second user is smaller.
[0080] The first test case for the first module can be generated based on the access data of the first user and the second user, and the second test case for the second module can be generated based on the access data of the first user and the second user. The distribution of the first test case for the first module matches the ratio of the access data volume of the first user and the second user, wherein the first user's access data volume distribution ratio is larger. The distribution of the second test case for the second module matches the ratio of the access data volume of the second user to the first user, wherein the second user's access data volume distribution ratio is larger. Since the first user and the second user are both users of the aggregation platform application software, there is a certain correlation. Therefore, compared with the case where the first test case for the first module is generated only based on the access data of the first user, or compared with the case where the second test case for the second module is generated only based on the access data of the second user, the test effect of the test case is improved. In addition, the first user has greater test value for the first module than the second user, and the second user has greater test value for the second module than the first user. Based on the above matching relationship, the test effect of the test case is further guaranteed.
[0081] More specifically, the distribution of online tracking points is matched to the division of functional modules, and the functional modules are associated with online tracking points. This improves the monitoring reliability of online tracking points. It should be understood that a fixed number of online tracking points, or a similar number of online tracking points, can be associated with each functional module, so that the user visits monitored based on online tracking points can more accurately indicate the user value of the functional module.
[0082] Then, the multiple clusters may be sorted from largest to smallest according to the number of functional modules each cluster includes.
[0083] The functional importance of each functional module and its corresponding importance label can then be determined based on the ranking number of the cluster in which it resides. The ranking number of each functional module's cluster indicates the user value of that functional module. More specifically, the importance label of each functional module belonging to a cluster can be determined as the ranking number of that cluster. This reduces the amount of data processing and improves the efficiency of determining importance labels.
[0084] In addition, generating the test value conditions corresponding to the test requirements and test value indicators of the application software may also include: generating the test requirements and the change correlation conditions corresponding to the change correlation labels. The degree of change is positively correlated with the code change correlation indicated by the change correlation label. It should be understood that the change correlation label indicates the degree of change of the code of the functional module when the version of the application software changes. The change correlation label can indicate two states: the functional module changes with the code change, or the functional module does not change with the code change. The change correlation label can also indicate multiple states with multiple degrees of change of the functional module with the code change.
[0085] More specifically, the mapping relationship between the code of the application software and each functional module can be obtained, and it can be determined whether the code of the application software changes with the version change of the application software. If the code changes with the version change of the application software, or the change is large, then the change correlation label of the functional module whose code has the mapping relationship is determined to be related to the code change. If it does not change with the version change of the application software, or the change is small, then the change correlation label of the functional module whose code has the mapping relationship is determined to be unrelated to the code change. Since the change correlation label indicating whether the code change is related or unrelated reliably indicates whether the code of the application software changes with the version change of the application software and the degree of change, the label marking efficiency is improved.
[0086] More specifically, a first code before the application software version change and a second code after the version change can be determined. A code difference test is then performed on the first and second codes to determine whether the second code has changed relative to the first code. Because code difference testing can efficiently test applications with a large amount of code, it improves the efficiency of determining whether code has changed with software version changes.
[0087] In addition, importance labels and change relevance labels can be combined. Generally speaking, the higher the function importance, the higher the test value, and the higher the code change relevance, the higher the test value. However, compared with a function module with high function importance but low code change relevance and a function module with low function importance but high code change relevance, which one has higher test value depends on the quantitative standards of function importance and code change relevance.
[0088] In other examples, the test requirements of the application software and the functional importance conditions corresponding to the importance labels, as well as the change relevance conditions corresponding to the change relevance labels are generated, including: combining the importance labels and change relevance labels of each functional module to obtain multiple recommended scenarios; based on each recommended scenario, generating the test requirements and the functional importance conditions corresponding to the importance labels, as well as the change relevance conditions corresponding to the change relevance labels.
[0089] In other words, from multiple test case recommendation scenarios, a target recommendation scenario that meets the test requirements can be identified. Then, the target importance label and target change relevance label corresponding to the target recommendation scenario can be determined. Finally, test cases for functional modules with these target importance labels and target change relevance labels can be recommended. Combining the multiple test case recommendation scenarios derived from the importance labels and change relevance labels of functional modules effectively labels the recommended scenarios, facilitating the identification of recommended scenarios that meet the test requirements, thereby improving the efficiency of test case recommendation.
[0090] Generally speaking, the test requirements of the recommended scenario include multiple dimensions, including a first dimension corresponding to the importance label and a second dimension corresponding to the change relevance label. The importance label and the change relevance label can respectively correspond to at least one dimension, and the combination of the label values corresponding to each label is the test value condition of the test requirement.
[0091] When a larger numerical value of the test value indicates a greater test value, the test value condition is a plurality of thresholds corresponding to a plurality of dimensions, and the functional module that meets the test value condition may refer to a functional module whose numerical values of each test value are not less than the corresponding threshold.
[0092] The following table describes and illustrates specific examples of recommended test cases based on the recommended scenarios.
[0093] Table 1
[0094]
[0095] In the example in Table 1, the user access volume relevance and user security relevance correspond to the importance label, and the code change relevance corresponds to the change relevance label. Accordingly, the test requirements of the recommended test case scenario include the following dimensions: [user access volume relevance; user security relevance; code change relevance].
[0096] In an example, the test value condition of the test requirement of the target recommended scenario is [4; 5; 3]. In each test case, the dimension values of test case 1 and test case 2 are not lower than the test value condition of the test requirement. Therefore, test case 1 and test case 2 can be selected to test the application software based on the target recommended scenario.
[0097] Table 2
[0098] Functional Importance Code change dependencies Test Case 1 5 9 Test Case 2 4 7 Test Case 3 2 7 Test Case 4 5 5 … … …
[0099] In the example in Table 2, function importance corresponds to the importance label, and code change relevance corresponds to the change relevance label. Accordingly, the test requirements for the recommended scenario for a test case include the following dimensions: [function importance; code change relevance]. For example, if the test value conditions for the test requirements for the target recommended scenario are [5; 7], then among all test cases, if the values for each dimension of test case 1 are not less than the test value conditions for the test requirement, and the other test cases do not meet the test value conditions, then test case 1 can be selected to test the application software based on the target recommended scenario.
[0100] It should be understood that the above examples are merely illustrative, and at least one first dimension corresponding to the importance label and at least one second dimension corresponding to the change relevance label can be combined into rich test value conditions, thereby improving the efficiency and accuracy of test case recommendations.
[0101] Reference Figure 5 , shows a schematic structural diagram of an electronic device according to another embodiment of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0102] like Figure 5 As shown, the electronic device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .
[0103] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .
[0104] The communication interface 504 is used to communicate with other electronic devices or servers.
[0105] The processor 502 is configured to execute the program 510 , and specifically may execute the relevant steps in the above method embodiment.
[0106] Specifically, the program 510 may include program codes, which include computer operation instructions.
[0107] Processor 502 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0108] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0109] Program 510 can specifically be used to enable the processor 502 to perform the following operations: generate test values corresponding to the test value indicators for each functional module of the application software, where the test value at least indicates a positive correlation with the user access volume and / or user security relevance of each functional module; generate test value conditions corresponding to the test requirements of the application software and the test value indicators.
[0110] Alternatively, the program 510 can be specifically used to enable the processor 502 to perform the following operations: match the user value distribution of each functional module of the application software with the test case distribution of each functional module, the user value distribution indicates the distribution of user visits and / or user security relevance of each functional module, and the test case distribution indicates the distribution of the number of test cases of each functional module and / or the distribution of the priority of the test cases; obtain a recommendation request, the recommendation request includes the test requirements of the application software; generate test value conditions for the test requirements of the application software according to the data generation method; determine at least one functional module whose test value meets the test value conditions; and recommend a test case corresponding to at least one functional module.
[0111] Alternatively, the program 510 may be specifically configured to enable the processor 502 to perform the following operations: obtain a test request; generate a test case recommendation request based on the test request; obtain a test case recommended according to a recommendation method based on the recommendation request; and test the application software based on the test case.
[0112] In addition, the specific implementation of each step in program 510 can refer to the corresponding description of the corresponding steps and units in the above-mentioned method embodiment, and will not be repeated here. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working process of the above-mentioned devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, and will not be repeated here.
[0113] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.
[0114] The method according to the embodiment of the present invention described above can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded via a network and will be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown here.
[0115] Those skilled in the art will appreciate that the units and method steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.
[0116] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not intended to limit the embodiments of the present invention. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.
Claims
1. A data generation method, comprising: Generate a test value corresponding to each functional module of the application software and a test value indicator, wherein the test value at least indicates a positive correlation with the user access volume and user security relevance of each functional module, and the test value indicator includes a function importance label and a change relevance label; Generate test value conditions corresponding to the test requirements of the application software and the test value indicators. The test value conditions are conditions for the test value of functional modules. The functional importance label and the change relevance label correspond to at least one dimension respectively. The test value conditions are thresholds of multiple test values corresponding to multiple dimensions.
2. The method according to claim 1, wherein The test value corresponding to each functional module of the application software and the test value indicator is generated, including: Generate the functional importance corresponding to the importance label and the change relevance corresponding to the change relevance label of each functional module of the application software, The functional importance is positively correlated with the user access volume and user security relevance of each functional module, and the change relevance indicates the degree of change of the code of each functional module when the version of the application software changes.
3. The method according to claim 2, wherein: The generating of the test requirements of the application software and the test value conditions corresponding to the test value indicators includes: The test requirements of the application software and the functional importance conditions corresponding to the importance labels, and the change relevance conditions corresponding to the change relevance labels are generated.
4. The method according to claim 3, wherein: The generating of the test requirements of the application software and the functional importance conditions corresponding to the importance labels, and the change relevance conditions corresponding to the change relevance labels, includes: Combine the importance labels and change relevance labels of each functional module to obtain multiple recommendation scenarios; Based on each recommended scenario, a test requirement and a function importance condition corresponding to the importance label, and a change relevance condition corresponding to the change relevance label are generated.
5. The method according to claim 2, wherein: The generating of the functional importance of each functional module of the application software and the corresponding importance label includes: Clustering each functional module of the application software according to its online visits to form a plurality of clusters; sorting the plurality of clusters from largest to smallest according to the number of functional modules each of the plurality of clusters comprises; According to the ranking number of the cluster where each functional module is located, the functional importance of the functional module corresponding to the importance label is determined, and the ranking number of the cluster where each functional module is located indicates the user value of the functional module.
6. The method according to claim 2, wherein: The generation of the change correlation corresponding to each functional module of the application software and the change correlation label includes: Obtaining a mapping relationship between the application software code and each functional module; Determining whether the code of the application software changes with the version of the application software; If yes, determining the change correlation label of the functional module with the mapping relationship in the code as being related to the code change; If not, the change correlation label of the functional module with the mapping relationship in the code is determined to be irrelevant to the code change.
7. The method according to claim 6, wherein: The determining whether the code of the application software changes with the version of the application software includes: Determining a first code before a version change and a second code after a version change of the application software; A code difference test is performed on the first code and the second code to determine whether the second code has changed relative to the first code.
8. A recommendation method comprising: Matching the user value distribution of each functional module of the application software with the test case distribution of each functional module, wherein the user value distribution indicates the distribution of user visits and / or user security relevance of each functional module, and the test case distribution indicates the distribution of the number of test cases of each functional module and / or the distribution of the priority of the test cases; Obtaining a recommendation request, wherein the recommendation request includes a test requirement for the application software; The data generation method according to any one of claims 1 to 7, generating a test value condition of the test requirement of the application software; determining at least one functional module whose test value meets the test value condition; Recommend a test case corresponding to the at least one functional module.
9. The method according to claim 8, wherein The user value distribution of each functional module of the matching application software and the test case distribution of each functional module include: Adjust the division of the functional modules of the application software so that the user value distribution of each functional module matches the test case distribution of each functional module.
10. A testing method comprising: Get the test request; Generating a recommendation request for a test case based on the test request; Obtaining, according to the recommendation request, a test case recommended by the recommendation method according to claim 8 or 9; The application software is tested based on the test case.
11. An electronic device comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, where the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1 to 10.
12. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Dynamic case priority ranking method and device
CN111813681A
Test case recommendation method and device and electronic equipment
CN112882955A