CN115080419A - Automatic testing method and device, storage medium and computer equipment - Google Patents
Automatic testing method and device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN115080419A CN115080419A CN202210734432.XA CN202210734432A CN115080419A CN 115080419 A CN115080419 A CN 115080419A CN 202210734432 A CN202210734432 A CN 202210734432A CN 115080419 A CN115080419 A CN 115080419A
- Authority
- CN
- China
- Prior art keywords
- target test
- component
- test
- target
- case
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 654
- 238000000034 method Methods 0.000 claims abstract description 48
- 238000007781 pre-processing Methods 0.000 claims abstract description 23
- 238000012545 processing Methods 0.000 claims description 35
- 238000004590 computer program Methods 0.000 claims description 10
- 238000004806 packaging method and process Methods 0.000 claims description 9
- 238000004891 communication Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000010998 test method Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses an automatic testing method and device, a storage medium and computer equipment, wherein the method comprises the following steps: determining a target test case and test data; acquiring a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case; preprocessing a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component respectively; and respectively calling an execution method of each target test component on the target test link, sequentially executing the target test components based on the component entry list, and acquiring output data of the target test components as a case execution result. The method and the device help to reduce the test cost and improve the test efficiency.
Description
Technical Field
The present application relates to the field of testing technologies, and in particular, to an automated testing method and apparatus, a storage medium, and a computer device.
Background
With the continuous development of computer technology and internet technology, more and more application services are continuously showing up new. When developing the application service, a technician needs to compile a complete application service code, test the compiled code, and can complete the development of the application service after the test is passed. At present, each time a new application service is developed, technicians are required to compile corresponding test codes, the workload is large, and the test efficiency is low.
Disclosure of Invention
In view of this, the present application provides an automated testing method and apparatus, a storage medium, and a computer device, which are helpful to reduce testing cost and improve testing efficiency.
According to one aspect of the application, there is provided an automated testing method, the method comprising:
determining a target test case and test data;
acquiring a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case;
preprocessing a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component respectively;
and respectively calling an execution method of each target test component on the target test link, sequentially executing the target test components based on the component entry list, and acquiring output data of the target test components as a case execution result.
Optionally, the determining the target test case specifically includes:
receiving a function to be tested, and inquiring whether a test case domain contains a test case corresponding to the function to be tested;
if yes, determining the test case corresponding to the function to be tested as the target test case;
if not, determining a processing link corresponding to the function to be tested, sequentially obtaining a target test component corresponding to each processing function in a test component domain according to at least one processing function on the processing link, and constructing a target test component list comprising the at least one target test component and the target test case corresponding to the target test component list.
Optionally, the obtaining of the target test component list associated with the target test case specifically includes:
and transmitting the target test case into a case execution container, and triggering the case execution container to acquire a target test component list associated with the target test case.
Optionally, the preprocessing the component entry list of the target test component according to the test data and the parameter rule corresponding to each target test component specifically includes:
transmitting the target test component into a component execution container, triggering the component execution container to preprocess a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component;
correspondingly, the respectively calling the execution method of each target test component on the target test link, sequentially executing the target test components based on the component entry list, and acquiring output data of the target test components as a case execution result specifically includes:
the component execution container calls an execution method of each target test component respectively, the target test components are sequentially executed based on the component access list, and output data of each target test component are assembled into the component execution container to form a case execution result;
and the component execution container checks whether an unexecuted component exists or not, and outputs the case execution result when determining that the unexecuted component does not exist.
Optionally, the preprocessing, by the component execution container, the component entry list of the target test component according to the test data and the parameter rule corresponding to each of the target test components specifically includes:
the component execution container configures the input parameter definition of the first target test component according to the parameter attribute corresponding to the test data and the input parameter rule of the first target test component, wherein the parameter attribute comprises a parameter name, a parameter type and a parameter format;
and configuring the input parameter definition of the next target test component according to the output parameter attribute of the first target test component and the input parameter rule of the next target test component until the input parameter definition of each target test component is obtained, and constructing a component parameter entry list containing the input parameter definition of each target test component.
Optionally, after the component execution container pre-processes the component entry list of the target test component according to the test data and the parameter rule corresponding to each of the target test components, the method further includes:
according to the test data and the component entry list, respectively carrying out interface packaging on each target test component;
correspondingly, the sequentially executing the target test components based on the component entry list specifically includes:
and transmitting the test data into an interface of a first target test component, executing the first target test component to obtain output data of the first target test component, and transmitting the output data of the first target test component into an interface of a next target test component until all target test components are completely executed.
According to another aspect of the present application, there is provided an automated testing apparatus comprising:
the parameter determining module is used for determining a target test case and test data;
the component obtaining module is used for obtaining a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case;
the preprocessing module is used for preprocessing a component entry list of the target test component according to the test data and the parameter rule corresponding to the target test component;
and the test module is used for respectively calling the execution method of each target test component on the target test link, sequentially executing the target test components based on the component access list and acquiring output data of the target test components as a case execution result.
Optionally, the parameter determining module is specifically configured to:
receiving a function to be tested, and inquiring whether a test case domain contains a test case corresponding to the function to be tested;
if yes, determining the test case corresponding to the function to be tested as the target test case;
if not, determining a processing link corresponding to the function to be tested, sequentially obtaining a target test component corresponding to each processing function in a test component domain according to at least one processing function on the processing link, and constructing a target test component list comprising the at least one target test component and the target test case corresponding to the target test component list.
Optionally, the component obtaining module is specifically configured to:
and transmitting the target test case into a case execution container, and triggering the case execution container to acquire a target test component list associated with the target test case.
Optionally, the preprocessing module is specifically configured to:
transmitting the target test component into a component execution container, triggering the component execution container to preprocess a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component;
correspondingly, the test module is specifically configured to:
the component execution container calls an execution method of each target test component respectively, the target test components are sequentially executed based on the component access list, and output data of each target test component are assembled into the component execution container to form a case execution result;
and the component execution container checks whether an unexecuted component exists or not, and outputs the case execution result when determining that the unexecuted component does not exist.
Optionally, the preprocessing module is further configured to:
the component execution container configures the input parameter definition of the first target test component according to the parameter attribute corresponding to the test data and the input parameter rule of the first target test component, wherein the parameter attribute comprises a parameter name, a parameter type and a parameter format;
and configuring the input parameter definition of the next target test component according to the output parameter attribute of the first target test component and the input parameter rule of the next target test component until the input parameter definition of each target test component is obtained, and constructing a component parameter entry list containing the input parameter definition of each target test component.
Optionally, the apparatus further comprises:
the interface packaging module is used for respectively packaging the interfaces of the target test components according to the test data and the component parameter list after the component execution container preprocesses the component parameter list of the target test components according to the test data and the parameter rules corresponding to the target test components;
accordingly, the test module is further configured to: and transmitting the test data into an interface of a first target test component, executing the first target test component to obtain output data of the first target test component, and transmitting the output data of the first target test component into an interface of a next target test component until all target test components are completely executed.
According to another aspect of the present application, there is provided an automated test system comprising:
the system comprises a data configuration center, an operation scheduling center and a result counting center;
the data configuration center is used for determining a target test case and test data; acquiring a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case; preprocessing a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component respectively;
the operation scheduling center is used for respectively calling an execution method of each target test component on the target test link and sequentially executing the target test components based on the component entry list;
and the result counting center is used for acquiring output data of the target test assembly as a case execution result.
Optionally, the data configuration center is further configured to:
receiving a function to be tested, and inquiring whether a test case domain contains a test case corresponding to the function to be tested;
if yes, determining the test case corresponding to the function to be tested as the target test case;
if not, determining a processing link corresponding to the function to be tested, sequentially obtaining a target test component corresponding to each processing function in a test component domain according to at least one processing function on the processing link, and constructing a target test component list comprising the at least one target test component and the target test case corresponding to the target test component list.
Optionally, the data configuration center is further configured to:
and transmitting the target test case into a case execution container, and triggering the case execution container to acquire a target test component list associated with the target test case.
Optionally, the data configuration center is further configured to: transmitting the target test component into a component execution container, triggering the component execution container to preprocess a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component;
the operation scheduling center is further configured to:
the component execution container calls an execution method of each target test component respectively, the target test components are sequentially executed based on the component access list, and output data of each target test component are assembled into the component execution container to form a case execution result;
and the component execution container checks whether an unexecuted component exists or not, and outputs the case execution result when determining that the unexecuted component does not exist.
Optionally, the data configuration center is further configured to:
the component execution container configures the input parameter definition of the first target test component according to the parameter attribute corresponding to the test data and the input parameter rule of the first target test component, wherein the parameter attribute comprises a parameter name, a parameter type and a parameter format;
and configuring the input parameter definition of the next target test component according to the output parameter attribute of the first target test component and the input parameter rule of the next target test component until the input parameter definition of each target test component is obtained, and constructing a component parameter entry list containing the input parameter definition of each target test component.
Optionally, the data configuration center is further configured to: according to the test data and the component entry list, respectively carrying out interface packaging on each target test component;
correspondingly, the operation scheduling center is further configured to transmit the test data to an interface of a first target test component, execute the first target test component to obtain output data of the first target test component, and transmit the output data of the first target test component to an interface of a next target test component until all target test components are executed.
According to yet another aspect of the present application, a storage medium is provided, on which a computer program is stored, which program, when being executed by a processor, carries out the above-mentioned automated testing method.
According to yet another aspect of the present application, there is provided a computer device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, the processor implementing the automated testing method when executing the program.
By means of the technical scheme, according to the automatic testing method and device, the storage medium and the computer equipment, for the target test cases and the test data to be tested, firstly, a related target test component list is obtained, secondly, the component parameter of each target test component is sequentially subjected to preprocessing based on the test data and the parameter rules of each target test component in a data driving mode to form a component parameter list, finally, the execution method of each target test component is respectively called, the target test components are sequentially executed based on the component parameter list, the execution results are obtained, and the automatic testing of the target test cases is completed. Compared with the current test mode, the test method and the test system have the advantages that the test assembly and the test case are configured through the test data drive, the automatic test is completed, the test cost is reduced, and the test efficiency is improved.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flow chart illustrating an automated testing method according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart illustrating another automated testing method provided by the embodiments of the present application;
FIG. 3 is a schematic structural diagram of an automated testing apparatus according to an embodiment of the present disclosure;
fig. 4 shows a schematic structural diagram of an automated testing system according to an embodiment of the present application.
Detailed Description
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In this embodiment, an automated testing method is provided, as shown in fig. 1, the method includes:
102, obtaining a target test component list associated with the target test case, wherein the target test component list includes at least one target test component on a target test link corresponding to the target test case.
In the embodiment of the present application, a complete service function is generally composed of a plurality of sub-functions, and each sub-function is sequentially called according to a certain sequence to implement a complete service function. Before a business service is online, in order to ensure that the service can be accurately and stably used, a test is required to be performed first, and the service is online after the test is passed. The method and the device for testing the business service realize the testing of the business service by executing the target test case corresponding to the business service.
Firstly, determining a target test case to be tested, determining input parameters to be tested, namely test data, and obtaining a target test component list associated with the target test case, wherein one service function generally comprises a plurality of sub-functions arranged according to a certain order, the plurality of sub-functions can form a processing link, each sub-function can be tested through a corresponding test component, the target test component list comprises target test components corresponding to the sub-functions, and the target test components are arranged according to the sequence of the sub-functions on the processing link (namely the target test link) of the service function.
Secondly, after the test component itself does not contain data, only the input and output parameter rules are defined, and a target test component list is obtained, in the embodiment of the application, the input parameters of each target test component are preprocessed according to the parameter rules of each target test component, so as to form a component parameter entry list containing the input parameters corresponding to each target test component, and the input parameters of each target test component in the list only contain input parameter definitions and do not contain specific numerical values, and can also be understood that the input parameters in the list are input data templates corresponding to the target test components, and the specific numerical values can be identified and executed by the target test components after being written into the templates. In addition, the target test component is compatible with various input data formats and data protocols, the parameter rules of the target test component comprise parameter rules corresponding to the various input data formats and the data protocols, and the input parameters of the target test component are specifically determined according to the data formats and the data protocols of the test data and the parameter rules of the target test component. In addition, because the input parameter data of the first target test component in the target test case is known test data, the test data can be directly written into the input parameter of the first target test component, so that the test can be driven only through the component parameter entry list when only the automatic test is required in the following process.
And 104, respectively calling an execution method of each target test component on the target test link, sequentially executing the target test components based on the component access list, and acquiring output data of the target test components as a case execution result.
And finally, sequentially calling the execution method of each target test component, sequentially configuring input data of the target test components by using the component reference list, inputting the data into the target test components on the target test link, executing the target test components according to the called execution method, and taking output data of each target test component as an execution result of the target test case to finish the automatic test of the target test case.
By applying the technical scheme of the embodiment, for target test cases and test data to be tested, firstly, a related target test component list is obtained, secondly, component parameter entry of each target test component is preprocessed in sequence in a data driving mode based on the test data and parameter rules of each target test component to form a component parameter entry list, finally, an execution method of each target test component is called respectively, the target test components are executed in sequence based on the component parameter entry list, an execution result is obtained, and automatic testing of the target test cases is completed. Compared with the current test mode, the test method and the test system have the advantages that the test assembly and the test case are configured through the test data drive, the automatic test is completed, the test cost is reduced, and the test efficiency is improved.
Further, as a refinement and an extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of the embodiment, another automated testing method is provided, as shown in fig. 2, and the method includes:
step 201, receiving a function to be tested and test data, and inquiring whether a test case domain contains a test case corresponding to the function to be tested.
The automatic testing method provided by the embodiment of the application can be realized through a pre-constructed automatic testing platform, a plurality of testing components capable of realizing different sub-functions are pre-configured in the automatic testing platform, a testing case capable of realizing a relatively complete function can be pre-configured, and the testing case is composed of a plurality of orderly testing components. When a user wants to test a certain function to be tested, the user can firstly inquire whether a test case corresponding to the function to be tested is constructed in advance in the platform, if the system comprises the test case corresponding to the function to be tested, the test case is directly used as a target test case for testing, and otherwise, the test case of the function to be tested needs to be constructed firstly and then the test is carried out. The process of constructing the test case corresponding to the function to be tested comprises the following steps: determining a processing link of a function to be tested, wherein the processing link comprises an ordered processing function, acquiring a test component for realizing each processing function in an automatic test platform, and constructing each acquired test component into a target test component list corresponding to the function to be tested according to the sequence of each processing function to obtain a target test case of the function to be tested.
And 204, transmitting the target test case into a case execution container, and triggering the case execution container to acquire a target test component list associated with the target test case.
The automated testing platform provided by the embodiment of the application further comprises a case execution container and a component execution container, after the target test case is determined, the number of the target test case can be transmitted into the case execution container, the case execution container is triggered through the number of the target test case to obtain a target test component list related to the target test case in the platform, then all target test components in the target test component list are sequentially transmitted into the component execution container, and therefore the component entry list of the target test components is preprocessed through the component execution container.
Optionally, step 205 comprises: the component execution container configures the input parameter definition of the first target test component according to the parameter attribute corresponding to the test data and the input parameter rule of the first target test component, wherein the parameter attribute comprises a parameter name, a parameter type and a parameter format; and configuring the input parameter definition of the next target test component according to the output parameter attribute of the first target test component and the input parameter rule of the next target test component until the input parameter definition of each target test component is obtained, and constructing a component parameter entry list containing the input parameter definition of each target test component.
In this embodiment, the component execution container sequentially configures the input parameter definitions according to the sequence of each target test component, and first configures the input parameter definition of the first target test component according to the data protocol, the data format, and the like of the test data and the input parameter rule of the first target test component, so that the component input data obtained by writing the test data into the input parameter definition can be recognized and executed by the first target test component. And further, configuring the input parameter definition of the next target test component, wherein the input parameter definition of the second target test component is configured according to the output parameter attribute of the first target test component and the input parameter rule of the second target test component. And by analogy, preprocessing the input parameter definitions of all target test components to form a component reference list. Specifically, the input parameter definition may include: a. parameter name: "key". Example (c): "key": tradeId "// order id. b. The parameter types are as follows: "valueType". Example (c): "valueType": java. c. Parameter format: "valueFormat". Example (c): "valueType": param | $. tradeId "// derived from the tradeId parameter among the parameters. The output parameter definition may include: a. parameter name: "key". Example (a): "key": tradeStatus "// order status. b. The parameter types are as follows: "source". Example (c): source// is derived from the interface output. c. Parameter format: "valueFormat". Example (c): "valueType": apiOut | $. tradesStatus "// derived from the tradesStatus parameter in the interface output.
And step 206, the component execution container respectively calls the execution method of each target test component, sequentially executes the target test components based on the component entry list, and assembles output data of each target test component into the component execution container to form a case execution result.
Optionally, step 205 is followed by: according to the test data and the component entry list, respectively carrying out interface packaging on each target test component; accordingly, step 206 includes: and transmitting the test data into an interface of a first target test component, executing the first target test component to obtain output data of the first target test component, and transmitting the output data of the first target test component into an interface of a next target test component until all target test components are completely executed.
In this embodiment, for each target test component, the target test component may be further packaged according to the component entry list, so as to convert the input data into standardized data that can be recognized and executed by the target test component through the test interface, and specifically, the data may be packaged as a DUBBO interface, an APIGW interface, a restul interface, an openpi interface, and the like according to actual needs. When the target test component is executed, the test data can be directly transmitted into the interface of the first target test component, and the test data is converted into standardized data which can be identified by the first target test component through the packaged test interface so as to facilitate the component execution. And repeating the steps until all the target test components are executed.
Finally, in order to ensure that the test is successful, whether the unexecuted test components exist in the container can be verified through the component execution container, if the unexecuted components exist, the step 206 is returned to execute the target test case again, and if all the components in the container are executed completely, the output data of each target test case acquired by the component execution container is output as an execution result.
Further, as a specific implementation of the method in fig. 1, an embodiment of the present application provides an automatic testing apparatus, as shown in fig. 3, the apparatus includes:
the parameter determining module is used for determining a target test case and test data;
the component obtaining module is used for obtaining a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case;
the preprocessing module is used for preprocessing a component entry list of the target test component according to the test data and the parameter rule corresponding to the target test component;
and the test module is used for respectively calling the execution method of each target test component on the target test link, sequentially executing the target test components based on the component access list and acquiring output data of the target test components as a case execution result.
Optionally, the parameter determining module is specifically configured to:
receiving a function to be tested, and inquiring whether a test case domain contains a test case corresponding to the function to be tested;
if yes, determining the test case corresponding to the function to be tested as the target test case;
if not, determining a processing link corresponding to the function to be tested, sequentially obtaining a target test component corresponding to each processing function in a test component domain according to at least one processing function on the processing link, and constructing a target test component list comprising the at least one target test component and the target test case corresponding to the target test component list.
Optionally, the component obtaining module is specifically configured to:
and transmitting the target test case into a case execution container, and triggering the case execution container to acquire a target test component list associated with the target test case.
Optionally, the preprocessing module is specifically configured to:
transmitting the target test component into a component execution container, triggering the component execution container to preprocess a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component;
correspondingly, the test module is specifically configured to:
the component execution container calls an execution method of each target test component respectively, the target test components are sequentially executed based on the component access list, and output data of the target test components are assembled into the component execution container to form a case execution result;
and the component execution container checks whether an unexecuted component exists or not, and outputs the case execution result when determining that the unexecuted component does not exist.
Optionally, the preprocessing module is further configured to:
the component execution container configures the input parameter definition of the first target test component according to the parameter attribute corresponding to the test data and the input parameter rule of the first target test component, wherein the parameter attribute comprises a parameter name, a parameter type and a parameter format;
and configuring the input parameter definition of the next target test component according to the output parameter attribute of the first target test component and the input parameter rule of the next target test component until the input parameter definition of each target test component is obtained, and constructing a component parameter entry list containing the input parameter definition of each target test component.
Optionally, the apparatus further comprises:
the interface packaging module is used for respectively packaging the interfaces of the target test components according to the test data and the component parameter list after the component execution container preprocesses the component parameter list of the target test components according to the test data and the parameter rules corresponding to the target test components;
accordingly, the test module is further configured to: and transmitting the test data into an interface of a first target test component, executing the first target test component to obtain output data of the first target test component, and transmitting the output data of the first target test component into an interface of a next target test component until all target test components are completely executed.
It should be noted that other corresponding descriptions of the functional units related to the automated testing apparatus and the automated testing system provided in the embodiment of the present application may refer to the corresponding descriptions in the method in fig. 1, and are not described herein again.
An embodiment of the present application further provides an automated testing system, as shown in fig. 4, the system includes:
the system comprises a data configuration center, an operation scheduling center and a result counting center;
the data configuration center is used for determining a target test case and test data; acquiring a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case; preprocessing a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component respectively;
the operation scheduling center is used for respectively calling an execution method of each target test component on the target test link and sequentially executing the target test components based on the component entry list;
and the result counting center is used for acquiring output data of the target test assembly as a case execution result.
Optionally, the data configuration center is further configured to:
receiving a function to be tested, and inquiring whether a test case domain contains a test case corresponding to the function to be tested;
if yes, determining the test case corresponding to the function to be tested as the target test case;
if not, determining a processing link corresponding to the function to be tested, sequentially obtaining a target test component corresponding to each processing function in a test component domain according to at least one processing function on the processing link, and constructing a target test component list comprising the at least one target test component and the target test case corresponding to the target test component list.
Optionally, the data configuration center is further configured to:
and transmitting the target test case into a case execution container, and triggering the case execution container to acquire a target test component list associated with the target test case.
Optionally, the data configuration center is further configured to: transmitting the target test component into a component execution container, triggering the component execution container to preprocess a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component;
the operation scheduling center is further configured to:
the component execution container calls an execution method of each target test component respectively, the target test components are sequentially executed based on the component access list, and output data of each target test component are assembled into the component execution container to form a case execution result;
and the component execution container checks whether an unexecuted component exists or not, and outputs the case execution result when determining that the unexecuted component does not exist.
Optionally, the data configuration center is further configured to:
the component execution container configures the input parameter definition of the first target test component according to the parameter attribute corresponding to the test data and the input parameter rule of the first target test component, wherein the parameter attribute comprises a parameter name, a parameter type and a parameter format;
and configuring the input parameter definition of the next target test component according to the output parameter attribute of the first target test component and the input parameter rule of the next target test component until the input parameter definition of each target test component is obtained, and constructing a component parameter entry list containing the input parameter definition of each target test component.
Optionally, the data configuration center is further configured to: according to the test data and the component entry list, respectively carrying out interface packaging on each target test component;
correspondingly, the operation scheduling center is further configured to transmit the test data to an interface of a first target test component, execute the first target test component to obtain output data of the first target test component, and transmit the output data of the first target test component to an interface of a next target test component until all target test components are executed.
By applying the automatic test system of the embodiment, (1) a uniform test case model is established; (2) providing a full link test execution scheme; (3) providing a uniform data configuration center, and realizing data driving and configuration generation by the test case and the test component; (4) providing a uniform operation scheduling center, and supporting task scheduling and case operation debugging; (5) and providing a result statistical center for supporting statistical analysis, test logs and message notification. Based on the characteristics, the scheme reduces the manual maintenance cost and the regression cost of the test cases, and provides a novel data-driven full-link interface automation system which is easy to reuse and maintain.
Based on the above-mentioned methods shown in fig. 1 to fig. 2, correspondingly, the present application further provides a storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the above-mentioned automated testing method shown in fig. 1 to fig. 2.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Based on the above methods shown in fig. 1 to fig. 2 and the virtual device embodiment shown in fig. 3, in order to achieve the above object, an embodiment of the present application further provides a computer device, which may specifically be a personal computer, a server, a network device, and the like, where the computer device includes a storage medium and a processor; a storage medium for storing a computer program; a processor for executing a computer program to implement the automated testing method described above and illustrated in fig. 1-2.
Optionally, the computer device may also include a user interface, a network interface, a camera, Radio Frequency (RF) circuitry, sensors, audio circuitry, a WI-FI module, and so forth. The user interface may include a Display screen (Display), an input unit such as a keypad (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., a bluetooth interface, WI-FI interface), etc.
It will be appreciated by those skilled in the art that the present embodiment provides a computer device architecture that is not limiting of the computer device, and that may include more or fewer components, or some components in combination, or a different arrangement of components.
The storage medium may further include an operating system and a network communication module. An operating system is a program that manages and maintains the hardware and software resources of a computer device, supporting the operation of information handling programs, as well as other software and/or programs. The network communication module is used for realizing communication among components in the storage medium and other hardware and software in the entity device.
Through the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by software plus a necessary universal hardware platform, and also can implement target test cases and test data to be tested by hardware, first, a list of associated target test components is obtained, then, in a data-driven manner, based on the test data and parameter rules of each target test component, component entry pre-processing is sequentially performed on component entry of each target test component to form a component entry list, and finally, an execution method of each target test component is respectively called, and the target test components are sequentially executed based on the component entry list and an execution result is obtained, thereby completing the automated test of the target test cases. Compared with the current test mode, the test method and the test system have the advantages that the test assembly and the test case are configured through the test data drive, the automatic test is completed, the test cost is reduced, and the test efficiency is improved.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.
Claims (10)
1. An automated testing method, the method comprising:
determining a target test case and test data;
acquiring a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case;
preprocessing a component entry list of the target test component according to the test data and the parameter rule corresponding to the target test component;
and respectively calling an execution method of each target test component on the target test link, sequentially executing the target test components based on the component entry list, and acquiring output data of the target test components as a case execution result.
2. The method according to claim 1, wherein the determining the target test case specifically includes:
receiving a function to be tested, and inquiring whether a test case domain contains a test case corresponding to the function to be tested;
if yes, determining the test case corresponding to the function to be tested as the target test case;
if not, determining a processing link corresponding to the function to be tested, sequentially obtaining a target test component corresponding to each processing function in a test component domain according to at least one processing function on the processing link, and constructing a target test component list comprising the at least one target test component and the target test case corresponding to the target test component list.
3. The method according to claim 1 or 2, wherein the obtaining of the target test component list associated with the target test case specifically includes:
and transmitting the target test case into a case execution container, and triggering the case execution container to acquire a target test component list associated with the target test case.
4. The method of claim 3, wherein the preprocessing the component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component respectively comprises:
transmitting the target test component into a component execution container, triggering the component execution container to preprocess a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component;
correspondingly, the respectively calling the execution method of each target test component on the target test link, sequentially executing the target test components based on the component entry list, and acquiring output data of the target test components as a case execution result specifically includes:
the component execution container calls an execution method of each target test component respectively, the target test components are sequentially executed based on the component access list, and output data of the target test components are assembled into the component execution container to form a case execution result;
and the component execution container checks whether an unexecuted component exists or not, and outputs the case execution result when determining that the unexecuted component does not exist.
5. The method according to claim 4, wherein the component execution container preprocesses the component entry list of the target test component according to the test data and the parameter rule corresponding to each of the target test components, and specifically includes:
the component execution container configures the input parameter definition of the first target test component according to the parameter attribute corresponding to the test data and the input parameter rule of the first target test component, wherein the parameter attribute comprises a parameter name, a parameter type and a parameter format;
and configuring the input parameter definition of the next target test component according to the output parameter attribute of the first target test component and the input parameter rule of the next target test component until the input parameter definition of each target test component is obtained, and constructing a component parameter entry list containing the input parameter definition of each target test component.
6. The method of claim 5, wherein after the component execution container pre-processes the component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component, the method further comprises:
according to the test data and the component entry list, respectively carrying out interface packaging on each target test component;
correspondingly, the sequentially executing the target test components based on the component entry list specifically includes:
and transmitting the test data into an interface of a first target test component, executing the first target test component to obtain output data of the first target test component, and transmitting the output data of the first target test component into an interface of a next target test component until all target test components are completely executed.
7. An automated testing apparatus, comprising:
the parameter determining module is used for determining a target test case and test data;
the component obtaining module is used for obtaining a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case;
the preprocessing module is used for preprocessing a component entry list of the target test component according to the test data and the parameter rule corresponding to the target test component;
and the test module is used for respectively calling an execution method of each target test component on the target test link, sequentially executing the target test components based on the component access list, and acquiring output data of the target test components as a case execution result.
8. An automated test system, comprising:
the system comprises a data configuration center, an operation scheduling center and a result counting center;
the data configuration center is used for determining a target test case and test data; acquiring a target test component list associated with the target test case, wherein the target test component list comprises at least one target test component on a target test link corresponding to the target test case; preprocessing a component entry list of the target test component according to the test data and the parameter rules corresponding to the target test component respectively;
the operation scheduling center is used for respectively calling an execution method of each target test component on the target test link and sequentially executing the target test components based on the component entry list;
and the result counting center is used for acquiring output data of the target test assembly as a case execution result.
9. A storage medium on which a computer program is stored, which computer program, when being executed by a processor, carries out the automated testing method according to one of claims 1 to 6.
10. A computer device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the automated testing method of any one of claims 1 to 6 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210734432.XA CN115080419A (en) | 2022-06-27 | 2022-06-27 | Automatic testing method and device, storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210734432.XA CN115080419A (en) | 2022-06-27 | 2022-06-27 | Automatic testing method and device, storage medium and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115080419A true CN115080419A (en) | 2022-09-20 |
Family
ID=83255024
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210734432.XA Pending CN115080419A (en) | 2022-06-27 | 2022-06-27 | Automatic testing method and device, storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115080419A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110750442A (en) * | 2019-09-06 | 2020-02-04 | 平安医疗健康管理股份有限公司 | Test case generation method, device, equipment and storage medium |
CN112631924A (en) * | 2020-12-29 | 2021-04-09 | 平安消费金融有限公司 | Automatic testing method and device, computer equipment and storage medium |
CN113094251A (en) * | 2019-12-23 | 2021-07-09 | 深圳奇迹智慧网络有限公司 | Embedded system testing method and device, computer equipment and storage medium |
WO2022016847A1 (en) * | 2020-07-21 | 2022-01-27 | 国云科技股份有限公司 | Automatic test method and device applied to cloud platform |
CN114579469A (en) * | 2022-03-21 | 2022-06-03 | 康键信息技术(深圳)有限公司 | Full link interface test method and device, electronic equipment and storage medium |
-
2022
- 2022-06-27 CN CN202210734432.XA patent/CN115080419A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110750442A (en) * | 2019-09-06 | 2020-02-04 | 平安医疗健康管理股份有限公司 | Test case generation method, device, equipment and storage medium |
CN113094251A (en) * | 2019-12-23 | 2021-07-09 | 深圳奇迹智慧网络有限公司 | Embedded system testing method and device, computer equipment and storage medium |
WO2022016847A1 (en) * | 2020-07-21 | 2022-01-27 | 国云科技股份有限公司 | Automatic test method and device applied to cloud platform |
CN112631924A (en) * | 2020-12-29 | 2021-04-09 | 平安消费金融有限公司 | Automatic testing method and device, computer equipment and storage medium |
CN114579469A (en) * | 2022-03-21 | 2022-06-03 | 康键信息技术(深圳)有限公司 | Full link interface test method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109582301B (en) | Service processing method, device, equipment and medium based on task scheduling system | |
CN108334465B (en) | Configuration method, device and equipment of communication interface and computer readable storage medium | |
CN110933095A (en) | Message parsing method and device | |
CN111159046B (en) | Test method, test device, electronic equipment, test system and storage medium | |
CN109492181B (en) | Page jump method, device, computer equipment and storage medium | |
CN113485880A (en) | Test method and device | |
CN113971110A (en) | Interface testing method, device, equipment and computer readable storage medium | |
CN108694120B (en) | Method and device for testing service component | |
CN115065652B (en) | Message reply method and device, storage medium and computer equipment | |
CN112132530B (en) | Visual dynamic flow arranging method and system | |
CN112306857A (en) | Method and apparatus for testing applications | |
CN113434405A (en) | Method and device for determining test file, storage medium and electronic device | |
CN113760736A (en) | Test method, device and system | |
KR20120102967A (en) | System and method for verifying application | |
CN109508193B (en) | Application deployment and operation method, device, terminal equipment and medium | |
CN111142859A (en) | Script generation method and device, electronic equipment and storage medium | |
CN115080419A (en) | Automatic testing method and device, storage medium and computer equipment | |
CN115833964A (en) | Performance test method and performance test system of dual-mode communication module | |
CN114756183A (en) | Data printing method, device, equipment and storage medium | |
CN113934552A (en) | Method and device for determining function code, storage medium and electronic device | |
CN110837476A (en) | Application program testing method and device | |
CN115409194B (en) | Quantum program generation system and quantum computer operation system | |
CN115409193B (en) | Quantum program generation method, quantum program generation device, quantum program generation medium and quantum computer operating system | |
CN114153733A (en) | Test method and device and mobile equipment | |
CN116166545A (en) | Test environment creation method, test environment creation device, medium and electronic device |
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 |