CN112749074B - Test case recommending method and device - Google Patents

Test case recommending method and device Download PDF

Info

Publication number
CN112749074B
CN112749074B CN201911047263.7A CN201911047263A CN112749074B CN 112749074 B CN112749074 B CN 112749074B CN 201911047263 A CN201911047263 A CN 201911047263A CN 112749074 B CN112749074 B CN 112749074B
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.)
Active
Application number
CN201911047263.7A
Other languages
Chinese (zh)
Other versions
CN112749074A (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

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

Abstract

The embodiment of the invention discloses a test case recommending method and a device, wherein the test case recommending method 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 start control and the service case, executing the service case when the clicking operation of a user on the start 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 determining a recommended test case set in a preset test case set based on the execution result when the clicking operation of the user on the query control is detected. The scheme can improve the accuracy of recommending the test case.

Description

Test case recommending method and device
Technical Field
The invention relates to the technical field of computers, in particular to a test case recommending method and device.
Background
With the development of technology, the architecture of a service system is more and more complex, and various problems may exist in the process of executing the service, so that a test case is generally adopted to test the service system.
At present, the label of the test case is selected according to the label of the test case, however, the label of the test case is usually constructed manually, the construction mode is mainly realized by referring to historical service data, if the historical service is not covered fully, the problem that the test case is constructed incompletely or incompletely is easily caused if the service is not overlapped fully in a certain degree of service, and the problem that the test case is redundant possibly exists due to the fact that the label of the test case is constructed manually is numerous. Therefore, the scheme accuracy of the existing recommended test case is not high.
Disclosure of Invention
The embodiment of the invention provides a test case recommending method and device, which can improve the accuracy of test case recommending.
The embodiment of the invention provides a test case recommending method, which comprises the following steps:
acquiring a service case needing to be tested;
displaying a test page corresponding to the service case, wherein the test page comprises a start control and the service case;
when the clicking operation of a user on the starting control is detected, executing the service case, 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 when the clicking 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.
Correspondingly, the embodiment of the invention also provides a test case recommending device, which comprises:
the acquisition module is used for acquiring service cases needing to be tested;
the display module is used for displaying a test page corresponding to the service case, wherein the test page comprises a start control and the service case;
the switching module is used for executing the service case when detecting the clicking operation of the user on the starting control, 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 on 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;
A second determining submodule, configured to determine an operation state and 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 calculation unit is used for calculating 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 the 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 used for determining recommended case data corresponding to the service case based on the determined executing nodes and the number of the executing nodes when the executing success rate is greater than a preset threshold;
and the second determining subunit is used for determining a 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 the association relation between each executing node according to the label information of each executing node;
constructing a service path diagram of the service use case according to the association 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 case;
the analysis sub-module 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 sub-module is used for generating an execution result corresponding to the service 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 use case recommending page, wherein the use case recommending page comprises a query control and an execution result corresponding to the service use case.
Optionally, in some embodiments of the present invention, the generating submodule is specifically configured to:
detecting valid execution data in the at least two execution data;
calculating the execution success rate of the service use case based on the quantity 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 case list, wherein the service case list comprises at least two service cases;
when detecting the selection operation of the user for the service cases in the service case list, displaying a test page corresponding to the test case selected by the user.
Optionally, in some embodiments of the present invention, the device further includes a detection module, where the detection module is specifically configured to:
detecting the current running environment of the service case;
the recommendation module is specifically configured to: and when the clicking 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 and the current running environment.
After acquiring a service case to be tested, the embodiment of the invention displays a test page corresponding to the service case, wherein the test page comprises a start control and the service case, when the clicking operation of a user on the start control is detected, the service case is executed, 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, and when the clicking operation of the user on the query control is detected, a recommended test case set is determined in a preset test case set based on the execution result. Therefore, the accuracy of test case recommendation can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a schematic view of a scenario of a test case recommendation method provided by 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 flow chart of a test case recommendation method according to an embodiment of the present invention;
FIG. 2b is a schematic diagram showing a test page in the test case recommendation method according to the embodiment of the present invention;
FIG. 2c is a schematic diagram showing a recommendation page in the test case recommendation method according to the embodiment of the present invention;
FIG. 2d is a schematic diagram showing a recommended test case set in the test case recommendation method provided by the embodiment of the invention;
FIG. 2e is a schematic flow chart of another method for recommending test cases according to an embodiment of the present invention;
FIG. 2f is a schematic diagram showing a test page in the test case recommendation method according to the embodiment of the present invention;
FIG. 2g is a schematic diagram of a test passing page in the test case recommendation method provided by the embodiment of the invention;
FIG. 2h is a schematic diagram of a test failed page in the test case recommendation method provided by the embodiment of the 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 following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the 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 program path or to verify whether a particular requirement is met; as one example, the more complete content that is present in a test case includes: 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, wherein the service requirement data may be service step path data, and specifically, the service step path data may include service execution flow step data.
The embodiment of the invention provides a test case recommending method and device.
The test case recommending device can be integrated in network equipment, such as a terminal or a server, wherein the terminal can comprise a mobile phone, a tablet computer or a personal computer (PC, personal Computer), and the server can comprise a server or a distributed server which independently operates or a server cluster formed by a plurality of servers.
With the test case recommending device integrated in a terminal as an example, please refer to fig. 1a, the terminal may receive a test request sent by a user, the test request may 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 includes a start control and the service case, when detecting a click operation of the user on the start control, the terminal executes the service case and switches the test page to be a case recommending page, the case recommending page includes a query control and an execution result corresponding to the service case, when detecting a click operation of the user on the query control, the terminal may determine a node for executing service case call based on the execution result, to obtain at least one execution node, and then the terminal may determine a recommended test case set in a preset test case set according to the execution node.
The following will describe in detail. It should be noted that the following description order of embodiments is not a limitation of the priority order of embodiments.
A test case recommending method comprises the following steps: the method comprises the steps of obtaining service cases to be tested, displaying a test page corresponding to the service cases, wherein the test page comprises a start control and the service cases, executing the service cases when detecting clicking operation of a user on the start control, displaying the test page in a switching mode as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service cases, and determining a recommended test case set in a preset test case set based on the execution result when detecting clicking operation of the user on the query control.
Referring to fig. 1b, fig. 1b is a flow chart of a test case recommendation method according to an embodiment of the present invention. The specific flow of the test case recommendation method can be as follows:
101. and acquiring the service case needing to be tested.
The service use case refers to a service requirement data set generated according to a service requirement of a target service, wherein the service requirement data set may include local data and network data, it may be understood that the local data may be data stored in a database in advance, and the network data may be data pulled through an access network interface.
102. And displaying a test page corresponding to the service case.
The test page includes a start control and a service instance, for example, the test page may be displayed on a browser, where the browser may be a google browser, a firefox browser, an IE browser, and the like. Further, the test page may display the start control and information of the service case, where the information of the service case may include a name of the service case, a creation time of the service case, and so on, and specifically set according to an actual situation.
Optionally, in some embodiments, the step of displaying the test page corresponding to the service case may specifically include:
(11) Displaying a service case list;
(12) When detecting the selection operation of the user for the service cases in the service case list, displaying a test page corresponding to the test case selected by the user.
Specifically, the service case list may include at least two service cases, when a selection operation of a user for a service case in the service case list is detected, a test page corresponding to a 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 of the service cases 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, 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 start control is detected, executing the service use case, and displaying the test page in a switching manner as a use case recommendation page.
And after the service case is executed, the user can switch and display 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.
Specifically, the data packet corresponding to the service case may be parsed to obtain an execution result corresponding to the service case, that is, in some embodiments, the step of "when detecting the click operation of the user on the start control, executing the service case and displaying the test page as the case recommendation page in a switching manner" may specifically include:
(21) Extracting a data packet of a service 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 the execution node corresponding to each execution data;
(24) And displaying the test page as a use case recommendation page in a switching manner.
The execution data refers to data after the service data executes the service capability thereof, firstly, the data packet can be parsed according to the service characteristics to be realized by the service use case, at least two execution data and the execution node corresponding to each execution data are obtained, for example, the service to be realized by the service use case is code scanning payment, then the data packet can be parsed based on the characteristics of code scanning payment, at least two execution data corresponding to code scanning payment are obtained, the execution data corresponding to the implementation payment is realized, the execution data corresponding to the confirmation payment is realized, the execution data corresponding to the cancellation payment is realized, and the like, and the execution node corresponding to each execution data can also be obtained, then, the execution data and the execution node corresponding to each execution data are added into the same set, the execution result corresponding to the service use case is generated, and finally, the test page is switched and displayed as a use case recommendation page, wherein the use case recommendation page comprises the execution result corresponding to the query control and the service use 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 pieces of execution data, that is, in some embodiments, the step of generating the execution result corresponding to the service use case based on at least two pieces of execution data and the execution node corresponding to each piece of execution data may specifically include:
(31) Detecting valid execution data in at least two execution data;
(32) Calculating the execution success rate of the service use case based on the quantity 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 is successfully executed, for example, a service use case includes 10 execution data, and if the effective execution data is 6, the execution success rate is 60%, and then, an 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. When the clicking operation of the user on the query control is detected, determining a recommended test case set in the preset test case set based on the 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 the user on the query control is detected, the recommended test case set may be determined in the preset test case set based on the node called by the service case in the execution process, that is, in some embodiments, the step of "when the click operation of the user on the query control is detected, determining the recommended test case set in the preset test case set based on the execution result" may specifically include:
(41) When the clicking operation of a user on the query control is detected, determining a node for executing service use case call according to an execution result, and obtaining at least one execution node;
(42) Determining the running state and the number of the execution nodes;
(43) And determining a recommended test case set in the preset test case set based on the running state and the number of the execution nodes.
For example, the node for executing the service case call may be determined according to the execution result, then the running state and the number of the executing nodes may be determined, where the running state may include a processed state, an unprocessed state, a received data error state, a processed data error state, or an output data error state, and so on, then, based on the running state and the number of the executing nodes, a recommended test case set is determined in a preset test case set, for example, 9 nodes are determined to be invoked by the executing service case, where the number of nodes in which the running state is the processed state is 6, and the number of nodes in which the running state is the output data error state is 3, and then, based on the nodes in which the running state is the processed state, the recommended test case set may be determined in the preset test case set.
Optionally, in some embodiments, the execution success rate of the service case may also be calculated by the running state of the execution node, and when the execution success rate is greater than a preset threshold, the recommended test case set may be determined in the preset test case set based on the running state and the number of the execution node, that is, in some embodiments, the step of determining the recommended test case set in the preset test case set "based on the running 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, determining a recommended test case set in the 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 executing nodes and the number of executing nodes, and the recommended test case set may be determined in the preset test case set according to the recommended case data, that is, the step of determining the recommended test case set in the preset test case set based on the determined executing nodes and the number of executing nodes when the execution success rate is greater than the preset threshold may specifically include:
(61) When the execution success rate is greater than a preset threshold, determining recommended case data corresponding to the service case based on the determined execution nodes and the number of the execution nodes;
(62) And determining a recommended test case set in the preset test case set based on the determined recommended case data.
For example, specifically, a service path diagram of a service case may be constructed according to the determined execution node, and based on the constructed service path diagram, recommended case data corresponding to the service case is determined, that is, optionally, in some embodiments, the step of determining, when the execution success rate is greater than a preset threshold, recommended case data corresponding to the service case 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 the association relation between each executing node according to the label information of each executing node;
(73) Constructing a service path diagram of the service use case according to the association 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 of determining the recommended test case set in the preset test case set based on the execution result when the clicking operation of the user on the query control is detected, the method specifically further includes: detecting the current running environment of the service case;
That is, the step of determining, based on the execution result, the recommended test case set in the preset test case set when the clicking operation of the user on the query control is detected may specifically include: when the clicking operation of the user on the query control is detected, determining a recommended test case set in the preset test case set based on an execution result and the current running environment.
It should be noted that, in order to further improve the accuracy of the recommendation, the current running environment of the service case may be detected when the recommended test case set is determined, for example, when the current running 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" running environment.
After acquiring a service case to be tested, the embodiment of the invention displays a test page corresponding to the service case, wherein the test page comprises a start control and the service case, when detecting the clicking operation of a user for the start control, the embodiment executes the service case, and displays the test page in a switching manner as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service case, and when detecting the clicking operation of the user for the query control, the embodiment determines a recommended test case set in a preset test case set based on the execution result. Compared with the existing scheme, the embodiment of the invention can determine the recommended test case set in the preset test case set according to the node called in the execution process of the service case, so that the problem that the recommended test case set is incomplete is avoided, and the accuracy of the recommendation of the test case can be improved.
The method according to the embodiment will be described in further detail by way of example.
In this embodiment, a description will be given of an example in which the test case recommending apparatus is specifically integrated in a terminal.
Referring to fig. 2a, a test case recommendation method includes the following specific steps:
201. the terminal acquires the service case needing 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 acquire the service requirement data set needing to be tested through accessing the network interface, namely, the terminal can acquire the service case needing to be tested through the network.
202. And the terminal displays a test page corresponding to the service case.
The test page may include a start control and a service case, for example, a display screen of the terminal may display 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 an operation for the 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 detecting the clicking operation of the user on the start control, the terminal executes the service use case and switches and displays the test page as the use case recommendation page.
When the terminal detects the clicking operation of the user on the starting control, the terminal can extract a data packet of the service case and analyze the data packet to obtain at least two execution data and execution nodes 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 nodes corresponding to each execution data, and switches and displays a test page as a case recommendation page, wherein the case recommendation page can comprise a query control and an execution result corresponding to the service case, and the user can acquire a test case set recommended by the service case by clicking the query control as shown in fig. 2 c.
204. The terminal detects the current running environment of the service case.
It should be noted that, the terminal may detect the current running environment of the service case before acquiring the service case to be tested, or may detect the current running environment of the service case before the terminal displays the test page corresponding to the service case, and specifically set according to the actual situation.
205. When the terminal detects clicking operation of a user on the query control, determining a recommended test case set in the preset test case set based on an execution result and a current running environment.
Specifically, when the terminal detects the click operation of the user on the query control, the terminal may determine a recommended test case set from the preset test case sets based on the 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 test cases in the beta environment is 31, that is, the total number of recommended test cases is 31, based on the execution result and the current running environment, and further, in order to improve the accuracy of the recommended test cases, the terminal may determine the node for executing the service case call based on the execution result, and the terminal determines the recommended test case set according to the execution nodes and the current execution environment, which is specifically please refer to the foregoing embodiment, and will not be described herein.
As can be seen from the foregoing, after the terminal in this embodiment obtains the service case that needs to be tested, the test page corresponding to the service case is displayed, where the test page includes a start control and the service case, and when the terminal detects a click operation of the user on the start control, the terminal executes the service case, and switches and displays the test page as a case recommendation page, where the case recommendation page includes a query control and an execution result corresponding to the service case, and when the terminal detects a click operation of the user on the query control, the terminal determines a recommended test case set in a preset test case set based on the execution result. Compared with the existing scheme, the terminal of the embodiment of the invention can determine the recommended test case set in the preset test case set according to the node called by the service case in the execution process and the current running environment of the service case, so that the problem that the recommended test case set is incomplete is avoided, and the accuracy of the recommendation of the test case can be improved.
In order to facilitate understanding of the test case recommendation method provided by the embodiment of the present invention, referring to fig. 2e, when a terminal receives a service case that needs to be tested, the terminal may load call stack information, automation data and case data based on the test case, the terminal may integrate 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 the terminal 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, where a test report page corresponding to the service case may be displayed, as shown in fig. 2g, on the page may display an operation environment, a test result, a total consumption time, a start time, and the like for testing the service case, where it is required to be explained that when a test failure rate of the service case is greater than a preset threshold, the test failure rate of the service case may be considered to be not passed, 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, based on the execution result, the terminal may determine a recommended test case set in the preset test case set
In order to facilitate better implementation of the test case recommending method of the embodiment of the invention, the embodiment of the invention also provides a test case recommending device (referred to as a recommending device for short) based on the test case recommending device. The meaning of the nouns is the same as that in the test case recommending 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 recommending apparatus according to an embodiment of the present invention, where the recommending apparatus may include an obtaining module 301, a display module 302, a switching module 303, and a recommending module 304, and may specifically be as follows:
the acquiring module 301 is configured to acquire a service case that needs to be tested.
The acquiring module 301 may acquire the service case to be tested through a network, or may acquire the service case to be tested in the local database.
And the display module 302 is configured to display a test page corresponding to the service case.
The test page includes a start control and the service case, and optionally, in some embodiments, the display module may specifically be configured to: and displaying a service case list, wherein the service case list comprises at least two service cases, and when detecting the selection operation of a user on the service cases in the service case list, displaying a test page corresponding to the test case selected by the user.
And the switching module 303 is configured to execute a service case when detecting a click operation of the user on the start control, and switch and display the test page as a case recommendation page.
The use case recommending page comprises a query control and an execution result corresponding to the service use case. When the switching module 303 detects that the user clicks the start control, the service use case is executed, and optionally, the switching module 303 may switch and display the test page as the use case recommendation page while executing the service use case.
Optionally, in some embodiments, the switching module may specifically include:
the extraction submodule is used for extracting the data packet of the service case;
the analysis sub-module 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 sub-module 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 use case recommending page, wherein the use case recommending page comprises a query control and an execution result corresponding to the service use case.
Alternatively, in some embodiments, the generation submodule may be specifically configured to: detecting effective execution data in at least two execution data, calculating the execution success rate of the service use cases based on the number of the effective execution data, and constructing an execution result corresponding to the service use cases 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, based on the execution result, a recommended test case set from the preset test case sets when the clicking 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 the recommendation module 304 detects a click operation of the user on the query control, the recommended test case set may be determined in the preset test case set based on the node that the service case is invoked in the execution process, that is, optionally, in some embodiments, the recommendation module 304 includes:
the first determining submodule is used for determining a node for executing service use 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 executing 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 the preset test case set based on the determined executing nodes and the number of the executing 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 case based on the determined executing nodes and the number of the executing nodes when the execution success rate is greater than a preset threshold;
and the second determining subunit is used for determining a 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 greater than a preset threshold, extracting label information of each execution node, determining an association 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 association relation, and determining recommended use case data corresponding to the service use case according to the service path diagram.
Optionally, in some embodiments, referring to fig. 3b, the recommending apparatus according to the embodiment of the present invention may further include a detecting module 305, where the detecting module 305 is specifically configured to: the current running environment of the service use case is detected. That is, recommendation module 304 may be specifically configured to: when the clicking operation of the user on the query control is detected, determining a recommended test case set in the preset test case set based on an execution result and the current running environment.
As can be seen, after the acquiring module 301 of the test case recommending apparatus in this embodiment acquires a service case that needs 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 the user on the start control, and switches and displays the test page as a case recommending page, where the case recommending page includes a query control and an execution result corresponding to the service case, and the recommending 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 the user on the query control. Compared with the existing scheme, the recommendation module 304 in the embodiment of the invention can determine the recommended test case set in the preset test case set according to the node called by the service case in the execution process, so that the problem that the recommended test case set is incomplete is avoided, and the accuracy of the recommendation of the test case can be improved.
Correspondingly, the embodiment of the present invention further provides a terminal, as shown in fig. 4, where the terminal may include a Radio Frequency (RF) circuit 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, wireless Fidelity) module 407, a processor 408 including one or more processing cores, and a power supply 409. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 4 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the RF circuit 401 may be used for receiving and transmitting signals during the process of receiving and transmitting information or communication, in particular, after receiving downlink information of a base station, the downlink information is processed by one or more processors 408; in addition, data relating to uplink is transmitted to the base station. Typically, 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, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 401 may also communicate with networks and other devices through wireless communications. The wireless communication may use any communication standard or protocol including, but not limited to, global system for mobile communications (GSM, global System of Mobile communication), general packet radio service (GPRS, general Packet Radio Service), code division multiple access (CDMA, code Division Multiple Access), wideband code division multiple access (WCDMA, wideband Code Division Multiple Access), long term evolution (LTE, long Term Evolution), email, short message service (SMS, short Messaging Service), and the like.
The memory 402 may be used to store software programs and modules, and the processor 408 may execute various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the terminal, etc. In addition, 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 access to the memory 402 by the processor 408 and the input unit 403.
The input unit 403 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, 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 thereon or thereabout by a user (e.g., operations thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. Alternatively, the touch-sensitive surface may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth 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 detection device and converts it into touch point coordinates, which are then sent to the processor 408, and can receive commands from the processor 408 and execute them. In addition, touch sensitive surfaces may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface, the input unit 403 may also comprise other input devices. 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, mouse, joystick, etc.
The display unit 404 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the terminal, which may be composed of graphics, text, icons, video and any combination thereof. The display unit 404 may include a display panel, which may be optionally configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, and upon detection of a touch operation thereon or thereabout, the touch-sensitive surface is communicated to the processor 408 to determine a type of touch event, and the processor 408 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 4 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The terminal may also include at least one sensor 405, such as a light sensor, a 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 backlight when the terminal moves to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured in the terminal are not described in detail herein.
Audio circuitry 406, speakers, and a microphone may provide an audio interface between the user and the terminal. The audio circuit 406 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted to a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 406 and converted into audio data, which are processed by the audio data output processor 408 for transmission to, for example, another terminal via the RF circuit 401, or which are output to the memory 402 for further processing. Audio circuitry 406 may also include an ear bud jack to provide communication of the peripheral ear bud with the terminal.
The WiFi belongs to a short-distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web pages, access streaming media and the like through the WiFi module 407, so that wireless broadband internet access is provided for the user. Although fig. 4 shows a WiFi module 407, it is understood that it does not belong to the essential constitution of the terminal, and can be omitted entirely as required within the scope of 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, performs various functions of the terminal and processes data by running or executing software programs and/or modules stored in the memory 402, and invoking data stored in the memory 402. Optionally, the processor 408 may include one or more processing cores; preferably, the processor 408 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles 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 supply 409 (e.g., a battery) for powering the various components, which may be logically connected to the processor 408 through a power management system that performs functions such as managing charge, discharge, and power consumption. The power supply 409 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, etc., which will not be described herein. In this embodiment, the processor 408 in the terminal loads executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 408 executes the application programs stored in the memory 402, so as to implement various functions:
the method comprises the steps of obtaining service cases to be tested, displaying a test page corresponding to the service cases, wherein the test page comprises a start control and the service cases, executing the service cases when detecting clicking operation of a user on the start control, displaying the test page in a switching mode as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service cases, and determining a recommended test case set in a preset test case set based on the execution result when detecting clicking operation of the user on the query control.
After acquiring a service case to be tested, the embodiment of the invention displays a test page corresponding to the service case, wherein the test page comprises a start control and the service case, when detecting the clicking operation of a user for the start control, the embodiment executes the service case, and displays the test page in a switching manner as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service case, and when detecting the clicking operation of the user for the query control, the embodiment determines a recommended test case set in a preset test case set based on the execution result. Compared with the existing scheme, the embodiment of the invention can determine the recommended test case set in the preset test case set according to the node called in the execution process of the service case, so that the problem that the recommended test case set is incomplete is avoided, and the accuracy of the recommendation of the test case can be improved.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present invention provides a storage medium having stored therein a plurality of instructions that can be loaded by a processor to perform the steps of any of the test case recommendation methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
the method comprises the steps of obtaining service cases to be tested, displaying a test page corresponding to the service cases, wherein the test page comprises a start control and the service cases, executing the service cases when detecting clicking operation of a user on the start control, displaying the test page in a switching mode as a case recommendation page, wherein the case recommendation page comprises a query control and an execution result corresponding to the service cases, and determining a recommended test case set in a preset test case set based on the execution result when detecting clicking operation of the user on the query control.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The instructions stored in the storage medium can execute the steps in any test case recommending method provided by the embodiment of the invention, so that the beneficial effects of any test case recommending method provided by the embodiment of the invention can be realized, and detailed descriptions of the previous embodiments are omitted.
The above describes in detail a test case recommendation method, device, terminal and storage medium provided by the embodiment of the present invention, and specific examples are applied to illustrate the principles and embodiments of the present invention, and the above description of the embodiment is only used to help understand the method and core idea of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present invention, the present description should not be construed as limiting the present invention.

Claims (10)

1. The test case recommending method is characterized by comprising the following steps of:
acquiring a service case needing to be tested;
displaying a test page corresponding to the service case, wherein the test page comprises a start control and the service case;
when the clicking operation of a user on the starting control is detected, executing the service case, 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;
when the clicking 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; wherein, include: when the clicking operation of a user on the query control is detected, determining a node for executing the service case call according to an execution result, and obtaining at least one execution node; determining the running state and the number of the execution nodes; determining a recommended test case set in a preset test case set based on the running state and the number of the executing nodes;
The determining a recommended test case set in a preset test case set based on the running state and the number of the executing nodes comprises the following steps: calculating the execution success rate of the service use cases according to the running state of the execution node; and when the execution success rate is greater than a preset threshold, determining a recommended test case set in the preset test case set based on the determined execution nodes and the number of the execution nodes.
2. The method of claim 1, wherein determining a recommended set of test cases in a set of preset test cases based on the determined execution nodes and the number of execution nodes when the execution success rate is greater than a preset threshold comprises:
when the execution success rate is greater than a preset threshold, 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 the preset test case set based on the determined recommended case data.
3. The method according to claim 2, wherein when the execution success rate is greater than a preset threshold, determining recommended case data corresponding to the service case based on the determined execution nodes and the number of execution nodes, includes:
When the execution success rate is greater than a preset threshold value, extracting label information of each execution node;
determining the association relation between each executing node according to the label information of each executing node;
constructing a service path diagram of the service use case according to the association relation;
and determining recommended case data corresponding to the service case according to the service path diagram.
4. The method of claim 1, wherein the executing the business case and displaying the test page switch as a case recommendation page when a click operation of the start control by a user is detected comprises:
extracting the data packet of the service 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 use case recommendation page, wherein the use case recommendation page comprises a query control and an execution result corresponding to the service use case.
5. The method of claim 4, wherein the generating the execution result corresponding to the service case based on the at least two execution data and the execution node corresponding to each execution data comprises:
Detecting valid execution data in the at least two execution data;
calculating the execution success rate of the service use case based on the quantity 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.
6. The method of claim 1, wherein displaying the test page corresponding to the service case comprises:
displaying a service case list, wherein the service case list comprises at least two service cases;
when detecting the selection operation of the user for the service cases in the service case list, displaying a test page corresponding to the test case selected by the user.
7. The method according to any one of claims 1 to 6, wherein when a click operation of the query control by the user is detected, before determining the recommended test case set in the preset test case set based on the execution result, the method further comprises:
detecting the current running environment of the service case;
when detecting the click operation of the user on the query control, determining a recommended test case set in a preset test case set based on the execution result, including: and when the clicking 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 and the current running environment.
8. A test case recommendation device, comprising:
the acquisition module is used for acquiring service cases needing to be tested;
the display module is used for displaying a test page corresponding to the service case, wherein the test page comprises a start control and the service case;
the switching module is used for executing the service case when detecting the clicking operation of the user on the starting control, 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;
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 a user on the query control is detected; the recommendation module is specifically configured to: when the clicking operation of a user on the query control is detected, determining a node for executing the service case call according to an execution result, and obtaining at least one execution node; determining the running state and the number of the execution nodes; determining a recommended test case set in a preset test case set based on the running state and the number of the executing nodes;
The determining a recommended test case set in a preset test case set based on the running state and the number of the executing nodes comprises the following steps: calculating the execution success rate of the service use cases according to the running state of the execution node; and when the execution success rate is greater than a preset threshold, determining a recommended test case set in the preset test case set based on the determined execution nodes and the number of the execution nodes.
9. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when the computer program is executed by the processor.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
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 CN112749074A (en) 2021-05-04
CN112749074B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297090B (en) * 2021-06-11 2024-01-23 南方电网数字平台科技(广东)有限公司 System test method, device, computer equipment and storage medium
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

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

Also Published As

Publication number Publication date
CN112749074A (en) 2021-05-04

Similar Documents

Publication Publication Date Title
CN112749074B (en) Test case recommending method and device
CN110020293B (en) Multimedia data display method, device and storage medium
CN104809055B (en) Application program testing method and device based on cloud platform
CN111078556B (en) Application testing method and device
CN105631059B (en) Data processing method, data processing device and data processing system
CN108959062B (en) Webpage element acquisition method and device
CN107766351B (en) File directory identification method and device
CN106339402B (en) Method, device and system for pushing recommended content
CN110347578B (en) Application testing method and device and storage medium
CN108269223B (en) Webpage graph drawing method and terminal
CN107798008B (en) Content pushing system, method and device
CN112667868B (en) Data detection method and device
CN113852450A (en) Message push feedback method and device, electronic equipment and storage medium
CN109799994B (en) Terminal component generation method and device
CN109240986B (en) Log processing method and device and storage medium
CN110209924B (en) Recommendation parameter acquisition method, device, server and storage medium
WO2015078409A1 (en) Method, device, terminal and system for collecting information
CN107346347B (en) Webpage table display method and device
CN108616552B (en) Webpage access method, device and system
CN112732548A (en) Interface testing method and device
CN117234137B (en) MCU clock frequency switching circuit, MCU and electronic equipment
CN111405649B (en) Information transmission method and device and mobile terminal
CN112799857B (en) Application access method, device, terminal and storage medium
CN107066116B (en) Character string generation method, character analysis method and device
CN110069723B (en) Graphic code identification method, device and storage medium

Legal Events

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