CN116701158A - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN116701158A
CN116701158A CN202210180910.7A CN202210180910A CN116701158A CN 116701158 A CN116701158 A CN 116701158A CN 202210180910 A CN202210180910 A CN 202210180910A CN 116701158 A CN116701158 A CN 116701158A
Authority
CN
China
Prior art keywords
test plan
test
triggering
automation
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210180910.7A
Other languages
Chinese (zh)
Inventor
刘崇正
王晓艳
李凯骅
宋奎
陈舒帆
冯仁杰
王雷鸣
李苗苗
郭伟伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202210180910.7A priority Critical patent/CN116701158A/en
Publication of CN116701158A publication Critical patent/CN116701158A/en
Pending legal-status Critical Current

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/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The invention discloses a testing method and device, and relates to the technical field of computers. One embodiment of the method comprises the following steps: defining corresponding action keywords according to the execution steps of the text use cases of the tested flow, and writing automatic use cases according to the execution steps and the corresponding action keywords; a test plan is created from the usage scenarios of the automation use cases and executed, the test plan including one or more automation use cases. According to the embodiment, a test plan can be created according to the use scene of the automation use case, the whole business full-link flow is supported to carry out automatic test, and the automatic test under different scene types mainly comprising long links is realized through the self-defined action keywords.

Description

Test method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a testing method and apparatus.
Background
Currently, an automation scheme is basically an interface-based automation platform, and verification of a single interface is performed.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
automatic testing cannot be performed on the whole business full-link flow, and automatic testing under different scene types mainly comprising long links cannot be realized.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a testing method and a testing device, which can create a testing plan according to the use scenario of an automation case, support the whole business full-link flow to carry out the automation test, and realize the automation test under different scenario types mainly based on long links through a self-defined action keyword.
To achieve the above object, according to one aspect of an embodiment of the present invention, there is provided a test method.
A method of testing, comprising: defining corresponding action keywords according to the execution steps of the text use cases of the tested flow, and writing automatic use cases according to the execution steps and the corresponding action keywords; creating a test plan according to the use cases of the automation cases, and executing the test plan, wherein the test plan comprises one or more automation cases.
Optionally, the method further comprises: and extracting variables related to the execution environment in the automation use case to obtain execution environment information, wherein the execution environment information is used for configuring or switching the execution environment of the automation use case in the test plan.
Optionally, before the executing the test plan, the method includes: setting a triggering mode of the test plan, wherein the triggering mode comprises any one of manual triggering, timing automatic triggering, periodic automatic triggering and automatic triggering according to triggering conditions.
Optionally, the triggering mode is automatic triggering according to triggering conditions; the executing the test plan includes: and responding to the test request of the development end through a code management platform in butt joint with the development end, and automatically triggering and executing the test plan.
Optionally, acquiring the text use case from the code management platform in butt joint with the development terminal; the executing the test plan further comprises: executing corresponding scripts according to the action keywords of the automation use cases in the test plan, and feeding corresponding defect information back to the code management platform in butt joint with the development end for the automation use cases with failed execution.
Optionally, the tested flow comprises a data interaction step based on long connection; the executing the test plan further comprises: and generating a visual test report and a code coverage rate report, wherein the visual test report comprises detailed data and response messages of the data interaction.
According to another aspect of an embodiment of the present invention, a test apparatus is provided.
A test apparatus comprising: the automatic use case writing module is used for defining corresponding action keywords according to the execution steps of the text use cases of the tested flow and writing the automatic use cases according to the execution steps and the corresponding action keywords; and the test plan execution module is used for creating a test plan according to the use scene of the automation use cases and executing the test plan, wherein the test plan comprises one or more automation use cases.
Optionally, the system further comprises an environment variable extraction module for: and extracting variables related to the execution environment in the automation use case to obtain execution environment information, wherein the execution environment information is used for configuring or switching the execution environment of the automation use case in the test plan.
Optionally, the test plan execution module is further configured to: setting a triggering mode of the test plan, wherein the triggering mode comprises any one of manual triggering, timing automatic triggering, periodic automatic triggering and automatic triggering according to triggering conditions.
Optionally, the triggering mode is automatic triggering according to triggering conditions; the test plan execution module is further configured to: and responding to the test request of the development end through a code management platform in butt joint with the development end, and automatically triggering and executing the test plan.
Optionally, acquiring the text use case from the code management platform in butt joint with the development terminal; the test plan execution module is further configured to: executing corresponding scripts according to the action keywords of the automation use cases in the test plan, and feeding corresponding defect information back to the code management platform in butt joint with the development end for the automation use cases with failed execution.
Optionally, the tested flow comprises a data interaction step based on long connection; the test plan execution module is further configured to: and generating a visual test report and a code coverage rate report, wherein the visual test report comprises detailed data and response messages of the data interaction.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; and the memory is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the testing method provided by the embodiment of the invention.
According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer readable medium having stored thereon a computer program which, when executed by a processor, implements the test method provided by the embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: defining corresponding action keywords according to the execution steps of the text use cases of the tested flow, and writing automatic use cases according to the execution steps and the corresponding action keywords; a test plan is created from the usage scenarios of the automation use cases and executed, the test plan including one or more automation use cases. The method can create a test plan according to the use scene of the automation use case, support the whole business full-link flow to carry out the automation test, and realize the automation test under different scene types mainly comprising long links through the self-defined action keywords.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a test method according to one embodiment of the invention;
FIG. 2 is a flow chart of a test method according to one embodiment of the invention;
FIG. 3 is a schematic diagram of the execution steps involved in a text use case in a code management platform according to one embodiment of the present invention;
FIG. 4 is a schematic diagram of the execution steps involved in an automation use case according to one embodiment of the present invention;
FIG. 5 is a schematic diagram of creating a test plan according to one embodiment of the invention;
FIG. 6 is a schematic diagram of a test architecture according to one embodiment of the invention;
FIG. 7 is a schematic diagram of the main modules of a test apparatus according to one embodiment of the invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 9 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a schematic diagram of the main steps of a test method according to one embodiment of the invention.
As shown in fig. 1, the testing method according to an embodiment of the present invention mainly includes the following steps S101 to S102.
Step S101: defining corresponding action keywords according to the execution steps of the text use cases of the tested flow, and writing the automatic use cases according to the execution steps and the corresponding action keywords.
The embodiment of the invention executes scene automation test on the tested flow, the text use case of the tested flow is written in the code management platform in advance, and the code management platform can be in butt joint with the development end, namely the embodiment of the invention can acquire the text use case from the code management platform in butt joint with the development end. A code management platform, such as a cloud (Teambition Codeup), is an enterprise-level code management platform.
The scene automation is an automatic mode for simulating the data collaboration flow of the real scene of a user according to the realization logic of a user side, and is different from the interface test in that the scene automation can simulate the operation process of the user more, the data generation is also constructed according to the generation mode in the real operation, and the process verification is not only the judgment of the response, but also the check needs to be performed deep into the system link node. The execution steps of the text use cases of the tested flow are the steps required to be tested in the tested flow, wherein the steps can comprise various times of data interaction steps.
Defining corresponding action keywords according to the execution steps of the text use cases of the tested flow, for example, a certain execution step is as follows: the multiple customers send messages, then the corresponding action key may be defined as: SENDMSG.
The embodiment of the invention can extract the variables related to the execution environment in the automation use cases to obtain the execution environment information, wherein the execution environment information is used for configuring or switching the execution environment of the automation use cases in the test plan.
The measured flow of one embodiment of the present invention includes a long connection based data interaction step.
When the automatic case is written according to the execution steps of the text case of the tested flow and the corresponding action keywords, the execution steps of the text case of the tested flow are identical to the execution steps of the automatic case, the execution steps in the automatic case all have the corresponding action keywords, and the related case names, action parameters, specific parameters, check items and the like can also be correspondingly arranged.
Step S102: a test plan is created from the usage scenarios of the automation use cases and executed, the test plan including one or more automation use cases.
Prior to executing the test plan, comprising: setting a triggering mode of the test plan, wherein the triggering mode comprises any one of manual triggering, timing automatic triggering, periodic automatic triggering and automatic triggering according to triggering conditions.
In one embodiment, the triggering mode is automatic triggering according to triggering conditions. Executing the test plan may specifically include: and responding to the test request of the development end through a code management platform in butt joint with the development end, and automatically triggering to execute the test plan.
Executing the test plan may further include: executing corresponding scripts according to the action keywords of the automation use cases in the test plan, and feeding corresponding defect information back to a code management platform in butt joint with the development end for the automation use cases with failed execution.
Executing the test plan may further include: visual test reports and code coverage reports are generated, which may include detailed data of data interactions and response messages.
FIG. 2 is a flow chart of a test method according to one embodiment of the invention.
As shown in fig. 2, in one embodiment, a test case is written based on a row cloud (code management platform), the test case is a text case of a tested process, a case set of a usage scenario is created, an automation case is created according to a corresponding action keyword defined by an execution step of the text case of the tested process, new/modified configuration is performed on environment variables related to the usage scenario, the automation case is checked, and a check pass is determined. Creating a test plan according to the use case of the automation, setting a triggering mode (such as timing period triggering in fig. 2) of the test plan, executing the test plan and generating a visual test report and a code coverage rate report to optimize the use case. And (3) configuring a triggering mode of the test plan in a pipeline (referred to as a research and development pipeline and located at a development end) through cloud, so as to automatically execute the test plan on the test version (submitted to the test version) in the pipeline, judging whether the test version passes the test through a visual test report and a code coverage rate report, if the test passes the test, sending the test version and a test result to a tester, if the test does not pass the test, rejecting the test version and automatically submitting the detected bug (namely the defect), and after repairing the bug, re-configuring the test plan in the pipeline through cloud. The cloud (Teambition Codeup) is an enterprise-level code management platform, provides functions of code hosting, code review, code scanning, quality detection and the like, protects enterprise code assets, and realizes safe, stable and efficient research and development production.
Fig. 3 is a schematic diagram of execution steps contained in a text use case in a code management platform according to an embodiment of the present invention, and fig. 4 is a schematic diagram of execution steps contained in an automation use case according to an embodiment of the present invention.
In one embodiment, corresponding action keywords are defined according to execution steps of text use cases of the tested flow, and automation use cases are written according to the execution steps and the corresponding action keywords. Specifically, according to the steps of the cloud text use cases, the corresponding automatic use cases are written. Taking the use case of're-entering line overflows when the customer service amount reaches the maximum' as an example, the details of writing the use case on the row cloud are shown in fig. 3, the fig. 3 comprises execution steps contained in the text use case written on the row cloud, and the fig. 4 comprises execution steps contained in the automatic use case. The execution steps of the automation use case are the same as the execution steps of the text use case on the cloud. The steps of tcp long-link protocol sending, cache clearing and obtaining, waiting (sleep) and the like are respectively realized through each defined action keyword, and the scene that the current customer service reaches the maximum reception amount is simulated.
According to one embodiment of the invention, variables related to the execution environment in the automation use case are extracted to obtain execution environment information, and the execution environment information is used for configuring or switching the execution environment of the automation use case in the test plan. Specifically, when an automation use case is written, variables related to the environment are specially extracted and managed as separate configurations, so that the same use case can be switched in test plans of different environments, and execution environments such as domestic prefire, test, commercialized test environments, commercialized Saas (software as a service) environments, commercialized prefire environments, domestic lines and the like can be switched, and specific types of the execution environments are set according to service requirements.
FIG. 5 is a schematic diagram of creating a test plan according to one embodiment of the invention.
As shown in FIG. 5, in one embodiment, after each automation case is written and execution environment related variables and case separation is completed, the automation cases are managed by different test plans according to different usage scenarios. The scenario use cases (for automatic use cases) are added into the test plan in the use case set mode, and meanwhile different trigger modes such as manual trigger, timing automatic trigger, periodic automatic trigger and the like are set, for example, the type of the plan in fig. 5 is manual execution, and the trigger mode is manual trigger. The execution environment can be switched arbitrarily when the test plan is created, so that the test plan is fully used in online daily inspection and version regression test, and the test result after the execution is completed can be synchronized to a tester in a mail mode.
In one embodiment, a test plan is executed, and a visual test report and a code coverage report are generated, the visual test report including detailed data of data interactions and response messages. Specifically, after the test plan is executed, a visual test report is automatically generated, detailed request data and response messages are displayed, and a tester locates the cause of the problem through analysis of process data of each step in the test report. If the execution result has the use cases of execution failure, the use cases of execution failure and the bug (defect) are automatically submitted in the cloud system, wherein the use cases include the detailed description of the bug, the defect type, the priority, the severity, the discovery stage and the like. Before automation is executed, application deployment is carried out from a precise test entry under an IMAT platform (a scene automation test platform provided for the embodiment of the invention, and the embodiment is specifically described in detail below), after the automation execution is finished, a code coverage rate report is automatically generated through an analysis function, and scene use cases are continuously adjusted and newly increased through analysis and evaluation of the code coverage rate report.
According to one embodiment of the invention, a code management platform in butt joint with a development end responds to a test request of the development end, a test plan is automatically triggered and executed, a text use case is obtained from the code management platform in butt joint with the development end, a corresponding script is executed according to an action keyword of the automation use case in the test plan, and corresponding defect information is fed back to the automation use case in failure execution to the code management platform in butt joint with the development end. Specifically, the code management platform in butt joint with the development end can be a pipeline in stage management, by adding a test plan in the pipeline in stage management and configuring an automatic triggering mode, in the cloud test process, the development and the test are carried out, then the use cases in the test plan are automatically triggered and the visual test report and the code coverage rate report are generated, and if the execution result has a failed use case, the failed use case and the bug are automatically fed back to the code management platform in butt joint with the development end.
FIG. 6 is a schematic diagram of a test architecture according to one embodiment of the invention.
As shown in fig. 6, the measured flow in the embodiment of the present invention may be scene automation including a data interaction step based on long connection, where the scene automation is an automation manner of simulating a user real scene data collaboration flow according to implementation logic of a user end, the scene automation can simulate a user operation process, and the data generation is also configured according to a generation manner in the real operation, and the process verification is not only for judging the response, but also for going deep into a system link node to perform inspection.
In order to support the automatic requirements of service scenes such as online customer service, audio and video, and the like, and support multiple protocols simultaneously, the embodiment builds a set of scene automatic test platform, which is called an IMAT platform, and can realize the scene automatic test through the IMAT platform. IMAT comprises a console, a management layer, a driver layer, an execution layer and a base layer. The control console comprises use case management, configuration management, plan management and keyword management; the management layer comprises use cases (case), configuration (config), plan (plan), keywords (key) and database (MySQL); the driving layer comprises a case management (case engine), a plan management (plan engine), a script management (script engine) and a Message Queue (MQ); the execution layer comprises keywords (keys), assertions (assets), texts (contexts) and scripts (scripts); the base layer comprises logs (logging), tcp long links (socket), http links and database storage (DB). The embodiment of the invention supports global variables, can multiplex other use cases (for example, one automation use case is used as the premise of other automation use cases), supports all step result variable references in the use cases (including other automation use cases which are referenced in the automation use case), supports data and use case separation (for example, different execution environments give the same variable different values), supports custom keywords and realizes the keywords of the service in a script mode.
FIG. 7 is a schematic diagram of the main modules of a test apparatus according to one embodiment of the invention.
As shown in fig. 7, a test apparatus 700 according to an embodiment of the present invention mainly includes: an automation use case writing module 701 and a test plan executing module 702.
The automation case writing module 701 is configured to define corresponding action keywords according to execution steps of text cases of the tested flow, and write the automation cases according to the execution steps and the corresponding action keywords.
The test plan execution module 702 is configured to create a test plan according to a usage scenario of an automation use case, and execute the test plan, where the test plan includes one or more automation use cases.
In one embodiment, the system further comprises an environment variable extraction module for: and extracting variables related to the execution environment in the automation use cases to obtain execution environment information, wherein the execution environment information is used for configuring or switching the execution environment of the automation use cases in the test plan.
In one embodiment, the test plan execution module 702 is further configured to: setting a triggering mode of the test plan, wherein the triggering mode comprises any one of manual triggering, timing automatic triggering, periodic automatic triggering and automatic triggering according to triggering conditions.
In one embodiment, the triggering mode is automatic triggering according to the triggering condition; the test plan execution module is further to: and responding to the test request of the development end through a code management platform in butt joint with the development end, and automatically triggering to execute the test plan.
In one embodiment, a text use case is obtained from a code management platform in docking with a development terminal; the test plan execution module 702 is also configured to: executing corresponding scripts according to the action keywords of the automation use cases in the test plan, and feeding corresponding defect information back to a code management platform in butt joint with the development end for the automation use cases with failed execution.
In one embodiment, the tested procedure includes a long connection based data interaction step; the test plan execution module 702 is also configured to: and generating a visual test report and a code coverage rate report, wherein the visual test report comprises detailed data of data interaction and a response message.
In addition, the specific implementation of the test device in the embodiment of the present invention has been described in detail in the above test method, so that the description is not repeated here.
Fig. 8 illustrates an exemplary system architecture 800 in which the test methods or test apparatuses of embodiments of the present invention may be applied.
As shown in fig. 8, a system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves as a medium for providing communication links between the terminal devices 801, 802, 803 and the server 805. The network 804 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 805 through the network 804 using the terminal devices 801, 802, 803 to receive or send messages or the like. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 801, 802, 803.
The terminal devices 801, 802, 803 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 805 may be a server providing various services, such as a background management server (by way of example only) that provides support for shopping-type websites browsed by users using the terminal devices 801, 802, 803. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that the testing method provided in the embodiment of the present invention is generally executed by the server 805, and accordingly, the testing device is generally disposed in the server 805.
It should be understood that the number of terminal devices, networks and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, there is illustrated a schematic diagram of a computer system 900 suitable for use in implementing a terminal device or server in accordance with an embodiment of the present invention. The terminal device or server shown in fig. 9 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU) 901, which can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
The following components are connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 901.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor comprises an automatic use case writing module and a test plan executing module. The names of these modules do not limit the module itself in some cases, for example, the automation case writing module may also be described as "a module for defining corresponding action keywords according to execution steps of text cases of a tested process and writing automation cases according to the execution steps and the corresponding action keywords".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: defining corresponding action keywords according to the execution steps of the text use cases of the tested flow, and writing automatic use cases according to the execution steps and the corresponding action keywords; a test plan is created from the usage scenarios of the automation use cases and executed, the test plan including one or more automation use cases.
According to the technical scheme of the embodiment of the invention, corresponding action keywords are defined according to the execution steps of the text use cases of the tested flow, and automatic use cases are written according to the execution steps and the corresponding action keywords; a test plan is created from the usage scenarios of the automation use cases and executed, the test plan including one or more automation use cases. The method can create a test plan according to the use scene of the automation use case, support the whole business full-link flow to carry out the automation test, and realize the automation test under different scene types mainly comprising long links through the self-defined action keywords.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (14)

1. A method of testing, comprising:
defining corresponding action keywords according to the execution steps of the text use cases of the tested flow, and writing automatic use cases according to the execution steps and the corresponding action keywords;
creating a test plan according to the use cases of the automation cases, and executing the test plan, wherein the test plan comprises one or more automation cases.
2. The method as recited in claim 1, further comprising:
and extracting variables related to the execution environment in the automation use case to obtain execution environment information, wherein the execution environment information is used for configuring or switching the execution environment of the automation use case in the test plan.
3. The method of claim 1, wherein prior to executing the test plan, comprising:
setting a triggering mode of the test plan, wherein the triggering mode comprises any one of manual triggering, timing automatic triggering, periodic automatic triggering and automatic triggering according to triggering conditions.
4. A method according to claim 3, wherein the triggering means is automatic triggering according to a triggering condition;
the executing the test plan includes:
and responding to the test request of the development end through a code management platform in butt joint with the development end, and automatically triggering and executing the test plan.
5. The method of claim 4, wherein the text use case is obtained from the code management platform interfacing with a development terminal;
the executing the test plan further comprises:
executing corresponding scripts according to the action keywords of the automation use cases in the test plan, and feeding corresponding defect information back to the code management platform in butt joint with the development end for the automation use cases with failed execution.
6. The method according to claim 4 or 5, wherein the measured flow comprises a data interaction step based on long connections;
the executing the test plan further comprises:
and generating a visual test report and a code coverage rate report, wherein the visual test report comprises detailed data and response messages of the data interaction.
7. A test device, comprising:
the automatic use case writing module is used for defining corresponding action keywords according to the execution steps of the text use cases of the tested flow and writing the automatic use cases according to the execution steps and the corresponding action keywords;
and the test plan execution module is used for creating a test plan according to the use scene of the automation use cases and executing the test plan, wherein the test plan comprises one or more automation use cases.
8. The apparatus of claim 7, further comprising an environment variable extraction module to:
and extracting variables related to the execution environment in the automation use case to obtain execution environment information, wherein the execution environment information is used for configuring or switching the execution environment of the automation use case in the test plan.
9. The apparatus of claim 7, wherein the test plan execution module is further to:
setting a triggering mode of the test plan, wherein the triggering mode comprises any one of manual triggering, timing automatic triggering, periodic automatic triggering and automatic triggering according to triggering conditions.
10. The device according to claim 9, wherein the triggering means is automatic triggering according to a triggering condition;
the test plan execution module is further configured to:
and responding to the test request of the development end through a code management platform in butt joint with the development end, and automatically triggering and executing the test plan.
11. The apparatus of claim 10, wherein the text use case is obtained from the code management platform interfacing with a development terminal;
the test plan execution module is further configured to:
executing corresponding scripts according to the action keywords of the automation use cases in the test plan, and feeding corresponding defect information back to the code management platform in butt joint with the development end for the automation use cases with failed execution.
12. The apparatus according to claim 10 or 11, wherein the measured flow comprises a long connection based data interaction step;
the test plan execution module is further configured to:
and generating a visual test report and a code coverage rate report, wherein the visual test report comprises detailed data and response messages of the data interaction.
13. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
14. A computer readable medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any of claims 1-6.
CN202210180910.7A 2022-02-25 2022-02-25 Test method and device Pending CN116701158A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210180910.7A CN116701158A (en) 2022-02-25 2022-02-25 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210180910.7A CN116701158A (en) 2022-02-25 2022-02-25 Test method and device

Publications (1)

Publication Number Publication Date
CN116701158A true CN116701158A (en) 2023-09-05

Family

ID=87843799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210180910.7A Pending CN116701158A (en) 2022-02-25 2022-02-25 Test method and device

Country Status (1)

Country Link
CN (1) CN116701158A (en)

Similar Documents

Publication Publication Date Title
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN111786939B (en) Method, device and system for testing management platform of Internet of things
CN110858172A (en) Automatic test code generation method and device
CN110737726B (en) Method and device for determining test data of interface to be tested
CN110059011A (en) Interface test method, device, medium and electronic equipment
CN109656799B (en) Test method and device
CN109218041B (en) Request processing method and device for server system
CN111444077A (en) Method and device for generating flow node test data
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
CN112988600A (en) Service scene testing method and device, electronic equipment and storage medium
CN110866031B (en) Database access path optimization method and device, computing equipment and medium
CN107247661B (en) Method and system for supporting automatic verification of installation package of application
CN113434384B (en) Pressure testing method and device
CN115964302A (en) Data testing method and device
CN112532734B (en) Method and device for detecting message sensitive information
CN112131095B (en) Pressure testing method and device
CN116701158A (en) Test method and device
CN113378346A (en) Method and device for model simulation
CN113132447A (en) Reverse proxy method and system
CN112579428A (en) Interface testing method and device, electronic equipment and storage medium
EP4354298A1 (en) Correlating session failures with application faults from application upgrades
CN113760727A (en) Interface regression testing method and device
CN113326188A (en) Browser testing method and device
CN113778847A (en) Test report generation method and 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