CN117555813B - Method, device, equipment and medium for determining common test case - Google Patents
Method, device, equipment and medium for determining common test case Download PDFInfo
- Publication number
- CN117555813B CN117555813B CN202410040555.2A CN202410040555A CN117555813B CN 117555813 B CN117555813 B CN 117555813B CN 202410040555 A CN202410040555 A CN 202410040555A CN 117555813 B CN117555813 B CN 117555813B
- Authority
- CN
- China
- Prior art keywords
- test case
- determining
- repeated
- steps
- list
- 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.)
- Active
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 304
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000000605 extraction Methods 0.000 claims abstract description 13
- 230000006870 function Effects 0.000 claims description 39
- 230000009471 action Effects 0.000 claims description 28
- 238000012098 association analyses Methods 0.000 claims description 7
- 238000012216 screening Methods 0.000 claims description 6
- 230000003252 repetitive effect Effects 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 3
- 230000006399 behavior Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application relates to the field of data processing, in particular to a method, a device, equipment and a medium for determining a public test case, wherein the method comprises the following steps: acquiring a plurality of single test cases, wherein the single test cases represent available test cases aiming at a single function of software; step extraction is carried out on each single test case, and a step list corresponding to each single test case is obtained; based on the step list corresponding to each of the plurality of single test cases, carrying out repeated step identification to obtain a repeated step list; and obtaining the common test case according to the repeated step list. The application can quickly obtain the public test case by utilizing the test case.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a medium for determining a common test case.
Background
A test case is a set of test inputs, execution conditions, and expected results that are formulated for a particular goal in order to test a program path or verify whether a particular requirement is met. Moreover, test cases are very important documents in software testing, which describe the inputs, outputs, and expected results of the test, help the tester perform the test, and ensure the quality of the software. However, the traditional software test has the problems of high test case design repetition rate, lack of unified specifications and the like.
In order to solve the problems, namely, repeatedly writing the same test case in different projects, the test time and the resources are wasted; commonly used test cases are used to obtain test cases. A common test case is a descriptive document that is tested for characteristics or problems common to a particular set of software products or systems.
In general, the process of determining a common test case is: determining the range of software products or systems covered by the common test cases, and the targets and requirements of the test; test requirements for the relevant software products or systems are collected, including requirements in terms of functionality, performance, security, availability, etc. Analyzing the demands and identifying a common test point; and writing corresponding common test cases according to the common test points obtained through analysis.
However, when a software product or a system of the public test case is needed, and before the public test case is available, time is consumed to write the corresponding specific test case, the reference to the specific test case is not needed, and then the public test case is directly written, so that the time consumption is long.
Therefore, how to obtain the public test cases quickly by using the test cases is a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
In order to quickly obtain a common test case by utilizing the test case, the application provides a method, a device, equipment and a medium for determining the common test case.
In a first aspect, the present application provides a method for determining a common test case, which adopts the following technical scheme:
A method for determining a common test case comprises the following steps:
obtaining a plurality of single test cases, wherein the single test cases represent available test cases aiming at a single function of software;
step extraction is carried out on each single test case, and a step list corresponding to each single test case is obtained;
based on the step list corresponding to each of the plurality of single test cases, performing repeated step identification to obtain a repeated step list;
And obtaining the common test case according to the repeated step list.
By adopting the technical scheme, a plurality of single test cases are acquired to determine a plurality of available test cases aiming at a single function of the software; step extraction is carried out on each single test case to obtain a step list corresponding to each single test case so as to determine all steps included in each single test case; compared with the prior art, the method has the advantages that longer time is consumed from the start of collecting product information to the end of writing the common test cases, the method is used for carrying out repeated step identification based on the step lists corresponding to the single test cases, and after the repeated step list is obtained, the common test cases are obtained according to the repeated step list, namely the common test cases aiming at the software function are directly extracted from the existing single test cases, so that the time consumption is shorter.
The present application may be further configured in a preferred example to:
according to the repeated step list, a common test case is obtained, which comprises the following steps:
Obtaining a common test case template based on the repeated step list;
Determining a plurality of template variables based on the step list corresponding to each of the plurality of single test cases;
and combining the common test case template with the plurality of template variables to obtain the common test case.
By adopting the technical scheme, after the common test case template is obtained based on the repeated step list, a plurality of template variables are determined based on the step list corresponding to each of a plurality of single test cases so as to determine the differences of the test cases when facing different single functions; based on the differences among the test cases, the common test case templates are improved, so that the common test cases which can be used for different single functions are obtained.
The present application may be further configured in a preferred example to: the step list includes a plurality of specific steps,
And performing repeated step identification based on the step list corresponding to each of the plurality of single test cases, wherein the obtained repeated step list comprises the following steps:
determining a plurality of parallel association step group stacks based on all the step lists, wherein the parallel association step group stacks comprise at least one parallel association step group with the same execution sequence;
Determining the number of steps respectively included in the at least one associated step group in the parallel associated step group pile for each parallel associated step group pile;
taking the association step group corresponding to the largest step number as a target association step group;
And obtaining repeated steps based on the target association step group so as to determine the repeated step list.
By adopting the technical scheme, a plurality of associated step group stacks are determined based on all step lists so as to obtain specific steps corresponding to a plurality of single test cases with the same execution sequence; and determining the steps with higher occurrence frequency as the steps in the common test case by determining the number of the steps respectively included in at least one associated step group in the parallel associated step group stack.
The present application may be further configured in a preferred example to: determining a plurality of parallel association step group stacks based on all the step lists, including:
performing transverse association analysis on all the step lists to determine a plurality of association step groups;
and determining the execution order corresponding to each of the plurality of association step groups, and determining a plurality of parallel association step group stacks, wherein the parallel association step group stacks comprise at least one association step group with the same execution order.
By adopting the technical scheme, the transverse association analysis is carried out on all the step lists, a plurality of association step groups are determined, and the specific steps with similar execution content are determined as the association steps in the same association step group; the method and the device have the advantages that the execution sequence corresponding to each of the plurality of associated step groups is determined, a plurality of parallel associated step group stacks are determined, the comparison of occurrence frequency of steps with far execution sequences is avoided, and the accuracy of the determined public test case is high.
The present application may be further configured in a preferred example to: obtaining repeated steps based on the target parallel association step group, wherein the repeated steps comprise:
Extracting at least one repetitive action from the target parallel association step group;
and combining the at least one repeated action through semantic analysis to obtain the repeated steps corresponding to the target parallel association step group.
By adopting the technical scheme, repeated actions are extracted from the target parallel association step group to determine actions with higher occurrence frequency; and combining at least one repeated action through semantic analysis to obtain repeated steps corresponding to the target parallel association step group, so as to avoid that the obtained repeated steps do not accord with the conventional method.
The present application may be further configured in a preferred example to: step extraction is carried out on each single test case to obtain a step list corresponding to each single test case, and the step list comprises the following steps:
determining a plurality of initial steps included in the single test case aiming at each single test case;
Determining the epitaxial relation between every two initial steps; and screening at least one secondary step out of the plurality of primary steps based on all of the epitaxial relationships to determine a plurality of primary steps;
And determining the main steps as a step list corresponding to the single test case.
By adopting the technical scheme, a plurality of initial steps included in the single test case are determined for each single test case, so that the content of the single test case is subjected to data initialization; obtaining whether the initial steps are included or juxtaposed by determining the epitaxial relation between every two initial steps; based on the whole epitaxial relation, in a plurality of initial steps, a plurality of main steps are determined by screening out at least one secondary step, and a single test case is simplified, so that the same action is prevented from being executed twice in a generalized mode and a detailed mode.
The present application may be further configured in a preferred example to: obtaining a plurality of single test cases, including:
Acquiring a target test function identifier;
and determining the plurality of single test cases corresponding to the target test function identifier in the corresponding relation between the preset test function identifier and the test cases.
By adopting the technical scheme, after the target test function identifier is obtained, a plurality of single test cases corresponding to the target test function identifier are determined in the corresponding relation between the preset test function identifier and the test cases, so that the single test cases with more pertinence are obtained.
In a second aspect, the present application provides a device for determining a common test case, which adopts the following technical scheme:
a common test case determination apparatus comprising:
the system comprises a single test case acquisition module, a software module and a software module, wherein the single test case acquisition module is used for acquiring a plurality of single test cases, and the single test cases represent available test cases aiming at a single function of the software;
the step list determining module is used for extracting the steps of each single test case to obtain a step list corresponding to each single test case;
The repeated step list determining module is used for carrying out repeated step identification based on the step list corresponding to each of the plurality of single test cases to obtain a repeated step list;
and the public test case generating module is used for obtaining the public test case according to the repeated step list.
In a third aspect, the present application provides an electronic device, which adopts the following technical scheme:
at least one processor;
A memory;
At least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, the at least one application program configured to: the method for determining a common test case according to any one of the first aspects is performed.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
A computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of determining a common test case according to any of the first aspects.
In summary, the application at least comprises the following beneficial technical effects:
Acquiring a plurality of single test cases to determine a plurality of available test cases for a single function of the software; step extraction is carried out on each single test case to obtain a step list corresponding to each single test case so as to determine all steps included in each single test case; compared with the prior art, the method has the advantages that longer time is consumed from the start of collecting product information to the end of writing the common test cases, the method is used for carrying out repeated step identification based on the step lists corresponding to the single test cases, and after the repeated step list is obtained, the common test cases are obtained according to the repeated step list, namely the common test cases aiming at the software function are directly extracted from the existing single test cases, so that the time consumption is shorter.
Drawings
Fig. 1 is a flow chart of a method for determining a common test case according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram of a device for determining a common test case according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Description of the embodiments
The present application will be described in further detail with reference to fig. 1 to 3.
The present embodiment is merely illustrative of the present application and is not intended to limit the present application, and those skilled in the art, after having read the present specification, may make modifications to the present embodiment without creative contribution as necessary, but are protected by patent laws within the scope of the present application.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application are clearly and completely described, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In addition, the term "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In this context, unless otherwise specified, the term "/" generally indicates that the associated object is an "or" relationship.
A common test case (common case) is a set of test cases that can be referenced by a plurality of different test modules or test function points. These test cases typically contain elements of test environments, operational steps, test data, expected results, etc., and are organized into separate sub-case libraries for reference and execution when testing the various functional sub-modules. The main purpose of writing the public test cases is to improve the reusability of the test cases, reduce the redundancy of the cases in the case library, facilitate the maintenance of the case library, and exercise the overall grasp of the requirements of case writers and the capability of extracting the public cases.
Test cases are test methods used to verify whether a system or software meets a particular requirement. It is a set of inputs and expected results that are used to determine the detailed requirements of the test in order to conduct the test and verify the behavior of the system or software. The test cases are the core of the test plan and are also the basis for test execution.
The test cases and the common test cases are contained relations. A common test case is a set of generic test cases that can be referenced by a number of different test modules or test function points. These generic test cases typically contain elements of test environments, operational steps, test data, expected results, etc., and are organized into separate sub-case libraries for reference and execution when testing the individual functional sub-modules. The test cases are test schemes for specific functions or behaviors, and are used for verifying whether the system or the software meets specific requirements. They typically include input, expected output, and execution steps to determine the detailed requirements of the test in order to perform the test and verify the behavior of the system or software.
Embodiments of the application are described in further detail below with reference to the drawings.
The embodiment of the application provides a method for determining a public test case, which is executed by electronic equipment, wherein the electronic equipment can be a server or terminal equipment, and the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server for providing cloud computing service. The terminal device may be a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like, but is not limited thereto, and the terminal device and the server may be directly or indirectly connected through a wired or wireless communication manner, as shown in fig. 1, the method includes steps S101 to S104, where:
Step S101: a plurality of single test cases are obtained, wherein the single test cases characterize available test cases for a single function of the software.
A single test case includes steps that can constitute a flow with a unique purpose. For example, opening a browser, entering a login page, inputting a correct user name and password, clicking a login button, and verifying that login is successful is a single test case, and opening a browser, entering a login page, inputting a wrong user name and password, clicking a login button, and verifying that login is failed is another single test case.
Step S102: step extraction is carried out on each single test case, and a step list corresponding to each single test case is obtained.
The step list comprises a plurality of specific steps arranged in a flow sequence, and the flow sequence characterizes the sequence among the steps.
Step S103: and carrying out repeated step identification based on the step list corresponding to each of the plurality of single test cases to obtain a repeated step list.
Wherein the repeating step list includes a plurality of repeating steps arranged in a flow order.
Step S104: and obtaining the common test case according to the repeated step list.
In the embodiment of the application, a plurality of single test cases are acquired to determine a plurality of available test cases aiming at a single function of software; step extraction is carried out on each single test case to obtain a step list corresponding to each single test case so as to determine all steps included in each single test case; compared with the prior art, the method has the advantages that longer time is consumed from the start of collecting product information to the end of writing the common test cases, the method is used for carrying out repeated step identification based on the step lists corresponding to the single test cases, and after the repeated step list is obtained, the common test cases are obtained according to the repeated step list, namely the common test cases aiming at the software function are directly extracted from the existing single test cases, so that the time consumption is shorter.
Step S104, according to a repeated step list, may be a possible implementation manner of the embodiment of the present application, where the obtaining a common test case specifically includes:
Obtaining a common test case template based on the repeated step list;
determining a plurality of template variables based on step lists corresponding to the single test cases;
And combining the common test case template with a plurality of template variables to obtain the common test case.
Specifically, performing action extraction on each repeated step in the repeated step list to obtain a common test case template only comprising actions, wherein a common test case target comprises a plurality of action groups, each action group corresponds to a unique repeated step, and each action group comprises at least one action; extracting association parameters between similar steps corresponding to each repeated step based on a step list corresponding to each single test case, wherein the association parameters characterize different characteristics of the correlation between similar steps of different single test cases, for example, "inputting a correct password" and "inputting an incorrect password" are similar steps, and "correct password" and "incorrect password" are different characteristics of the correlation between similar steps, namely "correct password" and "incorrect password" are association parameters; for each repetition step, determining a data name corresponding to the association parameter corresponding to the repetition step, wherein the data name is the name of the data type to which the association parameter belongs, and the data type can be a password, an account number and other data types; taking the data name corresponding to the repeated step as the template variable corresponding to the repeated step to obtain a plurality of template variables; combining an action group corresponding to the repeated step and a template variable corresponding to the repeated step which are included in the common test case template aiming at each repeated step to obtain a step expression corresponding to the repeated step; and combining the step expressions corresponding to all the repeated steps in the sequence of the repeated step list to obtain the common test case.
After the common test case template is combined with the plurality of template variables to obtain the common test case, the method can further comprise: and acquiring a test requirement, and changing a template variable in the common test case based on the test requirement to obtain the available test case.
In the embodiment of the application, after a common test case template is obtained based on a repeated step list, a plurality of template variables are determined based on the step list corresponding to each of a plurality of single test cases so as to determine the differences of the test cases when facing different single functions; based on the differences among the test cases, the common test case templates are improved, so that the common test cases which can be used for different single functions are obtained.
In one possible implementation manner of the embodiment of the present application, the step list includes a plurality of specific steps, step S103, and the step list obtained by performing repeated step identification based on the step list corresponding to each of the plurality of single test cases may specifically include:
Determining a plurality of parallel associated step group stacks based on the whole step list, wherein the parallel associated step group stacks comprise at least one parallel associated step group with the same execution sequence;
determining the number of steps respectively included in at least one association step group in the parallel association step group stacks aiming at each parallel association step group stack;
taking the association step group corresponding to the maximum step number as a target association step group;
the repeated steps are obtained based on the set of target associated steps to determine a list of repeated steps.
Obtaining the repeated steps based on the target association step group to determine a repeated step list, which may specifically include: extracting action features from the target association step group, and arranging all the action features based on semantic analysis to obtain each repeated step, thereby obtaining a repeated step list comprising a plurality of repeated steps.
In the embodiment of the application, a plurality of associated step group stacks are determined based on all step lists so as to obtain specific steps corresponding to a plurality of single test cases with the same execution sequence; and determining the steps with higher occurrence frequency as the steps in the common test case by determining the number of the steps respectively included in at least one associated step group in the parallel associated step group stack.
One possible implementation manner of the embodiment of the present application, based on the whole step list, determines a plurality of parallel association step group stacks, which specifically may include:
performing transverse association analysis on all the step lists to determine a plurality of association step groups;
and determining the execution order corresponding to each of the plurality of associated step groups, and determining a plurality of parallel associated step group stacks, wherein the parallel associated step group stacks comprise at least one associated step group with the same execution order.
Specifically, determining the number of steps corresponding to each step list, and taking the step list corresponding to the minimum number of steps as a reference step list, wherein each step in the reference step list is a reference step; for each reference step, extracting actions from the reference step to obtain a reference action group corresponding to the reference step, wherein the reference action group comprises at least one reference action; for the same reference step, determining a plurality of initial association step groups corresponding to the reference step from each remaining step list, wherein the initial association step groups comprise at least one initial association step, each initial association step group corresponds to a unique remaining step list, the remaining step list is a step list except the reference step list in all step lists, and the initial association step comprises at least one reference action in a reference action group corresponding to the reference step; it should be noted that, if the reference step does not have the corresponding initial association step, default the initial association step group corresponding to the reference step to be empty; the reference step and the initial association step group corresponding to the reference step are used as the association step group corresponding to the reference step; determining the execution order of the reference step in the reference step list, and taking the execution order as the execution order of each associated step group corresponding to the reference step; and taking the key step groups with the same execution order as parallel key step group stacks.
In the embodiment of the application, transverse association analysis is carried out on all step lists, a plurality of association step groups are determined, and specific steps with similar execution content are determined as association steps in the same association step group; the method and the device have the advantages that the execution sequence corresponding to each of the plurality of associated step groups is determined, a plurality of parallel associated step group stacks are determined, the comparison of occurrence frequency of steps with far execution sequences is avoided, and the accuracy of the determined public test case is high.
One possible implementation manner of the embodiment of the present application obtains the repeated steps based on the target parallel association step group, which specifically may include:
extracting at least one repetitive action from the target association step group;
and combining at least one repeated action through semantic analysis to obtain repeated steps corresponding to the target parallel association step group.
In the embodiment of the application, repeated actions are extracted from the target association step group to determine the action with higher occurrence frequency; and combining at least one repeated action through semantic analysis to obtain repeated steps corresponding to the target association step group, so as to avoid that the obtained repeated steps do not conform to the conventional method.
Step S102, in one possible implementation manner of the embodiment of the present application, performs step extraction on each single test case to obtain a step list corresponding to each single test case, which may specifically include:
Determining a plurality of initial steps included in the single test case for each single test case;
Determining the epitaxial relationship between every two initial steps; and screening at least one secondary step out of the plurality of initial steps based on the overall epitaxial relationship to determine a plurality of primary steps;
and determining the main steps as a step list corresponding to the single test case.
Wherein the epitaxial relationship is that the epitaxial relationship comprises or is parallel, the secondary step is a first step, and the primary step is a second step.
In the embodiment of the application, a plurality of initial steps included in a single test case are determined for each single test case so as to initialize the data of the content of the single test case; obtaining whether the initial steps are included or juxtaposed by determining the epitaxial relation between every two initial steps; based on the whole epitaxial relation, in a plurality of initial steps, a plurality of main steps are determined by screening out at least one secondary step, and a single test case is simplified, so that the same action is prevented from being executed twice in a generalized mode and a detailed mode.
In one possible implementation manner of the embodiment of the present application, step S101, obtaining a plurality of single test cases may specifically include:
Acquiring a target test function identifier;
and determining a plurality of single test cases corresponding to the target test function identifier in the corresponding relation between the preset test function identifier and the test cases.
In the embodiment of the application, after the target test function identifier is obtained, a plurality of single test cases corresponding to the target test function identifier are determined in the corresponding relation between the preset test function identifier and the test cases, so as to obtain the single test cases with more pertinence.
The above embodiment describes a method for determining a common test case from the viewpoint of a method flow, and the following embodiment describes a device for determining a common test case from the viewpoint of a virtual module or a virtual unit, and specifically, the following embodiment is described below.
The embodiment of the application provides a device for determining a common test case, as shown in fig. 2, which specifically comprises the following steps:
a single test case acquisition module 201, configured to acquire a plurality of single test cases, where the single test cases represent available test cases for a single function of the software;
The step list determining module 202 is configured to perform step extraction on each single test case to obtain a step list corresponding to each single test case;
the repeated step list determining module 203 is configured to perform repeated step identification based on step lists corresponding to each of the plurality of single test cases, so as to obtain a repeated step list;
and the common test case generating module 204 is configured to obtain a common test case according to the repeated step list.
In one possible implementation manner of the embodiment of the present application, the common test case generating module 204 is specifically configured to:
Obtaining a common test case template based on the repeated step list;
determining a plurality of template variables based on step lists corresponding to the single test cases;
And combining the common test case template with a plurality of template variables to obtain the common test case.
In one possible implementation manner of the embodiment of the present application, the step list includes a plurality of specific steps, and the step list repeating determination module 203 is specifically configured to, when executing the step list corresponding to each of the plurality of single test cases, perform step repeating identification to obtain the step repeating list:
Determining a plurality of parallel associated step group stacks based on the whole step list, wherein the parallel associated step group stacks comprise at least one parallel associated step group with the same execution sequence;
determining the number of steps respectively included in at least one association step group in the parallel association step group stacks aiming at each parallel association step group stack;
taking the association step group corresponding to the maximum step number as a target association step group;
the repeated steps are obtained based on the set of target associated steps to determine a list of repeated steps.
In one possible implementation manner of the embodiment of the present application, the repeat step list determining module 203 is specifically configured to, when executing determining a plurality of parallel association step group stacks based on the overall step list:
performing transverse association analysis on all the step lists to determine a plurality of association step groups;
and determining the execution order corresponding to each of the plurality of associated step groups, and determining a plurality of parallel associated step group stacks, wherein the parallel associated step group stacks comprise at least one associated step group with the same execution order.
In one possible implementation manner of the embodiment of the present application, the repeat step list determining module 203 is specifically configured to, when executing the repeat step obtained based on the target association step group:
extracting at least one repetitive action from the target association step group;
And combining at least one repeated action through semantic analysis to obtain repeated steps corresponding to the target association step group.
In one possible implementation manner of the embodiment of the present application, the step list determining module 202 is specifically configured to, when executing step extraction on each single test case to obtain a step list corresponding to each single test case:
Determining a plurality of initial steps included in the single test case for each single test case;
Determining the epitaxial relationship between every two initial steps; and screening at least one secondary step out of the plurality of initial steps based on the overall epitaxial relationship to determine a plurality of primary steps;
and determining the main steps as a step list corresponding to the single test case.
In one possible implementation manner of the embodiment of the present application, the single test case obtaining module 201 is specifically configured to:
Acquiring a target test function identifier;
and determining a plurality of single test cases corresponding to the target test function identifier in the corresponding relation between the preset test function identifier and the test cases.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, a specific working process of the above-described common test case determining apparatus may refer to a corresponding process in the foregoing method embodiment, which is not described herein again.
In an embodiment of the present application, as shown in fig. 3, an electronic device shown in fig. 3 includes: a processor 301 and a memory 303. Wherein the processor 301 is coupled to the memory 303, such as via a bus 302. Optionally, the electronic device may also include a transceiver 304. It should be noted that, in practical applications, the transceiver 304 is not limited to one, and the structure of the electronic device is not limited to the embodiment of the present application.
The Processor 301 may be a CPU (Central Processing Unit ), general purpose Processor, DSP (DIGITAL SIGNAL Processor, data signal Processor), ASIC (Application SPECIFIC INTEGRATED Circuit), FPGA (Field Programmable GATE ARRAY ) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules and circuits described in connection with this disclosure. Processor 301 may also be a combination that implements computing functionality, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
Bus 302 may include a path to transfer information between the components. Bus 302 may be a PCI (PERIPHERAL COMPONENT INTERCONNECT, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. Bus 302 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 3, but not only one bus or type of bus.
The Memory 303 may be, but is not limited to, a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, an EEPROM (ELECTRICALLY ERASABLE PROGRAMMABLE READ ONLY MEMORY ), a CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 303 is used for storing application program codes for executing the inventive arrangements and is controlled to be executed by the processor 301. The processor 301 is configured to execute the application code stored in the memory 303 to implement what is shown in the foregoing method embodiments.
Among them, electronic devices include, but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. But may also be a server or the like. The electronic device shown in fig. 3 is only an example and should not be construed as limiting the functionality and scope of use of the embodiments of the application.
Embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which when run on a computer, causes the computer to perform the corresponding method embodiments described above. Compared with the related art, the embodiment of the application acquires a plurality of single test cases to determine a plurality of available test cases aiming at a single function of software; step extraction is carried out on each single test case to obtain a step list corresponding to each single test case so as to determine all steps included in each single test case; compared with the prior art, the method has the advantages that longer time is consumed from the start of collecting product information to the end of writing the common test cases, the method is used for carrying out repeated step identification based on the step lists corresponding to the single test cases, and after the repeated step list is obtained, the common test cases are obtained according to the repeated step list, namely the common test cases aiming at the software function are directly extracted from the existing single test cases, so that the time consumption is shorter.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present application, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present application, and such modifications and adaptations should and are intended to be comprehended within the scope of the present application.
Claims (7)
1. The utility test case determining method is characterized by comprising the following steps:
obtaining a plurality of single test cases, wherein the single test cases represent available test cases aiming at a single function of software;
step extraction is carried out on each single test case, and a step list corresponding to each single test case is obtained;
based on the step list corresponding to each of the plurality of single test cases, performing repeated step identification to obtain a repeated step list;
Obtaining a common test case according to the repeated step list;
The step list includes a plurality of specific steps, and the step list obtained by performing repeated step identification based on the step list corresponding to each of the plurality of single test cases includes:
Determining a plurality of parallel association step group stacks based on all the step lists, wherein the parallel association step group stacks comprise at least one parallel association step group with the same execution sequence; determining the number of steps respectively included in the at least one associated step group in the parallel associated step group pile for each parallel associated step group pile; taking the parallel association step group corresponding to the largest step number as a target parallel association step group; obtaining repeated steps based on the target parallel association step group so as to determine the repeated step list;
Wherein determining a plurality of parallel association step group stacks based on all of the step lists comprises: performing transverse association analysis on all the step lists to determine a plurality of association step groups; determining the execution order corresponding to each of the plurality of association step groups, and determining a plurality of parallel association step group stacks, wherein the parallel association step group stacks comprise at least one association step group with the same execution order;
Wherein, based on the target parallel association step group, the repeated steps are obtained, including: extracting at least one repetitive action from the target parallel association step group; and combining the at least one repeated action through semantic analysis to obtain the repeated steps corresponding to the target parallel association step group.
2. The method for determining a common test case according to claim 1, wherein obtaining the common test case according to the repeated step list comprises:
Obtaining a common test case template based on the repeated step list;
Determining a plurality of template variables based on the step list corresponding to each of the plurality of single test cases;
and combining the common test case template with the plurality of template variables to obtain the common test case.
3. The method for determining a common test case according to claim 1, wherein the step extracting each single test case to obtain a step list corresponding to each single test case comprises:
determining a plurality of initial steps included in the single test case aiming at each single test case;
determining the epitaxial relation between every two initial steps; and screening at least one first step out of said plurality of initial steps based on all of said epitaxial relationships to determine a plurality of second steps;
and determining the plurality of second steps as a step list corresponding to the single test case.
4. The method for determining a common test case according to claim 1, wherein obtaining a plurality of single test cases comprises:
Acquiring a target test function identifier;
and determining the plurality of single test cases corresponding to the target test function identifier in the corresponding relation between the preset test function identifier and the test cases.
5. A common test case determination apparatus, comprising:
the system comprises a single test case acquisition module, a software module and a software module, wherein the single test case acquisition module is used for acquiring a plurality of single test cases, and the single test cases represent available test cases aiming at a single function of the software;
the step list determining module is used for extracting the steps of each single test case to obtain a step list corresponding to each single test case;
The repeated step list determining module is used for carrying out repeated step identification based on the step list corresponding to each of the plurality of single test cases to obtain a repeated step list;
The common test case generation module is used for obtaining a common test case according to the repeated step list;
the step list comprises a plurality of specific steps, and the repeated step list determining module is specifically configured to, when performing repeated step identification based on the step lists corresponding to the plurality of single test cases, obtain a repeated step list:
Determining a plurality of parallel association step group stacks based on all the step lists, wherein the parallel association step group stacks comprise at least one parallel association step group with the same execution sequence; determining the number of steps respectively included in the at least one associated step group in the parallel associated step group pile for each parallel associated step group pile; taking the parallel association step group corresponding to the largest step number as a target parallel association step group; obtaining repeated steps based on the target parallel association step group so as to determine the repeated step list;
Wherein determining a plurality of parallel association step group stacks based on all of the step lists comprises: performing transverse association analysis on all the step lists to determine a plurality of association step groups; determining the execution order corresponding to each of the plurality of association step groups, and determining a plurality of parallel association step group stacks, wherein the parallel association step group stacks comprise at least one association step group with the same execution order;
Wherein, based on the target parallel association step group, the repeated steps are obtained, including: extracting at least one repetitive action from the target parallel association step group; and combining the at least one repeated action through semantic analysis to obtain the repeated steps corresponding to the target parallel association step group.
6. An electronic device, comprising:
at least one processor;
A memory;
At least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, the at least one application program configured to: the method for determining a common test case according to any one of claims 1 to 4 is performed.
7. A computer-readable storage medium, having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of determining a common test case according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410040555.2A CN117555813B (en) | 2024-01-11 | 2024-01-11 | Method, device, equipment and medium for determining common test case |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410040555.2A CN117555813B (en) | 2024-01-11 | 2024-01-11 | Method, device, equipment and medium for determining common test case |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117555813A CN117555813A (en) | 2024-02-13 |
CN117555813B true CN117555813B (en) | 2024-05-14 |
Family
ID=89815123
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410040555.2A Active CN117555813B (en) | 2024-01-11 | 2024-01-11 | Method, device, equipment and medium for determining common test case |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117555813B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113434436A (en) * | 2021-07-30 | 2021-09-24 | 拉扎斯网络科技(上海)有限公司 | Test case generation method and device, electronic equipment and storage medium |
CN113760747A (en) * | 2021-06-03 | 2021-12-07 | 京东科技控股股份有限公司 | Software testing method, device, equipment, storage medium and program product |
CN114116449A (en) * | 2021-10-25 | 2022-03-01 | 合众新能源汽车有限公司 | Automatic test case parameterization method and device and electronic equipment |
CN114745749A (en) * | 2022-04-24 | 2022-07-12 | 湖南亚信安慧科技有限公司 | Virtual network element testing method and device, electronic equipment and readable storage medium |
CN116467171A (en) * | 2023-03-14 | 2023-07-21 | 海宁奕斯伟集成电路设计有限公司 | Automatic test case construction device, method, electronic equipment and storage medium |
CN117290236A (en) * | 2023-10-08 | 2023-12-26 | 金蝶软件(中国)有限公司 | Software testing method, device, computer equipment and computer readable storage medium |
-
2024
- 2024-01-11 CN CN202410040555.2A patent/CN117555813B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760747A (en) * | 2021-06-03 | 2021-12-07 | 京东科技控股股份有限公司 | Software testing method, device, equipment, storage medium and program product |
CN113434436A (en) * | 2021-07-30 | 2021-09-24 | 拉扎斯网络科技(上海)有限公司 | Test case generation method and device, electronic equipment and storage medium |
CN114116449A (en) * | 2021-10-25 | 2022-03-01 | 合众新能源汽车有限公司 | Automatic test case parameterization method and device and electronic equipment |
CN114745749A (en) * | 2022-04-24 | 2022-07-12 | 湖南亚信安慧科技有限公司 | Virtual network element testing method and device, electronic equipment and readable storage medium |
CN116467171A (en) * | 2023-03-14 | 2023-07-21 | 海宁奕斯伟集成电路设计有限公司 | Automatic test case construction device, method, electronic equipment and storage medium |
CN117290236A (en) * | 2023-10-08 | 2023-12-26 | 金蝶软件(中国)有限公司 | Software testing method, device, computer equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN117555813A (en) | 2024-02-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108984389B (en) | Application program testing method and terminal equipment | |
EP3563243B1 (en) | Determining application test results using screenshot metadata | |
CN110474900B (en) | Game protocol testing method and device | |
Lei et al. | How test suites impact fault localisation starting from the size | |
CN109783346B (en) | Keyword-driven automatic testing method and device and terminal equipment | |
CN111475494A (en) | Mass data processing method, system, terminal and storage medium | |
CN111338958A (en) | Parameter generation method and device of test case and terminal equipment | |
CN110688111A (en) | Configuration method, device, server and storage medium of business process | |
CN113656354A (en) | Log classification method, system, computer device and readable storage medium | |
CN117555813B (en) | Method, device, equipment and medium for determining common test case | |
CN116016692A (en) | Protocol description text construction method, device, equipment and storage medium | |
CN115080552A (en) | Data quality evaluation method, device, equipment and computer readable storage medium | |
CN114969641A (en) | Nuclear data processing method, electronic device and computer readable storage medium | |
CN113806737A (en) | Malicious process risk level evaluation method, terminal device and storage medium | |
CN112559331A (en) | Test method and device | |
CN114443375A (en) | Test method and device, electronic device and computer readable storage medium | |
CN112433932B (en) | Data processing method and device and computer storage medium | |
CN106528577B (en) | Method and device for setting file to be cleaned | |
CN105988917A (en) | Method and device for obtaining abnormal information | |
CN117851608B (en) | Case map generation method, device, equipment and medium | |
CN109726049A (en) | A kind of data checking, device and electronic equipment | |
CN116302925A (en) | Automatic test method, device, electronic equipment and readable storage medium | |
CN118349469A (en) | Method, device, equipment and storage medium for generating test cases | |
CN118013936A (en) | Method, device, equipment and medium for unified data structure of overseas house source data | |
CN118075180A (en) | Game protocol testing method, system and equipment |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |