CN115858367A - Test case screening method, device, equipment and medium - Google Patents

Test case screening method, device, equipment and medium Download PDF

Info

Publication number
CN115858367A
CN115858367A CN202211602046.1A CN202211602046A CN115858367A CN 115858367 A CN115858367 A CN 115858367A CN 202211602046 A CN202211602046 A CN 202211602046A CN 115858367 A CN115858367 A CN 115858367A
Authority
CN
China
Prior art keywords
test case
keyword set
code
change
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211602046.1A
Other languages
Chinese (zh)
Inventor
陈会亮
张晋锋
南亚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Sugon Information Industry Chengdu Co ltd
Zhongke Shuguang International Information Industry Co ltd
Original Assignee
Zhongke Sugon Information Industry Chengdu Co ltd
Zhongke Shuguang International Information Industry Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Sugon Information Industry Chengdu Co ltd, Zhongke Shuguang International Information Industry Co ltd filed Critical Zhongke Sugon Information Industry Chengdu Co ltd
Priority to CN202211602046.1A priority Critical patent/CN115858367A/en
Publication of CN115858367A publication Critical patent/CN115858367A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a test case screening method, a test case screening device, test case screening equipment and a test case screening medium. The method comprises the following steps: acquiring a change interface list corresponding to the change code; the change interface list comprises identification information of at least one change interface in the change codes; determining a function keyword set corresponding to the modification code according to the identification information of each modification interface; acquiring test case description information of each test case, and matching the test case description information of each test case with a function keyword set to obtain the matching degree between the test case description information of each test case and the function keyword set; and determining the regression test case corresponding to the change code according to the matching degree. The embodiment of the invention can automatically screen out the test cases for testing the code functions of the modified codes, which are affected by the code modification, based on the matching degree between the test case description information of each test case and the function keyword set corresponding to the modified codes.

Description

Test case screening method, device, equipment and medium
Technical Field
The invention relates to the technical field of computers, in particular to a test case screening method, a test case screening device, test case screening equipment and a test case screening medium.
Background
In the regression testing process, test cases relevant to the function of the modified code need to be screened out from preset test cases, and then the function of the modified code is tested through the screened test cases, so as to confirm whether new errors are introduced or other codes are caused to generate errors.
In the related art, a common test case screening scheme is as follows: the tester establishes the corresponding relation between the codes and the test cases or the corresponding relation between the code functions and the test cases, and then screens out the test cases related to the functions of the changed codes from the preset test cases based on the established corresponding relation between the codes and the test cases or the corresponding relation between the code functions and the test cases. In the test case screening scheme in the related art, a tester needs to establish a corresponding relationship between codes and test cases or a corresponding relationship between code functions and test cases, a large amount of labor cost and time cost are consumed, and the efficiency is low.
Disclosure of Invention
The invention provides a test case screening method, a test case screening device, test case screening equipment and a test case screening medium, which are used for solving the problems that a test case screening scheme in the related technology needs a tester to establish a corresponding relation between codes and test cases or a corresponding relation between code functions and test cases, a large amount of labor cost and time cost are consumed, and the efficiency is low.
According to an aspect of the present invention, a test case screening method is provided, including:
acquiring a change interface list corresponding to the change code; wherein, the change interface list comprises the identification information of at least one change interface in the change code;
determining a function keyword set corresponding to the change code according to the identification information of each change interface;
acquiring test case description information of each test case, and matching the test case description information of each test case with the function keyword set to obtain the matching degree between the test case description information of each test case and the function keyword set; the test case description information comprises a test case title and a test case step;
and determining the regression test case corresponding to the change code according to the matching degree between the test case description information of each test case and the function keyword set.
According to the technical scheme of the embodiment of the invention, the test cases for testing the code function of the change code, which is affected by the code change, can be quickly screened out from the test cases automatically based on the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code, and the test cases are used as the regression test cases corresponding to the change code, so that the labor cost and the time cost in the screening process of the test cases are reduced, the efficiency is higher, the regression test cases corresponding to the change code can be conveniently and quickly screened out from the test cases in the regression test process of the change code, the code function of the change code, which is affected by the code change, can be tested through the regression test cases corresponding to the change code, and whether new errors are introduced or other codes are generated errors are confirmed.
Optionally, before obtaining the change interface list corresponding to the change code, the method further includes:
acquiring a function description text of each interface in the modification code, and performing word segmentation processing on the function description text of each interface to obtain a function keyword set of each interface;
and storing the function keyword set of each interface into a preset database.
According to the technical scheme of the embodiment of the invention, the function keyword set of each interface can be extracted from the function description text of each interface, and the function keyword set of each interface is stored and managed through the preset database.
Optionally, the determining, according to the identification information of each modified interface, a set of functional keywords corresponding to the modified code includes:
acquiring a function keyword set of each modified interface from a function keyword set of each interface stored in the preset database according to the identification information of each modified interface;
and taking a union set of the functional keyword sets of the modified interfaces to obtain a combined functional keyword set, and determining the combined functional keyword set as a functional keyword set corresponding to the modified code.
According to the technical scheme of the embodiment of the invention, the function keyword set corresponding to the change code can be determined according to the identification information of each change interface included in the change code, so that the test cases for testing the code function of the change code affected by code change can be screened from each test case according to the function keyword set corresponding to the change code and taken as the regression test case corresponding to the change code.
Optionally, the matching the test case description information of each test case with the functional keyword set to obtain a matching degree between the test case description information of each test case and the functional keyword set includes:
the following operations are performed for each test case:
determining the number of functional keywords contained in the test case description information of the test case;
and determining the matching degree between the test case description information of the test case and the functional keyword set corresponding to the change code according to the number of the functional keywords.
According to the technical scheme of the embodiment of the invention, the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code can be determined according to the number of the same keywords between the test case description information of each test case and the function keyword set corresponding to the change code, so that the test cases for testing the code function of the change code, which is influenced by the code change, can be screened from each test case as the regression test case corresponding to the change code based on the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code.
Optionally, the determining, according to the matching degree between the test case description information of each test case and the function keyword set, a regression test case corresponding to the change code includes:
acquiring at least one alternative test case of which the matching degree between the test case description information and the function keyword set is greater than a preset matching degree threshold;
detecting whether a target alternative test case with the attribute of being a waste test case exists in each alternative test case;
and if the target alternative test case with the attribute of being the abandoned test case exists in each alternative test case, deleting the target alternative test case in each alternative test case, and determining each processed alternative test case as the regression test case corresponding to the change code.
According to the technical scheme of the embodiment of the invention, the test cases used for testing the code function of the change code, which is affected by the code change, can be screened out from the test cases based on the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code, and the test cases are used as regression test cases corresponding to the change code, so that the waste test cases in the test cases can be screened out, and the regression test cases corresponding to the change code are ensured to be the test cases which can be normally used in the code testing process.
Optionally, after detecting whether there is a target candidate test case with an attribute being a discarded test case in each of the candidate test cases, the method further includes:
and if the target alternative test case with the attribute of being the abandoned test case does not exist in the alternative test cases, determining the alternative test cases as regression test cases corresponding to the change codes.
According to the technical scheme of the embodiment of the invention, under the condition that no abandoned test case exists in the screened test cases for testing the code function of the change code, which is influenced by the code change, the test case for testing the code function of the change code, which is influenced by the code change, can be directly determined as the regression test case corresponding to the change code.
Optionally, the obtaining a change interface list corresponding to the change code includes:
and acquiring a change interface list which is uploaded by the target user and corresponds to the change code.
According to the technical scheme of the embodiment of the invention, the modified interface list corresponding to the modified code can be obtained, so that the function keyword set corresponding to the modified code can be conveniently determined according to the identification information of each modified interface in the modified interface list, and further, the test cases for testing the code function of the modified code, which is affected by the code modification, are screened from all the test cases according to the function keyword set corresponding to the modified code and serve as the regression test case corresponding to the modified code.
According to another aspect of the present invention, there is provided a test case screening apparatus, including:
the list acquisition module is used for acquiring a change interface list corresponding to the change code; wherein, the change interface list comprises the identification information of at least one change interface in the change code;
a keyword set determining module, configured to determine, according to the identification information of each modified interface, a function keyword set corresponding to the modified code;
the keyword set matching module is used for acquiring the test case description information of each test case, matching the test case description information of each test case with the function keyword set, and obtaining the matching degree between the test case description information of each test case and the function keyword set; the test case description information comprises a test case title and a test case step;
and the test case determining module is used for determining the regression test case corresponding to the change code according to the matching degree between the test case description information of each test case and the function keyword set.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor;
and a memory communicatively coupled to the at least one processor network;
the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute the test case screening method according to any embodiment of the present invention.
According to another aspect of the present invention, a computer-readable storage medium is provided, where computer instructions are stored, and the computer instructions are configured to enable a processor to implement the test case screening method according to any embodiment of the present invention when executed.
According to the technical scheme of the embodiment of the invention, the change interface list corresponding to the change code is obtained; the modified interface list comprises identification information of at least one modified interface in the modified code; then determining a function keyword set corresponding to the change code according to the identification information of each change interface; acquiring test case description information of each test case, and matching the test case description information of each test case with a function keyword set to obtain the matching degree between the test case description information of each test case and the function keyword set; finally, according to the matching degree between the test case description information of each test case and the function keyword set, the regression test case corresponding to the modified code is determined, the problems that a test case screening scheme in the related technology requires a tester to establish the corresponding relation between the code and the test case or the corresponding relation between the code function and the test case, a large amount of labor cost and time cost are consumed, and efficiency is low are solved.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a test case screening method according to an embodiment of the present invention.
Fig. 2 is a flowchart of a test case screening method according to a second embodiment of the present invention.
Fig. 3 is a flowchart of a test case screening method provided in the third embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a test case screening apparatus according to a fourth embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device for implementing the test case screening method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "object," "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a test case screening method according to an embodiment of the present invention. The method can be executed by a test case screening device, the test case screening device can be realized in a hardware and/or software mode, and the test case screening device can be configured in electronic equipment. As shown in fig. 1, the method includes:
step 101, obtaining a change interface list corresponding to the change code.
Wherein, the change interface list includes the identification information of at least one change interface in the change codes.
Optionally, the modified code is code modified by a developer, i.e. modified code. The alteration code includes a plurality of interfaces. Each interface is used to implement one or more code functions of the alteration code. The change interface in the change code is an interface in the change code that is modified by the developer.
Optionally, the change interface list corresponding to the change code is a list used for storing identification information of each change interface in the change code. The identification information of the interface is information for uniquely identifying the interface. The identification information of the interface can be the name of the interface or the number corresponding to the interface.
Optionally, the obtaining a change interface list corresponding to the change code includes: and acquiring a change interface list which is uploaded by the target user and corresponds to the change code. The target user may be a tester that manages the regression testing process of the altered code. And the target user uploads the change interface list corresponding to the change code to the electronic equipment through the terminal equipment. And the electronic equipment acquires a change interface list which is uploaded by the target user and corresponds to the change code.
Therefore, the modified interface list corresponding to the modified code can be obtained, the function keyword set corresponding to the modified code is determined conveniently according to the identification information of each modified interface in the modified interface list, and further, the test cases for testing the code function of the modified code, which is affected by the code modification, are screened from all the test cases according to the function keyword set corresponding to the modified code and serve as regression test cases corresponding to the modified code.
And step 102, determining a function keyword set corresponding to the change code according to the identification information of each change interface.
Optionally, before obtaining the change interface list corresponding to the change code, the method further includes: acquiring a function description text of each interface in the modification code, and performing word segmentation processing on the function description text of each interface to obtain a function keyword set of each interface; and storing the function keyword set of each interface into a preset database.
Therefore, the function keyword set of each interface can be extracted from the function description text of each interface, and the function keyword set of each interface is stored and managed through the preset database.
Optionally, each interface is included in the modification code. The function description text of the interface is text information for describing a code function implemented by the interface. Acquiring a function description text of each interface in the change code, wherein the function description text comprises the following steps: and acquiring function description texts of each interface uploaded by the target user. And the target user uploads the function description texts of the interfaces to the electronic equipment through the terminal equipment. The electronic equipment acquires function description texts of all interfaces uploaded by a target user.
Optionally, performing word segmentation processing on the function description text of each interface to obtain a function keyword set of each interface, including: the following operations are performed for each interface: and performing segmentation processing on the function description text line of the interface by using a preset segmentation model to obtain at least one term, wherein the at least one term is a function keyword set of the interface. The functional keywords of the interface are words used to describe the code functions implemented by the interface. One word is a functional keyword of one interface. The at least one term constitutes a set of functional keywords of the interface.
Optionally, the preset word segmentation model is a pre-established word segmentation model, and is used for segmenting the search information into a single word. The preset word segmentation models include, but are not limited to, statistical-based word segmentation models, dictionary-based word segmentation models, and artificial intelligence-based word segmentation models.
Optionally, the preset database is a database for storing the function keyword sets of the interfaces. And correspondingly storing the identification information and the function keyword set of each interface into a preset database.
Optionally, the determining, according to the identification information of each modified interface, a set of functional keywords corresponding to the modified code includes: acquiring a function keyword set of each modified interface from a function keyword set of each interface stored in the preset database according to the identification information of each modified interface; and taking a union set of the function keyword sets of the modified interfaces to obtain a combined function keyword set, and determining the combined function keyword set as a function keyword set corresponding to the modified code.
Therefore, the function keyword set corresponding to the change code can be determined according to the identification information of each change interface included in the change code, so that the test cases used for testing the code function of the change code affected by code change can be screened from the test cases according to the function keyword set corresponding to the change code and taken as the regression test case corresponding to the change code.
Optionally, obtaining, according to the identification information of each modified interface, a function keyword set of each modified interface from the function keyword sets of each interface stored in the preset database, where the obtaining includes: the following operations are performed for each modified interface: inquiring target identification information which is the same as the identification information of the changed interface in the identification information of each interface stored in the preset database; and acquiring a functional keyword set corresponding to the target identification information, and determining the functional keyword set corresponding to the target identification information as the functional keyword set of the modified interface.
Optionally, if the target identification information that is the same as the identification information of the changed interface is not queried, sending the preset error prompt information to the terminal device of the target user. And the preset error prompt information is used for prompting that errors occur in the test case screening process.
Optionally, the function keyword set of each modified interface includes the function keyword of each modified interface. The functional keyword of each change interface is a word for describing the code function of the change code affected by the code change.
Optionally, a union set is taken from the function keyword sets of each modified interface to obtain a merged function keyword set, and the merged function keyword set is determined as the function keyword set corresponding to the modified code. And the functional keywords of each modified interface form a functional keyword set corresponding to the modified code. The set of functional keywords corresponding to the change code includes words describing the code function of the change code affected by the code change.
103, obtaining the test case description information of each test case, and matching the test case description information of each test case with the function keyword set to obtain the matching degree between the test case description information of each test case and the function keyword set.
The test case description information comprises a test case title and a test case step.
Optionally, each test case is a plurality of preset test cases for testing the code function. Each test case is used to test one or more code functions of the code. The test case header may be text information for generally describing a code function of the test case test. The test case step may be text information for describing each step of the test case testing the code function.
Optionally, the matching degree between the test case description information of each test case and the function keyword set is a numerical value used for representing the degree of matching between the test case description information of each test case and the function keyword set.
Optionally, the matching the test case description information of each test case with the function keyword set to obtain a matching degree between the test case description information of each test case and the function keyword set includes: the following operations are performed for each test case: determining the number of functional keywords contained in the test case description information of the test case; and determining the matching degree between the test case description information of the test case and the functional keyword set corresponding to the change code according to the number of the functional keywords.
Therefore, the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code can be determined according to the number of the same keywords between the test case description information of each test case and the function keyword set corresponding to the change code, so that the test cases for testing the code functions of the change code affected by the code change are screened out from each test case and used as regression test cases corresponding to the change code based on the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code.
Optionally, determining the number of the functional keywords included in the test case description information of the test case includes: detecting whether the test case description information of the test case contains each functional keyword in the functional keyword set corresponding to the change code; and counting the number of the functional keywords in the functional keyword set corresponding to the change codes contained in the test case description information of the test case.
Optionally, determining a matching degree between the test case description information of the test case and the function keyword set corresponding to the change code according to the number of the function keywords includes: calculating the matching degree between the test case description information of the test case and the function keyword set corresponding to the change code by using the following formula:
Figure BDA0003995621930000121
wherein C is the matching degree between the test case description information of the test case and the function keyword set corresponding to the change code, Q l The number Q of the functional keywords contained in the test case description information of the test case 0 And the number of the functional keywords in the functional keyword set corresponding to the change code is obtained.
Optionally, the higher the matching degree between the test case description information of the test case and the function keyword set corresponding to the modified code is, the more similar the code function of the test case test and the code function of the modified code affected by the code modification are indicated, and the test case can test the code function of the modified code affected by the code modification.
Optionally, the lower the matching degree between the test case description information of the test case and the function keyword set corresponding to the modified code is, the more dissimilar the code function tested by the test case is to the code function of the modified code, which is affected by the code modification, and the test case cannot test the code function of the modified code, which is affected by the code modification.
And 104, determining the regression test case corresponding to the change code according to the matching degree between the test case description information of each test case and the function keyword set.
Optionally, the regression test case corresponding to the change code is a test case used for testing the change code in the regression test process.
Optionally, the determining, according to the matching degree between the test case description information of each test case and the function keyword set, the regression test case corresponding to the change code includes: acquiring at least one alternative test case of which the matching degree between the test case description information and the functional keyword set is greater than a preset matching degree threshold value; detecting whether a target alternative test case with the attribute of being a waste test case exists in each alternative test case; and if the target alternative test case with the attribute of being the abandoned test case exists in each alternative test case, deleting the target alternative test case in each alternative test case, and determining each processed alternative test case as the regression test case corresponding to the change code.
Therefore, the test cases used for testing the code functions of the modified codes, which are affected by the code modification, can be screened out from the test cases based on the matching degree between the test case description information of each test case and the function keyword set corresponding to the modified codes, and can be used as regression test cases corresponding to the modified codes, so that the waste test cases in the test cases can be screened out, and the regression test cases corresponding to the modified codes are guaranteed to be the test cases which can be normally used in the code testing process.
Optionally, the preset matching degree threshold may be set according to a service requirement. Illustratively, the predetermined threshold of the degree of match is 0.9. The alternative test case is a test case of which the matching degree between the test case description information and the function keyword set is greater than a preset matching degree threshold value.
Optionally, detecting whether a target candidate test case with an attribute of being a discarded test case exists in each candidate test case includes: obtaining the attribute of each alternative test case; wherein the attribute of each alternative test case is a normal test case or a waste test case; detecting whether the attribute of each alternative test case is a normal test case; if the attribute of each alternative test case is detected to be a normal test case, determining that no target alternative test case with the attribute of a waste test case exists in each alternative test case; and if the attribute of the target alternative test case is detected to be the abandoned test case, determining that the target alternative test case with the attribute of the abandoned test case exists in each alternative test case.
Optionally, the attribute of the test case is information for characterizing the test case as a normal test case or a waste test case. The attribute of the test case is a normal test case, which indicates that the test case is a test case that can be normally used in the code test process. The attribute of the test case is a waste test case, which indicates that the test case is a waste test case and cannot be used in the code test process. The target candidate test case is one or more candidate test cases in each candidate test case.
Optionally, after detecting whether a target candidate test case with an attribute of being a discarded test case exists in each candidate test case, the method further includes: and if the target alternative test case with the attribute of being the abandoned test case does not exist in the alternative test cases, determining the alternative test cases as regression test cases corresponding to the change codes.
Therefore, under the condition that no abandoned test case exists in the screened test cases for testing the code function of the modified code affected by the code modification, the test case for testing the code function of the modified code affected by the code modification can be directly determined as the regression test case corresponding to the modified code.
According to the technical scheme of the embodiment of the invention, the change interface list corresponding to the change code is obtained; the modified interface list comprises identification information of at least one modified interface in the modified codes; then determining a function keyword set corresponding to the change code according to the identification information of each change interface; acquiring test case description information of each test case, and matching the test case description information of each test case with a function keyword set to obtain the matching degree between the test case description information of each test case and the function keyword set; finally, according to the matching degree between the test case description information of each test case and the function keyword set, the regression test case corresponding to the modified code is determined, the problems that a test case screening scheme in the related technology requires a tester to establish the corresponding relation between the code and the test case or the corresponding relation between the code function and the test case, a large amount of labor cost and time cost are consumed, and efficiency is low are solved.
Example two
Fig. 2 is a flowchart of a test case screening method according to a second embodiment of the present invention. Embodiments of the invention may be combined with various alternatives in one or more of the embodiments described above. As shown in fig. 2, the method includes:
step 201, obtaining a function description text of each interface in the modification code, and performing word segmentation processing on the function description text of each interface to obtain a function keyword set of each interface.
Step 202, storing the function keyword sets of the interfaces into a preset database.
And step 203, acquiring a change interface list corresponding to the change code.
Wherein, the change interface list includes the identification information of at least one change interface in the change code.
And 204, acquiring a function keyword set of each modified interface from the function keyword sets of each interface stored in the preset database according to the identification information of each modified interface.
Step 205, a union set is selected for the functional keyword sets of each modified interface to obtain a merged functional keyword set, and the merged functional keyword set is determined as the functional keyword set corresponding to the modified code.
And step 206, obtaining the test case description information of each test case, and matching the test case description information of each test case with the function keyword set corresponding to the change code to obtain the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code.
The test case description information comprises a test case title and a test case step.
And step 207, determining a regression test case corresponding to the change code according to the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code.
According to the technical scheme of the embodiment of the invention, the function keyword set of each interface can be extracted from the function description text of each interface, the function keyword set of each interface is stored and managed through the preset database, the function keyword set corresponding to the change code can be determined according to the identification information of each change interface included in the change code, and the test cases for testing the code function of the change code affected by code change can be screened out from each test case according to the function keyword set corresponding to the change code and taken as the regression test case corresponding to the change code.
EXAMPLE III
Fig. 3 is a flowchart of a test case screening method provided in the third embodiment of the present invention, including the following steps:
step 301, obtaining the function description text of each interface in the modification code, and performing word segmentation processing on the function description text of each interface to obtain a function keyword set of each interface.
Step 302, storing the function keyword sets of each interface into a preset database.
And step 303, acquiring a change interface list corresponding to the change code.
Wherein, the change interface list includes the identification information of at least one change interface in the change code.
And step 304, acquiring a function keyword set of each changed interface from the function keyword sets of each interface stored in the preset database according to the identification information of each changed interface.
And 305, taking a union set of the function keyword sets of the modified interfaces to obtain a merged function keyword set, and determining the merged function keyword set as a function keyword set corresponding to the modified code.
And step 306, obtaining the test case description information of each test case, and matching the test case description information of each test case with the function keyword set corresponding to the change code to obtain the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code.
The test case description information comprises a test case title and a test case step.
And 307, acquiring at least one alternative test case of which the matching degree between the test case description information and the function keyword set corresponding to the change code is greater than a preset matching degree threshold value.
Step 308, detecting whether a target alternative test case with the attribute of being a abandoned test case exists in each alternative test case: if yes, go to step 309; if not, go to step 310.
And 309, deleting the target alternative test case in the alternative test cases, and determining the processed alternative test cases as regression test cases corresponding to the change codes.
And 310, determining each alternative test case as a regression test case corresponding to the change code.
According to the technical scheme of the embodiment of the invention, the test cases for testing the code function of the change code, which is affected by the code change, can be quickly screened out from the test cases automatically based on the matching degree between the test case description information of each test case and the function keyword set corresponding to the change code, and the test cases are used as the regression test cases corresponding to the change code, so that the labor cost and the time cost in the screening process of the test cases are reduced, the efficiency is higher, the regression test cases corresponding to the change code can be conveniently and quickly screened out from the test cases in the regression test process of the change code, the code function of the change code, which is affected by the code change, can be tested through the regression test cases corresponding to the change code, and whether new errors are introduced or other codes are generated errors are confirmed.
Example four
Fig. 4 is a schematic structural diagram of a test case screening apparatus according to a fourth embodiment of the present invention. The apparatus may be configured in an electronic device. As shown in fig. 4, the apparatus includes: the test case testing system comprises a list acquisition module 401, a keyword set determination module 402, a keyword set matching module 403 and a test case determination module 404.
The list obtaining module 401 is configured to obtain a change interface list corresponding to the change code; wherein, the change interface list comprises the identification information of at least one change interface in the change code; a keyword set determining module 402, configured to determine, according to the identification information of each modified interface, a function keyword set corresponding to the modified code; a keyword set matching module 403, configured to obtain test case description information of each test case, match the test case description information of each test case with the function keyword set, and obtain a matching degree between the test case description information of each test case and the function keyword set; the test case description information comprises a test case title and a test case step; and the test case determining module 404 is configured to determine a regression test case corresponding to the change code according to the matching degree between the test case description information of each test case and the function keyword set.
According to the technical scheme of the embodiment of the invention, the change interface list corresponding to the change code is obtained; the modified interface list comprises identification information of at least one modified interface in the modified code; then determining a function keyword set corresponding to the change code according to the identification information of each change interface; acquiring test case description information of each test case, and matching the test case description information of each test case with a function keyword set to obtain the matching degree between the test case description information of each test case and the function keyword set; finally, according to the matching degree between the test case description information of each test case and the function keyword set, the regression test case corresponding to the modified code is determined, the problems that a test case screening scheme in the related technology requires a tester to establish the corresponding relation between the code and the test case or the corresponding relation between the code function and the test case, a large amount of labor cost and time cost are consumed, and efficiency is low are solved.
In an optional implementation manner of the embodiment of the present invention, optionally, the test case screening apparatus further includes: the text processing module is used for acquiring the function description text of each interface in the change code, and performing word segmentation processing on the function description text of each interface to obtain a function keyword set of each interface; and the set storage module is used for storing the function keyword sets of the interfaces into a preset database.
In an optional implementation manner of the embodiment of the present invention, optionally, the keyword set determining module 402 is specifically configured to: acquiring a function keyword set of each modified interface from a function keyword set of each interface stored in the preset database according to the identification information of each modified interface; and taking a union set of the function keyword sets of the modified interfaces to obtain a combined function keyword set, and determining the combined function keyword set as a function keyword set corresponding to the modified code.
In an optional implementation manner of the embodiment of the present invention, optionally, when the keyword set matching module 403 executes an operation of matching the test case description information of each test case with the function keyword set to obtain a matching degree between the test case description information of each test case and the function keyword set, specifically, the operation is to: the following operations are performed for each test case: determining the same keywords and the number of the same keywords between the test case description information of the test case and the function keyword set corresponding to the change code; and determining the matching degree between the test case description information of the test case and the functional keyword set corresponding to the change code according to the number of the same keywords.
In an optional implementation manner of the embodiment of the present invention, optionally, the test case determining module 404 is specifically configured to: acquiring at least one alternative test case of which the matching degree between the test case description information and the function keyword set is greater than a preset matching degree threshold; detecting whether a target alternative test case with the attribute of being a waste test case exists in each alternative test case; and if the target alternative test case with the attribute of being the abandoned test case exists in each alternative test case, deleting the target alternative test case in each alternative test case, and determining each processed alternative test case as the regression test case corresponding to the change code.
In an optional implementation manner of the embodiment of the present invention, optionally, the test case determining module 404 is further configured to: and if the target alternative test case with the attribute of being the abandoned test case does not exist in the alternative test cases, determining the alternative test cases as regression test cases corresponding to the change codes.
In an optional implementation manner of the embodiment of the present invention, optionally, the list obtaining module 401 is specifically configured to: and acquiring a change interface list which is uploaded by the target user and corresponds to the change code.
With regard to the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
The test case screening device can execute the test case screening method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the test case screening method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device 10 that may be used to implement the test case screening method according to the embodiment of the present invention. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, which is connected to the at least one processor 11 in a network communication manner, wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program built from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the test case screening method.
In some embodiments, the test case screening method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is built into the RAM 13 and executed by the processor 11, one or more steps of the test case screening method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the test case screening method in any other suitable manner (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
The computer program for implementing the test case screening method of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A test case screening method is characterized by comprising the following steps:
acquiring a change interface list corresponding to the change code; wherein, the change interface list comprises the identification information of at least one change interface in the change code;
determining a function keyword set corresponding to the modification code according to the identification information of each modification interface;
acquiring test case description information of each test case, and matching the test case description information of each test case with the function keyword set to obtain the matching degree between the test case description information of each test case and the function keyword set; the test case description information comprises a test case title and a test case step;
and determining the regression test case corresponding to the change code according to the matching degree between the test case description information of each test case and the function keyword set.
2. The method of claim 1, prior to obtaining the list of alteration interfaces corresponding to the alteration code, further comprising:
acquiring a function description text of each interface in the modification code, and performing word segmentation processing on the function description text of each interface to obtain a function keyword set of each interface;
and storing the function keyword set of each interface into a preset database.
3. The method of claim 2, wherein determining the set of function keys corresponding to the change code according to the identification information of each change interface comprises:
acquiring a function keyword set of each modified interface from a function keyword set of each interface stored in the preset database according to the identification information of each modified interface;
and taking a union set of the function keyword sets of the modified interfaces to obtain a combined function keyword set, and determining the combined function keyword set as a function keyword set corresponding to the modified code.
4. The method according to claim 3, wherein the matching the test case description information of each test case with the function keyword set to obtain a matching degree between the test case description information of each test case and the function keyword set comprises:
the following operations are performed for each test case:
determining the number of functional keywords contained in the test case description information of the test case;
and determining the matching degree between the test case description information of the test case and the functional keyword set corresponding to the change code according to the number of the functional keywords.
5. The method according to claim 1, wherein the determining the regression test case corresponding to the change code according to the matching degree between the test case description information of each test case and the function keyword set includes:
acquiring at least one alternative test case of which the matching degree between the test case description information and the function keyword set is greater than a preset matching degree threshold;
detecting whether a target alternative test case with the attribute of being a waste test case exists in each alternative test case;
and if the target alternative test case with the attribute of being the abandoned test case exists in each alternative test case, deleting the target alternative test case in each alternative test case, and determining each processed alternative test case as the regression test case corresponding to the change code.
6. The method according to claim 5, after detecting whether there is a target candidate test case with an attribute being a obsolete test case in each of the candidate test cases, further comprising:
and if the target alternative test case with the attribute of being the abandoned test case does not exist in the alternative test cases, determining the alternative test cases as regression test cases corresponding to the change codes.
7. The method of claim 1, wherein obtaining a list of change interfaces corresponding to change codes comprises:
and acquiring a change interface list which is uploaded by the target user and corresponds to the change code.
8. A test case screening device is characterized by comprising:
the list acquisition module is used for acquiring a change interface list corresponding to the change code; wherein, the change interface list comprises the identification information of at least one change interface in the change code;
a keyword set determining module, configured to determine, according to the identification information of each modified interface, a functional keyword set corresponding to the modified code;
the keyword set matching module is used for acquiring the test case description information of each test case, matching the test case description information of each test case with the function keyword set and obtaining the matching degree between the test case description information of each test case and the function keyword set; the test case description information comprises a test case title and a test case step;
and the test case determining module is used for determining the regression test case corresponding to the change code according to the matching degree between the test case description information of each test case and the function keyword set.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor;
and a memory communicatively coupled to the at least one processor network;
wherein the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the test case screening method of any of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to implement the test case screening method of any one of claims 1-7 when executed.
CN202211602046.1A 2022-12-13 2022-12-13 Test case screening method, device, equipment and medium Pending CN115858367A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211602046.1A CN115858367A (en) 2022-12-13 2022-12-13 Test case screening method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211602046.1A CN115858367A (en) 2022-12-13 2022-12-13 Test case screening method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115858367A true CN115858367A (en) 2023-03-28

Family

ID=85672624

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211602046.1A Pending CN115858367A (en) 2022-12-13 2022-12-13 Test case screening method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115858367A (en)

Similar Documents

Publication Publication Date Title
CN115598505A (en) Chip detection method, device, equipment and storage medium
CN116881156A (en) Automatic test method, device, equipment and storage medium
CN113032258A (en) Electronic map testing method and device, electronic equipment and storage medium
CN115048352B (en) Log field extraction method, device, equipment and storage medium
CN116074183B (en) C3 timeout analysis method, device and equipment based on rule engine
CN114168119B (en) Code file editing method, device, electronic equipment and storage medium
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN115422028A (en) Credibility evaluation method and device for label portrait system, electronic equipment and medium
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN114443493A (en) Test case generation method and device, electronic equipment and storage medium
CN115858367A (en) Test case screening method, device, equipment and medium
CN114443802A (en) Interface document processing method and device, electronic equipment and storage medium
CN115511014B (en) Information matching method, device, equipment and storage medium
CN115098405B (en) Software product evaluation method and device, electronic equipment and storage medium
CN114116688B (en) Data processing and quality inspection method and device and readable storage medium
CN117668113A (en) Data synchronization method, device, equipment and medium
CN117493785A (en) Data processing method and device and electronic equipment
CN115905492A (en) Alarm information analysis method, device, equipment and medium
CN113836291A (en) Data processing method, device, equipment and storage medium
CN116340098A (en) Server detection method, device, equipment and medium
CN114721942A (en) Test data generation method, device, equipment and storage medium
CN117609150A (en) Data migration method, device, equipment and medium
CN117931155A (en) Code generation method, device, equipment and medium
CN115756575A (en) Submission record acquisition method, device, equipment and storage medium
CN116401269A (en) Data query method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination