Test case search method, device, equipment and storage medium
By obtaining test cases from the automated and manual test case collections, and combining the similarity calculation of functional labels and requirement documents, the problem of insufficient coverage of automated use cases is solved, and the coverage and accuracy of regression testing are improved.
Patent Information
- Application Number
- CN202011098053.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-14
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-10-14
AI Technical Summary
It is impossible for the coverage of automated use cases in the existing technology to reach full coverage, leading to the problem of incomplete regression during regression testing.
By obtaining the corresponding test cases from the automated test case collection and the manual test case collection, and adding them to the regression test case collection, we use functional labels, functions and requirement documents to perform similarity calculations to determine the tests that meet the preset similarity threshold. Use cases to improve the coverage of regression test cases.
It improves the coverage and accuracy of regression test cases, solves the problem of incomplete regression tests, and ensures the accuracy of subsequent regression tests.
Smart Images

Figure CN112100359B
Abstract
Description
Technical Field
[0001] The present application relates to the field of business regression technology, and in particular to a test case search method, device, equipment and storage medium. Background Art
[0002] In traditional technology, business function regression is generally performed by testers who modify a certain function point, evaluate a certain regression surface, and determine what content to regress. All regression information is determined by human experience and is not objective and accurate enough, so testers will create a large number of automated use cases for regression testing.
[0003] In the prior art, batch regression is performed by establishing automated test cases, and precise test regression cases are introduced to map functions and test cases. Each time a specific function is modified, the relevant test cases can be precisely regressed.
[0004] However, with this regression method, since not all test cases are suitable for automation construction, the coverage of the established automated test cases cannot reach full coverage, and there may be missing test cases, which may lead to incomplete regression during precise regression. Summary of the invention
[0005] In view of this, the purpose of this application is to provide a test case search method, device, equipment and storage medium, which can solve the problem that the coverage of automated use cases in the prior art cannot reach full coverage, there are missing use cases, and the problem that precise regression may not be complete, so as to achieve the effect of improving the use case coverage.
[0006] In a first aspect of the present application, the present application provides a test case search method, the method comprising:
[0007] According to the test requirements, obtain the first test case from the automated test case set;
[0008] According to the functional requirements of the test request, a second test case is obtained from the set of manual test cases;
[0009] The first test case and the second test case are added to a regression test case set to perform regression testing on the test requirement.
[0010] Optionally, the test request includes: a function label;
[0011] The obtaining of a first test case from a set of automated test cases according to the test requirement includes:
[0012] According to the function tag, obtaining a test case corresponding to the function tag from the automated test case set, wherein the automated test case set includes: a test case corresponding to at least one function tag;
[0013] The first test case includes: a test case corresponding to the function tag.
[0014] Optionally, obtaining a first test case from a set of automated test cases according to a test requirement includes:
[0015] Obtain the functions involved in the test request;
[0016] Obtaining a test case corresponding to the function from the automated test case set;
[0017] The first test case also includes: a test case corresponding to the function.
[0018] Optionally, the function involved in obtaining the test request includes:
[0019] Obtain the code submission record associated with the test requirement;
[0020] Parsing the comparison code in the code submission record to obtain the function involved in the comparison code;
[0021] The function involved in the test requirement is: the function involved in the comparison code.
[0022] Optionally, the test request further includes: a requirement document;
[0023] The obtaining a second test case from a set of manual test cases according to the functional requirements of the test requirement includes:
[0024] Obtaining a historical requirement document corresponding to the requirement document;
[0025] According to the historical requirement document, obtaining the test case associated with the historical requirement document from the manual test case set, wherein the manual test case set further includes: at least one test case associated with the historical requirement document;
[0026] The second test case includes: a test case associated with the historical requirement document.
[0027] Optionally, the obtaining a historical requirement document corresponding to the requirement document includes:
[0028] Performing text segmentation on the demand document and at least one historical demand document in the historical demand management system respectively;
[0029] Calculate the similarity between the demand document and each historical demand document based on the word vector after the demand document is segmented and the word vector after the text of each historical demand document is segmented;
[0030] According to the similarity between the requirement document and each of the historical requirement documents, determining, from the at least one historical requirement document, a historical requirement document whose similarity meets a first preset similarity threshold as a historical requirement document corresponding to the requirement document;
[0031] According to the historical requirement document corresponding to the requirement document, it is determined that the test case associated with the historical requirement document is the third test case.
[0032] Optionally, the functional requirement includes: a functional point involved in the functional label;
[0033] The obtaining a second test case from a set of manual test cases according to the functional requirements of the test requirement includes:
[0034] Performing a text description on the function points involved in the function label to obtain a fourth test case;
[0035] Performing text segmentation on the fourth test case and the third test case respectively to obtain a segmented text of the fourth test case and a segmented text of the third test case;
[0036] According to the similarity between the segmented text of the fourth test case and the segmented text of the third test case, determining a test case whose similarity meets a second preset similarity threshold from the set of artificial test cases;
[0037] The second test case also includes: a test case whose similarity meets the second preset similarity threshold.
[0038] In a second aspect of the present application, the present application further provides a test case search device, the device comprising: an acquisition module and an adding module, wherein:
[0039] The acquisition module is used to acquire a first test case from an automated test case set according to a test requirement; and acquire a second test case from an artificial test case set according to a functional requirement of the test requirement;
[0040] The adding module is used to add the first test case and the second test case to the regression test case set to perform regression testing on the test requirement.
[0041] Optionally, the test requirement includes: a function label; the acquisition module is specifically used to obtain the test case corresponding to the function label from the automated test case set based on the function label, wherein the automated test case set includes: a test case corresponding to at least one function label; the first test case includes: a test case corresponding to the function label.
[0042] Optionally, the acquisition module is specifically used to acquire the function involved in the test requirement; acquire the test case corresponding to the function from the set of automated test cases; and the first test case also includes: the test case corresponding to the function.
[0043] Optionally, the acquisition module is specifically used to obtain the code submission record associated with the test requirement; parse the comparison code in the code submission record to obtain the function involved in the comparison code; the function involved in the test requirement is: the function involved in the comparison code.
[0044] Optionally, the test requirement also includes: a requirement document; the acquisition module is specifically used to obtain a historical requirement document corresponding to the requirement document; based on the historical requirement document, obtaining the test case associated with the historical requirement document from the manual test case set, wherein the manual test case set also includes: at least one test case associated with a historical requirement document; the second test case includes: a test case associated with the historical requirement document.
[0045] Optionally, the device further comprises: a word segmentation module, a calculation module and a determination module, wherein:
[0046] The word segmentation module is used to perform text word segmentation on the demand document and at least one historical demand document in the historical demand management system respectively;
[0047] The calculation module is used to calculate the similarity between the demand document and each of the historical demand documents based on the word vector after the demand document is segmented and the word vector after the text of each historical demand document is segmented;
[0048] The determination module is used to determine, based on the similarity between the requirement document and each of the historical requirement documents, from the at least one historical requirement document, a historical requirement document whose similarity meets a first preset similarity threshold as the historical requirement document corresponding to the requirement document; and based on the historical requirement document corresponding to the requirement document, determine that the test case associated with the historical requirement document is a third test case.
[0049] Optionally, the functional requirement includes: the functional point involved in the functional label; the device further includes: a description module, used for performing a text description on the functional point involved in the functional label to obtain a fourth test case;
[0050] The word segmentation module is specifically used to perform text segmentation on the fourth test case and the third test case respectively to obtain the segmented text of the fourth test case and the segmented text of the third test case;
[0051] The determination module is specifically configured to determine, from the artificial test case set, a test case whose similarity meets a second preset similarity threshold according to the similarity between the segmented text of the fourth test case and the segmented text of the third test case.
[0052] In the third aspect of the present application, a test case search device is provided, which includes a processor, a storage medium and a bus. The storage medium stores machine-readable instructions executable by the processor. When the test case search device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any method described in the first aspect.
[0053] In a fourth aspect of the present application, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any method described in the first aspect are executed.
[0054] Based on any of the above aspects, the first test case can be obtained from the automated test case set and the second test case can be obtained from the manual test case set according to the testing requirements, and the first test case and the second test case can be added to the regression test case set. This method of jointly determining the regression test case set based on the automated test case set and the manual test case set improves the coverage of the regression test cases, thereby solving the problem of incomplete regression caused by missing test cases in the prior art, thereby achieving the effect of improving the coverage of the regression test cases and further improving the accuracy of subsequent regression testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 A schematic diagram of the structure of a test case search system provided in one embodiment of the present application;
[0057] Figure 2 A flowchart of a test case search method provided in one embodiment of the present application;
[0058] Figure 3 A flowchart of a test case search method provided by another embodiment of the present application;
[0059] Figure 4 A flowchart of a test case search method provided by another embodiment of the present application;
[0060] Figure 5 A flowchart of a test case search method provided by another embodiment of the present application;
[0061] Figure 6 A schematic diagram of the structure of a test case search device provided in one embodiment of the present application;
[0062] Figure 7 A schematic diagram of the structure of a test case search device provided in another embodiment of the present application;
[0063] Figure 8 A schematic diagram of the structure of a test case search device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0064] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0065] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0066] In order to enable those skilled in the art to use the contents of this application, the following implementation methods are provided in conjunction with regression testing of business functions in specific application scenarios. For those skilled in the art, the general principles defined herein may be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around regression testing of business functions, it should be understood that this is only an exemplary embodiment, and this application may be applied to various scenarios where regression testing is required.
[0067] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0068] One aspect of the present application relates to a test case search system. The system can obtain a first test case from an automated test case set and a second test case from a manual test case set according to a test requirement input by a user, and add the first test case and the second test case to a regression test case set, and perform regression testing of business functions on the test requirement according to each test case in the final regression test case set.
[0069] It is worth noting that before the present application was filed, the prior art usually only obtained test cases from the automated test case set for subsequent regression testing, but this method is only applicable to test requirements that are suitable for automated construction. For some test requirements that are not suitable for automated construction, the corresponding test cases cannot be obtained. Therefore, the coverage of the established automated test cases cannot achieve full coverage, and there are cases where test cases are missing. Therefore, in some scenarios where test requirements are not suitable for automated construction, this method of determining test cases based only on the automated test case set will result in missing regression test cases, which further leads to insufficient accuracy of regression testing.
[0070] The test case search method provided in the present application can obtain regression test cases from a combination of two dimensions according to the test requirements, wherein the two dimensions include: the first dimension can be, for example, an automated test case dimension, that is, obtaining a first test case from an automated test case set, and the second dimension can be, for example, a requirement management dimension, that is, obtaining a second test case from a manual test case set, and adding both the first test case and the second test case to the regression test case set. This method of jointly determining the regression test case set based on the automated test case set of the first dimension and the manual test case set of the second dimension improves the coverage of the regression test cases because the regression test case set includes the first test case and the second test case in the test case sets of the two dimensions. Therefore, the test case search method provided in the present application can solve the problem of incomplete regression testing due to missing test cases in the prior art, thereby achieving the effect of improving the coverage of regression test cases and further improving the accuracy of subsequent regression testing.
[0071] Figure 1 1 is a schematic diagram of the architecture of a test case search system 100 provided in an embodiment of the present application. For example, the test case search system 100 may be used for business regression services, or any platform or scenario involving task regression or function regression. Figure 1 As shown, the test case search system 100 may include one or more of a server 110 , a network 120 , and a database 130 .
[0072] In some embodiments, the server 110 may include a processor. The processor may process information and / or data related to the service request to perform one or more functions described in the present application. For example, the processor may obtain the test requirements and obtain the regression test case by executing the method provided in the present application. In some embodiments, the processor may include one or more processing cores (e.g., a single-core processor (S) or a multi-core processor (M)). By way of example only, the processor may include a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC), or a microprocessor, or any combination thereof.
[0073] In some embodiments, the database 130 may be connected to the network 120 to communicate with one or more components (e.g., the server 110, a service terminal, a service provider, etc.) in the test case search system 100. One or more components in the test case search system 100 may access data or instructions stored in the database 130 via the network 120. In some embodiments, the database 130 may be directly connected to one or more components in the test case search system 100, or the database 130 may also be part of the server 110.
[0074] The following is combined with the above Figure 1 The contents described in the test case search system 100 shown in the figure provide a detailed description of the test case search method provided in the embodiment of the present application. The following test case search method is applied to the above system. The execution subject may be a server. The preset scenarios may be designed and adjusted according to user needs. Any scenario involving business regression testing or business function regression testing may be used, and is not limited to the two scenarios given in the embodiment.
[0075] Reference Figure 2 As shown, it is a flow chart of a test case search method provided by an embodiment of the present application, such as Figure 2 As shown, the method includes:
[0076] S201: According to the test requirement, obtain a first test case from the automated test case set.
[0077] Among them, the test requirements can be test requirements input by users such as testers. The test requirements may include, for example: the code corresponding to a specific function in the application to be modified that currently needs to be modified, etc. Since there are many business functions in the application, some functions are independent, some functions are coupled, and the code corresponding to the function is public, one modification may have a relatively large impact on the application. Therefore, it is necessary to determine the corresponding regression test case set for the test requirements, and perform regression testing of the business functions on the test requirements based on the regression test case set. Regression testing refers to retesting after modifying the old code to confirm that the modification has not introduced new errors or caused errors in other codes. Therefore, automated regression testing will greatly reduce the cost of system testing, maintenance and upgrades.
[0078] The automated test case set includes: a plurality of automated test cases pre-established through automated construction. The automated test case set also includes: a mapping relationship between test cases and automated labels, that is, in the automated test case set, each automated test case has a corresponding automated label. The automated label may include, for example: a label included in the test requirement, and / or a label of a function involved in the test requirement.
[0079] That is, the first test case obtained from the automated test case set by executing S201 is the automated test case.
[0080] S202: Obtain a second test case from a set of manual test cases according to the functional requirements of the test request.
[0081] In the method, the functional requirements of the test request may be obtained first, and then the second test case may be obtained from the set of artificial test cases based on the functional requirements. The set of artificial test cases may be, for example, a set of test cases managed by a preset file management system, and the test cases included therein are all pre-stored artificial test cases used in the process of manual regression testing. Therefore, the test cases in the artificial test case may also become historical test cases. Each test case in the set of artificial test cases may be associated with a corresponding functional requirement, and the functional requirement associated with the test case in the set of artificial test cases may be a functional text description, or may be a functional requirement indicated by other means.
[0082] S203: Add the first test case and the second test case to the regression test case set.
[0083] The regression test case set is used to perform regression testing on the test requirements. Thus, after obtaining the regression test case set, the regression test of the business function of the test requirements can be implemented by running the test cases in the regression test case set.
[0084] By adopting the test case search method provided in the embodiment of the present application, the first test case can be obtained from the automated test case set and the second test case can be obtained from the manual test case set according to the test requirements, and the first test case and the second test case can be added to the regression test case set. This method of jointly determining the regression test case set based on the automated test case set and the manual test case set not only makes the determination of the test regression case more efficient, but also improves the coverage of the regression test case, thereby solving the problem of incomplete regression caused by missing test cases in the prior art, thereby achieving the effect of improving the coverage of the regression test case and further improving the accuracy of subsequent regression testing.
[0085] For example, in one embodiment of the present application, the test requirements may include: function labels; the automated test case set may include: a pre-established mapping relationship between automated test cases and function labels; at this time, the method for obtaining the first test case from the automated test case set may be: according to the function label, obtaining the test case corresponding to the function label from the automated test case set, wherein the automated test case set includes: at least one test case corresponding to the function label; wherein the first test case includes: a test case corresponding to the function label.
[0086] For example, in another embodiment of the present application, the automated test case set may include: a mapping relationship between pre-established automated test cases and a list of function coverage by the test cases; the method of obtaining the first test case from the automated test case set may be: obtaining the function involved in the test requirement; obtaining the test case corresponding to the function from the automated test case set; at this time, the first test case also includes: a test case corresponding to the function.
[0087] Among them, the method for obtaining the functions involved in the testing requirements can be, for example: obtaining the code submission git record associated with the testing requirements; parsing the comparison code diff in the code submission record to obtain the functions involved in the comparison code; the functions involved in the testing requirements are: the functions involved in the comparison code.
[0088] Optionally, in the present application, the test case corresponding to the function tag can be obtained from the automated test case set as the first test case only according to the function tag; or the test case corresponding to the function can be obtained from the automated test case set as the first test case only according to the function involved in the test requirement; or the corresponding test case can be obtained from the automated test case set as the first test case based on both the function tag and the function involved in the test requirement, thereby further improving the coverage of the test cases. How to obtain the first test case from the automated test case set can be flexibly adjusted according to user needs and is not limited to the methods given in the above embodiments.
[0089] Optionally, based on the above embodiment, if the test requirement also includes: a requirement document, the embodiment of the present application can also provide a test case search method. The following is an example of the implementation process of obtaining the second test case from the manual test case set in the above method in combination with the accompanying drawings. Figure 3 A flow chart of a test case search method provided by another embodiment of the present application, wherein the test requirement also includes: a requirement document; the functional requirement includes: a requirement document; Figure 3 As shown, S202 may include:
[0090] S204: Acquire a historical requirement document corresponding to the requirement document.
[0091] Among them, the demand document or historical demand document includes more text, for example, it may include product design drawings, functional points, database design, table design, interface definition method, etc. The content included in the specific document can be flexibly adjusted according to user needs and is not limited to the above embodiments.
[0092] Optionally, in one embodiment of the present application, the method for obtaining the historical requirement document corresponding to the requirement document may be: according to the requirement document, determine from at least one historical requirement document in the historical requirement management system a historical requirement document whose document similarity satisfies a first preset similarity threshold as the historical requirement document corresponding to the requirement document. The historical requirement document that satisfies the first preset similarity threshold may, for example, be a historical requirement document whose similarity to the requirement document is greater than or equal to the first preset similarity threshold. In this case, the historical requirement document determined is a historical requirement document with a high similarity to the requirement document.
[0093] For example, text segmentation can be performed on the requirement document and at least one historical requirement document in the historical requirement management system respectively; based on the word vector after text segmentation of the requirement document and the word vector after text segmentation of each historical requirement document, the similarity between the requirement document and each historical requirement document is calculated; based on the similarity between the requirement document and each historical requirement document, from at least one historical requirement document, a historical requirement document whose similarity meets a first preset similarity threshold is determined as the historical requirement document corresponding to the requirement document; and a third test case is determined based on the historical requirement document corresponding to the requirement document.
[0094] For example, in one embodiment of the present application, a preset word segmentation tool can be used to segment demand documents and historical demand documents, and a word vector generation model obtained by pre-training word2vec of a basic toolkit of natural language processing (NLP) is used to generate word vectors corresponding to each text segmentation after word segmentation, and then the similarity between each document can be calculated based on a model for determining similarity, such as an LDA model. The toolkit or model used for specific word segmentation, word vector generation, and similarity calculation can be flexibly adjusted according to user needs and is not limited to the above embodiments.
[0095] The preset word segmentation tool may be, for example, a word segmentation tool for any language, such as a Chinese word segmentation tool or a Jieba word segmentation tool. The basic toolkit for NLP may include, for example, a gensim toolkit, or other toolkits. The word vector after text segmentation may be, for example, a word embedding vector or a distributed vector, or other forms of word vectors.
[0096] S205: According to the historical requirement document, a test case associated with the historical requirement document is obtained from a set of manual test cases.
[0097] The manual test case set further includes: a test case associated with at least one historical requirement document, for example, a test case set in which each historical requirement document is associated with a text description managed by a file management system.
[0098] Optionally, based on the above embodiment, the embodiment of the present application may also provide a test case search method, and the implementation process of obtaining the second test case from the manual test case set in the above method is exemplified below in conjunction with the accompanying drawings. Figure 4 A flow chart of a test case search method provided by another embodiment of the present application, wherein the functional requirements include: functional points involved in functional tags; Figure 4 As shown, S202 may include:
[0099] S206: Perform text description on the function points involved in the function label to obtain a fourth test case.
[0100] For example, in one embodiment of the present application, after a textual description of the function points involved in the function label, the code associated with the function requirement needs to be saved to facilitate the determination of the first test case based on the automated test case set in the future. If it is code related to the function requirement, the git record associated with the test requirement can be obtained. The comparison code diff in the code submission record is parsed to obtain the functions involved in the comparison code, thereby further expanding the coverage of regression test cases.
[0101] S207: Perform text segmentation on the fourth test case and the third test case respectively to obtain the segmented text of the fourth test case and the segmented text of the third test case.
[0102] Optionally, in an embodiment of the present application, the word segmentation method is still described by using a preset word segmentation tool, such as a Chinese word segmentation tool or an ieba word segmentation tool.
[0103] S208: According to the similarity between the segmented text of the fourth test case and the segmented text of the third test case, determine a test case whose similarity meets a second preset similarity threshold from the artificial test case set.
[0104] For example, in one embodiment of the present application, the similarity between the third test case and the fourth test case is still determined based on the word vectors corresponding to the word segmentations of each text after word segmentation. The method for determining the word vectors can still use the word vector generation model obtained by pre-training the word2vec of the basic toolkit of NLP to generate the word vectors corresponding to the word segmentations of each text after word segmentation, and then the similarity between each document can be calculated based on the model for determining the similarity, for example, the LDA model can be used.
[0105] The second test case also includes: a test case whose similarity satisfies a second preset similarity threshold. The fourth test case that satisfies the second preset similarity threshold may be, for example, a fourth test case whose similarity to the third test case is greater than or equal to the second preset similarity threshold. In this case, the fourth test case determined is a fourth test case with a higher similarity to the third test case.
[0106] Figure 5 A flow chart of a test case search method provided in an embodiment of the present application is shown in FIG. Figure 5As shown, taking the example of obtaining the corresponding test case from the automated test case set as the first test case based on the function label and the function involved in the test requirement at the same time as the test case, it can be seen that after obtaining the test requirement, the first test case set can be determined in the combination of automated test cases based on the function label and the associated code; in addition, after text segmentation of the test requirement, the third test case corresponding to the historical requirement document whose similarity meets the first preset similarity threshold can be determined in the manual test case set, and then the second test case set can be determined in the third test case according to the fourth test case corresponding to the functional description of the test requirement, and finally the final regression test case can be determined based on the second test case set and the first test case set.
[0107] By adopting the test case search method provided in the present application, a method of combining automated test cases and manual test cases is proposed to automatically evaluate the regression test cases corresponding to the test requirements. Since the test cases are associated with the requirement documents in the manual test cases, the corresponding third test cases can be determined according to the requirement documents, and then similarity matching is performed based on the third test cases and the fourth test cases corresponding to the test requirement documents, and the test cases whose final similarity meets the second similarity threshold are selected as the second test cases. By combining the above-mentioned first test cases and the second test cases, the final regression test case set is more comprehensive than the test case combination determined by a single method, so that subsequent regression tests can also be more comprehensive.
[0108] Based on the same inventive concept, a test case search device corresponding to the test case search method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned test case search method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repetition of the beneficial effects will not be repeated.
[0109] Figure 6 A schematic diagram of a test case search device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device includes: an acquisition module 301 and an adding module 302, wherein:
[0110] The acquisition module 301 is used to acquire a first test case from an automated test case set according to a test requirement; and acquire a second test case from a manual test case set according to a functional requirement of the test requirement.
[0111] The adding module 302 is used to add the first test case and the second test case to the regression test case set to perform regression testing on the test requirement.
[0112] Optionally, the test requirements include: a function label; an acquisition module 301, which is specifically used to obtain a test case corresponding to the function label from a set of automated test cases based on the function label, wherein the set of automated test cases includes: a test case corresponding to at least one function label; the first test case includes: a test case corresponding to the function label.
[0113] Optionally, the acquisition module 301 is specifically used to acquire the function involved in the test requirement; acquire the test case corresponding to the function from the set of automated test cases; the first test case also includes: the test case corresponding to the function.
[0114] Optionally, the acquisition module 301 is specifically used to obtain the code submission record associated with the test requirement; parse the comparison code in the code submission record to obtain the function involved in the comparison code; the function involved in the test requirement is: the function involved in the comparison code.
[0115] Optionally, the test requirement also includes: a requirement document; an acquisition module 301, which is specifically used to obtain a historical requirement document corresponding to the requirement document; based on the historical requirement document, obtaining a test case associated with the historical requirement document from a set of manual test cases, wherein the set of manual test cases also includes: at least one test case associated with a historical requirement document; the second test case includes: a test case associated with the historical requirement document.
[0116] Figure 7 A schematic diagram of a test case search device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device further includes: a word segmentation module 303, a calculation module 304 and a determination module 305, wherein:
[0117] The word segmentation module 303 is used to perform text word segmentation on the demand document and at least one historical demand document in the historical demand management system.
[0118] The calculation module 304 is used to calculate the similarity between the demand document and each historical demand document based on the word vector after the demand document is segmented and the word vector after the text of each historical demand document is segmented.
[0119] Determination module 305 is used to determine, based on the similarity between the requirement document and each historical requirement document, from at least one historical requirement document, a historical requirement document whose similarity meets a first preset similarity threshold as the historical requirement document corresponding to the requirement document; and based on the historical requirement document corresponding to the requirement document, determine that the test case associated with the historical requirement document is a third test case.
[0120] Optionally, the functional requirements include: functional points involved in the functional labels; Figure 6As shown, the device further includes: a description module 306, which is used to perform a text description on the function points involved in the function label to obtain a fourth test case.
[0121] The word segmentation module 303 is specifically used to perform text segmentation on the fourth test case and the third test case respectively, to obtain the segmented text of the fourth test case and the segmented text of the third test case.
[0122] Determination module 305 is specifically used to determine, from the artificial test case set, a test case whose similarity meets a second preset similarity threshold based on the similarity between the segmented text of the fourth test case and the segmented text of the third test case; the second test case also includes: a test case whose similarity meets the second preset similarity threshold.
[0123] Figure 8 A schematic diagram of a test case search device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the test case search device includes: a processor 601, a memory 602 and a bus 603; the memory 602 stores machine-readable instructions executable by the processor 601. When the test case search device is running, the processor 601 communicates with the memory 602 through the bus 603, and the processor 601 executes the machine-readable instructions to perform the steps of the test case search method provided in the aforementioned method embodiment.
[0124] Specifically, the machine-readable instructions stored in the memory 602 are the execution steps of the test case search method described in the aforementioned embodiment of the present application. The processor 601 can execute the test case search method to process the test requirements. Therefore, the test case search device also has all the beneficial effects described in the aforementioned method embodiment, and this application will not repeat the description.
[0125] It should be noted that the test case search device can be a general-purpose computer or a special-purpose computer, as well as other servers for processing data, etc., all of which can be used to implement the test case search method of the present application. Although the present application only describes the test case search method through computers and servers, for convenience, the functions described in the present application can also be implemented in a distributed manner on multiple similar platforms to balance the processing load.
[0126] For example, the test case search device may include one or more processors for executing program instructions, a communication bus, and different forms of storage media, such as a disk, ROM, or RAM, or any combination thereof. Exemplarily, the computer platform may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application may be implemented according to these program instructions.
[0127] For ease of description, only one processor is described in the above test case search device. However, it should be noted that the test case search device in the present application may also include multiple processors, so the steps performed by one processor described in the present application may also be performed jointly or individually by multiple processors.
[0128] The present application also provides a storage medium on which a computer program is stored. The computer program is executed by a processor. Figure 1-Figure 5 Provides steps for the test case search method.
[0129] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, the above-mentioned Figure 1-Figure 5 The provided test case search method solves the problem in the prior art that the test case coverage is not comprehensive enough, resulting in the possibility of missing test cases, which further leads to incomplete regression in subsequent regression.
[0130] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0131] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0133] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0134] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A test case search method, characterized in that: The method comprises: According to the test requirement, a first test case is obtained from the automated test case set, wherein the test requirement is a test requirement input by a user, and the test requirement includes: a function label and a requirement document; Obtaining a historical requirement document corresponding to the requirement document; According to the functional requirements of the test request, a second test case is obtained from the set of manual test cases, wherein the functional requirements include function points involved in the function tags, and the second test cases include test cases whose similarity meets a second preset similarity threshold; wherein, according to the functional requirements of the test request, obtaining the second test case from the set of manual test cases includes: Performing a text description on the function points involved in the function label to obtain a fourth test case; Performing text segmentation on the fourth test case and the third test case respectively to obtain the segmented text of the fourth test case and the segmented text of the third test case; the third test case is a test case associated with the historical requirement document; According to the similarity between the segmented text of the fourth test case and the segmented text of the third test case, determining a test case whose similarity meets a second preset similarity threshold from the set of artificial test cases; The first test case and the second test case are added to a regression test case set to perform regression testing on the test requirement.
2. The method according to claim 1, characterized in that The obtaining of a first test case from a set of automated test cases according to the test requirement includes: According to the function tag, obtaining a test case corresponding to the function tag from the automated test case set, wherein the automated test case set includes: a test case corresponding to at least one function tag; The first test case includes: a test case corresponding to the function tag.
3. The method according to claim 1, characterized in that The obtaining of a first test case from a set of automated test cases according to the test requirement includes: Obtain the functions involved in the test request; Obtaining a test case corresponding to the function from the automated test case set; The first test case also includes: a test case corresponding to the function.
4. The method according to claim 3, characterized in that The function involved in obtaining the test request includes: Obtain the code submission record associated with the test requirement; Parsing the comparison code in the code submission record to obtain the function involved in the comparison code; The function involved in the test requirement is: the function involved in the comparison code.
5. The method according to claim 2, characterized in that The obtaining a second test case from a set of manual test cases according to the functional requirements of the test requirement includes: According to the historical requirement document, a test case associated with the historical requirement document is obtained from the manual test case set, wherein the manual test case set further includes: at least one test case associated with a historical requirement document.
6. The method according to claim 1, characterized in that The obtaining of a historical requirement document corresponding to the requirement document includes: Performing text segmentation on the demand document and at least one historical demand document in the historical demand management system respectively; Calculate the similarity between the demand document and each historical demand document based on the word vector after the demand document is segmented and the word vector after the text of each historical demand document is segmented; According to the similarity between the requirement document and each of the historical requirement documents, determining, from the at least one historical requirement document, a historical requirement document whose similarity meets a first preset similarity threshold as a historical requirement document corresponding to the requirement document; According to the historical requirement document corresponding to the requirement document, it is determined that the test case associated with the historical requirement document is the third test case.
7. A test case search device, characterized in that: The device comprises: an acquisition module and an adding module, wherein: The acquisition module is used to acquire a first test case from an automated test case set according to a test requirement; the test requirement includes: a function label and a requirement document; acquire a second test case from a manual test case set according to a function requirement of the test requirement, wherein the test requirement is a test requirement input by a user; acquire a historical requirement document corresponding to the requirement document; the function requirement includes a function point involved in the function label; the second test case includes a test case whose similarity meets a second preset similarity threshold, wherein acquiring a second test case from a manual test case set according to the function requirement of the test requirement includes: Performing a text description on the function points involved in the function label to obtain a fourth test case; Performing text segmentation on the fourth test case and the third test case respectively to obtain the segmented text of the fourth test case and the segmented text of the third test case; the third test case is a test case associated with the historical requirement document; According to the similarity between the segmented text of the fourth test case and the segmented text of the third test case, determining a test case whose similarity meets a second preset similarity threshold from the set of artificial test cases; The adding module is used to add the first test case and the second test case to the regression test case set to perform regression testing on the test requirement.
8. A test case search device, characterized in that: The device includes: a processor, a storage medium and a bus, the storage medium stores machine-readable instructions executable by the processor, when the test case search device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to execute the method described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is executed.
