Test case screening method, system, electronic device and storage medium

By establishing the correlation between test cases and requirements and screening according to the test strategy, the problems of low efficiency and lack of scientificity in test case screening in the existing technology are solved, standardized management and automated screening of use cases and requirements are realized, and screening efficiency is improved. and scientific.

CN115017040BActive Publication Date: 2024-10-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210609932.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2024-10-22
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

The existing technology has low efficiency and insufficient scientific basis in the test case screening process, and lacks the corresponding relationship between use cases and requirements. As a result, the screening results cannot intuitively judge the coverage of requirements.

Method used

By establishing the relationship between the test case base library and the requirements base library, the test cases to be screened are determined based on the project requirements and relationships, and the test cases are screened using priorities and preset ratios based on the test strategy (traversal or regression testing) to achieve test case selection. Automated screening.

Benefits of technology

It improves the efficiency and scientificity of test case screening, enables the coverage of use cases and requirements to be intuitively presented, and is free from manual intervention, achieving systematic and standardized management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115017040B_ABST
    Figure CN115017040B_ABST
Patent Text Reader

Abstract

The present application provides a test case screening method, system, electronic device and storage medium, including establishing an association relationship between a test case base library and a requirement base library; determining the test cases to be screened in the test case base library according to the requirements and association relationship corresponding to the project; selecting a test strategy according to the project version; if the test strategy is a traversal test strategy, then based on the case priority, preset ratio and the first preset rule, screen the test cases to be screened to determine the first target test cases; if the test strategy is a regression test strategy, then based on the second preset rule, screen the test cases to be screened to determine the second target test cases. This achieves standardized and systematic management of test cases and requirements, and intuitively reflects the coverage of test cases for each product requirement through the association relationship between test cases and requirements; at the same time, the screening rules for test cases are programmed and separated from manual work, which greatly improves the efficiency and scientificity of test case screening.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a test case screening method, system, electronic equipment and storage medium. Background Art

[0002] When developing a product, it is usually necessary to build cross-departmental and cross-system collaboration. Therefore, resource reuse becomes the core concept in the product development process. Specifically, when it comes to product testing and verification, test resources must be shared among different projects, including the reuse of test cases.

[0003] However, different projects involve different products and have different requirements for test cases. Even for the same product, the requirements for test cases in different testing stages are different. Therefore, the prior art provides a screening method. When a test task is received, it is necessary to manually select tests one by one according to product requirements and test cases. Among them, the test leader usually determines the priority of the use cases based on product requirements and personal experience, calculates the total number of use cases, and selects use cases that are as consistent as possible with the test strategy for subsequent testing. However, this method is inefficient, time-consuming, and unscientific. There is a lack of correspondence between use cases and requirements, which makes it difficult to intuitively judge the coverage of the selected use cases for the requirements.

[0004] Therefore, there is an urgent need for a method to improve the scientificity and efficiency of test case screening to solve the above-mentioned technical problems of the prior art. Summary of the invention

[0005] In order to solve the deficiencies of the prior art, the main purpose of the present invention is to provide a test case screening method, system, electronic device and storage medium to solve the above-mentioned technical problems of the prior art.

[0006] In order to achieve the above object, the present invention provides a test case screening method in a first aspect, the method comprising:

[0007] Establish the relationship between the test case base library and the requirement base library;

[0008] Determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship;

[0009] Choose a testing strategy based on the project version;

[0010] If the test strategy is a traversal test strategy, the test cases to be screened are screened according to the test case priority, the preset ratio and the first preset rule to determine the first target test case;

[0011] If the test strategy is a regression test strategy, the test cases to be screened are screened according to a second preset rule to determine a second target test case.

[0012] In some embodiments, the use case priority includes a first priority and a second priority. Before screening the test cases to be screened to determine the first target test case according to the use case priority, the preset ratio and the first preset rule, the method further includes:

[0013] Dividing the test cases in the test case base library into a plurality of first-level test cases according to a first priority;

[0014] Each of the first-level test cases is divided into a plurality of second-level test cases according to the second priority.

[0015] In some embodiments, screening the test cases to be screened to determine the first target test cases according to the test case priority, the preset ratio and the first preset rule includes:

[0016] Determine the first target number of test cases according to the number of test cases to be screened and the preset ratio;

[0017] According to the first priority order, determining whether the number of first-level test cases with the highest first priority among the test cases to be screened exceeds the number of the first target test cases;

[0018] If it exceeds, the highest first priority is recorded as the target first priority and the first-level test cases under the target first priority are screened again according to the third preset rule to determine the first target test case;

[0019] If it does not exceed, determine the first-level test case under the highest first priority as the first alternative test case and add it to the first target test case, and take the difference between the number of first alternative test cases and the number of first target test cases as the first remaining number, and determine the first target test case according to the fourth preset rule.

[0020] In some embodiments, determining the first target test case according to a fourth preset rule includes:

[0021] Determine whether the number of first-level test cases under the first-level priority level next to the highest first-priority level exceeds the first remaining number;

[0022] If not, adding the first-level test cases under the first priority level of the next level to the first candidate test cases, and updating the first remaining number, until the total number of the first-level test cases under the first priority level of the next level exceeds the first remaining number, at which time the first priority level of the next level is recorded as the target first priority;

[0023] The first-level test cases under the target first priority are screened again according to the third preset rule to determine the first target test cases.

[0024] In some embodiments, the step of rescreening the first-level test cases under the target first priority according to the third preset rule to determine the first target test cases includes:

[0025] Determine whether the number of second-level test cases corresponding to the highest second priority level under the first-level test cases of the target first priority level exceeds the number of the first target test cases;

[0026] If it exceeds, randomly selecting secondary test cases corresponding to the number of the first target test cases from the test cases under the highest second priority, and determining the secondary test cases corresponding to the number of the first target test cases as the first target test cases;

[0027] If not, determining the secondary test cases under the highest second priority as second candidate test cases and adding them to the first target test cases, and setting the difference between the number of the second candidate test cases and the number of the first target test cases as the second remaining number;

[0028] Determine whether the number of secondary test cases under the second priority level of the next level of the highest second priority level exceeds the second remaining number;

[0029] If not, then adding the secondary test cases under the second priority level of the next level to the second candidate test cases, and updating the second remaining number, until the total number of secondary test cases under the second priority level of the next level exceeds the second remaining number, at which time the second priority level of the next level is recorded as the target second priority;

[0030] Determine as the first target test case the second test case corresponding to the second remaining number randomly selected from the second test cases corresponding to the second priority of the target, the second test cases corresponding to all the second priorities before the second priority of the target, and the first test cases corresponding to all the first priorities before the first priority of the target.

[0031] In some embodiments, screening the test cases to be screened to determine the second target test cases according to the second preset rule includes:

[0032] According to the test result of the test case to be screened, when the test result is abnormal, a bug number is added to the corresponding test case to be screened;

[0033] The test cases to be screened are screened according to the bug number to determine the second target test case.

[0034] In some embodiments, establishing an association relationship between a test case base library and a requirement base library includes:

[0035] Add a requirement number column in the requirement base library;

[0036] Add the requirement number column and the use case number column in the test case basic library;

[0037] Based on the requirement number, the association relationship between the test case basic library and the test cases and requirements in the requirement basic library is established.

[0038] In a second aspect, the present application provides a test case screening system, the system comprising:

[0039] Preparation module, used to establish the association relationship between the test case base library and the requirement base library;

[0040] The preparation module is further used to determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship;

[0041] The preparation module is also used to select a test strategy according to the project version;

[0042] A screening module, used for screening the test cases to be screened to determine a first target test case when the test strategy is a traversal test strategy according to the case priority, the preset ratio and the first preset rule;

[0043] The screening module is further used for screening the test cases to be screened to determine the second target test cases according to the second preset rule when the test strategy is a regression test strategy.

[0044] In a third aspect, the present application provides an electronic device, the electronic device comprising:

[0045] one or more processors;

[0046] and a memory associated with the one or more processors, the memory being used to store program instructions, the program instructions when read and executed by the one or more processors performing the following operations:

[0047] Establish the relationship between the test case base library and the requirement base library;

[0048] Determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship;

[0049] Choose a testing strategy based on the project version;

[0050] If the test strategy is a traversal test strategy, the test cases to be screened are screened according to the test case priority, the preset ratio and the first preset rule to determine the first target test case;

[0051] If the test strategy is a regression test strategy, the test cases to be screened are screened according to a second preset rule to determine a second target test case.

[0052] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program enables a computer to perform the following operations:

[0053] Establish the relationship between the test case base library and the requirement base library;

[0054] Determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship;

[0055] Choose a testing strategy based on the project version;

[0056] If the test strategy is a traversal test strategy, the test cases to be screened are screened according to the test case priority, the preset ratio and the first preset rule to determine the first target test case;

[0057] If the test strategy is a regression test strategy, the test cases to be screened are screened according to a second preset rule to determine a second target test case.

[0058] The beneficial effects achieved by this application are:

[0059] The present application provides a test case screening method, system, electronic device and storage medium, including establishing an association relationship between a test case base library and a requirement base library; determining the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship; selecting a test strategy according to the project version; if the test strategy is a traversal test strategy, then screening the test cases to be screened according to the case priority, preset ratio and first preset rule to determine the first target test case; if the test strategy is a regression test strategy, then screening the test cases to be screened according to the second preset rule to determine the second target test case. It realizes the standardized and systematic management of test cases and requirements, and intuitively reflects the coverage of test cases for each product requirement through the association relationship between test cases and requirements; at the same time, the screening rules of test cases are programmed and separated from manual work, which greatly improves the efficiency and scientificity of test case screening. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:

[0061] Figure 1 is a test system screening flow chart provided in an embodiment of the present application;

[0062] Figure 2 is a flow chart of a test case screening method provided in an embodiment of the present application;

[0063] Figure 3 is a structural diagram of a test case screening system provided in an embodiment of the present application;

[0064] Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0066] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like in the entire specification and claims should be interpreted as inclusive rather than exclusive or exhaustive; that is, the meaning of "including but not limited to".

[0067] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.

[0068] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.

[0069] As described in the background technology, the existing technology usually selects test cases based on the experience of testers. Although test cases that meet the test requirements can be selected, the selection process is time-consuming, lacks scientificity, and is strongly related to the test leader. In addition, due to the lack of relationship between use cases and requirements, the corresponding screened use cases cannot directly determine the coverage of the corresponding test requirements, and further operations are required to determine.

[0070] To solve the above technical problems, the present application provides a systematic and standardized test case screening method, which realizes the automation of case screening by constructing the association between requirements and use cases and further refining the priority of use cases, algorithmizing the test case selection rules.

[0071] It is worth noting that the test case screening method provided in the present application is applicable to test case screening under the IPD (Integrated Product Development) process, and is also applicable to any other test scenarios for test cases with priority.

[0072] Embodiment 1

[0073] In order to implement the test case screening method provided in the present application, the present application embodiment provides a test system, specifically, as follows Figure 1 As shown, the process of applying the test system disclosed in this embodiment to screen out test cases that meet the requirements includes:

[0074] S100. Build the relationship between test cases and requirements.

[0075] In order to intuitively judge the coverage of the product requirements by the test cases subsequently screened, at the beginning of the construction of the test system, the embodiment of the present application constructs the association relationship between the test cases and the requirements. Specifically, the process of the above association relationship includes the following steps:

[0076] Standardized management of product requirements, adding a requirement number column to the requirement decomposition table under the general template as the unique identifier of the requirement, and importing it into the test system to form a basic requirement library (i.e., standardized requirement library) for a certain product line; the above test system supports the addition, deletion, and modification of requirements, including but not limited to the two methods of importing and adding pages. Standardized management of product corresponding test cases, adding a case number column and a requirement number column to the test case table under the general test case template, and constructing the relationship between test cases and requirements through the added requirement number column; the case number is used as the unique identifier of the case. In addition, on the basis of the general priority division, a secondary priority column is added. The test case table after adding the case number column and the requirement number column is uploaded to the test system to form a basic test case library (i.e., standardized case library). The above test system supports the addition, deletion, and modification of test cases, including but not limited to the two methods of importing and adding pages. In addition, the above test system also allows dynamic recording of the execution status of each case of each iteration version to facilitate version traceability. It is worth noting that before uploading the test system, the test cases need to be designed, written and reviewed according to the general test case template. Only the test cases that pass the review can be uploaded to the test system as the test case basic library.

[0077] S200, determine the test cases and test strategies to be screened corresponding to the project.

[0078] When testing products in a certain product line, the product manager can log in to the test system and create a new project. The test system imports the requirements that need to be covered by the above project from the standardized requirements library based on the project requirements. At this time, the association between the requirements and the test cases is called to form a standard case library corresponding to the above project. At this time, the standard case library consists of test cases to be screened.

[0079] At the same time, when the test leader receives the test task of the product, he logs into the test system and enters the test version. The test system determines the test strategy according to the test version. The test strategy includes the traversal test strategy and the regression test strategy. Specifically, the test system obtains the test version entered by the test leader. If the entered test version is the first test version, the traversal test strategy is selected; if the entered test version is not the first test version, the regression test strategy is selected.

[0080] S300. Based on different testing strategies, filter out test cases that meet the requirements.

[0081] Specifically, if the test case selected by the test system is a traversal test strategy, you also need to choose whether the traversal test strategy is based on functional modules or based on the overall traversal. Among them, traversal based on functional modules is suitable for testing versions that include newly developed modules or modules with unstable functions. After selecting traversal based on functional modules, the test system will automatically filter out the functional modules included in the above projects, and the test leader only needs to enter the test ratio of each module in the test system; traversal based on the overall is suitable for regular version iterations. After selecting this traversal method, the test leader only needs to enter the ratio of use cases that need to be covered by the test.

[0082] Taking the traversal test strategy based on functional modules as an example, the process of screening test cases under this test strategy is as follows:

[0083] First, in terms of setting the priority, preferably for the convenience of operation, three first-level priorities can be set, recorded as level 1, level 2, and level 3, corresponding to normal flow, alternative flow, and abnormal flow; each first-level priority is divided into three second-level priorities, recorded as level 1-1, level 1-2, level 1-3; level 2-1, level 2-2, level 2-3; level 3-1, level 3-2, level 3-3. The confirmation of the priority is written and reviewed by the staff. Here, the embodiment of the present application only proposes a priority setting, and does not limit the priority setting to three.

[0084] The test system output project includes functional modules, and the functional modules include module A, module B and module C, etc. For example, in the server test project, the output functional modules are the BMC module (Baseboard Management Controller), the BIOS module (Basic Input Output System), the operating system module, etc. The test leader inputs the test case ratio of each module. For example, for module A, the test leader inputs a test case ratio of 15%. When the test system performs traversal screening, it first calculates the total number of test cases corresponding to module A and the first target number of test cases that need to be screened out. The first target number of test cases is equal to the total number of test cases for module A multiplied by 15%.

[0085] Determine whether the number of test cases corresponding to level 1 in module A reaches the first target number of test cases. If the number of test cases corresponding to level 1 exceeds the first target number of test cases, it means that the number of test cases corresponding to level 1 is too large, and the test cases corresponding to level 1 need to be deeply filtered. The step of deeply filtering the test cases corresponding to level 1 includes: determining whether the number of test cases corresponding to level 1-1 exceeds the first target number of test cases. If the number of test cases corresponding to level 1-1 exceeds the first target number of test cases, then among the test cases corresponding to level 1-1, randomly select the test cases that are consistent with the first target number of test cases as the first target test cases. If the number of test cases corresponding to level 1-1 does not exceed the first target number of test cases, then calculate the number of remaining cases (target1), where target1 is the difference between the number of test cases corresponding to level 1-1 and the first target number of test cases. At this time, determine whether the test cases corresponding to level1-2 exceed target1. If so, take the test cases corresponding to level1-1 and the test cases randomly selected from the test cases corresponding to level1-2 with the same number as target1 as the first target test cases; if not, calculate the remaining number of cases (target2), target2 is the first target test case number minus the number of test cases corresponding to level1-1 and the number of test cases corresponding to level1-2, and take the test cases corresponding to level1-1, the test cases corresponding to level1-2, and the test cases randomly selected from the number of test cases corresponding to level1-2 with the same number as target2 as the first target test cases.

[0086] If the number of test cases corresponding to level1 does not exceed the first target number of test cases, it means that the test cases corresponding to level1 do not meet the number of test cases that need to be screened out. Therefore, all the test cases corresponding to level1 need to be included in the first target number of test cases, and the test cases corresponding to level2 are screened out. The number of remaining cases (target3) is calculated, where target3 is the difference between the first target number of test cases and the number of test cases corresponding to level1. If the number of test cases corresponding to level2 exceeds target3, it means that the test cases corresponding to level2 need to be deeply filtered. At this time, the steps for deeply filtering the test cases corresponding to level1 are consistent with the above steps, and the test cases corresponding to level2 are screened out with the same number as target3; at this time, the first target test cases are all the test cases corresponding to level1 and the test cases screened out with the same number as target3 from the test cases corresponding to level2. If the number of test cases corresponding to level2 does not exceed target3, it means that the total number of test cases corresponding to level1 and level2 still does not meet the screening requirements, that is, it does not meet the required number of the first target test cases. At this time, the test cases corresponding to level1 and level2 are taken as part of the first target test cases and the test cases corresponding to level3 are screened; at this time, since the test cases corresponding to module A are only divided into level1, level2 and level3, the number of test cases corresponding to level3 must exceed the number of remaining cases (target4), target4 is the difference between the first target number of test cases and the total number of test cases corresponding to level1 and level2. At this time, the test cases corresponding to level3 are deeply filtered, wherein the step of deep filtering the test cases corresponding to level3 is consistent with the above-mentioned step of deep filtering the test cases corresponding to level1, and this application will not repeat them again.

[0087] According to the above method, the test cases corresponding to other modules included in the project are screened to realize automatic screening of the test cases required for the entire project. In addition, the test strategy based on traversal of the population is similar to the above method and requires the user to input the proportion of test cases corresponding to the population.

[0088] If the test case selected by the test system is a regression test strategy, according to the test results after the test case is executed, that is, PASS or Fail, in the test case table, fill in the bug number for the test case with the corresponding test result of Fail; in case of regression, directly filter out the test case set that needs to be executed according to the bug number.

[0089] Based on the test case screening method disclosed in the embodiment of the present application, the test system can realize automatic screening of test cases, improve efficiency and increase the scientific nature of screening, while enabling staff to intuitively judge the test case coverage required by the product.

[0090] Embodiment 2

[0091] Corresponding to the above embodiment, the present application provides a test case screening method, such as Figure 2 As shown, the method includes:

[0092] 2100. Establish the association relationship between the test case base library and the requirement base library;

[0093] Preferably, the establishing of the association relationship between the test case base library and the requirement base library includes:

[0094] 2110. Add a requirement number column in the requirement base library;

[0095] 2120. Add the requirement number column and the use case number column to the test case basic library;

[0096] 2130. Based on the requirement number, establish the association relationship between the test case basic library and the test cases and requirements in the requirement basic library.

[0097] 2200. Determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship;

[0098] 2300. Select the test strategy based on the project version;

[0099] 2400. If the test strategy is a traversal test strategy, the test cases to be screened are screened according to the test case priority, the preset ratio and the first preset rule to determine a first target test case;

[0100] Preferably, the use case priority includes a first priority and a second priority. Before screening the test cases to be screened to determine the first target test case according to the use case priority, the preset ratio and the first preset rule, the method further includes:

[0101] 2410. Divide the test cases in the test case base library into a plurality of first-level test cases according to the first priority;

[0102] 2420. Divide each of the first-level test cases into a plurality of second-level test cases according to the second priority.

[0103] Preferably, screening the test cases to be screened to determine the first target test cases according to the test case priority, the preset ratio and the first preset rule includes:

[0104] 2430. Determine the first target number of test cases according to the number of test cases to be screened and the preset ratio;

[0105] 2440. Determine, according to the first priority order, whether the number of first-level test cases with the highest first priority among the test cases to be screened exceeds the number of the first target test cases;

[0106] 2450. If it exceeds, the highest first priority is recorded as the target first priority and the first-level test cases under the target first priority are screened again according to a third preset rule to determine the first target test case;

[0107] Preferably, the step of rescreening the first-level test cases under the target first priority according to the third preset rule to determine the first target test cases includes:

[0108] 2451. Determine whether the number of second-level test cases corresponding to the highest second priority under the first-level test cases of the target first priority exceeds the number of the first target test cases;

[0109] 2452. If more than, randomly select secondary test cases corresponding to the number of the first target test cases from the test cases with the highest second priority, and determine the secondary test cases corresponding to the number of the first target test cases as the first target test cases;

[0110] 2453. If not, determine the secondary test case under the highest second priority as the second candidate test case and add it to the first target test case, and set the difference between the number of the second candidate test cases and the number of the first target test cases as the second remaining number;

[0111] 2454. Determine whether the number of the second-level test cases under the second priority level below the highest second priority level exceeds the second remaining number;

[0112] 2455. If not, then add the second-level test cases under the second priority level of the next level to the second candidate test cases, and update the second remaining number, until the total number of the second-level test cases under the second priority level of the next level exceeds the second remaining number, at which time the second priority level of the next level is recorded as the target second priority;

[0113] 2456. Determine as the first target test case the second-level test case corresponding to the second remaining number randomly selected from the second-level test cases corresponding to the second priority of the target, the second-level test cases corresponding to all the second priorities before the second priority of the target, and the first-level test cases corresponding to all the first priorities before the first priority of the target.

[0114] 2460. If it does not exceed, determine the first-level test case under the highest first priority as the first alternative test case and add it to the first target test case, and use the difference between the number of first alternative test cases and the number of first target test cases as the first remaining number, and determine the first target test case according to the fourth preset rule.

[0115] Preferably, determining the first target test case according to the fourth preset rule includes:

[0116] 2461. Determine whether the number of first-level test cases under the first-level priority level next to the highest first priority level exceeds the first remaining number;

[0117] 2462. If not, add the first-level test cases under the first priority level of the next level to the first candidate test cases, and update the first remaining number until the total number of the first-level test cases under the first priority level of the next level exceeds the first remaining number, at which time the first priority level of the next level is recorded as the target first priority;

[0118] 2463. Screen the first-level test cases under the target first priority again according to the third preset rule to determine the first target test cases.

[0119] 2500. If the test strategy is a regression test strategy, then according to a second preset rule, the test cases to be screened are screened to determine a second target test case.

[0120] Preferably, screening the test cases to be screened to determine the second target test cases includes:

[0121] 2510. According to the test result of the test case to be screened, when the test result is abnormal, add a bug number to the corresponding test case to be screened;

[0122] 2520. Filter the test cases to be filtered according to the bug number to determine the second target test case.

[0123] Embodiment 3

[0124] Corresponding to the first and second embodiments, as Figure 3 As shown, the present application also provides a test case screening system, the system comprising:

[0125] A preparation module 310 is used to establish an association relationship between a test case base library and a requirement base library;

[0126] The preparation module 310 is further used to determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship;

[0127] The preparation module 310 is also used to select a test strategy according to the project version;

[0128] A screening module 320, configured to screen the test cases to be screened to determine a first target test case when the test strategy is a traversal test strategy according to a case priority, a preset ratio and a first preset rule;

[0129] The screening module 320 is further configured to screen the test cases to be screened to determine the second target test cases according to the second preset rule when the test strategy is a regression test strategy.

[0130] In some embodiments, the preparation module 310 is also used to divide the test cases in the test case basic library into multiple first-level test cases according to a first priority; the preparation module 310 is also used to divide each of the first-level test cases into multiple second-level test cases according to a second priority.

[0131] In some embodiments, the screening module 320 is also used to determine the first target test case number based on the number of test cases to be screened and the preset ratio; the screening module 320 is also used to determine whether the number of first-level test cases under the highest first priority in the test cases to be screened exceeds the first target test case number according to the first priority order; if it exceeds, the screening module 320 is also used to record the highest first priority as the target first priority and screen the first-level test cases under the target first priority again according to a third preset rule to determine the first target test case; if it does not exceed, the screening module 320 is also used to determine the first-level test case under the highest first priority as the first alternative test case and add it to the first target test case, and use the difference between the number of first alternative test cases and the number of first target test cases as the first remaining number, and determine the first target test case according to a fourth preset rule.

[0132] In some embodiments, the screening module 320 is also used to determine whether the number of first-level test cases under the next level first priority of the highest first priority exceeds the first remaining number; if not, the screening module 320 is also used to add the first-level test cases under the next level first priority to the first alternative test cases, and update the first remaining number until the total number of first-level test cases under the next level first priority exceeds the first remaining number, at which time the next level first priority is recorded as the target first priority; the screening module 320 is also used to screen the first-level test cases under the target first priority again according to the third preset rule to determine the first target test cases.

[0133] In some embodiments, the screening module 320 is further used to determine whether the number of secondary test cases corresponding to the highest second priority under the first-level test cases of the target first priority exceeds the number of the first target test cases; if so, the screening module 320 is further used to randomly select secondary test cases corresponding to the first target test case number from the test cases under the highest second priority, and determine the secondary test cases corresponding to the first target test case number as the first target test cases; if not, the screening module 320 is further used to determine the secondary test cases under the highest second priority as second alternative test cases and add them to the first target test cases, and use the difference between the number of second alternative test cases and the number of the first target test cases as the second remaining number; determine the highest second priority Whether the number of secondary test cases under the second priority level of the next level exceeds the second remaining number; if not, the screening module 320 is also used to add the secondary test cases under the second priority level of the next level to the second candidate test cases, and update the second remaining number until the total number of secondary test cases under the second priority level of the next level exceeds the second remaining number, at which time the next level second priority level is recorded as the target second priority; the screening module 320 is also used to determine that the secondary test cases corresponding to the second remaining number randomly selected from the secondary test cases corresponding to the target second priority, the secondary test cases corresponding to all the second priorities before the target second priority, and the first test cases corresponding to all the first priorities before the target first priority are the first target test cases.

[0134] In some embodiments, the screening module 320 is also used to add a bug number to the corresponding test case to be screened based on the test result of the test case to be screened when the test result is abnormal; the screening module 320 is also used to screen the test case to be screened based on the bug number to determine the second target test case.

[0135] In some embodiments, the filtering module 320 is also used to add a requirement number column in the requirement basic library; the filtering module 320 is also used to add the requirement number column and the test case number column in the test case basic library; the filtering module 320 is also used to establish the association relationship between the test case basic library and the test cases and requirements in the requirement basic library based on the requirement number.

[0136] Embodiment 4

[0137] Corresponding to all the above embodiments, an embodiment of the present application provides an electronic device, including:

[0138] One or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, the program instructions when read and executed by the one or more processors, performing the following operations:

[0139] Establish the relationship between the test case base library and the requirement base library;

[0140] Determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship;

[0141] Choose a testing strategy based on the project version;

[0142] If the test strategy is a traversal test strategy, the test cases to be screened are screened according to the test case priority, the preset ratio and the first preset rule to determine the first target test case;

[0143] If the test strategy is a regression test strategy, the test cases to be screened are screened according to a second preset rule to determine a second target test case.

[0144] in, Figure 4 The architecture of the electronic device is exemplarily shown, which may include a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, and a memory 420. The processor 410, the video display adapter 411, the disk drive 412, the input / output interface 413, the network interface 414, and the memory 420 may be communicatively connected via a bus 430.

[0145] Among them, the processor 410 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided in this application.

[0146] The memory 420 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 420 can store an operating system 421 for controlling the execution of the electronic device 400, and a basic input and output system (BIOS) 422 for controlling the low-level operations of the electronic device 400. In addition, a web browser 423, a data storage management system 424, and an icon font processing system 425, etc. can also be stored. The above-mentioned icon font processing system 425 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present application. In short, when the technical solution provided in the present application is implemented by software or firmware, the relevant program code is stored in the memory 420 and is called and executed by the processor 410.

[0147] The input / output interface 413 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0148] The network interface 414 is used to connect to a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0149] The bus 430 comprises a pathway for transmitting information between the various components of the device (eg, the processor 410, the video display adapter 411, the disk drive 412, the input / output interface 413, the network interface 414, and the memory 420).

[0150] In addition, the electronic device 400 can also obtain information on specific collection conditions from the virtual resource object collection condition information database for use in condition judgment, etc.

[0151] It should be noted that, although the above device only shows a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, a memory 420, a bus 430, etc., in the specific implementation process, the device may also include other components necessary for normal execution. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.

[0152] Embodiment 5

[0153] Corresponding to all the above embodiments, the embodiments of the present application further provide a computer-readable storage medium, characterized in that it stores a computer program, and the computer program enables the computer to operate as follows:

[0154] Establish the relationship between the test case base library and the requirement base library;

[0155] Determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship;

[0156] Choose a testing strategy based on the project version;

[0157] If the test strategy is a traversal test strategy, the test cases to be screened are screened according to the test case priority, the preset ratio and the first preset rule to determine the first target test case;

[0158] If the test strategy is a regression test strategy, the test cases to be screened are screened according to a second preset rule to determine a second target test case.

[0159] It can be seen from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a cloud service end, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0160] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0161] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A test case screening method, characterized in that: The method comprises: Establish the relationship between the test case base library and the requirement base library; Determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship; Choose a testing strategy based on the project version; If the test strategy is a traversal test strategy, the test cases to be screened are screened according to the test case priority, the preset ratio and the first preset rule to determine the first target test case; If the test strategy is a regression test strategy, screening the test cases to be screened according to a second preset rule to determine a second target test case; The step of screening the test cases to be screened to determine the first target test cases according to the test case priority, the preset ratio and the first preset rule includes: Determine the first target number of test cases according to the number of test cases to be screened and the preset ratio; According to the first priority order, determining whether the number of first-level test cases with the highest first priority among the test cases to be screened exceeds the number of the first target test cases; If it exceeds, the highest first priority is recorded as the target first priority and the first-level test cases under the target first priority are screened again according to the third preset rule to determine the first target test case; If not, determining the first-level test case under the highest first priority as the first candidate test case and adding it to the first target test case, and taking the difference between the number of the first candidate test cases and the number of the first target test cases as the first remaining number, and determining the first target test case according to a fourth preset rule; The screening of the test cases to be screened to determine the second target test cases according to the second preset rule includes: According to the test result of the test case to be screened, when the test result is abnormal, a bug number is added to the corresponding test case to be screened; The test cases to be screened are screened according to the bug number to determine the second target test case.

2. The method according to claim 1, characterized in that The use case priority includes a first priority and a second priority. Before screening the test cases to be screened to determine the first target test case according to the use case priority, the preset ratio and the first preset rule, the method further includes: Dividing the test cases in the test case base library into a plurality of first-level test cases according to a first priority; Each of the first-level test cases is divided into a plurality of second-level test cases according to the second priority.

3. The method according to claim 1, characterized in that The determining the first target test case according to the fourth preset rule includes: Determine whether the number of first-level test cases under the first-level priority level next to the highest first-priority level exceeds the first remaining number; If not, adding the first-level test cases under the first priority level of the next level to the first candidate test cases, and updating the first remaining number, until the total number of the first-level test cases under the first priority level of the next level exceeds the first remaining number, at which time the first priority level of the next level is recorded as the target first priority; The first-level test cases under the target first priority are screened again according to the third preset rule to determine the first target test cases.

4. The method according to claim 1, characterized in that The step of screening the first-level test cases under the target first priority again according to the third preset rule to determine the first target test cases includes: Determine whether the number of second-level test cases corresponding to the highest second priority level under the first-level test cases of the target first priority level exceeds the number of the first target test cases; If it exceeds, randomly selecting secondary test cases corresponding to the number of the first target test cases from the test cases under the highest second priority, and determining the secondary test cases corresponding to the number of the first target test cases as the first target test cases; If not, determining the secondary test cases under the highest second priority as second candidate test cases and adding them to the first target test cases, and setting the difference between the number of the second candidate test cases and the number of the first target test cases as the second remaining number; Determine whether the number of secondary test cases under the second priority level of the next level of the highest second priority level exceeds the second remaining number; If not, then adding the secondary test cases under the second priority level of the next level to the second candidate test cases, and updating the second remaining number, until the total number of secondary test cases under the second priority level of the next level exceeds the second remaining number, at which time the second priority level of the next level is recorded as the target second priority; Determine as the first target test case the second test case corresponding to the second remaining number randomly selected from the second test cases corresponding to the second priority of the target, the second test cases corresponding to all the second priorities before the second priority of the target, and the first test cases corresponding to all the first priorities before the first priority of the target.

5. According to the method of claim 1, the establishing of the association relationship between the test case base library and the requirement base library comprises: Add a requirement number column in the requirement base library; Add the requirement number column and the use case number column in the test case basic library; Based on the requirement number, the association relationship between the test case basic library and the test cases and requirements in the requirement basic library is established.

6. A system for implementing the test case screening method according to any one of claims 1 to 5, characterized in that: The system comprises: Preparation module, used to establish the association relationship between the test case base library and the requirement base library; The preparation module is further used to determine the test cases to be screened in the test case base library according to the requirements corresponding to the project and the association relationship; The preparation module is also used to select a test strategy according to the project version; A screening module, used for screening the test cases to be screened to determine a first target test case when the test strategy is a traversal test strategy according to the case priority, the preset ratio and the first preset rule; The screening module is further used for screening the test cases to be screened to determine the second target test cases according to the second preset rule when the test strategy is a regression test strategy.

7. An electronic device, characterized in that: The electronic device comprises: one or more processors; And a memory associated with the one or more processors, the memory is used to store program instructions, and when the program instructions are read and executed by the one or more processors, the method according to any one of claims 1-5 is executed.

8. A storage medium, characterized in that: The computer program stores a computer program, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 5.