Test case processing method and device, equipment and storage medium
By conducting demand coverage detection and supplementary processing of software test cases, the problem of incomplete testing in the existing technology is solved, and the comprehensiveness and efficiency of software testing is improved.
Patent Information
- Application Number
- CN202411689729.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art often fails to fully cover all the testing needs of the software in software testing, resulting in inefficiency in testing.
By obtaining multiple test cases and use case description information of the target software, perform coverage detection of test requirements one by one, determine the requirements coverage of test cases, and perform use case supplementary processing when the coverage rate is lower than the preset value to ensure that the test cases can cover all test requirements of the software.
Improves the comprehensiveness and efficiency of software testing, ensures that test cases can cover all necessary testing needs of the software, and reduces duplicate testing.
Smart Images

Figure CN119537237A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and in particular to a test case processing method, apparatus, device and storage medium. Background Art
[0002] A test case is a description of a test task for a software product, and its purpose is to determine whether a certain feature of the software product can work properly.
[0003] At present, test cases are usually designed and written based on the description information of software functions, uses and performance parameters. After the test case design is completed, the designed test case is often directly executed to obtain the test results. However, since the designed test case may only meet part of the test requirements, the software test is not comprehensive, which reduces the efficiency of software testing. Summary of the invention
[0004] The embodiments of the present invention provide a test case processing method, apparatus, device and storage medium to perform comprehensive detection and supplementary processing on test cases for requirement coverage, thereby improving the comprehensiveness of software testing and enhancing software testing efficiency.
[0005] In a first aspect, an embodiment of the present invention provides a test case processing method, comprising:
[0006] Obtain multiple test cases to be executed by the target software and use case description information of each test case;
[0007] Performing coverage detection of the test requirements one by one according to the test requirement contents corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determining the first test requirement content covered by the multiple test cases, wherein the multiple test requirements are obtained by pre-dividing all the test requirements required for the software;
[0008] Determining the requirement coverage corresponding to the plurality of test cases according to the quantity of the first test requirement contents;
[0009] If the requirement coverage is less than a preset coverage, supplementary processing of the test cases is performed according to the second test requirement content not covered by the multiple test cases.
[0010] In a second aspect, an embodiment of the present invention further provides a test case processing device, comprising:
[0011] A test case acquisition module is used to acquire multiple test cases to be executed by the target software and the case description information of each test case;
[0012] A test requirement coverage detection module is used to perform coverage detection of the test requirements one by one according to the test requirement contents corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determine the first test requirement content covered by the multiple test cases, wherein the multiple test requirements are obtained by pre-dividing all the test requirements required for the software;
[0013] A requirement coverage determination module, used to determine the requirement coverage corresponding to the plurality of test cases according to the quantity of the first test requirement content;
[0014] The test case supplement module is used to supplement the test cases according to the second test requirement content not covered by the multiple test cases if the requirement coverage is less than the preset coverage.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] A memory for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the test case processing method provided by any embodiment of the present invention.
[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a test case processing method as provided in any embodiment of the present invention.
[0020] One embodiment of the above invention has the following advantages or beneficial effects:
[0021] By obtaining multiple test cases to be executed by the target software and the use case description information of each test case, the test requirements are covered one by one according to the test requirement content corresponding to the multiple test requirements of the target software and the use case description information of each test case, the first test requirement content covered by multiple test cases is determined, and the requirement coverage rate corresponding to multiple test cases is determined according to the number of first test requirement contents, thereby achieving a comprehensive detection of the requirement coverage of the test cases. In the case where the requirement coverage rate is less than the preset coverage rate, the test cases are supplemented according to the second test requirement content not covered by the multiple test cases, so that the supplemented test cases can cover all the test requirements of the target software, thereby improving the comprehensiveness of software testing and further improving software testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 is a flow chart of a test case processing method provided by an embodiment of the present invention;
[0024] Figure 2 is a flowchart of another test case processing method provided by an embodiment of the present invention;
[0025] Figure 3 It is a structural schematic diagram of a test case processing device provided by an embodiment of the present invention;
[0026] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0028] Figure 1 This is a flow chart of a test case processing method provided by an embodiment of the present invention. This embodiment is applicable to the case of detecting and supplementing the test case requirements. The method can be executed by a test case processing device, which can be implemented by software and / or hardware and integrated in an electronic device. Figure 1 As shown, the method specifically comprises the following steps:
[0029] S110, obtaining multiple test cases to be executed by the target software and use case description information of each test case.
[0030] The target software may refer to any software product that needs to be tested. The multiple test cases to be executed refer to all test cases designed for the target software. Different test cases are used to test different functional information of the target software. The use case description information of each test case is used to describe the detailed information of the test case. For example, the use case description information of each test case may include: test objectives, test environment, input data, test steps and expected results. Among them, the test objectives mainly describe the functional information of the test. The predicted results refer to the expected requirements that are met.
[0031] Specifically, the tester can design test cases based on the description information of the software's functions, uses, and performance parameters, and obtain multiple designed test cases. Before executing all test cases of the target software, the test case description information of each test case to be executed is obtained to perform coverage detection of the test requirements.
[0032] S120. Perform coverage detection of the test requirements one by one according to the test requirement contents corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determine the first test requirement content covered by multiple test cases, wherein the multiple test requirements are obtained by pre-dividing all the test requirements required for the software.
[0033] Among them, all the test requirements required by the software refer to all the test contents that all software need to test. By analyzing and integrating the existing test requirements of multiple software, all the test requirements required by the software are obtained. All the test requirements required by the software are classified to obtain multiple different categories of test requirements. The types of test requirements for different software are the same, but the test requirement contents of different software under the same test requirements are different. The test requirement contents corresponding to the multiple test requirements of the target software refer to the specific test requirement contents of the target software under each test requirement. The test requirement content is used to describe the specific content that needs to be tested under each test requirement. The first test requirement content refers to the test requirements that can be met by the test case.
[0034] Exemplarily, the test requirements may include: requirement specifications, product specifications, inheritance documents, historical experience libraries, general specification libraries, and user experience libraries. Among them, the requirement specifications are mainly used to guide the development team to develop the software system and ensure the realization of the final software system. The requirement specifications describe in detail the functional requirements, performance requirements, and user interface requirements of the software system, etc., to ensure that the development team has a clear understanding of each business detail. The product specifications are mainly used to guide the construction of the software product framework, focusing on business logic and software product planning. The product specifications mainly describe how to solve the user's pain points through specific solutions. Both the requirement specifications and product specifications are used to clarify the functional and performance requirements of the software product. The inheritance document is a document used to describe the inheritance relationship between the new version features of the software and the historical version features. The historical experience library is a database for storing the test experience accumulated by testers during historical testing. Test experience can include various problems and solutions encountered during the test process, as well as how to conduct test activities more effectively. The general specification library is the sum of a series of standards and specifications formulated to ensure the consistency and standardization of testing. The general specification library can include test theory, test type, test method, test standard and test process, so as to effectively ensure the quality of software products. The user experience library refers to a collection of various user experience related data and information, so that developers can better understand user needs.
[0035] Specifically, the test requirement content of the target software under each test requirement is obtained. For each test requirement content, the test requirement content can be matched with the use case description information of each test case to determine whether the test requirement content is covered by the test case, that is, whether there is a test case that meets the test requirement content. If so, the test requirement content is determined to be the first test requirement content that can be covered by the currently designed test case. By performing coverage detection on the test requirement content under each test requirement one by one, comprehensive coverage detection of the test case can be achieved.
[0036] S130. Determine the requirement coverage corresponding to the plurality of test cases according to the quantity of the first test requirement content.
[0037] Among them, requirement coverage refers to the degree to which all test cases currently designed meet all test requirements. Requirement coverage can be used to characterize the comprehensiveness of the test of the target software. The higher the requirement coverage, the more comprehensive the test of the target software.
[0038] Specifically, the number of first test requirement contents covered by all test cases is divided by the total number of test requirement contents, and the obtained division result is used as the requirement coverage rate corresponding to all test cases currently designed.
[0039] S140: If the requirement coverage is less than the preset coverage, supplementary processing of the test cases is performed according to the second test requirement content not covered by the multiple test cases.
[0040] The preset coverage rate can be a maximum required coverage rate that is set in advance based on business requirements and does not require additional test cases. For example, the preset coverage rate can be 100% to ensure the comprehensiveness of software testing. The lower the requirement coverage rate, the greater the impact on the quality of software testing. The second test requirement content refers to the test requirements that cannot be met by the test cases.
[0041] Specifically, when the requirement coverage is less than the preset coverage, it indicates that all the test cases currently involved cannot cover enough test requirements. At this time, the second test requirement content not covered by all the test cases is obtained. A corresponding target test case is generated for each uncovered second test requirement content, so that the target test case can cover each second test requirement content, and the target test case is used as a supplementary test case for the target software, so that all supplemented test cases can meet all test requirements, thereby improving the comprehensiveness of software testing, eliminating the need for multiple repeated tests, and improving the efficiency of software testing.
[0042] Exemplarily, after supplementing the test cases, the coverage of the test requirements can be checked again for all the supplemented test cases, and the requirement coverage corresponding to all the supplemented test cases can be determined. If the re-determined requirement coverage is equal to the preset coverage, it means that all the supplemented test cases can cover enough test requirements or all test requirements. At this time, all the supplemented test cases can be executed, otherwise the test case supplementation process will continue until the requirement coverage is equal to the preset coverage, thereby improving the comprehensiveness of software testing.
[0043] The technical solution of this embodiment, by obtaining multiple test cases to be executed by the target software and the use case description information of each test case, performs coverage detection of the test requirements one by one according to the test requirement content corresponding to the multiple test requirements of the target software and the use case description information of each test case, determines the first test requirement content covered by multiple test cases, and determines the requirement coverage rate corresponding to multiple test cases according to the number of first test requirement contents, thereby realizing comprehensive detection of requirement coverage of test cases. In the case where the requirement coverage rate is less than the preset coverage rate, the test cases are supplemented according to the second test requirement content not covered by multiple test cases, so that the supplemented test cases can cover all the test requirements of the target software, thereby improving the comprehensiveness of software testing, and further improving software testing efficiency.
[0044] On the basis of the above technical solution, each test requirement includes multiple test requirement items. Among them, a test requirement item refers to a test requirement that a test case needs to meet. Different test requirement items correspond to different test requirement item contents. The test requirement item content is used to describe the specific requirements of the test requirement item. The test requirement content corresponding to each test requirement includes: multiple test requirement item contents corresponding to multiple test requirement items. It should be noted that in order to test comprehensively, all test cases need to cover each test requirement item in each test requirement.
[0045] Exemplarily, the test requirements may include: a requirement specification, a product specification, an inheritance document, a historical experience library, a general specification library, and a user experience library.
[0046] Among them, the multiple test requirement items corresponding to the requirements specification may include: the title of each requirement chapter in the requirements specification, each business rule in each requirement chapter, the input and output items in each requirement chapter, the operation steps in each requirement chapter, and the process branches of the flowchart. The multiple test requirement items corresponding to the product specification may include: the product introduced in the product specification, the product functional requirements, the product role, and the product quality requirements. The multiple test requirement items corresponding to the inheritance document may include: all requirements related to the current improvement in the inheritance document. The multiple test requirement items corresponding to the historical experience library may include: common error types, common defects, and common failure logic. The multiple test requirement items corresponding to the general specification library may include: the user interface, user experience, and interaction specifications involved in the general specification library. The multiple test requirement items corresponding to the user experience library may include: user usage habits, user usage processes, user error interaction processing, and user behavior analysis.
[0047] Figure 2 A flowchart of another test case processing method provided by an embodiment of the present invention, based on the above embodiments, this embodiment describes in detail the detection process and supplementary processing process of the test case requirement coverage when the test requirement content corresponding to each test requirement includes multiple test requirement item contents. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0048] See also Figure 2 Another test case processing method provided in this embodiment specifically includes the following steps:
[0049] S210, obtaining multiple test cases to be executed by the target software and use case description information of each test case;
[0050] S220: For each test requirement item of each test requirement, match the test requirement item content with the use case description information of each test case to determine whether there is a test case that covers the test requirement item content.
[0051] Specifically, for each test requirement item of each test requirement, the use case description information of each test case can be matched with the content of the test requirement item in turn according to the arrangement order of the test cases to determine whether there is any use case description information that successfully matches the content of the test requirement item. Among them, information matching can refer to text matching of the entire information, information keyword matching or semantic matching, etc. If there is a use case description information that successfully matches the content of the test requirement item, it means that the test case corresponding to the successfully matched use case description information can cover the test requirement item, and only one test case is required to cover the test requirement item. At this time, the operation of detecting whether subsequent test cases cover the test requirement item can be stopped. If the use case description information of each test case fails to match the content of the test requirement item, it is determined that there is no test case that covers the content of the test requirement item. At this time, the content of the test requirement item is a test requirement that was not considered when the test case was designed.
[0052] Exemplarily, step S220 may include: inputting the content of the test requirement item and the use case description information of each test case into the target semantic matching model for information semantic matching, obtaining the information similarity between the content of the test requirement item and the use case description information of each test case; based on the information similarity, determining whether there is a test case that covers the content of the test requirement item.
[0053] The target semantic matching model may be a deep learning model for matching the semantic similarity between the test requirement item content and the use case description information. The target semantic matching model may be a text semantic matching model of any network architecture.
[0054] Specifically, for each test requirement item of each test requirement, the test requirement item content and the use case description information of each test case are input into the target semantic matching model, and the target semantic matching model performs semantic similarity analysis and calculation on the test requirement item content and the use case description information of each test case, and determines and outputs the information similarity between the test requirement item content and the use case description information of each test case. The higher the information similarity, the higher the probability that the test requirement item content and the use case description information of each test case describe the same content. It is detected whether the information similarity corresponding to each test case is greater than or equal to the preset similarity. If there is a test case with a similarity greater than the preset similarity, it indicates that the test case can cover the content of the test requirement item, and at this time, it is determined that there is a test case covering the content of the test requirement item. If the information similarity corresponding to each test case is less than the preset similarity, it indicates that each test case does not cover the content of the test requirement item, and at this time, it is determined that there is no test case covering the content of the test requirement item. By using the target semantic matching model to perform semantic matching of description information, the accuracy of demand coverage detection can be further improved.
[0055] S230: If there is a test case that covers the content of the test requirement item, determine that the content of the test requirement item is the first test requirement item content covered by multiple test cases.
[0056] Specifically, when there is a test case that can cover the content of the test requirement item, it is determined that the content of the test requirement item is the first test requirement item content covered by multiple test cases.
[0057] S240: If there is no test case that covers the content of the test requirement item, determine that the content of the test requirement item is a second test requirement item content that is not covered by multiple test cases.
[0058] Specifically, when each test case does not cover the content of the test requirement item, it is determined that the content of the test requirement item is a second test requirement item content that is not covered by multiple test cases.
[0059] Exemplarily, the coverage detection process for the requirements specification can be: detecting whether there are test cases covering the title of each requirements section, whether there are test cases covering each business rule in each requirements section, whether there are test cases covering the input and output items in each requirements section, whether there are test cases covering the operation steps in each requirements section, and whether there are test cases covering the process branches of the flowchart. It should be noted that as long as there is a test requirement item that is not covered, it can be determined that the requirements specification is not fully covered. The content of the test requirement items that have been covered in the requirements specification is determined as the first test requirement item content, and the content of the test requirement items that are not covered is determined as the second test requirement item content.
[0060] The coverage detection process for the product specification can be: detecting whether there are test cases that cover the product introduced in the product specification, whether there are test cases that cover the functional requirements of the product, whether there are test cases that cover the product roles, and whether there are test cases that cover the product quality requirements. It should be noted that as long as there is a test requirement item that is not covered, it can be determined that the product specification is not fully covered. The content of the test requirement items that have been covered in the product specification is determined as the first test requirement item content, and the content of the test requirement items that are not covered is determined as the second test requirement item content.
[0061] The coverage detection process for the inheritance document can be as follows: detect whether there is a test case that covers each requirement related to the current improvement in the inheritance document. As long as there is a test requirement item that is not covered, it can be determined that the inheritance document is not fully covered. The covered test requirement item content in the inheritance document is determined as the first test requirement item content, and the uncovered test requirement item content is determined as the second test requirement item content.
[0062] The coverage detection process for the historical experience library can be: detecting whether there are test cases covering common error types, whether there are test cases covering common defects, and whether there are test cases covering common failure logic. As long as there is a test requirement item that is not covered, it can be determined that the historical experience library is not fully covered. The content of the test requirement item that has been covered in the historical experience library is determined as the first test requirement item content, and the content of the test requirement item that is not covered is determined as the second test requirement item content.
[0063] The coverage detection process for the general specification library can be: detecting whether there are test cases covering the user interface involved in the general specification library, whether there are test cases covering the user experience, and whether there are test cases covering the interaction specifications. As long as there is a test requirement item that is not covered, it can be determined that the general specification library is not fully covered. The content of the test requirement items that have been covered in the general specification library is determined as the first test requirement item content, and the content of the test requirement items that are not covered is determined as the second test requirement item content.
[0064] The coverage detection process for the user experience library can be: detecting whether there are test cases that cover user usage habits, whether there are test cases that cover user usage processes, whether there are test cases that cover user error interaction processing, and whether there are test cases that cover user behavior analysis. As long as there is a test requirement item that is not covered, it can be determined that the user experience library is not fully covered. The content of the test requirement items that have been covered in the user experience library is determined as the first test requirement item content, and the content of the test requirement items that are not covered is determined as the second test requirement item content.
[0065] S250. Determine the requirement coverage corresponding to the multiple test cases according to the number of the first test requirement item contents and the total number of the test requirement item contents corresponding to all the test requirements.
[0066] Specifically, the number of first test requirement item contents covered by all test cases is divided by the total number of test requirement item contents corresponding to all test requirements, and the obtained division result is used as the requirement coverage rate corresponding to all test cases currently designed.
[0067] S260. If the requirement coverage is less than the preset coverage, a target test case corresponding to each second test requirement item content that is not covered by multiple test cases is generated, and the target test case is used as a supplementary test case to be executed by the target software.
[0068] Specifically, when the requirement coverage is less than the preset coverage, it indicates that all the test cases currently involved cannot cover enough test requirements. At this time, the second test requirement content not covered by all the test cases is obtained. For each second test requirement content that is not covered, a corresponding target test case can be automatically generated. For example, for each second test requirement content that is not covered, based on the test function corresponding to the second test requirement content, the candidate test case for testing the function is queried from the test database, and the inconsistent test case content in the candidate test case is replaced and modified based on the second test requirement content, to obtain the target test case that can cover the second test requirement content, thereby improving the test case generation efficiency. The target test case is used as a supplementary test case for the target software, so that all supplemented test cases can meet all test requirements, thereby improving the comprehensiveness of software testing, eliminating the need for multiple repeated tests, and improving the efficiency of software testing.
[0069] The technical solution of this embodiment matches the content of the test requirement item with the use case description information of each test case to determine whether there is a test case covering the content of the test requirement item, and determines the requirement coverage corresponding to multiple test cases based on the number of covered first test requirement item contents and the total number of test requirement item contents corresponding to all test requirements, generates a target test case corresponding to each second test requirement item content based on each uncovered second test requirement item content, and uses the target test case as a supplementary test case to be executed by the target software, thereby utilizing the multiple test requirement item contents corresponding to each test requirement to perform more detailed requirement coverage detection, further improving the accuracy of requirement coverage detection, and also further improving the comprehensiveness of software testing.
[0070] The following is an embodiment of a test case processing device provided in an embodiment of the present invention. The device and the test case processing methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the test case processing device, please refer to the embodiment of the above-mentioned test case processing method.
[0071] Figure 3 The present invention provides a schematic diagram of the structure of a test case processing device, which can be applied to the detection and supplementary processing of the test case requirements. Figure 3 As shown, the device specifically includes: a test case acquisition module 310, a test requirement coverage detection module 320, a requirement coverage determination module 330 and a test case supplementation module 340.
[0072] Among them, the test case acquisition module 310 is used to obtain multiple test cases to be executed by the target software and the use case description information of each test case; the test requirement coverage detection module 320 is used to perform coverage detection of the test requirements one by one according to the test requirement content corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determine the first test requirement content covered by the multiple test cases, wherein the multiple test requirements are obtained by pre-dividing all the test requirements required for the software; the requirement coverage determination module 330 is used to determine the requirement coverage corresponding to the multiple test cases according to the number of the first test requirement content; the test case supplement module 340 is used to supplement the test cases according to the second test requirement content not covered by the multiple test cases if the requirement coverage is less than the preset coverage.
[0073] The technical solution of this embodiment, by obtaining multiple test cases to be executed by the target software and the use case description information of each test case, performs coverage detection of the test requirements one by one according to the test requirement content corresponding to the multiple test requirements of the target software and the use case description information of each test case, determines the first test requirement content covered by multiple test cases, and determines the requirement coverage rate corresponding to multiple test cases according to the number of first test requirement contents, thereby realizing comprehensive detection of requirement coverage of test cases. In the case where the requirement coverage rate is less than the preset coverage rate, the test cases are supplemented according to the second test requirement content not covered by multiple test cases, so that the supplemented test cases can cover all the test requirements of the target software, thereby improving the comprehensiveness of software testing, and further improving software testing efficiency.
[0074] Optionally, each test requirement includes multiple test requirement items, wherein different test requirement items correspond to different test requirement item contents; and the test requirement content corresponding to each test requirement includes: multiple test requirement item contents corresponding to the multiple test requirement items.
[0075] Optionally, the test requirements include: requirement specifications, product specifications, inheritance documents, historical experience library, general specification library and user experience library; wherein,
[0076] The multiple test requirement items corresponding to the requirement specification include: the title of each requirement chapter in the requirement specification, each business rule in each requirement chapter, the input and output items in each requirement chapter, the operation steps in each requirement chapter, and the process branches of the flowchart;
[0077] The multiple test requirement items corresponding to the product specification include: the product introduced in the product specification, product functional requirements, product roles, and product quality requirements;
[0078] The multiple test requirement items corresponding to the inheritance document include: all requirements in the inheritance document related to the current improvement;
[0079] The multiple test requirement items corresponding to the historical experience library include: common error types, common defects, and common failure logic;
[0080] The multiple test requirement items corresponding to the general specification library include: user interface, user experience, and interaction specifications involved in the general specification library;
[0081] The multiple test requirement items corresponding to the user experience library include: user usage habits, user usage processes, user error interaction processing, and user behavior analysis.
[0082] Optionally, the test requirement coverage detection module 320 includes:
[0083] An information matching unit, for each test requirement item of each test requirement, matches the test requirement item content with the use case description information of each test case to determine whether there is a test case covering the test requirement item content;
[0084] A first test requirement item content determining unit, configured to determine that the test requirement item content is the first test requirement item content covered by the multiple test cases if there is a test case covering the test requirement item content;
[0085] The second test requirement item content determining unit is configured to determine that the test requirement item content is the second test requirement item content not covered by the multiple test cases if there is no test case covering the test requirement item content.
[0086] Optionally, the information matching unit is specifically used to: input the content of the test requirement item and the use case description information of each test case into the target semantic matching model for information semantic matching, and obtain the information similarity between the content of the test requirement item and the use case description information of each test case; based on the information similarity, determine whether there is a test case that covers the content of the test requirement item.
[0087] Optionally, the demand coverage determination module 330 is specifically configured to:
[0088] Determine the requirement coverage corresponding to the multiple test cases according to the number of the first test requirement item contents and the total number of the test requirement item contents corresponding to all test requirements.
[0089] Optionally, the test case supplement module 340 is specifically used to:
[0090] According to each second test requirement item content not covered by the multiple test cases, a target test case corresponding to each second test requirement item content is generated, and the target test case is used as a supplementary test case to be executed by the target software.
[0091] The test case processing device provided in the embodiment of the present invention can execute the test case processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the test case processing method.
[0092] It is worth noting that in the embodiment of the above-mentioned test case processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0093] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 4 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0094] like Figure 4 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0095] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0096] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0097] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory 30 (RAM) and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0098] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0099] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0100] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a test case processing method provided by any embodiment of the present invention, the method comprising:
[0101] Obtain multiple test cases to be executed by the target software and use case description information of each test case;
[0102] Performing coverage detection of the test requirements one by one according to the test requirement contents corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determining the first test requirement content covered by the multiple test cases, wherein the multiple test requirements are obtained by pre-dividing all the test requirements required for the software;
[0103] Determining the requirement coverage corresponding to the plurality of test cases according to the quantity of the first test requirement contents;
[0104] If the requirement coverage is less than a preset coverage, supplementary processing of the test cases is performed according to the second test requirement content not covered by the multiple test cases.
[0105] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the test case processing method provided by any embodiment of the present invention.
[0106] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the test case processing method provided in any embodiment of the present invention are implemented. The method includes:
[0107] Obtain multiple test cases to be executed by the target software and use case description information of each test case;
[0108] Performing coverage detection of the test requirements one by one according to the test requirement contents corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determining the first test requirement content covered by the multiple test cases, wherein the multiple test requirements are obtained by pre-dividing all the test requirements required for the software;
[0109] Determining the requirement coverage corresponding to the plurality of test cases according to the quantity of the first test requirement contents;
[0110] If the requirement coverage is less than a preset coverage, supplementary processing of the test cases is performed according to the second test requirement content not covered by the multiple test cases.
[0111] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0112] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0113] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0114] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0116] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A test case processing method, characterized in that: include: Obtain multiple test cases to be executed by the target software and use case description information of each test case; Performing coverage detection of the test requirements one by one according to the test requirement contents corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determining the first test requirement content covered by the multiple test cases, wherein the multiple test requirements are obtained by pre-dividing all the test requirements required for the software; Determining the requirement coverage corresponding to the plurality of test cases according to the quantity of the first test requirement contents; If the requirement coverage is less than a preset coverage, supplementary processing of the test cases is performed according to the second test requirement content not covered by the multiple test cases.
2. The method according to claim 1, characterized in that: Each test requirement includes multiple test requirement items, where different test requirement items correspond to different test requirement item contents; The test requirement content corresponding to each test requirement includes: multiple test requirement item contents corresponding to the multiple test requirement items.
3. The method according to claim 2, characterized in that The test requirements include: requirement specifications, product specifications, inheritance documents, historical experience library, general specification library and user experience library; The multiple test requirement items corresponding to the requirement specification include: the title of each requirement chapter in the requirement specification, each business rule in each requirement chapter, the input and output items in each requirement chapter, the operation steps in each requirement chapter, and the process branches of the flowchart; The multiple test requirement items corresponding to the product specification include: the product introduced in the product specification, product functional requirements, product roles, and product quality requirements; The multiple test requirement items corresponding to the inheritance document include: all requirements in the inheritance document related to the current improvement; The multiple test requirement items corresponding to the historical experience library include: common error types, common defects, and common failure logic; The multiple test requirement items corresponding to the general specification library include: user interface, user experience, and interaction specifications involved in the general specification library; The multiple test requirement items corresponding to the user experience library include: user usage habits, user usage processes, user error interaction processing, and user behavior analysis.
4. The method according to claim 2, characterized in that: The step of performing coverage detection of the test requirements one by one according to the test requirement contents corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determining the first test requirement contents covered by the multiple test cases, comprises: For each test requirement item of each test requirement, the test requirement item content is matched with the use case description information of each test case to determine whether there is a test case covering the test requirement item content; If there is a test case covering the content of the test requirement item, determining that the content of the test requirement item is the first test requirement item content covered by the multiple test cases; If there is no test case covering the content of the test requirement item, it is determined that the content of the test requirement item is a second test requirement item content that is not covered by the multiple test cases.
5. The method according to claim 4, characterized in that The matching of the test requirement item content with the use case description information of each test case to determine whether there is a test case covering the test requirement item content includes: Input the test requirement item content and the use case description information of each test case into the target semantic matching model for information semantic matching, and obtain the information similarity between the test requirement item content and the use case description information of each test case; Based on the information similarity, determine whether there is a test case that covers the content of the test requirement item.
6. The method according to claim 4, characterized in that The determining, according to the quantity of the first test requirement contents, the requirement coverage corresponding to the plurality of test cases comprises: Determine the requirement coverage corresponding to the multiple test cases according to the number of the first test requirement item contents and the total number of the test requirement item contents corresponding to all test requirements.
7. The method according to claim 4, characterized in that The supplementary processing of the test cases according to the second test requirement content not covered by the multiple test cases includes: According to each second test requirement item content not covered by the multiple test cases, a target test case corresponding to each second test requirement item content is generated, and the target test case is used as a supplementary test case to be executed by the target software.
8. A test case processing device, characterized in that: include: A test case acquisition module is used to acquire multiple test cases to be executed by the target software and the use case description information of each test case; A test requirement coverage detection module is used to perform coverage detection of the test requirements one by one according to the test requirement contents corresponding to the multiple test requirements of the target software and the use case description information of each test case, and determine the first test requirement content covered by the multiple test cases, wherein the multiple test requirements are obtained by pre-dividing all the test requirements required for the software; A requirement coverage determination module, used to determine the requirement coverage corresponding to the plurality of test cases according to the quantity of the first test requirement content; The test case supplement module is used to supplement the test cases according to the second test requirement content not covered by the multiple test cases if the requirement coverage is less than the preset coverage.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the test case processing method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the test case processing method as described in any one of claims 1 to 7 is implemented.