CN112749074A - Test case recommendation method and device - Google Patents

Test case recommendation method and device Download PDF

Info

Publication number
CN112749074A
CN112749074A CN201911047263.7A CN201911047263A CN112749074A CN 112749074 A CN112749074 A CN 112749074A CN 201911047263 A CN201911047263 A CN 201911047263A CN 112749074 A CN112749074 A CN 112749074A
Authority
CN
China
Prior art keywords
case
execution
service
test
determining
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.)
Granted
Application number
CN201911047263.7A
Other languages
Chinese (zh)
Other versions
CN112749074B (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911047263.7A priority Critical patent/CN112749074B/en
Publication of CN112749074A publication Critical patent/CN112749074A/en
Application granted granted Critical
Publication of CN112749074B publication Critical patent/CN112749074B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses a test case recommendation method and a device, wherein the test case recommendation method comprises the following steps: the method comprises the steps of obtaining a service case needing to be tested, displaying a test page corresponding to the service case, wherein the test page comprises a starting control and the service case, executing the service case when the clicking operation of a user for the starting control is detected, switching and displaying the test page as a case recommending page, wherein the case recommending page comprises an inquiry control and an execution result corresponding to the service case, and determining a recommended test case set in a preset test case set based on the execution result when the clicking operation of the user for the inquiry control is detected. The scheme can improve the accuracy of recommending the test case.

Description

Test case recommendation method and device
Technical Field
The invention relates to the technical field of computers, in particular to a test case recommendation method and device.
Background
With the development of science and technology, the architecture of a business system is more and more complex, and various problems may exist in the process of executing a business, so that a test case is usually adopted to test the business system.
At present, the test case label is selected according to the test case label, however, the test case label is usually constructed manually, the construction mode is mainly realized by referring to historical service data, if the historical service coverage is incomplete, and the importance of some services is not enough, the problem that the test case construction is incomplete or incomplete is easily caused, and the artificially constructed test case labels are various and the problem that the test cases are redundant may exist. Therefore, the existing scheme for recommending the test case is not high in accuracy.
Disclosure of Invention
The embodiment of the invention provides a test case recommendation method and device, which can improve the accuracy of test case recommendation.
The embodiment of the invention provides a test case recommendation method, which comprises the following steps:
acquiring a service case to be tested;
displaying a test page corresponding to the service case, wherein the test page comprises a starting control and the service case;
when the clicking operation of the user for the starting control is detected, the service case is executed, and the test page is switched and displayed to be a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service case;
and when the clicking operation of the user for the query control is detected, determining a recommended test case set in a preset test case set based on the execution result.
Correspondingly, an embodiment of the present invention further provides a test case recommendation device, including:
the acquisition module is used for acquiring a service case to be tested;
the display module is used for displaying a test page corresponding to the service case, and the test page comprises a starting control and the service case;
the switching module is used for executing the service case when the clicking operation of the user for the starting control is detected, and switching and displaying the test page as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service case;
and the recommending module is used for determining a recommended test case set in a preset test case set based on the execution result when the clicking operation of the user for the query control is detected.
Optionally, in some embodiments of the present invention, the recommendation module includes:
the first determining submodule is used for determining a node for executing the service case call according to an execution result to obtain at least one execution node;
the second determining submodule is used for determining the running state and the number of the execution nodes;
and the third determining submodule is used for determining a recommended test case set in a preset test case set based on the running state and the number of the execution nodes.
Optionally, in some embodiments of the present invention, the third determining sub-module includes:
the computing unit is used for computing the execution success rate of the execution node according to the running state of the execution node;
and the determining unit is used for determining a recommended test case set in a preset test case set based on the determined execution nodes and the number of the execution nodes when the execution success rate is greater than a preset threshold value.
Optionally, in some embodiments of the present invention, the determining unit includes:
the first determining subunit is configured to determine, when the execution success rate is greater than a preset threshold, recommended case data corresponding to the service case based on the determined execution nodes and the number of the execution nodes;
and the second determining subunit is used for determining the recommended test case set in the preset test case set based on the determined recommended case data.
Optionally, in some embodiments of the present invention, the first determining subunit is specifically configured to:
when the execution success rate is greater than a preset threshold value, extracting label information of each execution node;
determining an incidence relation between each execution node according to the label information of each execution node;
constructing a service path diagram of the service use case according to the incidence relation;
and determining recommended case data corresponding to the service case according to the service path diagram.
Optionally, in some embodiments of the present invention, the switching module includes:
the extraction submodule is used for extracting the data packet of the service use case;
the analysis submodule is used for analyzing the data packet to obtain at least two execution data and at least two execution nodes corresponding to each execution data;
the generating submodule is used for generating an execution result corresponding to the service use case based on the at least two execution data and at least two execution nodes corresponding to each execution data;
and the switching sub-module is used for switching and displaying the test page as a case recommendation page, and the case recommendation page comprises a query control and an execution result corresponding to the service case.
Optionally, in some embodiments of the present invention, the generating sub-module is specifically configured to:
detecting valid execution data of the at least two execution data;
calculating the execution success rate of the service use case based on the number of the effective execution data;
and constructing an execution result corresponding to the service use case according to the execution success rate and at least two execution nodes corresponding to each execution data.
Optionally, in some embodiments of the present invention, the display module is specifically configured to:
displaying a service use case list, wherein the service use case list comprises at least two service use cases;
and when the selection operation of the user for the service cases in the service case list is detected, displaying a test page corresponding to the test case selected by the user.
Optionally, in some embodiments of the present invention, the apparatus further includes a detection module, where the detection module is specifically configured to:
detecting the current operation environment of the service use case;
the recommendation module is specifically configured to: and when the clicking operation of the user for the query control is detected, determining a recommended test case set in a preset test case set based on the execution result and the current running environment.
The method comprises the steps of displaying a test page corresponding to a service case after the service case needing to be tested is obtained, wherein the test page comprises a starting control and the service case, executing the service case when the clicking operation of a user aiming at the starting control is detected, switching and displaying the test page as a case recommending page, the case recommending page comprises an inquiry control and an execution result corresponding to the service case, and determining a recommended test case set in a preset test case set based on the execution result when the clicking operation of the user aiming at the inquiry control is detected. Therefore, the accuracy of test case recommendation can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1a is a scene schematic diagram of a test case recommendation method provided in an embodiment of the present invention;
FIG. 1b is a flowchart illustrating a test case recommendation method according to an embodiment of the present invention;
FIG. 2a is another schematic flow chart of a test case recommendation method according to an embodiment of the present invention;
fig. 2b is a schematic diagram illustrating a test page in the test case recommendation method according to the embodiment of the present invention;
fig. 2c is a schematic diagram illustrating a recommendation page in the test case recommendation method according to the embodiment of the present invention;
fig. 2d is a schematic diagram illustrating a recommended test case set in the test case recommendation method according to the embodiment of the present invention;
FIG. 2e is a schematic flowchart of a test case recommendation method according to an embodiment of the present invention;
fig. 2f is another schematic diagram of a test page displayed in the test case recommendation method provided in the embodiment of the present invention;
fig. 2g is a schematic diagram of a test pass page in the test case recommendation method provided in the embodiment of the present invention;
fig. 2h is a schematic diagram of a test failure page in the test case recommendation method provided in the embodiment of the present invention;
fig. 3a is a schematic structural diagram of a first implementation of a test case recommendation device according to an embodiment of the present invention;
fig. 3b is a schematic structural diagram of a second implementation of the test case recommendation device according to the embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
First, the terms mentioned in the present invention are explained:
a test case is a set of test information compiled for a particular target to test a certain program path or to verify whether a certain specific requirement is met; as an example, the test case has more complete contents including: test inputs, execution conditions, and expected results.
The service use case refers to a service requirement data set generated according to a service requirement of a target service, where the service requirement data may be service step path data, and specifically, the service step path data may include execution flow step data of the service.
The embodiment of the invention provides a test case recommendation method and device.
The test case recommendation apparatus may be specifically integrated in a network device, such as a terminal or a server, where the terminal may include a mobile phone, a tablet Computer, or a Personal Computer (PC), and the server may include an independently operating server or a distributed server, or may include a server cluster including a plurality of servers.
Taking the example that the test case recommending apparatus is integrated in the terminal, please refer to fig. 1a, the terminal can receive the test request sent by the user, the test request can include a service case to be tested, the terminal displays a test page corresponding to the service case based on the service case, the test page comprises a start control and a service case, the terminal executes the service case when detecting the clicking operation of the user aiming at the start control, and the test page is switched and displayed as a case recommendation page, the case recommendation page comprises a query control and an execution result corresponding to the service case, when the terminal detects the click operation of the user on the query control, based on the execution result, the terminal can determine the node for executing the service use case call, obtain at least one execution node, then, the terminal can determine a recommended test case set in a preset test case set according to the execution node.
The following are detailed below. It should be noted that the description sequence of the following embodiments is not intended to limit the priority sequence of the embodiments.
A test case recommendation method comprises the following steps: the method comprises the steps of obtaining a service case needing to be tested, displaying a test page corresponding to the service case, wherein the test page comprises a starting control and the service case, executing the service case when the clicking operation of a user for the starting control is detected, switching and displaying the test page as a case recommending page, wherein the case recommending page comprises an inquiry control and an execution result corresponding to the service case, and when the clicking operation of the user for the inquiry control is detected, determining a recommended test case set in a preset test case set based on the execution result.
Referring to fig. 1b, fig. 1b is a schematic flow chart illustrating a test case recommendation method according to an embodiment of the invention. The specific flow of the test case recommendation method can be as follows:
101. and acquiring a service case to be tested.
The service use case refers to a service requirement data set generated according to a service requirement of a target service, and the service requirement data set may include local data and network data.
102. And displaying a test page corresponding to the service case.
The test page includes a start control and a service case, for example, the test page may be displayed on a browser, and the browser may be a google browser, a fire fox browser, an IE browser, and the like. Further, the test page may display information of the start control and the service case, where the information of the service case may include a name of the service case, creation time of the service case, and the like, and is specifically set according to an actual situation.
Optionally, in some embodiments, the step "displaying a test page corresponding to the service case" may specifically include:
(11) displaying a service use case list;
(12) and when the selection operation of the user for the service cases in the service case list is detected, displaying the test page corresponding to the test case selected by the user.
Specifically, the service case list may include at least two service cases, and when a selection operation of a user for a service case in the service case list is detected, a test page corresponding to the test case selected by the user is displayed, for example, the service case list includes two service cases, and when a selection operation of a user for one service case in the service case list is detected, for example, a selection operation for an icon of the service case or a selection operation for a selection box corresponding to the service case is detected, and a test page corresponding to the test case selected by the user is displayed.
103. And when the clicking operation of the user for the starting control is detected, executing the service case, and switching and displaying the test page as a case recommendation page.
The user can execute the service case by clicking the starting control, and after the execution of the service case is finished, the test page can be switched and displayed to be a case recommendation page, wherein the case recommendation page comprises the query control and an execution result corresponding to the service case.
Specifically, the data packet corresponding to the service case may be analyzed to obtain an execution result corresponding to the service case, that is, in some embodiments, the step "execute the service case when a click operation of the user on the start control is detected, and switch and display the test page as a case recommendation page" may specifically include:
(21) extracting a data packet of a service use case;
(22) analyzing the data packet to obtain at least two execution data and an execution node corresponding to each execution data;
(23) generating an execution result corresponding to the service use case based on at least two execution data and an execution node corresponding to each execution data;
(24) and switching and displaying the test page as a case recommendation page.
The execution data refers to data after the service data executes its service capability, and first, the data packet may be analyzed according to the service characteristics to be implemented by the service use case to obtain at least two execution data and an execution node corresponding to each execution data, for example, if the service to be implemented by the service use case is code scanning payment, the data packet may be analyzed based on the characteristics of code scanning payment to obtain at least two execution data corresponding to code scanning payment, such as implementing the execution data corresponding to payment, implementing the execution data corresponding to payment confirmation deduction, implementing payment cancellation, and the like, and also obtain the execution node corresponding to each execution data, then, the execution data and the execution node corresponding to each execution data are added to the same set to generate the execution result corresponding to the service use case, and finally, and switching and displaying the test page as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service case.
In order to enable the execution result to be more accurate, therefore, the execution success rate of the service use case may be calculated, for example, the execution success rate of the service use case may be calculated by effectively executing data in at least two execution data, that is, in some embodiments, the step "generating the execution result corresponding to the service use case based on at least two execution data and an execution node corresponding to each execution data" may specifically include:
(31) detecting valid execution data of the at least two execution data;
(32) calculating the execution success rate of the service use case based on the number of the effective execution data;
(33) and constructing an execution result corresponding to the service use case according to the execution success rate and at least two execution nodes corresponding to each execution data.
It should be noted that, in the embodiment of the present invention, the effective execution data refers to execution data that has been successfully executed, for example, the service use case includes 10 execution data, and if the effective execution data is 6, the execution success rate is 60%, and then, the execution result corresponding to the service use case may be constructed according to the execution success rate and at least two execution nodes corresponding to each execution data.
104. And when the clicking operation of the user for the query control is detected, determining a recommended test case set in a preset test case set based on an execution result.
The use case recommendation page may include a query control and an execution result corresponding to the service use case. For example, specifically, when a click operation of a user on a query control is detected, a recommended test case set may be determined in a preset test case set based on a node called by a service case in an execution process, that is, in some embodiments, the step "when a click operation of a user on a query control is detected, a recommended test case set is determined in a preset test case set based on an execution result", may specifically include:
(41) when the clicking operation of a user for the query control is detected, determining a node for executing the calling of the service case according to an execution result to obtain at least one execution node;
(42) determining the running state and the number of execution nodes;
(43) and determining a recommended test case set in a preset test case set based on the running state and the number of the execution nodes.
For example, a node for executing a service case call may be determined according to an execution result, then an operation state and a number of the execution nodes are determined, where the operation state may include a processed state, an unprocessed state, a received data error state, a processed data error state, an output data error state, or the like, and then, based on the operation state and the number of the execution nodes, a recommended test case set is determined in a preset test case set, for example, 9 nodes for executing the service case call are determined, where 6 nodes in the operation state are in the processed state, and 3 nodes in the operation state are in the output data error state, and then the recommended test case set may be determined in the preset test case set based on the nodes in the operation state in the processed state.
Optionally, in some embodiments, the execution success rate of the service case may also be calculated through the operating state of the execution node, and when the execution success rate is greater than a preset threshold, a recommended test case set may be determined in a preset test case set based on the operating state and the number of the execution node, that is, in some embodiments, the step "determining the recommended test case set in the preset test case set based on the operating state and the number of the execution node" may specifically include:
(51) calculating the execution success rate of the execution node according to the running state of the execution node;
(52) and when the execution success rate is greater than a preset threshold value, determining a recommended test case set in a preset test case set based on the determined execution nodes and the number of the execution nodes.
Optionally, in some embodiments, the recommended case data may be determined by the determined execution nodes and the number of the execution nodes, and the recommended test case set is determined in the preset test case set according to the recommended case data, that is, the step "when the execution success rate is greater than a preset threshold, the recommended test case set is determined in the preset test case set based on the determined execution nodes and the number of the execution nodes", may specifically include:
(61) when the execution success rate is greater than a preset threshold value, determining recommended case data corresponding to the service cases based on the determined execution nodes and the number of the execution nodes;
(62) and determining a recommended test case set in a preset test case set based on the determined recommended case data.
For example, specifically, a service path graph of a service case may be constructed according to the determined execution node, and recommended case data corresponding to the service case is determined based on the constructed service path graph, that is, optionally, in some embodiments, the step "when the execution success rate is greater than a preset threshold, the recommended case data corresponding to the service case is determined based on the determined execution node and the number of execution nodes", may specifically include:
(71) when the execution success rate is greater than a preset threshold value, extracting label information of each execution node;
(72) determining an incidence relation between each execution node according to the label information of each execution node;
(73) constructing a service path diagram of the service use case according to the incidence relation;
(74) and determining recommended case data corresponding to the service case according to the service path diagram.
Optionally, in some embodiments, before the step "determining, based on the execution result, a recommended test case set in the preset test case set when the click operation of the user on the query control is detected", specifically, the method may further include: detecting the current operation environment of the service use case;
that is, the step "determining a recommended test case set in a preset test case set based on an execution result when a click operation of a user on a query control is detected" may specifically include: and when the clicking operation of the user for the query control is detected, determining a recommended test case set in a preset test case set based on the execution result and the current running environment.
It should be noted that, in order to further improve the recommendation accuracy, the current operation environment of the service case may be detected in the determination of the recommended test case set, for example, when the current operation environment of the service case is detected to be "gamma", the recommended test case set may be determined in the preset test case set based on the execution result and the "gamma" operation environment.
The method and the device for testing the service cases comprise the steps that after the service cases needing to be tested are obtained, the test pages corresponding to the service cases are displayed, the test pages comprise starting controls and the service cases, when the clicking operation of a user for the starting controls is detected, the service cases are executed, the test pages are switched and displayed to be case recommending pages, the case recommending pages comprise query controls and execution results corresponding to the service cases, and when the clicking operation of the user for the query controls is detected, the recommended test case set is determined in a preset test case set on the basis of the execution results. Compared with the existing scheme, the method and the device for recommending the test cases can determine the recommended test case set in the preset test case set according to the nodes called by the service cases in the execution process, so that the problem that the recommended test case set is incomplete is solved, and the accuracy of recommending the test cases can be improved.
The method according to the examples is further described in detail below by way of example.
In this embodiment, the test case recommendation apparatus is specifically integrated in a terminal as an example.
Referring to fig. 2a, a method for recommending test cases may specifically include the following steps:
201. and the terminal acquires a service case to be tested.
The service case refers to a service requirement data set generated according to the service requirement of the target service, and the terminal can obtain the service requirement data set to be tested by accessing the network interface, that is, the terminal can obtain the service case to be tested through the network.
202. And the terminal displays a test page corresponding to the service case.
Specifically, first, the terminal may display a service case list, and when detecting that a user selects a service case in the service case list, the terminal displays a test page corresponding to the test case selected by the user, as shown in fig. 2 b.
203. And when the terminal detects that the user clicks the starting control, executing the service case, and switching and displaying the test page as a case recommendation page.
When the terminal detects that a user clicks on a start control, the terminal may extract a data packet of a service case and analyze the data packet to obtain at least two execution data and an execution node corresponding to each execution data, the terminal generates an execution result corresponding to the service case based on the at least two execution data and the execution node corresponding to each execution data, and switches and displays a test page as a case recommendation page, where the case recommendation page may include a query control and an execution result corresponding to the service case, as shown in fig. 2c, and the user may obtain a test case set recommended by the service case by clicking the query control.
204. And the terminal detects the current operation environment of the service use case.
It should be noted that the terminal may detect the current operating environment of the service case before acquiring the service case to be tested, or may detect the current operating environment of the service case before the terminal displays the test page corresponding to the service case, which is specifically set according to the actual situation.
205. And when the terminal detects the clicking operation of the user for the query control, determining a recommended test case set in a preset test case set based on the execution result and the current running environment.
Specifically, when the terminal detects a click operation of the user on the query control, the terminal may determine a recommended test case set in a preset test case set based on a node called by the service case in the execution process, as shown in fig. 2 d. In fig. 2d, it can be seen that the total number of recommended use cases in a beta environment is 31, that is, the terminal determines the total number of recommended test cases to be 31 based on the execution result and the current operating environment, and further, in order to improve the accuracy of recommending test cases, the terminal may determine nodes for executing service use case calls based on the execution result, and then determines the recommended test case set according to the execution nodes and the current operating environment, which is specifically referred to the foregoing embodiment and is not described herein again.
As can be seen from the above, after the terminal of this embodiment acquires the service case to be tested, a test page corresponding to the service case is displayed, where the test page includes a start control and the service case, when the terminal detects a click operation of a user on the start control, the terminal executes the service case and switches and displays the test page as a case recommendation page, the case recommendation page includes an inquiry control and an execution result corresponding to the service case, and when the terminal detects a click operation of the user on the inquiry control, the terminal determines, based on the execution result, a recommended test case set in a preset test case set. Compared with the existing scheme, the terminal provided by the embodiment of the invention can determine the recommended test case set in the preset test case set according to the nodes called by the service cases in the execution process and the current operation environment of the service cases, so that the problem that the recommended test case set is incomplete is avoided, and the accuracy of recommending the test cases can be improved.
In order to facilitate understanding of the test case recommendation method provided by the embodiment of the present invention, please refer to fig. 2e, when the terminal receives a service case to be tested, the terminal may load call stack information, automation data, and case data based on the test case, the terminal may perform data integration on the call stack information, the automation data, and the case data to obtain integrated data, and then the terminal may select a corresponding module based on the integrated data, and may obtain a corresponding container based on the integrated data. For example, when a user needs to test a certain service case, the terminal may display a test page corresponding to the service case, as shown in fig. 2f, at this time, a test report page corresponding to the service case may be displayed, as shown in fig. 2g, an operating environment, a test result, a total time consumption, a start time, and the like for testing the service case may be displayed on the page, it needs to be described that, when a test failure rate of the service case is greater than a preset threshold, the test case may be considered to fail to be tested, for example, the threshold may be 65%, at this time, a test summary result corresponding to the service case may be displayed, as shown in fig. 2h, and finally, the terminal may determine a recommended test case set in the preset test case set based on the execution result
In order to better implement the test case recommendation method according to the embodiment of the present invention, an embodiment of the present invention further provides a test case recommendation device (referred to as a recommendation device for short) based on the above test case recommendation device. The meaning of the noun is the same as that in the test case recommendation method, and specific implementation details can refer to the description in the method embodiment.
Referring to fig. 3a, fig. 3a is a schematic structural diagram of a test case recommendation device according to an embodiment of the present invention, where the recommendation device may include an obtaining module 301, a displaying module 302, a switching module 303, and a recommending module 304, which may specifically be as follows:
the obtaining module 301 is configured to obtain a service case that needs to be tested.
The obtaining module 301 may obtain a service case to be tested through a network, or may obtain a service case to be tested in a local database.
The display module 302 is configured to display a test page corresponding to the service case.
Optionally, in some embodiments, the display module may be specifically configured to: and displaying a service case list, wherein the service case list comprises at least two service cases, and when the selection operation of the user for the service cases in the service case list is detected, displaying a test page corresponding to the test case selected by the user.
The switching module 303 is configured to execute a service case when a click operation of the user on the start control is detected, and switch and display the test page as a case recommendation page.
The case recommendation page comprises a query control and an execution result corresponding to the service case. When detecting that the user clicks the start control, the switching module 303 executes the service case, and optionally, while executing the service case, the switching module 303 may switch and display the test page as a case recommendation page.
Optionally, in some embodiments, the switching module may specifically include:
the extraction submodule is used for extracting the data packet of the service use case;
the analysis submodule is used for analyzing the data packet to obtain at least two execution data and at least two execution nodes corresponding to each execution data;
the generation submodule is used for generating an execution result corresponding to the service use case based on at least two execution data and at least two execution nodes corresponding to each execution data;
and the switching sub-module is used for switching and displaying the test page as a case recommendation page, and the case recommendation page comprises a query control and an execution result corresponding to the service case.
Optionally, in some embodiments, the generating sub-module may specifically be configured to: the method comprises the steps of detecting effective execution data in at least two execution data, calculating the execution success rate of a service case based on the quantity of the effective execution data, and constructing an execution result corresponding to the service case according to the execution success rate and at least two execution nodes corresponding to each execution data.
And the recommending module 304 is configured to determine a recommended test case set in the preset test case set based on the execution result when a click operation of the user on the query control is detected.
The use case recommendation page may include a query control and an execution result corresponding to the service use case. For example, specifically, when detecting that the user clicks on the query control, the recommending module 304 may determine the recommended test case set in the preset test case set based on a node called by the service case in the execution process, that is, optionally, in some embodiments, the recommending module 304 includes:
the first determining submodule is used for determining a node for executing the service case call according to an execution result to obtain at least one execution node;
the second determining submodule is used for determining the running state and the number of the execution nodes;
and the third determining submodule is used for determining a recommended test case set in the preset test case set based on the running state and the number of the execution nodes.
Optionally, in some embodiments, the third determining sub-module includes:
the computing unit is used for computing the execution success rate of the executed node according to the running state of the executed node;
and the determining unit is used for determining a recommended test case set in a preset test case set based on the determined execution nodes and the number of the execution nodes when the execution success rate is greater than a preset threshold value.
Optionally, in some embodiments, the determining unit includes:
the first determining subunit is used for determining recommended case data corresponding to the service cases based on the determined execution nodes and the number of the execution nodes when the execution success rate is greater than a preset threshold;
and the second determining subunit is used for determining the recommended test case set in the preset test case set based on the determined recommended case data.
Optionally, in some embodiments, the first determining subunit is specifically configured to: when the execution success rate is larger than a preset threshold value, extracting label information of each execution node, determining an incidence relation between each execution node according to the label information of each execution node, constructing a service path diagram of a service case according to the incidence relation, and determining recommended case data corresponding to the service case according to the service path diagram.
Optionally, in some embodiments, referring to fig. 3b, the recommendation device according to the embodiments of the present invention may further include a detection module 305, where the detection module 305 is specifically configured to: and detecting the current operation environment of the service use case. That is, the recommendation module 304 may be specifically configured to: and when the clicking operation of the user for the query control is detected, determining a recommended test case set in a preset test case set based on the execution result and the current running environment.
It can be seen that, after the obtaining module 301 of the test case recommendation device of this embodiment obtains a service case to be tested, the display module 302 displays a test page corresponding to the service case, where the test page includes a start control and the service case, the switching module 303 executes the service case when detecting a click operation of a user on the start control, and switches and displays the test page as a case recommendation page, where the case recommendation page includes an inquiry control and an execution result corresponding to the service case, and the recommendation module 304 determines, based on the execution result, a recommended test case set in a preset test case set when detecting a click operation of a user on the inquiry control. Compared with the existing scheme, the recommending module 304 in the embodiment of the invention can determine the recommended test case set in the preset test case set according to the nodes called by the service cases in the executing process, so that the problem that the recommended test case set is incomplete is avoided, and the accuracy of recommending the test cases can be improved.
Accordingly, an embodiment of the present invention further provides a terminal, as shown in fig. 4, the terminal may include Radio Frequency (RF) circuits 401, a memory 402 including one or more computer-readable storage media, an input unit 403, a display unit 404, a sensor 405, an audio circuit 406, a Wireless Fidelity (WiFi) module 407, a processor 408 including one or more processing cores, and a power supply 409. Those skilled in the art will appreciate that the terminal configuration shown in fig. 4 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 401 may be used for receiving and transmitting signals during a message transmission or communication process, and in particular, for receiving downlink information of a base station and then sending the received downlink information to the one or more processors 408 for processing; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuitry 401 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 401 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), and the like.
The memory 402 may be used to store software programs and modules, and the processor 408 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal, etc. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 408 and the input unit 403 access to the memory 402.
The input unit 403 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in a particular embodiment, the input unit 403 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 408, and can receive and execute commands from the processor 408. In addition, touch sensitive surfaces may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 403 may include other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 404 may be used to display information input by or provided to the user and various graphical user interfaces of the terminal, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 404 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor 408 to determine the type of touch event, and then the processor 408 provides a corresponding visual output on the display panel according to the type of touch event. Although in FIG. 4 the touch-sensitive surface and the display panel are shown as two separate components to implement input and output functions, in some embodiments the touch-sensitive surface may be integrated with the display panel to implement input and output functions.
The terminal may also include at least one sensor 405, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or the backlight when the terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal, detailed description is omitted here.
Audio circuitry 406, a speaker, and a microphone may provide an audio interface between the user and the terminal. The audio circuit 406 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electric signal, which is received by the audio circuit 406 and converted into audio data, which is then processed by the audio data output processor 408, and then transmitted to, for example, another terminal via the RF circuit 401, or the audio data is output to the memory 402 for further processing. The audio circuitry 406 may also include an earbud jack to provide peripheral headset communication with the terminal.
WiFi belongs to short distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web page and access streaming media etc. through WiFi module 407, it provides wireless broadband internet access for the user. Although fig. 4 shows the WiFi module 407, it is understood that it does not belong to the essential constitution of the terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 408 is a control center of the terminal, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the handset. Optionally, processor 408 may include one or more processing cores; preferably, the processor 408 may integrate an application processor, which handles primarily the operating system, user interface, applications, etc., and a modem processor, which handles primarily the wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 408.
The terminal also includes a power source 409 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 408 via a power management system to manage charging, discharging, and power consumption via the power management system. The power supply 409 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, and the like, which will not be described herein. Specifically, in this embodiment, the processor 408 in the terminal loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 408 runs the application programs stored in the memory 402, thereby implementing various functions:
the method comprises the steps of obtaining a service case needing to be tested, displaying a test page corresponding to the service case, wherein the test page comprises a starting control and the service case, executing the service case when the clicking operation of a user for the starting control is detected, switching and displaying the test page as a case recommending page, wherein the case recommending page comprises an inquiry control and an execution result corresponding to the service case, and when the clicking operation of the user for the inquiry control is detected, determining a recommended test case set in a preset test case set based on the execution result.
The method and the device for testing the service cases comprise the steps that after the service cases needing to be tested are obtained, the test pages corresponding to the service cases are displayed, the test pages comprise starting controls and the service cases, when the clicking operation of a user for the starting controls is detected, the service cases are executed, the test pages are switched and displayed to be case recommending pages, the case recommending pages comprise query controls and execution results corresponding to the service cases, and when the clicking operation of the user for the query controls is detected, the recommended test case set is determined in a preset test case set on the basis of the execution results. Compared with the existing scheme, the method and the device for recommending the test cases can determine the recommended test case set in the preset test case set according to the nodes called by the service cases in the execution process, so that the problem that the recommended test case set is incomplete is solved, and the accuracy of recommending the test cases can be improved.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the embodiment of the present invention provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the test case recommendation methods provided by the embodiment of the present invention. For example, the instructions may perform the steps of:
the method comprises the steps of obtaining a service case needing to be tested, displaying a test page corresponding to the service case, wherein the test page comprises a starting control and the service case, executing the service case when the clicking operation of a user for the starting control is detected, switching and displaying the test page as a case recommending page, wherein the case recommending page comprises an inquiry control and an execution result corresponding to the service case, and when the clicking operation of the user for the inquiry control is detected, determining a recommended test case set in a preset test case set based on the execution result.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium may execute the steps in any test case recommendation method provided in the embodiments of the present invention, beneficial effects that can be achieved by any test case recommendation method provided in the embodiments of the present invention may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
The test case recommendation method, device, terminal and storage medium provided by the embodiment of the present invention are introduced in detail above, and a specific example is applied in the present document to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A test case recommendation method is characterized by comprising the following steps:
acquiring a service case to be tested;
displaying a test page corresponding to the service case, wherein the test page comprises a starting control and the service case;
when the clicking operation of the user for the starting control is detected, the service case is executed, and the test page is switched and displayed to be a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service case;
and when the clicking operation of the user for the query control is detected, determining a recommended test case set in a preset test case set based on the execution result.
2. The method according to claim 1, wherein when the click operation of the user on the query control is detected, determining a recommended test case set in a preset test case set based on the execution result comprises:
when the clicking operation of the user for the query control is detected, determining a node for executing the service case call according to an execution result to obtain at least one execution node;
determining the running state and the number of the execution nodes;
and determining a recommended test case set in a preset test case set based on the running state and the number of the execution nodes.
3. The method according to claim 2, wherein the determining a recommended set of test cases in a preset set of test cases based on the running state and the number of the execution nodes comprises:
calculating the execution success rate of the service case according to the running state of the execution node;
and when the execution success rate is greater than a preset threshold value, determining a recommended test case set in a preset test case set based on the determined execution nodes and the number of the execution nodes.
4. The method according to claim 3, wherein when the execution success rate is greater than a preset threshold, determining a recommended test case set in a preset test case set based on the determined execution nodes and the number of execution nodes includes:
when the execution success rate is larger than a preset threshold value, determining recommended case data corresponding to the service case based on the determined execution nodes and the number of the execution nodes;
and determining a recommended test case set in a preset test case set based on the determined recommended case data.
5. The method according to claim 4, wherein when the execution success rate is greater than a preset threshold, determining recommended use case data corresponding to the business use case based on the determined execution nodes and the number of execution nodes comprises:
when the execution success rate is greater than a preset threshold value, extracting label information of each execution node;
determining an incidence relation between each execution node according to the label information of each execution node;
constructing a service path diagram of the service use case according to the incidence relation;
and determining recommended case data corresponding to the service case according to the service path diagram.
6. The method according to claim 1, wherein when the click operation of the user on the start control is detected, executing the business case and switching and displaying the test page as a case recommendation page comprises:
extracting a data packet of the service use case;
analyzing the data packet to obtain at least two execution data and an execution node corresponding to each execution data;
generating an execution result corresponding to the service use case based on the at least two execution data and the execution node corresponding to each execution data;
and switching and displaying the test page as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service case.
7. The method according to claim 6, wherein the generating an execution result corresponding to the service use case based on the at least two execution data and an execution node corresponding to each execution data comprises:
detecting valid execution data of the at least two execution data;
calculating the execution success rate of the service use case based on the number of the effective execution data;
and constructing an execution result corresponding to the service use case according to the execution success rate and at least two execution nodes corresponding to each execution data.
8. The method according to claim 1, wherein the displaying the test page corresponding to the service use case comprises:
displaying a service use case list, wherein the service use case list comprises at least two service use cases;
and when the selection operation of the user for the service cases in the service case list is detected, displaying a test page corresponding to the test case selected by the user.
9. The method according to any one of claims 1 to 8, wherein when the click operation of the user on the query control is detected, before determining the recommended set of test cases in the preset set of test cases based on the execution result, the method further includes:
detecting the current operation environment of the service use case;
when the click operation of the user for the query control is detected, determining a recommended test case set in a preset test case set based on the execution result, wherein the method comprises the following steps: and when the clicking operation of the user for the query control is detected, determining a recommended test case set in a preset test case set based on the execution result and the current running environment.
10. A test case recommendation device, comprising:
the acquisition module is used for acquiring a service case to be tested;
the display module is used for displaying a test page corresponding to the service case, and the test page comprises a starting control and the service case;
the switching module is used for executing the service case when the clicking operation of the user for the starting control is detected, and switching and displaying the test page as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service case;
and the recommending module is used for determining a recommended test case set in a preset test case set based on the execution result when the clicking operation of the user for the query control is detected.
CN201911047263.7A 2019-10-30 2019-10-30 Test case recommending method and device Active CN112749074B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911047263.7A CN112749074B (en) 2019-10-30 2019-10-30 Test case recommending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911047263.7A CN112749074B (en) 2019-10-30 2019-10-30 Test case recommending method and device

Publications (2)

Publication Number Publication Date
CN112749074A true CN112749074A (en) 2021-05-04
CN112749074B CN112749074B (en) 2023-10-27

Family

ID=75641871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911047263.7A Active CN112749074B (en) 2019-10-30 2019-10-30 Test case recommending method and device

Country Status (1)

Country Link
CN (1) CN112749074B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297090A (en) * 2021-06-11 2021-08-24 南方电网数字电网研究院有限公司 System testing method, device, computer equipment and storage medium
CN113535594A (en) * 2021-09-17 2021-10-22 广州裕睿信息科技有限公司 Method, device, equipment and storage medium for generating service scene test case
US20230305950A1 (en) * 2022-03-22 2023-09-28 International Business Machines Corporation Determination of a prioritized subset of test cases to run after a source code change

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070011649A1 (en) * 2005-07-05 2007-01-11 Microsoft Corporation Graph browser and implicit query for software development
CN109871311A (en) * 2017-12-04 2019-06-11 北京京东尚科信息技术有限公司 A kind of method and apparatus for recommending test case

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070011649A1 (en) * 2005-07-05 2007-01-11 Microsoft Corporation Graph browser and implicit query for software development
CN109871311A (en) * 2017-12-04 2019-06-11 北京京东尚科信息技术有限公司 A kind of method and apparatus for recommending test case

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297090A (en) * 2021-06-11 2021-08-24 南方电网数字电网研究院有限公司 System testing method, device, computer equipment and storage medium
CN113297090B (en) * 2021-06-11 2024-01-23 南方电网数字平台科技(广东)有限公司 System test method, device, computer equipment and storage medium
CN113535594A (en) * 2021-09-17 2021-10-22 广州裕睿信息科技有限公司 Method, device, equipment and storage medium for generating service scene test case
CN113535594B (en) * 2021-09-17 2021-12-21 广州裕睿信息科技有限公司 Method, device, equipment and storage medium for generating service scene test case
US20230305950A1 (en) * 2022-03-22 2023-09-28 International Business Machines Corporation Determination of a prioritized subset of test cases to run after a source code change

Also Published As

Publication number Publication date
CN112749074B (en) 2023-10-27

Similar Documents

Publication Publication Date Title
CN107040609B (en) Network request processing method and device
US20170316781A1 (en) Remote electronic service requesting and processing method, server, and terminal
CN109857403B (en) Page updating method and device, page processing method and device
CN108039963B (en) Container configuration method and device and storage medium
CN107465841B (en) Fault information reporting method and terminal
CN110020293B (en) Multimedia data display method, device and storage medium
CN106293738B (en) Expression image updating method and device
CN112749074B (en) Test case recommending method and device
CN104809055B (en) Application program testing method and device based on cloud platform
CN107734618B (en) Application program closing method and device, storage medium and electronic equipment
JP6915074B2 (en) Message notification method and terminal
CN105631059B (en) Data processing method, data processing device and data processing system
CN107766351B (en) File directory identification method and device
CN108269223B (en) Webpage graph drawing method and terminal
CN106201220B (en) Display content acquisition method and device
CN115065609A (en) B-end SaaS system hybrid deployment method and system
CN112667868B (en) Data detection method and device
CN113852450A (en) Message push feedback method and device, electronic equipment and storage medium
CN110209924B (en) Recommendation parameter acquisition method, device, server and storage medium
CN109799994B (en) Terminal component generation method and device
CN109240986B (en) Log processing method and device and storage medium
CN108449259B (en) Communication processing method and mobile terminal
CN108259187B (en) Method and device for monitoring charging network
CN117234137B (en) MCU clock frequency switching circuit, MCU and electronic equipment
CN114095585B (en) Data transmission method, device, storage medium and electronic 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