A method and device for recommending a use case, an electronic device, and a storage medium

By obtaining and merging the unsolved defects, new requirements and incremental code associated use cases lists of target applications, generating the current version of the test case list, solving the problem of inefficiency in the existing technology, and achieving efficient testing and application function quality guarantee.

CN114936155BActive Publication Date: 2025-02-11HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210551815.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2025-02-11
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

With the huge application terminal business and the rapid changes in business requirements, the existing technology conducts full-function testing at each version update, resulting in inefficient testing and labor-consuming.

Method used

By obtaining the current version number and basic version number of the target application, obtain the list of unresolved defect-related use cases, the list of new requirements related use cases, and the table of incremental code related use cases, merge these lists to generate a list of test cases for the current version, and feedback the use case information .

Benefits of technology

The use cases corresponding to the changes in the target application are selected from three dimensions, significantly reducing the number of use cases that need to be executed, improving testing efficiency, and ensuring the quality of application functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114936155B_ABST
    Figure CN114936155B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for recommending use cases, an electronic device, and a storage medium, the method comprising: obtaining a current version number and a base version number of a target application; obtaining a list of use cases associated with unresolved defects of the current version based on the current version number and a list of defect-related use cases, and obtaining a list of use cases associated with new requirements of the current version based on the current version number and a list of requirement-related use cases; determining an incremental code-associated use case table corresponding to the current version of the target application from a pre-built code-and-use case association mapping table according to the current version number and the base version number; wherein the code-and-use case association mapping table includes a mapping relationship between each use case of the target application and each code file covered when the use case is executed; merging the three lists obtained into a test case list of the current version of the target application; and feeding back information on each use case in the test case list of the current version of the target application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of application testing technology, and in particular to a method and device for recommending a use case, an electronic device, and a storage medium. Background Art

[0002] In order to ensure that the functions of the new version of the application are of high quality after it is launched, it is usually necessary to test the new version of the application through test cases when the new version of the application is launched.

[0003] Currently, before each new version of the application is launched, a full-function test will be carried out, that is, all test cases involved in the new version of the application will be executed once to ensure the quality of the application functions after launch.

[0004] However, as the business carried by application terminals becomes larger and larger, business requirements change faster and faster, and internal logic becomes more and more complex, the number of test cases involved is also increasing. Therefore, if full-function testing is performed for each version update, the testing efficiency will become lower and lower, and it will also consume a lot of manpower. Summary of the invention

[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a method and device for recommending a use case, an electronic device, and a storage medium to solve the problem of low efficiency of the prior art.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] The first aspect of the present application provides a method for recommending a use case, including:

[0008] Get the current version number and base version number of the target application;

[0009] Based on the current version number and the defect-related use case list, a list of unresolved defect-related use cases of the current version is obtained, and based on the current version number and the requirement-related use case list, a list of new requirement-related use cases of the current version is obtained; wherein the defect-related use case list includes defect information submitted by the user each time, the use case identifier associated with the defect, and the version number; the requirement-related use case list includes the identifier of each requirement entered by the user, the use case identifier associated with each requirement, and the version number;

[0010] According to the current version number and the basic version number, an incremental code association use case table corresponding to the current version of the target application is determined from a pre-built code-use case association mapping table; wherein the code-use case association mapping table includes a mapping relationship between each use case of the target application and each code file covered when the use case is executed;

[0011] Merge the current version's unresolved defect-associated use case list, the current version's new requirement-associated use case list, and the incremental code-associated use case table corresponding to the target application to obtain a current version test case list for the target application;

[0012] Feedback the information of each of the test cases in the current version test case list of the target application.

[0013] Optionally, in the above-mentioned use case recommendation method, obtaining a list of unresolved defect-related use cases of the current version based on the current version number and the list of defect-related use cases includes:

[0014] Obtain a list of unresolved defect identifiers corresponding to the current version number;

[0015] Determine, from the defect-related use case list, the use case identifiers corresponding to the respective unresolved defect identifiers in the unresolved defect identifier list, to obtain a first use case identifier list;

[0016] The list of unresolved defect-related use cases of the current version is generated by using the use case information corresponding to each of the use case identifiers in the first use case identifier list found from the general use case library.

[0017] Optionally, in the above-mentioned use case recommendation method, obtaining a new requirement-related use case list of the current version based on the current version number and the requirement-related use case list includes:

[0018] Find out a version function requirement list corresponding to the current version number from the requirement library;

[0019] Determine the use case identifier corresponding to each requirement in the version function requirement list from the requirement-related use case list to obtain a second use case identifier list;

[0020] The new requirement-associated use case list of the current version is generated by using the use case information corresponding to each of the use case identifiers in the second use case identifier list found out from the total use case library.

[0021] Optionally, in the above-mentioned use case recommendation method, determining the incremental code associated use case table corresponding to the current version of the target application from a pre-built code and use case association mapping table according to the current version number and the base version number includes:

[0022] Determine, according to the current version number and the base version number, a list of incremental code file names between the target application corresponding to the current version number and the target application corresponding to the base version number;

[0023] From the association mapping table between the code and the use case, find out the use case identifiers that have a mapping relationship with each code file name in the incremental code file name list to obtain a third use case identifier list;

[0024] The incremental code associated use case table corresponding to the current version of the target application is generated by using the use case information corresponding to each of the use case identifiers in the third use case identifier list found out from the total use case library.

[0025] Optionally, in the above-mentioned method for recommending use cases, the method for constructing the association mapping table between codes and use cases includes:

[0026] For each of the use cases of the target application, clear the coverage result file in the code coverage tool in turn;

[0027] Execute the use case, and generate a coverage result file corresponding to the use case through the code coverage tool; wherein the coverage result file corresponding to the use case is named after the use case identifier of the use case;

[0028] Generate a coverage report for the use case based on the coverage result file corresponding to the use case; wherein the coverage report is in HTML format;

[0029] Parse the coverage report of the use case to obtain multiple code file names with coverage greater than zero;

[0030] The use case identifier of the use case and each of the obtained code file names are stored in an association mapping table between the code and the use case.

[0031] A second aspect of the present application provides a use case recommendation device, including:

[0032] A version number acquisition unit, used to acquire the current version number and the base version number of the target application;

[0033] A first list acquisition unit is used to acquire a list of unresolved defect-related use cases of the current version based on the current version number and the list of defect-related use cases; wherein the list of defect-related use cases includes defect information submitted by the user each time, a use case identifier associated with the defect, and a version number;

[0034] A second list acquisition unit is used to acquire a new requirement-associated use case list of the current version based on the current version number and the requirement-associated use case list; wherein the requirement-associated use case list includes the identifier of each requirement entered by the user, the use case identifier associated with each requirement, and the version number;

[0035] A third list acquisition unit is used to determine, according to the current version number and the basic version number, from a pre-built code-use case association mapping table, an incremental code association use case table corresponding to the current version of the target application; wherein the code-use case association mapping table includes a mapping relationship between each use case of the target application and each code file covered when the use case is executed;

[0036] A merging unit, used to merge the current version's unresolved defect-associated use case list, the current version's new requirement-associated use case list, and the incremental code-associated use case table corresponding to the target application to obtain a current version test case list of the target application;

[0037] The feedback unit is used to feedback information of each of the test cases in the current version test case list of the target application.

[0038] Optionally, in the recommendation device of the above use case, the first list acquisition unit includes:

[0039] A first acquisition unit, configured to acquire a list of unresolved defect identifiers corresponding to the current version number;

[0040] A first identifier determining unit is used to determine the use case identifiers corresponding to the respective unresolved defect identifiers in the unresolved defect identifier list from the defect-related use case list, and obtain a first use case identifier list;

[0041] The first generating unit is used to generate the unresolved defect-related use case list of the current version by using the use case information corresponding to each of the use case identifiers in the first use case identifier list found out from the general use case library.

[0042] Optionally, in the recommendation device of the above use case, the second list acquisition unit includes:

[0043] A second acquisition unit is used to search for a version function requirement list corresponding to the current version number from a requirement library;

[0044] A second identifier determination unit, configured to determine the use case identifiers corresponding to the respective requirements in the version function requirement list from the requirement-related use case list, and obtain a second use case identifier list;

[0045] The second generating unit is used to generate the new requirement associated use case list of the current version by using the use case information corresponding to each of the use case identifiers in the second use case identifier list found out from the total use case library.

[0046] Optionally, in the recommendation device of the above use case, the third list acquisition unit includes:

[0047] A third acquisition unit determines, according to the current version number and the base version number, a list of incremental code file names between the target application corresponding to the current version number and the target application corresponding to the base version number;

[0048] A third identifier determination unit is used to find the use case identifier that has a mapping relationship with each code file name in the incremental code file name list from the association mapping table between the code and the use case, and obtain a third use case identifier list;

[0049] The third generating unit is used to generate an incremental code associated use case table corresponding to the current version of the target application by using the use case information corresponding to each of the use case identifiers in the third use case identifier list found out from the total use case library.

[0050] Optionally, in the recommended device of the above use case, it also includes:

[0051] A clearing unit, used for clearing the coverage result file in the code coverage tool for each of the use cases of the target application in turn;

[0052] A file generation unit, used for executing the use case and generating a coverage result file corresponding to the use case through the code coverage tool; wherein the coverage result file corresponding to the use case is named after the use case identifier of the use case;

[0053] A report generating unit, used to generate a coverage report of the use case based on the coverage result file corresponding to the use case; wherein the coverage report is in HTML format;

[0054] A parsing unit, used for parsing the coverage report of the use case to obtain a plurality of code file names with a coverage greater than zero;

[0055] The storage unit is used to store the use case identifier of the use case and each of the obtained code file names in the association mapping table between the code and the use case.

[0056] A third aspect of the present application provides an electronic device, including:

[0057] Memory and processor;

[0058] Wherein, the memory is used to store programs;

[0059] The processor is used to execute the program, and when the program is executed, it is specifically used to implement the recommended method of any use case described above.

[0060] A fourth aspect of the present application provides a computer storage medium for storing a computer program, which, when executed, is used to implement a recommendation method for a use case as described in any one of the above.

[0061] The present application provides a method for recommending use cases, which pre-maintains a list of defect-related use cases, a list of requirement-related use cases, and a mapping table of associations between codes and use cases. Among them, the list of defect-related use cases includes the defect information submitted by the user each time, the use case identifier associated with the defect, and the version number; the list of requirement-related use cases includes the identifiers of each requirement entered by the user, the use case identifiers associated with each requirement, and the version number; the mapping table of associations between codes and use cases includes the mapping relationship between each use case of the target application and each code file covered when the use case is executed. Therefore, when a new version of the target application needs to be tested, the current version number and the base version number of the target application are obtained, and then based on the current version number and the list of defect-related use cases, the list of unresolved defect-related use cases of the current version is obtained, and based on the current version number and the list of requirement-related use cases, the list of new requirement-related use cases of the current version is obtained. According to the current version number and the base version number, the incremental code-associated use case table corresponding to the current version of the target application is determined from the pre-built mapping table of associations between code and use cases. Then merge the current version's unresolved defect-related use case list, the current version's new requirement-related use case list, and the target application's corresponding incremental code-related use case table to obtain the target application's current version test case list, and finally feedback the information of each use case in the target application's current version test case list. Thus, from three dimensions, the use cases corresponding to the changed parts of the target application are screened out and fed back to the user for testing, which can greatly reduce the number of use cases that need to be executed, improve test efficiency, and ensure the quality of application functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0063] Figure 1 A flowchart of a recommended method for a use case provided in an embodiment of the present application;

[0064] Figure 2 A flowchart of a method for obtaining a list of use cases associated with unresolved defects in the current version provided in an embodiment of the present application;

[0065] Figure 3 A flowchart of a method for obtaining a list of new requirements associated use cases of the current version provided in an embodiment of the present application;

[0066] Figure 4A flowchart of a method for constructing a code-use case association mapping table provided in an embodiment of the present application;

[0067] Figure 5 A flowchart of a method for obtaining an incremental code associated use case table provided in an embodiment of the present application;

[0068] Figure 6 A schematic diagram of a structure of a recommended device for a use case provided in an embodiment of the present application;

[0069] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0070] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0071] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0072] The present application embodiment provides a method for recommending a use case, such as Figure 1 As shown, the following steps are included:

[0073] S101. Obtain the current version number and the base version number of the target application.

[0074] The target application refers to the application to be tested, and the current version number is the latest version number of the target application to be launched.

[0075] Optionally, after the target application is packaged, the generated download URL may be parsed to obtain the current version number and the base version number of the target application.

[0076] S102: Based on the current version number and the defect-related use case list, obtain a list of unresolved defect-related use cases of the current version.

[0077] Among them, the defect-related use case list includes the defect information submitted by the user each time, the use case identifier associated with the defect, and the version number. It should be noted that during the maintenance of the target application, if a defect (bug) is found, the relevant information of the defect needs to be uploaded to the server. In the embodiment of the present application, the user is required to upload the identifier of the use case associated with the defect and the version number of the target application where the defect exists. At this time, the server will associate the three and store them in the defect-related use case list.

[0078] Unresolved defects refer to defects that have not been resolved before. When a new version is launched, the previously unresolved defects are usually updated accordingly to eliminate the defects in the target application. Therefore, you can filter out the corresponding use cases for the unresolved defect updates, that is, based on the current version number and the defect-related use case list, get the current version's unresolved defect-related use case list.

[0079] Optionally, the current version of the unresolved defect associated use case list may be a use case identifier list, that is, it is composed of the use case identifiers corresponding to the unresolved defects queried from the defect-related use case list, and when step S106 is finally executed, the corresponding use case information is obtained according to the use case identifier for feedback. Of course, the current version of the unresolved defect associated use case list may also be use case information, that is, after finding the use case identifier corresponding to the unresolved defect, the use case information corresponding to the use case identifier is further searched to form the current version of the unresolved defect associated use case list.

[0080] Optionally, in another embodiment of the present application, an implementation of step S102 is as follows: Figure 2 As shown, the following steps are included:

[0081] S201. Obtain a list of unresolved defect identifiers corresponding to the current version number.

[0082] It should be noted that relevant information will be maintained for defects to facilitate the association of various defects, so the identifiers of unresolved defects corresponding to the current version number can be found according to the current version number, and then these identifiers can be combined into a list of unresolved defect identifiers corresponding to the current version number.

[0083] S202: Determine, from the defect-related use case list, use case identifiers corresponding to the respective unresolved defect identifiers in the unresolved defect identifier list, to obtain a first use case identifier list.

[0084] S203: Generate a list of unresolved defect-related use cases of the current version by using the use case information corresponding to each use case identifier in the first use case identifier list found from the general use case library.

[0085] The use case information may include the use case name, steps, functions, priority, expected results, etc.

[0086] S103. Based on the current version number and the list of use cases related to the requirements, obtain a list of use cases associated with new requirements of the current version.

[0087] Among them, the demand-related use case list includes the identifiers of each demand entered by the user, the use case identifiers associated with each demand, and the version number. It should be noted that in the embodiment of the present application, when the user enters the information of the new demand use case, he or she also needs to enter the corresponding version number and the identifier of the associated demand at the same time, so that the three can also be associated and stored in the new demand-associated use case list of the current version.

[0088] It should be noted that a new version may usually have new requirements, and corresponding updates will inevitably be made for the new requirements, so in the embodiment of the present application, the use case corresponding to this updated part is also obtained. Therefore, based on the current version number, the use case identifier corresponding to the new requirements of the current version is filtered out from the list of use cases related to the requirements, and then the new requirement-related use case list of the current version is generated based on the filtered use case identifier. Similarly, the corresponding use case information can be searched according to the filtered use case identifier, and then the use case information can be used to form a new requirement-related use case list for the current version. It is also possible to directly use the filtered use case identifier to form a new requirement-related use case list for the current version, and then find the corresponding use case information for feedback later.

[0089] Optionally, in another embodiment of the present application, an implementation of step S103 is as follows: Figure 3 As shown, the following steps are included:

[0090] S301. Find out the version function requirement list corresponding to the current version number from the requirement library.

[0091] Specifically, the identifier of the new requirement of the current version number is found from the requirement library to form a version function requirement list corresponding to the current version number.

[0092] S302: Determine the use case identifier corresponding to each requirement in the version function requirement list from the requirement-related use case list to obtain a second use case identifier list.

[0093] S303: Generate a new requirement-associated use case list of the current version by using the use case information corresponding to each use case identifier in the second use case identifier list found out from the general use case library.

[0094] S104: According to the current version number and the basic version number, determine the incremental code association use case table corresponding to the current version of the target application from the pre-built code and use case association mapping table.

[0095] The code-use case association mapping table includes the mapping relationship between each use case of the target application and each code file covered when the use case is executed. Specifically, in the embodiment of the present application, each use case of the target application is pre-executed to determine each code file covered by it, and then the use case identifier of the use case and the file name of the covered code file are stored in the code-use case association mapping table.

[0096] Since only part of the code is usually updated when a new version is launched, only the functions involved in this part of the code can be tested. Therefore, in an embodiment of the present application, the newly added code file can be determined based on the current version number and the base version number, so that the use case identifier corresponding to the newly added code file can be further determined from the pre-built code and use case association mapping table, and then the incremental code association use case table corresponding to the current version of the target application is generated based on the determined use case identifier.

[0097] Optionally, another embodiment of the present application provides a method for constructing a mapping table of associations between codes and use cases, such as Figure 4 As shown, including:

[0098] S401 . Clear the coverage result file in the code coverage tool for each use case of the target application in turn.

[0099] In the embodiment of the present application, the code files covered by the use case are determined by a code coverage tool, wherein the code coverage tool may be jacoco.

[0100] Since the coverage result file in the code coverage tool needs to be uploaded to the server, in order to avoid repeated uploading, when starting to process the coverage of a use case, the coverage result file in the code coverage tool is cleared first, and then step S402 is executed.

[0101] S402: Execute the use case and generate a coverage result file corresponding to the use case through a code coverage tool.

[0102] The coverage result file corresponding to the use case is named after the use case identifier of the use case.

[0103] It should be noted that the coverage result file can be submitted at any time during the execution of the use case and the functional test process, but the local coverage result file needs to be cleared after each submission to avoid repeated submission. The submitted coverage result file supports self-naming. In the embodiment of the present application, the use case identifier of the use case is used to name it, so as to distinguish the coverage result files corresponding to different use cases, and also to facilitate the subsequent storage of the use case identifier in the mapping table.

[0104] S403: Generate a coverage report for the use case based on the coverage result file corresponding to the use case.

[0105] The coverage report is in HTML format.

[0106] Since the coverage result file does not support direct parsing, the coverage result file is used to generate HTML results in combination with source code and class files, that is, to generate a coverage report.

[0107] S404. Parse the coverage report of the use case to obtain multiple code file names with coverage greater than zero.

[0108] S405: Store the use case identifier of the use case and each obtained code file name into a mapping table of association between code and use case.

[0109] Optionally, in another embodiment of the present application, a specific implementation method of step S104 is as follows: Figure 5 As shown, including:

[0110] S501. Determine, according to the current version number and the base version number, a list of incremental code file names between a target application corresponding to the current version number and a target application corresponding to the base version number.

[0111] Specifically, according to the current version number and the base version number, the names of the code files that are different between the target application corresponding to the current version number and the target application corresponding to the base version number are determined, and then these names are used to generate an incremental code file name list.

[0112] S502. From the code-to-use case association mapping table, find the use case identifiers that have a mapping relationship with each code file name in the incremental code file name list to obtain a third use case identifier list.

[0113] S503: Generate an incremental code associated use case table corresponding to the current version of the target application by using the use case information corresponding to each use case identifier in the third use case identifier list found out from the general use case library.

[0114] It should be noted that the execution order of step S102, step S103, and step S104 in the embodiment of the present application is only an optional method. This step is to screen use cases from three dimensions respectively. The three steps are independent of each other, so they are not limited to the order provided in the embodiment of the present application. Therefore, they can also be executed simultaneously or in other orders, which should fall within the protection scope of the present application.

[0115] S105 , merging the current version's unresolved defect-associated use case list, the current version's new requirement-associated use case list, and the incremental code-associated use case table corresponding to the target application to obtain a current version test case list of the target application.

[0116] Specifically, the information filtered out from the three dimensions is combined to obtain a summary of the test case list of the current version of the target application. In addition, the information filtered out from the three dimensions may be repeated, so when merging, the repeated information needs to be removed.

[0117] S106: Feedback information of each test case in the current version test case list of the target application.

[0118] Optionally, if the current version test case list of the target application is composed of use case information of multiple use cases, that is, the lists obtained in steps S102 to S104 all include use case information, then step S106 can be: directly feeding back the current version test case list of the target application to the user. If the current version test case list of the target application is composed of use case identifiers of multiple use cases, then step S106 is: find out the use case information corresponding to each use case identifier in the current version test case list of the target application from the total use case library, and feed it back to the user.

[0119] The embodiment of the present application provides a method for recommending use cases, which pre-maintains a list of defect-related use cases, a list of requirement-related use cases, and a mapping table of associations between codes and use cases. Among them, the list of defect-related use cases includes the defect information submitted by the user each time, the use case identifier associated with the defect, and the version number; the list of requirement-related use cases includes the identifiers of each requirement entered by the user, the use case identifiers associated with each requirement, and the version number; the mapping table of associations between codes and use cases includes the mapping relationship between each use case of the target application and each code file covered when the use case is executed. Therefore, when a new version of the target application needs to be tested, by obtaining the current version number and the base version number of the target application, and then based on the current version number and the list of defect-related use cases, a list of unresolved defect-associated use cases of the current version is obtained, and based on the current version number and the list of requirement-related use cases, a list of new requirement-associated use cases of the current version is obtained. According to the current version number and the base version number, the incremental code-associated use case table corresponding to the target application of the current version is determined from the pre-built mapping table of associations between code and use cases. Then merge the current version's unresolved defect-related use case list, the current version's new requirement-related use case list, and the target application's corresponding incremental code-related use case table to obtain the target application's current version test case list, and finally feedback the information of each use case in the target application's current version test case list. Thus, from three dimensions, the use cases corresponding to the changed parts of the target application are screened out and fed back to the user for testing, which can greatly reduce the number of use cases that need to be executed, improve test efficiency, and ensure the quality of application functions.

[0120] Another embodiment of the present application provides a recommended device for a use case, such as Figure 6 As shown, including:

[0121] The version number acquisition unit 601 is used to acquire the current version number and the base version number of the target application.

[0122] The first list acquisition unit 602 is used to acquire a list of unresolved defect-related use cases of the current version based on the current version number and the list of defect-related use cases.

[0123] The defect-related use case list includes the defect information submitted by the user each time, the use case identifier associated with the defect, and the version number.

[0124] The second list acquisition unit 603 is used to acquire a new requirement-related use case list of the current version based on the current version number and the requirement-related use case list.

[0125] The requirement-related use case list includes the identifier of each requirement entered by the user, the use case identifier associated with each requirement, and the version number.

[0126] The third list acquisition unit 604 is used to determine the incremental code associated use case table corresponding to the current version of the target application from the pre-built code and use case association mapping table according to the current version number and the basic version number.

[0127] The code-use case association mapping table includes a mapping relationship between each use case of the target application and each code file covered when the use case is executed.

[0128] The merging unit 605 is used to merge the current version's unresolved defect associated use case list, the current version's new requirement associated use case list, and the incremental code associated use case table corresponding to the target application to obtain the current version test case list of the target application.

[0129] The feedback unit 606 is used to feedback information of each test case in the test case list of the current version of the target application.

[0130] Optionally, in a recommendation device for a use case provided in another embodiment of the present application, the first list acquisition unit includes:

[0131] The first acquisition unit is used to acquire a list of unresolved defect identifiers corresponding to the current version number.

[0132] The first identifier determining unit is used to determine, from the defect-related use case list, use case identifiers corresponding to each unresolved defect identifier in the unresolved defect identifier list to obtain a first use case identifier list.

[0133] The first generating unit is used to generate a list of unresolved defect-related use cases of the current version by using the use case information corresponding to each use case identifier in the first use case identifier list found from the general use case library.

[0134] Optionally, in the recommendation device of the use case provided in another embodiment of the present application, the second list acquisition unit includes:

[0135] The second acquisition unit is used to search the version function requirement list corresponding to the current version number from the requirement library.

[0136] The second identifier determination unit is used to determine the use case identifier corresponding to each requirement in the version function requirement list from the requirement-related use case list to obtain a second use case identifier list.

[0137] The second generating unit is used to generate a new requirement associated use case list of the current version by using the use case information corresponding to each use case identifier in the second use case identifier list found out from the total use case library.

[0138] Optionally, in the recommendation device for a use case provided in another embodiment of the present application, the third list acquisition unit includes:

[0139] The third acquisition unit determines, according to the current version number and the base version number, a list of incremental code file names between a target application corresponding to the current version number and a target application corresponding to the base version number.

[0140] The third identifier determination unit is used to find out the use case identifiers that have a mapping relationship with each code file name in the incremental code file name list from the association mapping table between code and use case, and obtain a third use case identifier list.

[0141] The third generating unit is used to generate an incremental code associated use case table corresponding to the current version of the target application by using the use case information corresponding to each use case identifier in the third use case identifier list found from the total use case library.

[0142] Optionally, in the recommended device of the use case provided in another embodiment of the present application, the following is further included:

[0143] The clearing unit is used to clear the coverage result file in the code coverage tool for each use case of the target application in turn.

[0144] The file generation unit is used to execute the use case and generate a coverage result file corresponding to the use case through a code coverage tool, wherein the coverage result file corresponding to the use case is named after the use case identifier of the use case.

[0145] The report generation unit is used to generate a coverage report of the use case based on the coverage result file corresponding to the use case, wherein the coverage report is in HTML format.

[0146] The parsing unit is used to parse the coverage report of the use case and obtain multiple code file names with coverage greater than zero.

[0147] The storage unit is used to store the use case identifier of the use case and each obtained code file name in the association mapping table between the code and the use case.

[0148] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, which will not be repeated here.

[0149] Another embodiment of the present application provides an electronic device, such as Figure 7 As shown, including:

[0150] Memory 701 and processor 702 .

[0151] The memory 701 is used to store programs.

[0152] The processor 702 is used to execute the program stored in the memory 701, and when the program is executed, it is specifically used to implement the recommended method of the use case provided in any one of the above embodiments.

[0153] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed, it is used to implement a recommended method for a use case provided in any of the above embodiments.

[0154] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0155] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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 this application.

[0156] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for recommending a use case, characterized in that: include: Get the current version number and base version number of the target application; Based on the current version number and the defect-related use case list, a list of unresolved defect-related use cases of the current version is obtained, and based on the current version number and the requirement-related use case list, a list of new requirement-related use cases of the current version is obtained; wherein the defect-related use case list includes defect information submitted by the user each time, the use case identifier associated with the defect, and the version number; the requirement-related use case list includes the identifier of each requirement entered by the user, the use case identifier associated with each requirement, and the version number; According to the current version number and the basic version number, an incremental code association use case table corresponding to the current version of the target application is determined from a pre-built code-use case association mapping table; wherein the code-use case association mapping table includes a mapping relationship between each use case of the target application and each code file covered when the use case is executed; Merge the current version's unresolved defect-associated use case list, the current version's new requirement-associated use case list, and the incremental code-associated use case table corresponding to the target application to obtain a current version test case list for the target application; Feedback the information of each of the test cases in the current version test case list of the target application.

2. The method according to claim 1, characterized in that The obtaining, based on the current version number and the defect-related use case list, a list of unresolved defect-related use cases of the current version includes: Obtain a list of unresolved defect identifiers corresponding to the current version number; Determine, from the defect-related use case list, the use case identifiers corresponding to the respective unresolved defect identifiers in the unresolved defect identifier list, to obtain a first use case identifier list; The list of unresolved defect-related use cases of the current version is generated by using the use case information corresponding to each of the use case identifiers in the first use case identifier list found from the general use case library.

3. The method according to claim 1, characterized in that: The acquiring of a new requirement-related use case list of the current version based on the current version number and the requirement-related use case list includes: Find out a version function requirement list corresponding to the current version number from the requirement library; Determine the use case identifier corresponding to each requirement in the version function requirement list from the requirement-related use case list to obtain a second use case identifier list; The new requirement-associated use case list of the current version is generated by using the use case information corresponding to each of the use case identifiers in the second use case identifier list found out from the total use case library.

4. The method according to claim 1, characterized in that The step of determining, according to the current version number and the basic version number, from a pre-built code-use case association mapping table, an incremental code association use case table corresponding to the target application of the current version, comprises: Determine, according to the current version number and the base version number, a list of incremental code file names between the target application corresponding to the current version number and the target application corresponding to the base version number; From the association mapping table between the code and the use case, find out the use case identifiers that have a mapping relationship with each code file name in the incremental code file name list to obtain a third use case identifier list; The incremental code associated use case table corresponding to the current version of the target application is generated by using the use case information corresponding to each of the use case identifiers in the third use case identifier list found out from the total use case library.

5. The method according to claim 1, characterized in that The method for constructing the association mapping table between the code and the use case includes: For each of the use cases of the target application, clear the coverage result file in the code coverage tool in turn; Execute the use case, and generate a coverage result file corresponding to the use case through the code coverage tool; wherein the coverage result file corresponding to the use case is named after the use case identifier of the use case; Generate a coverage report for the use case based on the coverage result file corresponding to the use case; wherein the coverage report is in HTML format; Parse the coverage report of the use case to obtain multiple code file names with coverage greater than zero; The use case identifier of the use case and each of the obtained code file names are stored in an association mapping table between the code and the use case.

6. A recommendation device for a use case, characterized in that: include: A version number acquisition unit, used to acquire the current version number and the base version number of the target application; A first list acquisition unit is used to acquire a list of unresolved defect-related use cases of the current version based on the current version number and the list of defect-related use cases; wherein the list of defect-related use cases includes defect information submitted by the user each time, a use case identifier associated with the defect, and a version number; A second list acquisition unit is used to acquire a new requirement-associated use case list of the current version based on the current version number and the requirement-associated use case list; wherein the requirement-associated use case list includes the identifier of each requirement entered by the user, the use case identifier associated with each requirement, and the version number; A third list acquisition unit is used to determine, according to the current version number and the basic version number, from a pre-built code-use case association mapping table, an incremental code association use case table corresponding to the current version of the target application; wherein the code-use case association mapping table includes a mapping relationship between each use case of the target application and each code file covered when the use case is executed; A merging unit, used to merge the current version's unresolved defect-associated use case list, the current version's new requirement-associated use case list, and the incremental code-associated use case table corresponding to the target application to obtain a current version test case list of the target application; The feedback unit is used to feedback the information of each of the test cases in the current version test case list of the target application.

7. The device according to claim 6, characterized in that The first list obtaining unit includes: A first acquisition unit, configured to acquire a list of unresolved defect identifiers corresponding to the current version number; A first identifier determining unit is used to determine the use case identifiers corresponding to the respective unresolved defect identifiers in the unresolved defect identifier list from the defect-related use case list, and obtain a first use case identifier list; The first generating unit is used to generate the unresolved defect-related use case list of the current version by using the use case information corresponding to each of the use case identifiers in the first use case identifier list found out from the general use case library.

8. The device according to claim 6, characterized in that The second list obtaining unit includes: A second acquisition unit is used to search for a version function requirement list corresponding to the current version number from a requirement library; A second identifier determining unit, configured to determine the use case identifiers corresponding to the respective requirements in the version function requirement list from the requirement-related use case list, and obtain a second use case identifier list; The second generating unit is used to generate the new requirement associated use case list of the current version by using the use case information corresponding to each of the use case identifiers in the second use case identifier list found out from the total use case library.

9. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the recommended method of the use case described in any one of claims 1 to 5.

10. A computer storage medium, characterized in that: Used to store a computer program, which, when executed, is used to implement the recommended method for the use case as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Test case recommendation method and device and electronic equipment

    CN112416778A

  • Cognition-based analysis, interpretation, reporting and recommendations for customizations of cloud-implemented applications

    US20200167154A1