CN117632748A - Method and device for determining smoke emission test case, electronic equipment and storage medium - Google Patents

Method and device for determining smoke emission test case, electronic equipment and storage medium Download PDF

Info

Publication number
CN117632748A
CN117632748A CN202311661564.5A CN202311661564A CN117632748A CN 117632748 A CN117632748 A CN 117632748A CN 202311661564 A CN202311661564 A CN 202311661564A CN 117632748 A CN117632748 A CN 117632748A
Authority
CN
China
Prior art keywords
task
test case
determining
tasks
case
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
CN202311661564.5A
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202311661564.5A priority Critical patent/CN117632748A/en
Publication of CN117632748A publication Critical patent/CN117632748A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a method and a device for determining a smoke emission test case, electronic equipment and a storage medium, and relates to the technical field of testing, wherein the method comprises the following steps: determining functional flow information of a function to be tested, wherein the functional flow information comprises a starting task, a terminating task, at least two judging tasks and at least two negative tasks, and the negative tasks correspond to the judging tasks one by one; determining at least three candidate test cases based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks; and determining the smoke test cases of the function to be tested based on at least three candidate test cases. According to the technical scheme, tasks of the function to be tested can be connected in series according to the preset task determination rule, candidate test cases are determined according to the serial connection result, and the smoke emission test cases which cover all the tasks and have the smallest task quantity can be obtained, so that the test efficiency is improved, and the test resources are saved.

Description

Method and device for determining smoke emission test case, electronic equipment and storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a method and apparatus for determining a smoke emission test case, an electronic device, and a storage medium.
Background
The smoking test is a basic functional verifiability test performed before the software application/system performs formal test work, and is used for checking whether the basic function/main business flow of the software application/system is correct, and once the basic function/main business flow has faults, the software application/system is considered to have functional defects and needs to be developed again, so that unnecessary test work by a tester can be effectively avoided, and the selection mode of the smoking test case is a problem which is concerned by the tested person.
Currently, the smoke test cases are determined by a tester based on the influencing factors of the basic functions/main business processes of the software application/system, for example, the tester determines the functions/business processes to be tested, screens test coverage items of the functions/business processes to be tested, and determines the smoke test cases according to the arrangement and combination results of the test coverage items. However, the number of smoking test cases determined based on the arrangement and combination result of each test coverage item is large, and a large number of redundant test cases (test cases with the same test purpose) exist, which seriously affects the test efficiency of the smoking test.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a storage medium for determining a smoke emission test case, and aims to obtain the smoke emission test case which covers all tasks of a function to be tested and has the minimum task amount, so that the test efficiency is improved, and the test resources are saved.
According to an aspect of the present invention, there is provided a method of determining a smoke test case, the method comprising:
determining functional flow information of a function to be tested, wherein the functional flow information comprises a starting task, a terminating task, at least two judging tasks and at least two negative tasks, and the negative tasks correspond to the judging tasks one by one;
determining at least three candidate test cases based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks;
and determining the smoke test cases of the function to be tested based on at least three candidate test cases.
Optionally, the negative task includes a first case generation identifier, the termination task includes a second case generation identifier, the task determination rule includes a task selection rule and a case generation rule, the task selection rule is a target task corresponding to the current task based on task priority, and the case generation rule determines candidate test cases based on each historical task when the first case generation identifier or the second case generation identifier is detected; the target task is the task with the highest priority among the tasks to be executed corresponding to the current task.
Optionally, the judging task includes an acquiring node, a negating node and a affirming node, the negating node is connected with the negating task, the acquiring node is connected with the starting task or the judging task, and the affirming node is connected with the judging task or the ending task; wherein the priority of the task connected by the non-covered negative node is higher than the priority of the task connected by the positive node, and the priority of the task connected by the covered negative node is lower than the priority of the task connected by the positive node.
Optionally, determining the candidate test case based on a preset task determination rule, a start task, a stop task, at least two judgment tasks and at least two negative tasks includes: determining the starting task as a current task; updating the current task based on the target task corresponding to the current task; determining whether the updated current task contains a first user generation identifier or a second user generation identifier; if the current task comprises a first case generation identifier or a second case generation identifier, determining candidate test cases based on historical information of the current task; and if the current task does not contain the first case generation identifier and the second case generation identifier, executing the step of updating the current task based on the target task corresponding to the current task.
Optionally, the candidate test cases include a first type of candidate test case and a second type of candidate test case, where the first type of candidate test case includes a start task, a negative task and at least one judgment task, and the second type of candidate test case includes a start task, a termination task and at least one judgment task.
Optionally, the candidate test cases include a termination candidate test case, where the termination candidate test case is a candidate test case carrying a second case generation identifier.
Optionally, determining the smoke test case of the function to be tested based on at least three candidate test cases includes: determining the priority of each candidate test case based on the generation time of each candidate test case; determining whether the test case to be tested is a termination candidate test case, wherein the test case to be tested is the test case with the highest priority in the candidate test cases which are not tested; if the test case to be tested is the termination candidate test case, determining a smoke test case based on the history information of the test case to be tested; if the test case to be tested is not the termination candidate test case, updating the test case to be tested, and executing the step of determining whether the test case to be tested is the termination candidate test case.
According to another aspect of the present invention, there is provided a device for determining a smoke test case, which is used for implementing a method for determining a smoke test case in an embodiment of the present invention, the device including:
the system comprises an acquisition module, a test module and a test module, wherein the acquisition module is used for determining functional flow information of a function to be tested, and the functional flow information comprises a starting task, a terminating task, at least two judging tasks and at least two negative tasks, wherein the negative tasks correspond to the judging tasks one by one;
the determining module is used for determining at least three candidate test cases based on a preset task determining rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks;
and the execution module is used for determining the smoke emission test cases of the functions to be tested based on at least three candidate test cases.
According to another aspect of the present invention, there is provided an electronic device including:
at least one processor; and a memory communicatively coupled to the at least one processor;
the memory stores a computer program executable by the at least one processor, so that the at least one processor can execute the method for determining the smoke emission test case according to any embodiment of the invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the method for determining a smoke test case according to any one of the embodiments of the present invention when executed.
According to the technical scheme, function flow information of the function to be tested is determined, wherein the function flow information comprises a starting task, a terminating task, at least two judging tasks and at least two negative tasks, and the negative tasks correspond to the judging tasks one by one; determining at least three candidate test cases based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks; and determining the smoke test cases of the function to be tested based on at least three candidate test cases. According to the invention, each task of the function to be tested can be connected in series according to the preset task determination rule, and the candidate test cases are determined according to the serial result, so that the smoke emission test cases which cover all the tasks and have the minimum task amount can be obtained, the test efficiency is improved, and the test resources are saved. The method solves the problems that the number of the smoking test cases determined based on the arrangement and combination results of the test coverage items is large, a large number of redundant test cases exist, the test efficiency of the smoking test is affected, and the like.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for determining a smoke test case according to a first embodiment of the present invention;
fig. 2 is a flow chart of a method for determining a smoke emission test case according to a second embodiment of the present invention;
fig. 3 is a schematic diagram of a functional flow information provided in the second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a determining device for a smoke emission test case according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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 1
Fig. 1 is a flow chart of a method for determining a smoke test case according to a first embodiment of the present invention, where the embodiment is applicable to determining a case of a comprehensive and simple smoke test case, and the method may be performed by a device for determining a smoke test case according to the present invention, where the device may be implemented in a form of hardware and/or software, and in a specific embodiment, the device may be integrated in an electronic device. The following embodiment will be described taking the example of the integration of the apparatus in an electronic device, and referring to fig. 1, the method specifically includes the following steps:
s101, determining function flow information of a function to be tested.
The test in the invention essentially refers to a verifiability test (smoke test) of the software application/system before the formal test work is performed, the function to be tested is generally a basic function or a main business flow of the software application/system, including login, registration, basic business, exit and the like, and the function flow information can be understood as a function flow chart of the function to be tested, wherein the function flow chart comprises a plurality of coverage items corresponding to the function to be tested and connection relations and sequence among the coverage items.
Specifically, the functional flow information includes a start task, a stop task, at least two judging tasks and at least two negative tasks, where the start task may be understood as a start coverage item (i.e., first flow data in the functional flow chart) in the functional flow chart of the function to be tested, the stop task may be understood as an end coverage item (i.e., last flow data in the functional flow chart) in the functional flow chart of the function to be tested, the judging task may be understood as a judging coverage item (i.e., flow data in a judging box in the functional flow chart) in the functional flow chart of the function to be tested, and the negative task may be understood as a coverage item (i.e., flow data corresponding to a negative branch of the judging box in the functional flow chart) corresponding to a negative node of the judging coverage item in the functional flow chart of the function to be tested.
It should be noted that the negative task is only connected to the negative branch of the judging task, so that the negative task corresponds to the judging task one by one.
For example, determining the functional flow information of the function to be tested may be understood as determining the function to be tested and the corresponding flow chart thereof, so as to analyze each task of the function to be tested and comb the sequential execution sequence of each task.
S102, determining at least three candidate test cases based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks.
A test case can be understood as a series result of a plurality of coverage items (tasks in the invention), and the test cases composed of coverage items with different series sequences and different coverage items are different.
The preset task determination rule may be understood as a determination manner of a serial order of each task and the number of tasks, and the candidate test case may be understood as a task serial result that is carded out from the flow chart of the function to be tested based on the preset task determination rule.
The trend of the negative branches of the judging tasks can determine a test case, the positive branches of the middle judging task can be directly or indirectly connected with the next judging task, and the positive branches and the negative branches of the last judging task can both determine the test cases, so that the number of candidate test cases is equal to the number of judging tasks plus one, and the number of judging tasks of the application is at least two, therefore, the number of candidate test cases of the application is at least three. However, each candidate test case determined by the application can ensure that all branch flows of the flow chart are covered at least once, namely all data of the flow chart can be covered, and the collected data is comprehensive.
Illustratively, determining at least three candidate test cases based on a preset task determination rule, a start task, a stop task, at least two determination tasks, and at least two negative tasks may be understood as determining at least three serial results (candidate test cases) of the start task, the stop task, the at least two determination tasks, and the at least two negative tasks based on a preset task determination rule.
The advantage of this arrangement is that the test cases containing all the flow tasks of the function to be tested can be determined in a targeted manner, so that the comprehensiveness and accuracy of the smoking test can be ensured.
S103, determining a smoke test case of the function to be tested based on at least three candidate test cases.
The smoke test cases can be understood as the integration result of each candidate test case. Specifically, the smoke test case is a collection of at least three candidate test cases.
The candidate test cases are assumed to include a candidate test case 1, a candidate test case 2 and a candidate test case 3, wherein the candidate test case 1 is a test case a, the candidate test case 2 is a test case B, the candidate test case 3 is a test case C, and the smoking test case is a test case set consisting of the test case a, the test case B and the test case C.
According to the technical scheme, function flow information of a function to be tested is determined, wherein the function flow information comprises a starting task, a terminating task, at least two judging tasks and at least two negative tasks, and the negative tasks correspond to the judging tasks one by one; determining at least three candidate test cases based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks; and determining the smoke test cases of the function to be tested based on at least three candidate test cases. According to the invention, each task of the function to be tested can be connected in series according to the preset task determination rule, and the candidate test cases are determined according to the serial result, so that the smoke emission test cases which cover all the tasks and have the minimum task amount can be obtained, the test efficiency is improved, and the test resources are saved. The method solves the problems that the number of the smoking test cases determined based on the arrangement and combination results of the test coverage items is large, a large number of redundant test cases exist, the test efficiency of the smoking test is affected, and the like.
Example two
Fig. 2 is a flow chart of a method for determining a smoke test case according to a second embodiment of the present invention, where the present embodiment is applicable to determining a case of a comprehensive and simple smoke test case, and the method may be performed by a device for determining a smoke test case according to the present invention, where the device may be implemented in a form of hardware and/or software, and in a specific embodiment, the device may be integrated in an electronic device. The following embodiment will be described taking the example of the integration of the device in an electronic apparatus, and referring to fig. 2, the method specifically includes the following steps:
S201, determining function flow information of the function to be tested.
In this embodiment, the function to be tested may be understood as a function to be tested in a software system/application, which is generally a basic function or a main service flow of the software system/application, including login, registration, basic service, exit, and the like, and the function flow information may be understood as a function flow chart of the function to be tested, where the function flow chart includes a plurality of coverage items corresponding to the function to be tested and a connection relationship and a sequence between the plurality of coverage items. Specifically, the functional flow information includes a start task, a stop task, at least two judging tasks and at least two negative tasks, where the start task may be understood as a start coverage item in a functional flow chart of the function to be tested, the stop task may be understood as an end coverage item in the functional flow chart of the function to be tested, the judging tasks may be understood as a judging coverage item in the functional flow chart of the function to be tested, and the negative tasks may be understood as coverage items corresponding to negative nodes of the judging coverage item in the functional flow chart of the function to be tested.
Further, the negative task comprises a first case generation identifier, the termination task comprises a second case generation identifier, the task determination rule comprises a task selection rule and a case generation rule, the task selection rule is used for determining a target task corresponding to the current task based on task priority, and the case generation rule is used for determining candidate test cases based on each historical task when the first case generation identifier or the second case generation identifier is detected; the target task is the task with the highest priority among the tasks to be executed corresponding to the current task.
The first case generation identifier and the second case generation identifier are indicative information determined by the case, and when the first case generation identifier or the second case generation identifier is detected, the tasks which flow through can be strung together to generate a test case; the process of tandem connection of use cases is dynamic, the current task can be understood as the process of tandem connection currently in the flow chart, and the target task can be understood as the process of tandem connection needed next in the flow chart. If the current task corresponds to only one task, the corresponding task is directly determined to be the target task, and if the current task corresponds to a plurality of tasks, the priority of the corresponding task is required to be determined, and the target task is determined according to the priority of each task.
The judging task comprises an acquiring node, a negating node and a affirming node, wherein the negating node is connected with the negating task, the acquiring node is connected with the starting task or the judging task, and the affirming node is connected with the judging task or the ending task. It is noted that the priority of the task of the uncovered negative node connection is higher than the priority of the task of the positive node connection, and the priority of the task of the covered negative node connection is lower than the priority of the task of the positive node connection. Specifically, when the task is judged to be the current task, if the negative node is not covered, the target task is the negative task corresponding to the negative node, and if the negative node is covered, the target task is the task corresponding to the positive node.
Fig. 3 is a schematic diagram of functional flow information provided in the second embodiment of the present invention, in fig. 3, A1, B1, C1, B2, C2, B3, C3, and A2 each represent a task/flow of a function to be tested, N represents negation, Y represents affirmation, where A1 represents a start task, B1 represents a first judgment task, C1 represents a first negation task, B2 represents a second judgment task, C2 represents a second negation task, B3 represents a third judgment task, C3 represents a third negation task, A2 represents a termination task, an arrow flowing to the judgment task represents an acquisition node, an N node flowing out of the judgment task represents a negation node, and a Y node flowing out of the judgment task represents an affirmative node.
The present invention may further include an intermediate task, which may be located between two judgment tasks, between a start task and a judgment task, or between a judgment task and a stop task, which is not limited in this embodiment.
S202, determining at least three candidate test cases based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks.
The preset task determination rule may be understood as a determination manner of a serial order of each task and the number of tasks, and the candidate test case may be understood as a task serial result that is carded out from the flow chart of the function to be tested based on the preset task determination rule. The trend of the negative branch of the judging task can determine a test case, the positive branch of the middle judging task can be directly or indirectly connected with the next judging task, and the positive branch and the negative branch of the last judging task can both determine the test case. The candidate test cases include a first type of candidate test case and a second type of candidate test case, where the first type of candidate test case may be understood as a test case determined by a negative branch of the determination task (a test case determined based on the first case generation identifier), including a start task, a negative task, and at least one determination task, and the second type of candidate test case may be understood as a test case determined by a positive branch of the determination task (a test case determined based on the second case generation identifier), including a start task, a termination task, and at least one determination task.
Specifically, the candidate test cases include a termination candidate test case, where the termination candidate test case is a candidate test case carrying a second case generation identifier, that is, a second type candidate test case including a start task, a termination task, and at least one judgment task.
For any one candidate test case, determining the candidate test case based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks, wherein the method specifically comprises the following steps: determining the starting task as a current task; updating the current task based on the target task corresponding to the current task; determining whether the updated current task contains a first user generation identifier or a second user generation identifier; if the current task comprises a first case generation identifier or a second case generation identifier, determining candidate test cases based on historical information of the current task; and if the current task does not contain the first case generation identifier and the second case generation identifier, executing the step of updating the current task based on the target task corresponding to the current task.
Specifically, the candidate test cases are test cases generated by starting a flow chart of a function to be tested according to the priority of each task from a starting task until a first case generation identifier or a second case generation identifier is detected, and connecting the tasks flowing through in series according to the flowing sequence.
The determination process of each candidate test case is described in conjunction with fig. 3, where each negative node is uncovered when the candidate test case is determined for the first time. The determination process of the candidate test case 1 is as follows: determining A1 as a current task, determining a target task B1 corresponding to the A1 as a new current task, wherein the B1 does not contain a case generation identifier, so that the current task is continuously updated, the tasks corresponding to the B1 comprise C1 and B2, negative nodes of the B1 are not covered, determining C1 corresponding to the negative nodes of the B1 as the new current task, the C1 carries a first case generation identifier, and the candidate test case 1 is a historical series result (A1-B1-C1) of the current task. The determination process of the candidate test case 2 is as follows: determining A1 as a current task, determining that a target task B1 corresponding to the A1 is a new current task, wherein B1 does not contain a case generation identifier, so that the current task is continuously updated, the tasks corresponding to the B1 comprise C1 and B2, negative nodes of the B1 are covered, determining that B2 corresponding to positive nodes of the B1 is a new current task, B2 does not contain a case generation identifier, so that the current task is continuously updated, the tasks corresponding to the B2 comprise C2 and B3, the negative nodes of the B2 are uncovered, determining that C2 corresponding to the negative nodes of the B2 is a new current task, C2 carries a first case generation identifier, and candidate test cases 2 are historical series results (A1-B1-B2-C2) of the current task. The determination process of the candidate test case 3 is as follows: determining that A1 is a current task, determining that a target task B1 corresponding to A1 is a new current task, determining that B1 does not contain a use case generation identifier, so continuously updating the current task, wherein the tasks corresponding to B1 comprise C1 and B2, the negative node of B1 is covered, determining that B2 corresponding to a positive node of B1 is a new current task, B2 does not contain a use case generation identifier, continuously updating the current task, wherein the tasks corresponding to B2 comprise C2 and B3, the negative node of B2 is covered, determining that B3 corresponding to a positive node of B2 is a new current task, B3 does not contain a use case generation identifier, continuously updating the current task, the tasks corresponding to B3 comprise C3 and A2, and the negative node of B3 is uncovered, determining that C3 corresponding to a negative node of B3 is a new current task, C3 carries a first use case generation identifier, and candidate test case 3 is a historical series result (A1-B1-B2-B3-C3). The determination process of the candidate test case 4 is as follows: determining that A1 is a current task, determining that a target task B1 corresponding to A1 is a new current task, determining that B1 does not contain a use case generation identifier, continuing to update the current task, wherein the tasks corresponding to B1 comprise C1 and B2, the negative node of B1 is covered, determining that B2 corresponding to the positive node of B1 is a new current task, determining that B2 does not contain a use case generation identifier, continuing to update the current task, wherein the tasks corresponding to B2 comprise C2 and B3, the negative node of B2 is covered, determining that B3 corresponding to the positive node of B2 is a new current task, and the negative node of B3 does not contain a use case generation identifier, continuing to update the current task, determining that A2 corresponding to the positive node of B3 is a new current task, and the candidate test case 4 is a historical series result (A1-B1-B2-B3-A2) of the current task.
It should be noted that the test case may further include path information of each task, which is not limited in this embodiment.
S203, determining the priority of each candidate test case based on the generation time of each candidate test case.
The generation time of the candidate test cases may be understood as the determination time of the candidate test cases, and the priority of the candidate test cases may be understood as the time sequencing result of the candidate test cases, for example, the candidate test cases generated earlier are arranged before the candidate test cases generated later.
Specifically, candidate test cases are generated one by one, and therefore, the generation time of each candidate test case is different. Illustratively, the priorities of the four candidate test cases in S202 are candidate test case 1, candidate test case 2, candidate test case 3, and candidate test case 4 in order.
S204, determining whether the test case to be tested is a termination candidate test case.
The terminating candidate test case is a test case carrying a second case generation identifier, namely, the candidate test case 4 in the embodiment, and the test case to be tested is a test case with the highest priority in the candidate test cases which are not tested. Specifically, if the test case to be tested is the termination candidate test case, it is verified that each candidate test case has been traversed, and S206 is executed, otherwise S205 is executed.
For example, assuming that the test case to be tested is the candidate test case 2, if the case generation identifier carried by the candidate test case 2 is the first case generation identifier, the test case to be tested is not the termination candidate test case, and S205 is executed; assuming that the test case to be tested is the candidate test case 4, the case generation identifier carried by the candidate test case 4 is the second case generation identifier, and the test case to be tested is the termination candidate test case, and S206 is executed.
It should be noted that the test case to be tested is candidate test case 1 when S204 is executed for the first time.
S205, updating the test case to be tested.
Specifically, updating the test cases to be tested to determine the test case with the highest priority among the candidate test cases which are not tested as the new test case to be tested. And S204 is executed after updating the test case to be tested so as to determine whether the updated test case to be tested is a termination candidate test case.
For example, assuming that the test case to be tested is the candidate test case 2, the candidate test case which is not tested includes the candidate test case 3 and the candidate test case 4, the candidate test case 3 has a higher priority than the candidate test case 4, and updating the test case to be tested can be understood as determining that the candidate test case 3 is a new test case to be tested.
S206, determining the smoke emission test case based on the history information of the test case to be tested.
Specifically, determining the smoke test case based on the history information of the test case to be tested can be understood as integrating the tested test cases to obtain the smoke test case.
When the test case to be tested is the termination candidate test case, the termination task of the flow chart is considered to be traversed, the tested candidate test case covers all flow information of the function to be tested, and the set of each tested candidate test case is the smoke test case.
In this embodiment, when the terminating candidate test case is candidate test case 4, the history information is candidate test case 1, candidate test case 2, candidate test case 3, and candidate test case 4, and the smoking test case is a case set composed of candidate test case 1, candidate test case 2, candidate test case 3, and candidate test case 4.
Notably, the invention does not execute the covered branches, and can effectively improve the determination efficiency of the smoke emission test case.
According to the technical scheme, function flow information of a function to be tested is determined, wherein the function flow information comprises a starting task, a terminating task, at least two judging tasks and at least two negative tasks, and the negative tasks correspond to the judging tasks one by one; determining at least three candidate test cases based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks; determining the priority of each candidate test case based on the generation time of each candidate test case; determining whether the test case to be tested is a termination candidate test case, wherein the test case to be tested is the test case with the highest priority in the candidate test cases which are not tested; if the test case to be tested is the termination candidate test case, determining a smoke test case based on the history information of the test case to be tested; if the test case to be tested is not the termination candidate test case, updating the test case to be tested, and executing the step of determining whether the test case to be tested is the termination candidate test case. Determining functional flow information of a function to be tested, wherein the functional flow information comprises a starting task, a terminating task, at least two judging tasks and at least two negative tasks, and the negative tasks correspond to the judging tasks one by one; determining at least three candidate test cases based on a preset task determination rule, a starting task, a terminating task, at least two judging tasks and at least two negative tasks; and determining the smoke test cases of the function to be tested based on at least three candidate test cases.
Example III
Fig. 4 is a schematic structural diagram of a determining device for a smoke test case according to a third embodiment of the present invention. As shown in fig. 4, the apparatus includes: an acquisition module 401, a determination module 402 and an execution module 403.
The obtaining module 401 is configured to determine functional flow information of a function to be tested, where the functional flow information includes a start task, a stop task, at least two determination tasks, and at least two negative tasks, and the negative tasks are in one-to-one correspondence with the determination tasks.
The determining module 402 is configured to determine at least three candidate test cases based on a preset task determining rule, a start task, a stop task, at least two judging tasks, and at least two negative tasks.
An execution module 403, configured to determine a smoke test case of the function to be tested based on at least three candidate test cases.
Optionally, the negative task includes a first case generation identifier, the termination task includes a second case generation identifier, the task determination rule includes a task selection rule and a case generation rule, the task selection rule is a target task corresponding to the current task based on task priority, and the case generation rule determines candidate test cases based on each historical task when the first case generation identifier or the second case generation identifier is detected; the target task is the task with the highest priority among the tasks to be executed corresponding to the current task.
Optionally, the judging task includes an acquiring node, a negating node and a affirming node, the negating node is connected with the negating task, the acquiring node is connected with the starting task or the judging task, and the affirming node is connected with the judging task or the ending task; wherein the priority of the task connected by the non-covered negative node is higher than the priority of the task connected by the positive node, and the priority of the task connected by the covered negative node is lower than the priority of the task connected by the positive node.
Optionally, the determining module 402 is specifically configured to determine that the starting task is a current task; updating the current task based on the target task corresponding to the current task; determining whether the updated current task contains a first user generation identifier or a second user generation identifier; if the current task comprises a first case generation identifier or a second case generation identifier, determining candidate test cases based on historical information of the current task; and if the current task does not contain the first case generation identifier and the second case generation identifier, executing the step of updating the current task based on the target task corresponding to the current task.
Optionally, the candidate test cases include a first type of candidate test case and a second type of candidate test case, where the first type of candidate test case includes a start task, a negative task and at least one judgment task, and the second type of candidate test case includes a start task, a termination task and at least one judgment task.
Optionally, the candidate test cases include a termination candidate test case, where the termination candidate test case is a candidate test case carrying a second case generation identifier.
Optionally, the execution module 403 is specifically configured to determine a priority of each candidate test case based on a generation time of each candidate test case; determining whether the test case to be tested is a termination candidate test case, wherein the test case to be tested is the test case with the highest priority in the candidate test cases which are not tested; if the test case to be tested is the termination candidate test case, determining a smoke test case based on the history information of the test case to be tested; if the test case to be tested is not the termination candidate test case, updating the test case to be tested, and executing the step of determining whether the test case to be tested is the termination candidate test case.
The device for determining the smoke test case provided by the embodiment of the invention can execute the method for determining the smoke test case provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. 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 communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a random access Memory (also referred to as a random access Memory, random Access Memory, RAM) 13, etc., in which a computer program executable by the at least one processor is stored, and the processor 11 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may 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.
Various 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, etc.; 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.
The 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, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the method of determining a smoke test case.
In some embodiments, the method of determining a smoke test case may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the 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 loaded into RAM 13 and executed by processor 11, one or more steps of the above-described method of determining a smoke test case may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method of determining the smoke test case in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On 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, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods 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 implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the 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. The 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 portable 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) through 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 may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 through which a user can interact with an implementation of the systems and techniques described here, or any combination of such background, 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. The client and server are typically 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 hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for determining a smoke test case, comprising:
determining functional flow information of a function to be tested, wherein the functional flow information comprises a starting task, a terminating task, at least two judging tasks and at least two negative tasks, and the negative tasks are in one-to-one correspondence with the judging tasks;
determining at least three candidate test cases based on a preset task determination rule, the starting task, the terminating task, the at least two judging tasks and the at least two negative tasks;
And determining the smoke emission test cases of the functions to be tested based on the at least three candidate test cases.
2. The method of claim 1, wherein the negative task includes a first case generation identifier, the termination task includes a second case generation identifier, the task determination rule includes a task selection rule and a case generation rule, the task selection rule is a target task corresponding to a current task based on task priority, and the case generation rule determines the candidate test case based on each historical task when the first case generation identifier or the second case generation identifier is detected;
the target task is a task with the highest priority among tasks to be executed corresponding to the current task.
3. The method according to claim 2, wherein the judging task includes an acquisition node, a negative node and a positive node, the negative node being connected to the negative task, the acquisition node being connected to the starting task or the judging task, the positive node being connected to the judging task or the terminating task;
wherein the priority of the task connected by the non-covered negative node is higher than the priority of the task connected by the positive node, and the priority of the task connected by the covered negative node is lower than the priority of the task connected by the positive node.
4. The method of claim 3, wherein the determining candidate test cases based on the pre-set task determination rule, the start task, the stop task, the at least two judgment tasks, and the at least two negative tasks comprises:
determining a starting task as the current task;
updating the current task based on a target task corresponding to the current task;
determining whether the updated current task contains the first use case generation identifier or the second use case generation identifier;
if the current task comprises the first case generation identifier or the second case generation identifier, determining the candidate test case based on the history information of the current task;
and if the current task does not contain the first case generation identifier and the second case generation identifier, executing the step of updating the current task based on the target task corresponding to the current task.
5. The method of claim 4, wherein the candidate test cases comprise a first type of candidate test cases and a second type of candidate test cases, the first type of candidate test cases comprising the start task, a negative task, and at least one judgment task, the second type of candidate test cases comprising the start task, the termination task, and at least one judgment task.
6. The method of claim 2, wherein the candidate test cases comprise termination candidate test cases that generate an identified candidate test case for the second case.
7. The method of claim 6, wherein the determining the smoke test case for the function under test based on the at least three candidate test cases comprises:
determining the priority of each candidate test case based on the generation time of each candidate test case;
determining whether the test case to be tested is the termination candidate test case, wherein the test case to be tested is the test case with the highest priority in the candidate test cases which are not tested;
if the test case to be tested is the termination candidate test case, determining the smoke emission test case based on the history information of the test case to be tested;
if the test case to be tested is not the termination candidate test case, updating the test case to be tested, and executing the step of determining whether the test case to be tested is the termination candidate test case.
8. A device for determining a smoke test case, comprising:
The system comprises an acquisition module, a test module and a test module, wherein the acquisition module is used for determining functional flow information of a function to be tested, the functional flow information comprises a starting task, a stopping task, at least two judging tasks and at least two negative tasks, and the negative tasks are in one-to-one correspondence with the judging tasks;
the determining module is used for determining at least three candidate test cases based on a preset task determining rule, the starting task, the ending task, the at least two judging tasks and the at least two negative tasks;
and the execution module is used for determining the smoke emission test cases of the functions to be tested based on the at least three candidate test cases.
9. An electronic device, the electronic device comprising:
at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of determining a smoke test case according to any one of claims 1 to 7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the method of determining a smoke test case according to any one of claims 1 to 7.
CN202311661564.5A 2023-12-05 2023-12-05 Method and device for determining smoke emission test case, electronic equipment and storage medium Pending CN117632748A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311661564.5A CN117632748A (en) 2023-12-05 2023-12-05 Method and device for determining smoke emission test case, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311661564.5A CN117632748A (en) 2023-12-05 2023-12-05 Method and device for determining smoke emission test case, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117632748A true CN117632748A (en) 2024-03-01

Family

ID=90031909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311661564.5A Pending CN117632748A (en) 2023-12-05 2023-12-05 Method and device for determining smoke emission test case, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117632748A (en)

Similar Documents

Publication Publication Date Title
CN116225769B (en) Method, device, equipment and medium for determining root cause of system fault
CN116126346B (en) Code compiling method and device of AI model, computer equipment and storage medium
CN115576828A (en) Test case generation method, device, equipment and storage medium
CN116431505A (en) Regression testing method and device, electronic equipment, storage medium and product
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN116382658A (en) Compiling method and device of AI model, computer equipment and storage medium
CN115495151A (en) Rule engine migration method, device, equipment, storage medium and program product
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
CN115576827A (en) Performance test method, device, equipment and storage medium of business process software
CN115890684A (en) Robot scheduling method, device, equipment and medium
CN117632748A (en) Method and device for determining smoke emission test case, electronic equipment and storage medium
CN114816758B (en) Resource allocation method and device
CN117290113B (en) Task processing method, device, system and storage medium
CN115374010A (en) Function testing method, device, equipment and storage medium
CN117422339A (en) Importance assessment method, device, equipment and medium for power grid nodes
CN116702667A (en) Regression testing method, device, equipment and medium for chip
CN117609086A (en) Method and device for determining test content, electronic equipment and storage medium
CN117370213A (en) Test data generation method and device, electronic equipment and storage medium
CN117608896A (en) Transaction data processing method and device, electronic equipment and storage medium
CN115567624A (en) Message processing method and device, electronic equipment and medium
CN115860055A (en) Performance determination method, performance optimization method, device, electronic equipment and medium
CN115328810A (en) Performance verification method and device of speed limiting module, electronic equipment and storage medium
CN117687993A (en) Data migration method, device, equipment and storage medium
CN116777674A (en) Power distribution network data processing method and device, electronic equipment and storage medium
CN116205279A (en) Hardware scheduling execution method, device, equipment and medium of deep learning model

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