A case activity detection method, device, equipment and storage medium
By obtaining and merging case execution sets that meet preset time conditions, calculating the activity of test cases, solving the problem of low case activity detection efficiency in the prior art, achieving more efficient and flexible activity evaluation, and supporting more detailed software testing analysis.
Patent Information
- Application Number
- CN202111317420.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-11-09
AI Technical Summary
The prior art methods used for case activity detection in software testing are less efficient and flexible, mainly because only querying the time stamp of the latest execution flow record, resulting in limited data range.
By obtaining multiple target case execution sets that meet the preset time conditions, each set corresponds to a unit time period, containing the identification and active feature information of the test case, and combining these sets to obtain the activity detection set, and compute each test The activity of the case will improve the detection efficiency and flexibility.
It realizes more efficient and flexible evaluation of case activity in software testing, expands the use scenarios of activity detection, and can quickly identify high and low test cases, and supports more detailed analysis and updates.
Smart Images

Figure CN114036048B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a case activity detection method, device, equipment and storage medium. Background Art
[0002] When performing software testing, different test tasks correspond to different test cases. In order to ensure that the test cases are fully executed during the software testing phase, it is necessary to perform case activity detection based on the execution records of the test cases and modify the test cases with low activity.
[0003] Typically, current evaluation methods only query the timestamp of the latest execution flow record of a case to determine whether the case is active. This is because the data analyzed by this evaluation method is limited, resulting in low efficiency and flexibility in case activity detection. Summary of the invention
[0004] The embodiments of the present application provide a case activity detection method and device for improving the efficiency and flexibility of case activity detection.
[0005] On the one hand, an embodiment of the present application provides a case activity detection method, the method comprising:
[0006] Acquire multiple target case execution sets that meet preset time conditions, wherein each case execution set corresponds to a unit time period, and each case execution set includes: test case identifiers and active feature information of test cases executed in the corresponding unit time period;
[0007] The multiple target case execution sets are merged to obtain an activity detection set corresponding to the preset time condition and the case activity of each test case in the activity detection set, wherein the case activity of the test case is determined based on the test case identifier and active feature information corresponding to the test case.
[0008] On the one hand, an embodiment of the present application provides a case activity detection device, the device comprising:
[0009] An acquisition module, used to acquire multiple target case execution sets that meet preset time conditions, wherein each case execution set corresponds to a unit time period, and each case execution set includes: a test case identifier and active feature information of a test case executed in the corresponding unit time period;
[0010] A merging module is used to merge the multiple target case execution sets to obtain an activity detection set corresponding to the preset time condition, and the case activity of each test case in the activity detection set, wherein the case activity of the test case is determined based on the test case identifier and active feature information corresponding to the test case.
[0011] Optionally, an adding module is further included, and the adding module is specifically used for:
[0012] Before obtaining multiple target case execution sets that meet the preset time conditions, perform the following steps for each test case:
[0013] When determining that a test case is executed, determining a case execution set corresponding to the test case based on the execution time of the test case;
[0014] Adding the test case identifier and active feature information of the one test case to the case execution set.
[0015] Optionally, the merging module is specifically used for:
[0016] Sequentially adding the test case identifiers and active feature information of the test cases included in the multiple target case execution sets to the reference set, and after each addition, merging the active feature information corresponding to the same test case identifier in the reference set;
[0017] The reference set obtained after the addition is completed is used as the activity detection set, wherein the case activity of each test case in the activity detection set is obtained by merging various active feature information corresponding to the test case.
[0018] Optionally, a sorting module is further included, and the sorting module is specifically used to:
[0019] After merging the multiple target case execution sets to obtain the activity detection set corresponding to the preset time condition and the case activity of each test case in the activity detection set, the case activity of each test case is sorted in order from large to small to obtain the case activity distribution of each test case.
[0020] Optionally, the acquisition module is specifically used for:
[0021] Based on a preset time range, multiple target case execution sets are obtained.
[0022] Optionally, the active feature information is a preset value, or the number of times a test case is executed.
[0023] On the one hand, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned case activity method when executing the program.
[0024] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned case activity method.
[0025] In an embodiment of the present application, each case execution set corresponds to a unit time period, and each case execution set includes the test case identification and active feature information of the test cases executed within the corresponding unit time period. Therefore, when it is necessary to determine the case activity of the test cases within a period of time, the corresponding multiple target case execution sets can be directly obtained based on the preset time conditions, and the multiple target case execution sets can be merged to obtain the case activity of the test cases within a period of time, thereby improving the flexibility and efficiency of detecting case activity. In the field of software testing, the use scenarios of evaluating case activity are expanded. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0027] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present application;
[0028] Figure 2 A flowchart of a case activity detection method provided in an embodiment of the present application;
[0029] Figure 3 A flowchart of a method for obtaining execution sets of each case provided in an embodiment of the present application;
[0030] Figure 4 A schematic diagram of the structure of a case activity detection device provided in an embodiment of the present application;
[0031] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0033] For ease of understanding, the terms involved in the embodiments of the present invention are explained below.
[0034] Case activity: The frequency with which test cases in the case library are correctly executed within a specified period of time.
[0035] Non-relational database: stores data as a collection of key-value pairs, where the key is a unique identifier. The key is a string object. The value can be any type of data, such as integer, character, array, list, set, etc. Common key-value databases include redis, riak, simpleDB, etc.
[0036] Redis database: not only supports simple key-value data, but also provides storage for lists, sets, ordered sets, hashes and other data structures.
[0037] refer to Figure 1 , which is a system architecture diagram applicable to an embodiment of the present application, and the system architecture at least includes a terminal device 101 and a case activity detection system 102.
[0038] The terminal device 101 is installed with a target application for detecting case activity, which may be a pre-installed client, a web application, or a small program embedded in other applications, etc. The terminal device 101 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto.
[0039] The case activity detection system 102 is the background server of the target application and provides services for the target application. The case activity detection system 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal device 101 can be directly or indirectly connected to the case activity detection system 102 through wired or wireless communication, and this application does not limit this.
[0040] In response to the user's case activity detection operation, the terminal device 101 sends a case activity detection instruction to the case activity detection system 102, wherein the case activity detection instruction includes a preset time condition.
[0041] The case activity detection system 102 receives a case activity detection instruction, and obtains multiple target case execution sets that meet a preset time condition, wherein each case execution set corresponds to a unit time period, and each case execution set includes: a test case identifier and active feature information of a test case executed in the corresponding unit time period. Then, multiple target case execution sets are merged to obtain an activity detection set corresponding to the preset time condition, and the case activity of each test case in the activity detection set, wherein the case activity of the test case is determined based on the test case identifier and active feature information corresponding to the test case.
[0042] The case activity detection system 102 sends the activity detection set corresponding to the preset time conditions and the case activity of each test case in the activity detection set to the terminal device 101, and the terminal device 101 displays the activity detection set corresponding to the preset time conditions and the case activity of each test case in the activity detection set in the display interface.
[0043] based on Figure 1 The system architecture diagram, the embodiment of the present application provides a process of detecting case activity method, such as Figure 2 As shown, the process of the method is executed by a computer device, which may be Figure 1 The case activity detection system 102 shown includes the following steps:
[0044] Step S201, obtaining multiple target case execution sets that meet a preset time condition.
[0045] Specifically, multiple target case execution sets that meet preset time conditions may be obtained from the database.
[0046] Each case execution set in the database corresponds to a unit time period, and each case execution set includes: a test case identifier and active feature information of the test case executed in the corresponding unit time period.
[0047] The database is a non-relational database and can be any of redis, riak, and simpleDB.
[0048] The data in the database is stored in the form of key-value pairs. The unit time period corresponding to each case execution set is the key name, and each key name corresponds to an ordered set, which stores the test case identifier and corresponding active feature information of the test case. The time period and the ordered set form a one-to-one corresponding key-value pair and are stored in the database.
[0049] The test case identifier is a unique mark for distinguishing different test cases, which can be the number of the test case. The active feature information can be a preset value or the number of times the test case is executed.
[0050] The duration of the unit time period corresponding to each case execution set can be one hour or more hours, one day or more days, one month or more months, one year or more years, etc.
[0051] For example, if the unit time period corresponding to each case execution set is set to one month, then the unit time period corresponding to each case execution set can be January 2021, February 2021, March 2021, etc., that is, the key name of the case execution set can be January 2021, February 2021, March 2021, etc.
[0052] Set the duration of the unit time period corresponding to each case execution set to one day, then the unit time period corresponding to each case execution set can be January 1, 2021, January 2, 2021, January 3, 2021, etc., that is, the key name of the case execution set can be January 1, 2021, January 2, 2021, January 3, 2021, etc.
[0053] The preset time condition may be a preset time range. For example, the preset time condition may be May 2021 to June 2021, or May 2021, etc.
[0054] For example, the preset time condition can be May 1, 2021 - May 3, 2021, or May 1, 2021, etc.
[0055] Use the preset time condition as the key name to query the redis database and obtain multiple target case execution sets.
[0056] Specifically, a key name query is performed on the database based on the preset time condition to obtain a key name that meets the preset time condition, and an ordered set corresponding to the key name is used as a target case execution set.
[0057] Specifically, based on the preset time condition, a regular expression for query is determined, and the database is queried by key name using the regular expression to obtain a key name that matches the preset time condition, and an ordered set corresponding to the key name is used as the target case execution set.
[0058] For example, it is assumed that the database includes 6 case execution sets, and the unit time periods corresponding to each case execution set are January 2021, February 2021, March 2021, April 2021, May 2021, and June 2021, that is, the keys stored in the database are January 2021, February 2021, March 2021, April 2021, May 2021, and June 2021. Set the preset time condition as May 2021-June 2021, and determine the regular expression as May 2021|June 2021. According to the regular expression, the database is queried by key name, and it is determined that the key names matching the preset time condition are May 2021 and June 2021. Then, the target case execution set includes: the case execution set corresponding to May 2021 and the case execution set corresponding to June 2021.
[0059] For example, it is assumed that the database includes 31 case execution sets, and the unit time periods corresponding to each case execution set are January 1, 2021, January 2, 2021, ..., January 31, 2021, that is, the key names stored in the database are January 1, 2021, January 2, 2021, ..., January 31, 2021. The preset time condition is set to January 2021, and the regular expression is determined to be January 2021* based on the preset time condition. The database is queried by key name according to the regular expression, and the key names that match the preset time condition are determined to be January 1, 2021, January 2, 2021, ..., January 31, 2021, then the target case execution set includes: all case execution sets corresponding to January 1, 2021 to January 31, 2021.
[0060] Step S202: merging multiple target case execution sets to obtain an activity detection set corresponding to a preset time condition and the case activity of each test case in the activity detection set.
[0061] Specifically, the case activity of the test case is determined based on the test case identifier and active feature information corresponding to the test case. Merging multiple target case execution sets to obtain an activity detection set corresponding to a preset time condition includes the following steps:
[0062] The test case identifiers and active feature information of the test cases included in the multiple target case execution sets are added to the reference set in sequence. After each addition, the active feature information corresponding to the same test case identifier in the reference set is merged. Finally, the reference set obtained after the addition is completed is used as the activity detection set, where the case activity of each test case in the activity detection set is obtained by merging the active feature information corresponding to the test case.
[0063] In a specific implementation, merging each active feature information may be adding each active feature information together, or adding each active feature information together according to the weight of each target case execution set. In the obtained activity detection set, the preset time condition is used as the key name, and the test case identifier and case activity of each test case are stored in the activity detection set corresponding to the key name.
[0064] For example, the active feature information is set to the preset value 1, the preset time condition is May 2021, and the target case execution set that meets the preset time condition includes: target case execution set 1 and target case execution set 2. Target case execution set 1 includes the test case identifiers and corresponding active feature information of 3 test cases, as shown in Table 1. Target case execution set 2 includes the test case identifiers and corresponding active feature information of 3 test cases, as shown in Table 2.
[0065] Table 1.
[0066] Test case identification Active feature information Test Case 1 1 Test Case 2 1 Test Case 3 1
[0067] Table 2.
[0068] Test case identification Active feature information Test Case 2 1 Test Case 4 1 Test Case 5 1
[0069] Set reference set 1 to an empty ordered set, and the key name corresponding to reference set 1 is May 2021. Add the test case identification and active feature information of the test cases included in the target case execution set 1 to reference set 1. At this time, reference set 1 is as shown in Table 3.
[0070] Table 3.
[0071] Test case identification Active feature information Test Case 1 1 Test Case 2 1 Test Case 3 1
[0072] Then, the test case identification and active feature information of the test cases included in the target case execution set 2 are added to the reference set 1, and the active feature information of the test case 2 included in both the target case execution set 1 and the target case execution set 2 is added, and the active feature information of the test case 2 is obtained as 2, and the active feature information of the other test cases is 1, as shown in Table 4.
[0073] Table 4 is the activity detection set obtained after merging. The activity feature information corresponding to each test case in Table 4 is used as the case activity corresponding to each test case, that is, the case activity of test case 1 is 1, the case activity of test case 2 is 2, the case activity of test case 3 is 1, the case activity of test case 4 is 1, and the case activity of test case 5 is 1.
[0074] Table 4.
[0075] Test case identification Active feature information Test Case 1 1 Test Case 2 2 Test Case 3 1 Test Case 4 1 Test Case 5 1
[0076] For example, the active feature information is set to the number of times the test case is executed, and the preset time condition is May 2021. The target case execution set that meets the preset time condition includes: target case execution set 1 and target case execution set 2. Target case execution set 1 includes the test case identifiers and corresponding active feature information of 3 test cases, as shown in Table 5. Target case execution set 2 includes the test case identifiers and corresponding active feature information of 3 test cases, as shown in Table 6.
[0077] Table 5.
[0078] Test case identification Active feature information Test Case 1 3 Test Case 2 5 Test Case 3 7
[0079] Table 6.
[0080] Test case identification Active feature information Test Case 2 1 Test Case 4 2 Test Case 5 6
[0081] Set reference set 2 to an empty ordered set, and the key name corresponding to reference set 2 is May 2021. Add the test case identification and active feature information of the test cases included in the target case execution set 1 to reference set 2. At this time, reference set 2 is as shown in Table 7.
[0082] Table 7.
[0083] Test case identification Active feature information Test Case 1 3 Test Case 2 5 Test Case 3 7
[0084] Then, the test case identification and active feature information of the test cases included in the target case execution set 2 are added to the reference set 2, and the active feature information of the test case 2 included in both the target case execution set 1 and the target case execution set 2 is added, and the active feature information of the test case 2 is obtained as 6. The active feature information of other test cases remains unchanged, as shown in Table 8.
[0085] Table 8 is the activity detection set obtained after merging. The activity feature information corresponding to each test case in Table 8 is used as the case activity corresponding to each test case, that is, the case activity of test case 1 is 3, the case activity of test case 2 is 6, the case activity of test case 3 is 7, the case activity of test case 4 is 2, and the case activity of test case 5 is 6.
[0086] Table 8.
[0087] Test case identification Active feature information Test Case 1 3 Test Case 2 6 Test Case 3 7 Test Case 4 2 Test Case 5 6
[0088] In an embodiment of the present application, each case execution set corresponds to a unit time period, and each case execution set includes the test case identification and active feature information of the test cases executed within the corresponding unit time period. Therefore, when it is necessary to determine the case activity of the test cases within a period of time, the corresponding multiple target case execution sets can be directly obtained based on the preset time conditions, and the multiple target case execution sets can be merged to obtain the case activity of the test cases within a period of time, thereby improving the flexibility and efficiency of detecting case activity. In the field of software testing, the use scenarios of evaluating case activity are expanded.
[0089] Optionally, after the above step S202, that is, after merging multiple target case execution sets to obtain an activity detection set corresponding to a preset time condition and the case activity of each test case in the activity detection set, the method further includes:
[0090] The case activity of each test case in the activity detection set is sorted in descending order of case activity to obtain the case activity distribution of each test case.
[0091] Alternatively, the case activities of each test case in the activity detection set are sorted in ascending order of case activity to obtain the case activity distribution of each test case.
[0092] For example, the case activity of each test case in the activity detection set shown in Table 4 is sorted in descending order of case activity, and the case activity distribution of each test case is obtained as shown in Table 9.
[0093] Table 9.
[0094] Test case identification Active feature information Test Case 2 2 Test Case 1 1 Test Case 3 1 Test Case 4 1 Test Case 5 1
[0095] In the embodiment of the present application, based on the activity distribution of each test case, test cases with higher activity and test cases with lower activity can be counted more quickly, which facilitates subsequent test case analysis and updating.
[0096] Optionally, before the above step S201, the steps of obtaining each case execution set are as follows:
[0097] For each test case, perform the following steps:
[0098] When determining that a test case is executed, a case execution set corresponding to the test case is determined based on the execution time of the test case, and then the test case identifier and active feature information of the test case are added to the case execution set.
[0099] Specifically, information such as the test case identification and execution time of the test case can be directly obtained from the database, or can be obtained from the test case execution record log.
[0100] In an embodiment of the present application, when a test case is executed, the test case identifier and active feature information of each test case are saved in a non-relational database according to the execution time of the test case, and the data collection and calculation process such as the activity information is dispersed when each case is executed, thereby reducing the computational pressure during query statistics and significantly improving the response speed of query requests, making it easy to operate and view.
[0101] When it is necessary to query according to the preset time condition, the regular expression is determined according to the preset time condition, and the key name query is performed on the database to obtain the key name that matches the preset time condition, and the ordered set corresponding to the matched key name is used as the target case execution set. Finally, multiple target case execution sets are merged to obtain the activity detection set corresponding to the preset time condition and the case activity of each test case in the activity detection set. The target case execution set is obtained by querying the key value of each case execution set, rather than querying the data in the entire database, which improves the efficiency of database query and reduces the database query time. Since the process of storing each test case in a different case execution set and the process of obtaining the target case execution set are executed separately, the coupling of each execution process is reduced.
[0102] In order to better explain the embodiment of the present application, the following describes a method for obtaining each case execution set provided by the embodiment of the present application in combination with a specific test case execution record scenario, such as Figure 3 As shown, the following steps are included:
[0103] Step S301: The i-th test case is executed, where i>0.
[0104] Step S302: Obtain the test case identifier, active feature information, and test case execution time of the test case in the i-th record.
[0105] Step S303: Add the above test case identification, active feature information, and test case execution time to the MySQL database.
[0106] Step S304: Determine a case execution set corresponding to the test case according to the test case execution time.
[0107] Step S305: Add the test case identification and active feature information to the case execution set in the redis database.
[0108] In an embodiment of the present application, when a test case is executed, the test case identifier and active feature information of each test case are added to different case execution sets according to the execution time, thereby effectively dividing each test case according to the execution time and facilitating the case activity detection of subsequent test cases.
[0109] A possible implementation method is that when the active feature information is a preset value, after determining a case execution set corresponding to a test case, if the test case identifier of the above test case does not exist in the case execution set, the test case identifier and active feature information corresponding to the test case are added to the case execution set; if the test case identifier of the above test case already exists in the case execution set, no processing is performed.
[0110] For example, the test case identifier and active feature information corresponding to the test case are shown in Table 10.
[0111] Table 10.
[0112] Test case identification Active feature information Test Case 1 1
[0113] If the case execution set corresponding to the test case is as shown in Table 11, since test case 1 does not exist in the test case identifier of the case execution set, the test case identifier (test case 1) and active feature information (1) corresponding to the test case are added to the case execution set. The added case execution set is shown in Table 12.
[0114] Table 11.
[0115] Test case identification Active feature information Test Case 2 1 Test Case 3 1
[0116] Table 12.
[0117] Test case identification Active feature information Test Case 2 1 Test Case 3 1 Test Case 1 1
[0118] If the case execution set corresponding to the test case is as shown in Table 13, since test case 1 already exists in the test case identifier of the case execution set, no processing is performed.
[0119] Table 13.
[0120]
[0121]
[0122] In an embodiment of the present application, the active feature information is a preset value. The test case identifier and active feature information of each test case are added to different case execution sets according to the execution time, which can clearly and conveniently record whether each test case is executed in different unit time periods.
[0123] Another possible implementation method is that when the active feature information is the number of times a test case is executed, after determining a case execution set corresponding to a test case, if the test case identifier of the above test case does not exist in the case execution set, the test case identifier and active feature information corresponding to the test case are added to the case execution set; if the test case identifier of the above test case already exists in the case execution set, the active feature information corresponding to the test case identifier in the case execution set is added to the active feature information corresponding to the above test case.
[0124] For example, the test case identifier and active feature information corresponding to the test case are shown in Table 14.
[0125] Table 14.
[0126] Test case identification Active feature information Test Case 1 3
[0127] If the case execution set corresponding to the test case is as shown in Table 15, since test case 1 does not exist in the test case identifier of the case execution set, the test case identifier (test case 1) and active feature information (3) corresponding to the test case are added to the case execution set. The added case execution set is shown in Table 16.
[0128] Table 15.
[0129] Test case identification Active feature information Test Case 2 2 Test Case 3 5
[0130] Table 16.
[0131]
[0132]
[0133] If the case execution set corresponding to the test case is as shown in Table 17, since test case 1 already exists in the test case identifier of the case execution set, the active feature information 3 corresponding to test case 1 in the case execution set is added to the active feature information 3 corresponding to the above test case, and the updated case execution set is shown in Table 18.
[0134] Table 17.
[0135] Test case identification Active feature information Test Case 1 3 Test Case 2 4 Test Case 3 5
[0136] Table 18.
[0137] Test case identification Active feature information Test Case 1 6 Test Case 2 4 Test Case 3 5
[0138] In an embodiment of the present application, the active feature information is the number of times the test case is executed. The test case identifier and active feature information of each test case are added to different case execution sets according to the execution time, which can clearly and conveniently record the number of times each test case is executed in different unit time periods.
[0139] Based on the same technical concept, the embodiment of the present application provides a case activity detection device, such as Figure 4 As shown, the device 400 includes:
[0140] The acquisition module 401 is used to acquire multiple target case execution sets that meet a preset time condition, wherein each case execution set corresponds to a unit time period, and each case execution set includes: a test case identifier and active feature information of a test case executed in the corresponding unit time period;
[0141] The merging module 402 is used to merge the multiple target case execution sets to obtain the activity detection set corresponding to the preset time condition and the case activity of each test case in the activity detection set, wherein the case activity of the test case is determined based on the test case identifier and active feature information corresponding to the test case.
[0142] Optionally, an adding module 403 is further included, and the adding module 403 is specifically used to:
[0143] Before obtaining multiple target case execution sets that meet the preset time conditions, perform the following steps for each test case:
[0144] When determining that a test case is executed, determining a case execution set corresponding to the test case based on the execution time of the test case;
[0145] Adding the test case identifier and active feature information of the one test case to the case execution set.
[0146] Optionally, the merging module 402 is specifically used for:
[0147] Sequentially adding the test case identifiers and active feature information of the test cases included in the multiple target case execution sets to the reference set, and after each addition, merging the active feature information corresponding to the same test case identifier in the reference set;
[0148] The reference set obtained after the addition is completed is used as the activity detection set, wherein the case activity of each test case in the activity detection set is obtained by merging various active feature information corresponding to the test case.
[0149] Optionally, a sorting module 404 is further included, and the sorting module 404 is specifically used to:
[0150] After merging the multiple target case execution sets to obtain the activity detection set corresponding to the preset time condition and the case activity of each test case in the activity detection set, the case activity of each test case is sorted in order from large to small to obtain the case activity distribution of each test case.
[0151] Optionally, the acquisition module 401 is specifically used for:
[0152] Based on a preset time range, multiple target case execution sets are obtained.
[0153] Optionally, the active feature information is a preset value, or the number of times a test case is executed.
[0154] Based on the same technical concept, the embodiment of the present application provides a computer device, which may be a terminal or a server, such as Figure 5 As shown, it includes at least one processor 501 and a memory 502 connected to the at least one processor. The specific connection medium between the processor 501 and the memory 502 is not limited in the embodiment of the present application. Figure 5 For example, the processor 501 and the memory 502 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0155] In an embodiment of the present application, the memory 502 stores instructions that can be executed by at least one processor 501. The at least one processor 501 can execute the steps included in the above-mentioned case activity detection method by executing the instructions stored in the memory 502.
[0156] Among them, the processor 501 is the control center of the computer device, which can use various interfaces and lines to connect various parts of the computer device, and perform case activity detection by running or executing instructions stored in the memory 502 and calling data stored in the memory 502. Optionally, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0157] The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0158] The memory 502 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 502 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0159] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned case activity detection method.
[0160] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0161] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0162] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0163] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0164] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A case activity detection method, characterized in that: include: When determining that a test case is executed, determining a case execution set corresponding to the test case based on the execution time of the test case; adding the test case identifier and active feature information of the one test case to the case execution set; Acquire multiple target case execution sets that meet preset time conditions, wherein each case execution set corresponds to a unit time period, and each case execution set includes: a test case identifier and active feature information of a test case executed in the corresponding unit time period; Sequentially adding the test case identifiers and active feature information of the test cases included in the multiple target case execution sets to the reference set, and after each addition, merging the active feature information corresponding to the same test case identifier in the reference set; The reference set obtained after the addition is completed is used as the activity detection set, wherein the case activity of each test case in the activity detection set is obtained by merging various active feature information corresponding to the test case.
2. The method according to claim 1, characterized in that After adding the reference set obtained after the end as the activity detection set, the following further includes: The case activities of the test cases are sorted in descending order of case activity to obtain a case activity distribution of the test cases.
3. The method according to claim 1, characterized in that The step of obtaining a plurality of target case execution sets that meet a preset time condition includes: Based on a preset time range, multiple target case execution sets are obtained.
4. The method according to any one of claims 1 to 3, characterized in that: The active feature information is a preset value, or the number of times the test case is executed.
5. A case activity detection device, characterized in that: include: Adding a module, for determining, when determining that a test case is executed, a case execution set corresponding to the test case based on the execution time of the test case; adding the test case identifier and active feature information of the one test case to the case execution set; An acquisition module, used to acquire multiple target case execution sets that meet preset time conditions, wherein each case execution set corresponds to a unit time period, and each case execution set includes: a test case identifier and active feature information of a test case executed in the corresponding unit time period; A merging module is used to sequentially add the test case identifiers and active feature information of the test cases included in the multiple target case execution sets to a reference set, and after each addition, merge the active feature information corresponding to the same test case identifier in the reference set; and use the reference set obtained after the addition as an activity detection set, wherein the case activity of each test case in the activity detection set is obtained after merging the active feature information corresponding to the test case.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of any method described in claims 1 to 4.
