CN115794637A - Method, device, equipment and computer readable medium for automatic test - Google Patents

Method, device, equipment and computer readable medium for automatic test Download PDF

Info

Publication number
CN115794637A
CN115794637A CN202211536538.5A CN202211536538A CN115794637A CN 115794637 A CN115794637 A CN 115794637A CN 202211536538 A CN202211536538 A CN 202211536538A CN 115794637 A CN115794637 A CN 115794637A
Authority
CN
China
Prior art keywords
error code
file
enumeration
class file
code
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
CN202211536538.5A
Other languages
Chinese (zh)
Inventor
尼凯
王定成
胡培
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211536538.5A priority Critical patent/CN115794637A/en
Publication of CN115794637A publication Critical patent/CN115794637A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses an automatic testing method, device, equipment and computer readable medium, and relates to the technical field of big data intelligent analysis. One embodiment of the method comprises: modifying an error code enumeration class file according to the updated error code, and pushing the modified error code enumeration class file, wherein the error code enumeration class file is obtained from a data warehouse; compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to a code server; and the code server pushes the file packet of the compiled error code enumeration class file so as to execute automatic test by adopting the updated error code. The embodiment can reduce the reference error of the error code and realize automatic test.

Description

Method, device, equipment and computer readable medium for automatic test
Technical Field
The invention relates to the technical field of big data intelligent analysis, in particular to a method, a device, equipment and a computer readable medium for automatic testing.
Background
Currently, when an error occurs in a system, an interface provided by the Java microservice usually returns a specific error code corresponding to the error to the interface. In Java, error codes are typically returned or maintained in constant or enumerated classes directly by developers via an interface, and then manually added or modified.
Each error code corresponds to a fixed error description, the caller can quickly understand the cause of the error through the error description interface, and the problem tracking of the background error is carried out through the error code.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: the error codes are updated through manual maintenance, so that the reference of the error codes is disordered, and the automatic test cannot be realized.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a computer readable medium for automated testing, which can reduce reference errors of error codes and implement automated testing.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided an automated testing method, including:
modifying an error code enumeration class file according to the updated error code, and pushing the modified error code enumeration class file, wherein the error code enumeration class file is obtained from a data warehouse;
compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to a code server;
and the code server pushes the file packet of the compiled error code enumeration class file so as to execute automatic test by adopting the updated error code.
The updating error code is generated based on error code description information and an error code identifier, wherein the error code description information and the error code identifier are parameters obtained according to an updating error code instruction.
The updating error code is generated in an error code management platform based on the error code description information and the error code identification.
Modifying the error code enumeration class file according to the updated error code, including:
analyzing the class file acquired from the data warehouse through an abstract syntax tree to obtain the error code enumeration class file;
and modifying the error code information of the error code enumeration type file according to the updated error code.
Analyzing the class file acquired from the data warehouse through the abstract syntax tree to obtain the error code enumeration type file, wherein the method comprises the following steps:
performing class file comparison on the class files acquired from the data warehouse to obtain enumeration values of the class files acquired from the data warehouse;
and analyzing the enumeration value by adopting an abstract syntax tree to obtain the error code information of the error code enumeration type file.
The pushing of the updated error code enumeration class file includes:
and pushing the updated error code enumeration class file to the data warehouse so as to be compiled into a class file in the data warehouse.
The data warehouse comprises a git warehouse.
The modifying the error code enumeration class file according to the updated error code and pushing the modified error code enumeration class file includes:
and in the error code management platform, modifying the error code enumeration class file according to the updated error code, and pushing the modified error code enumeration class file.
The compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to a code server, including:
and after receiving the modified error code enumeration type file, compiling and packaging the modified error code enumeration type file, and sending a file package of the compiled error code enumeration type file to a code server.
Compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to a code server, wherein the compiling and packaging comprises:
and compiling and packaging the modified error code enumeration class file in a continuous integration platform, and sending a file package of the compiled error code enumeration class file to a code server.
The code server pushes the file package of the compiled error code enumeration class file, and the method comprises the following steps:
and the code server pushes the file packet of the compiled error code enumeration type file through a preset message.
The code server includes a proxy server.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for automated testing, including:
the modification module is used for modifying the error code enumeration type file according to the updated error code and pushing the modified error code enumeration type file, wherein the error code enumeration type file is obtained from a data warehouse;
the processing module is used for compiling and packaging the modified error code enumeration class file and sending a file package of the compiled error code enumeration class file to the code server;
and the control module is used for controlling the code server to push the file package of the compiled error code enumeration type file so as to execute the automatic test by adopting the updated error code.
According to a third aspect of embodiments of the present invention, there is provided an electronic device for automated testing, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method as described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method as described above.
According to a fifth aspect of embodiments of the present invention, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method as provided above by embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: modifying an error code enumeration class file according to the updated error code, and pushing the modified error code enumeration class file, wherein the error code enumeration class file is obtained from a data warehouse; compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to a code server; and the code server pushes the file packet of the compiled error code enumeration class file so as to execute automatic test by adopting the updated error code. The error code updating method comprises the steps of modifying and pushing an error code enumeration type file by using an updating error code, sending the updating error code in a file package mode, and further using the updating error code in an automatic test process, so that reference errors of the error code can be reduced, and automatic test is realized.
Further effects of the above-mentioned non-conventional alternatives will be 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 a main flow of a method of automated testing according to an embodiment of the invention;
FIG. 2 is a flow chart illustrating a process of modifying an error code enumeration class file according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating obtaining an error code enumeration class file according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a structure of an error code enumeration class file according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the main structure of an apparatus for automated testing according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an apparatus application for automated testing according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 8 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as 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. According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
Currently, java micro service error codes are maintained by manual addition of error codes. Manually maintaining error codes is prone to the following problems.
(1) Different service error codes are defined in different classes, and the same error code is repeatedly defined in a plurality of classes.
(2) The coding format of error codes is not uniform. There are combinations of letters + numbers, also combinations of pure numbers, also combinations of letters + underlines + numbers
(3) The error code reference pattern is not uniform.
(4) There are cases where the interface arbitrarily fills in an error code.
In summary, the error code is manually maintained, so that the reference of the error code is disordered, and the automatic test cannot be realized.
In order to solve the technical problem that the error code reference is disordered and the automatic test cannot be realized, the following technical scheme in the embodiment of the invention can be adopted.
Referring to fig. 1, fig. 1 is a schematic diagram of a main flow of an automated testing method according to an embodiment of the present invention, in which an error code is updated to modify an error code enumeration class file, and an automated test is performed based on an error code in a file package of the compiled error code enumeration class file. As shown in fig. 1, the method specifically comprises the following steps:
s101, modifying the error code enumeration type file according to the updated error code, and pushing the modified error code enumeration type file, wherein the error code enumeration type file is obtained from a data warehouse.
In the embodiment of the invention, a developer, namely an operator of the automatic test, determines the update error code by sending the update error code instruction. The error code instruction includes error code description information and an error code identifier. The error code description information is information describing the content of the error code identification. As an example, the error code description information includes: the format is wrong. The error code identification comprises Chinese identification and/or English identification.
And generating an updating error code based on the error code description information and the error code identification. That is, the update error code is generated based on the error code description information and the error code identification, which are parameters acquired according to the update error code instruction.
In one embodiment of the invention, the error codes are considered to have the characteristics of multiple types and large number. An error code update instruction may be entered using an error code management platform. In the error code management platform, a developer inputs an error code updating instruction comprising error code description information and error code identification in an interactive interface. Furthermore, in the error code management platform, an updated error code is generated based on the error code description information and the error code identification.
That is, the update error code is generated based on the error code description information and the error code identification in the error code management platform.
The error code is operated through the error code management platform, on one hand, the error code is modified by adopting an error code updating instruction, so that the disorder caused by directly modifying the error code is avoided; on the other hand, each instruction is recorded to normalize the operation on the error code.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a process of modifying an error code enumeration class file according to an embodiment of the present invention. The method specifically comprises the following steps:
s201, analyzing the class file acquired from the data warehouse through an abstract syntax tree to obtain an error code enumeration file.
In the embodiment of the present invention, the file maintaining the error code is referred to as an error code enumeration class file. The error code enumeration class file belongs to an enumeration class file. This is because the enumerated class may contain richer attachment information than the Map class and the constant class.
The class file is stored in a data repository, and is obtained from the data repository in the case of modifying the error code enumeration class file. And then, analyzing the class file acquired from the data warehouse through an abstract syntax tree to obtain an error code enumeration file.
The class file includes the complete information of the error code. As an example, the complete information of the error code includes: enumeration name, code, chinese identification, english identification, chinese description information, version number, whether to enable, name of person to be added and time of addition. Where the enumerated name and the code are globally unique. That is, the error code may be uniquely determined based on the enumerated name or code.
Referring to fig. 3, fig. 3 is a schematic flowchart of obtaining an error code enumeration class file according to an embodiment of the present invention. The method specifically comprises the following steps:
s301, performing class file comparison on the class files acquired from the data warehouse to obtain enumeration values of the class files acquired from the data warehouse.
And performing class file comparison on the class files acquired from the data warehouse to obtain enumeration values of the class files acquired from the data warehouse. As an example, when loading a class file, the Java virtual machine performs class file comparison on the loaded class file to obtain an enumeration value.
For example, in a GenderEnum enumeration class there are two enumeration values, MAN and WOMAN. And comparing class files of GenderEnum enumeration classes to obtain enumeration values MAN and WOMAN.
S302, analyzing the enumeration value by adopting an abstract syntax tree to obtain error code information of the error code enumeration type file.
An abstract syntax tree is an abstract representation of the source code syntax structure. It represents the syntactic structure of the programming language in the form of a tree, each node on the tree representing a structure in the source code. And analyzing the enumeration value by adopting the abstract syntax tree to obtain the error code information of the error code enumeration type file.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an error code enumeration class file according to an embodiment of the present invention. The error code enumerates n enumeration values under the enumeration class in the class file, wherein n is an integer greater than or equal to 2. Each enumeration value is provided with attributes such as code, chinese identification, english identification, version, release date, release person and the like.
As an example, in a GenderEnum enumeration class, there are two enumeration values of MAN and WOMAN, and each enumeration value has attributes of encoding, chinese identification, english identification, chinese description, and the like. Through analyzing the abstract syntax tree of the class file, two enumeration values of MAN and WOMAN in a GenderEnum enumeration class and all attributes thereof can be extracted.
In the embodiment of fig. 3, the abstract syntax tree is used to obtain the error code information of the error code enumeration type file, thereby laying a foundation for modifying the error code information.
S202, according to the updated error code, modifying the error code information of the error code enumeration type file.
The update error code is generated based on the error code description information and the error code identification. The updating error code comprises the description information of the newly added or deleted error code and the identification of the newly added or deleted error code. The current need for error codes can be reflected by updating the error codes.
As an example, the updated error code includes the newly added error code description information and the newly added error code identifier, which indicates that the error code information in the error code enumeration-type file cannot meet the requirement of the automated test, and the newly added error code is required.
As another example, the update error code includes the description information of the deleted error code and the identifier of the deleted error code, which indicates that the error code information in the error code enumeration type file is too much and the error code needs to be deleted.
The error code enumeration file comprises the existing error code information, and the error code information of the error code enumeration file is modified by utilizing the updated error code. As an example, the error code information of the error code enumeration class file is added or deleted by updating the error code, so as to obtain the modified error code enumeration class file.
In the embodiment of fig. 2, the error code enumeration class file is modified by updating the error code to update the existing error code, so as to meet the actual requirements of the automated testing.
After the error code enumeration class file is modified, the modified error code enumeration class file needs to be pushed. Where the destination of the push may be a data warehouse. In the data warehouse, the modified error code enumeration class file may be compiled into a class file for use in the next modification of the error code enumeration class file. Specifically, the updated error code enumeration class file is pushed to the data warehouse to be compiled into a class file in the data warehouse.
In one embodiment of the invention, the data warehouse comprises a git warehouse. The git warehouse supports distributed deployment, and can effectively process very small to very large project management at high speed.
In one embodiment of the present invention, instructions for each test need to be recorded to account for automated test requirements. And modifying and sending the enumeration type file by adopting an error code management platform. Specifically, in the error code management platform, the error code enumeration class file is modified according to the updated error code, and the modified error code enumeration class file is pushed. As an example, the error code management platform is provided with an interactive interface, and an error code updating instruction is received through the interactive interface.
S102, compiling and packaging the modified error code enumeration type file, and sending a file package of the compiled error code enumeration type file to a code server.
And coding and packaging the modified error code enumeration type file to obtain a file package of the compiled error code enumeration type file. And sending a file packet of the compiled error code enumeration class file to a code server.
In one embodiment of the present invention, to update the error codes in time, the trigger condition for encoding and packaging is the receipt of a modified error code enumeration class file. That is, once the modified error code enumeration class file is received, encoding and packaging are immediately performed, resulting in a package of compiled error code enumeration class files. Wherein the file package comprises a jar package.
That is, after receiving the modified error code enumeration class file, compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to the code server.
In one embodiment of the invention, in the persistent integration platform, the modified error code enumeration class file is compiled and packaged, and a jar package of the compiled error code enumeration class file is sent to the code server. The role of the persistent integration platform is to encode and pack. And a continuous integration platform is adopted, so that the modified error code enumeration type file can be processed in time.
After the modified error code enumeration class file is compiled and packaged, a jar package of the compiled error code enumeration class file may be sent to a code server. Storing the jar packet including the error code in the code server.
S103, the code server pushes a file package of the compiled error code enumeration type file so as to execute the automatic test by adopting the updated error code.
The code server stores jar packages of compiled error code enumeration class files on one hand and pushes jar packages of compiled error code enumeration class files on the other hand.
In an embodiment of the invention, the code server pushes a jar packet of the compiled error code enumeration class file through a preset message. As one example, the predetermined message includes one or more of an email, a short message, and social software.
In one embodiment of the invention, the code server comprises a proxy server. As one example, the proxy server includes a maven private server. The speed of downloading the file package of the compiled error code enumeration type file can be improved by adopting the maven private server.
maven is a Java platform-based project management and integration tool, which abstracts the project development and management process into a Project Object Model (POM). The private server is a special remote warehouse erected on a local area network and aims to act on the remote warehouse and deploy third-party components.
In the embodiment of the invention, the maven privately stores the jar packet of the compiled error code enumeration class file. Then, pushing a jar package of the compiled error code enumeration class file to execute the automated test by adopting the updated error code.
In the embodiment of the present invention, the error code enumeration class file is modified according to the updated error code, and the modified error code enumeration class file is pushed, where the error code enumeration class file is obtained from the data warehouse; compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to a code server; and the code server pushes the file packet of the compiled error code enumeration class file so as to execute automatic test by adopting the updated error code. The error code updating method comprises the steps of modifying and pushing an error code enumeration type file by using an updating error code, sending the updating error code in a file package mode, and further using the updating error code in an automatic test process, so that reference errors of the error code can be reduced, and automatic test is realized.
In addition, through the error code management platform, the git warehouse, the continuous integration platform and the code server, a series of unattended operation such as reading, modification, pushing, compiling, packaging and pushing of the updated error code is completed to complete the unique controllable management of the error code, so that the automatic test is realized.
Referring to fig. 5, fig. 5 is a schematic diagram of a main structure of an automatic testing apparatus according to an embodiment of the present invention, where the automatic testing apparatus can implement an automatic testing method, and as shown in fig. 5, the automatic testing apparatus specifically includes:
a modifying module 501, configured to modify an error code enumeration class file according to the updated error code, and push the modified error code enumeration class file, where the error code enumeration class file is obtained from a data warehouse;
a processing module 502, configured to compile and package the modified error code enumeration class file, and send a file package of the compiled error code enumeration class file to a code server;
a control module 503, configured to control the code server to push a file package of the compiled error code enumeration class file, so as to execute an automated test by using the updated error code.
In one embodiment of the present invention, the update error code is generated based on error code description information and an error code identification, which are parameters obtained according to an update error code instruction.
In one embodiment of the present invention, the update error code is generated in an error code management platform based on the error code description information and the error code identification.
In an embodiment of the present invention, the modifying module 501 is specifically configured to parse, through an abstract syntax tree, a class file obtained from the data warehouse to obtain the error code enumeration class file;
and modifying the error code information of the error code enumeration type file according to the updated error code.
In an embodiment of the present invention, the modifying module 501 is specifically configured to perform class file comparison on the class file acquired from the data warehouse to obtain an enumerated value of the class file acquired from the data warehouse;
and analyzing the enumeration value by adopting an abstract syntax tree to obtain the error code information of the error code enumeration type file.
In an embodiment of the present invention, the modifying module 501 is specifically configured to push the updated error code enumeration class file to the data warehouse, so as to be compiled into a class file in the data warehouse.
In one embodiment of the invention, the data warehouse comprises a git warehouse.
In an embodiment of the present invention, the modifying module 501 is specifically configured to modify, in the error code management platform, the error code enumeration class file according to the updated error code, and push the modified error code enumeration class file.
In an embodiment of the present invention, the processing module 502 is specifically configured to, after receiving the modified error code enumeration class file, compile and package the modified error code enumeration class file, and send a file package of the compiled error code enumeration class file to a code server.
In an embodiment of the present invention, the processing module 502 is specifically configured to compile and package the modified error code enumeration class file in a persistent integration platform, and send a file package of the compiled error code enumeration class file to a code server.
In an embodiment of the present invention, the control module 503 is specifically configured to control the code server to push a file package of the compiled error code enumeration class file through a preset message.
In one embodiment of the invention, the code server comprises a proxy server.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating an apparatus application flow of an automated test according to an embodiment of the present invention.
The developer sends an error code update command to the automated testing device. In the device for automatic testing, the error code enumeration class file is modified according to the updated error code, and the modified error code enumeration class file is pushed. Compiling and packaging the modified error code enumeration class file, and sending a jar package of the compiled error code enumeration class file to a code server. The code server pushes a jar package of the compiled error code enumeration class file to execute an automated test by adopting the updated error code.
In the embodiment of the invention, the error code is updated without manual intervention in the whole process, so that the standardized management of the error code is realized. Developers can search and check through the management page, and the method is more convenient and faster.
Fig. 7 shows an exemplary system architecture 700 of a method of automated testing or an apparatus of automated testing to which embodiments of the present invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is the medium used to provide communications links between terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. The terminal devices 701, 702, 703 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 701, 702, 703. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for automated testing provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the apparatus for automated testing is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU) 801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to the flow diagrams 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 illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 present invention, 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, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 flowchart 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 described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a modification module, a processing module, and a control module. Where the names of the units do not in some cases constitute a limitation on the units themselves, the modification module may also be described as "for modifying an error code enumeration class file, which is obtained from a data repository, according to an update error code, and pushing the modified error code enumeration class file, for example.
As another aspect, the present invention also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
modifying an error code enumeration class file according to the updated error code, and pushing the modified error code enumeration class file, wherein the error code enumeration class file is obtained from a data warehouse;
compiling and packaging the modified error code enumeration type file, and sending a file package of the compiled error code enumeration type file to a code server;
and the code server pushes the file packet of the compiled error code enumeration class file so as to execute automatic test by adopting the updated error code.
According to the technical scheme of the embodiment of the invention, the error code enumeration type file is modified according to the updated error code, and the modified error code enumeration type file is pushed, wherein the error code enumeration type file is obtained from a data warehouse; compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to a code server; and the code server pushes the file packet of the compiled error code enumeration class file so as to execute automatic test by adopting the updated error code. The error code updating method comprises the steps of modifying and pushing an error code enumeration type file by using an updating error code, sending the updating error code in a file package mode, and further using the updating error code in an automatic test process, so that reference errors of the error code can be reduced, and automatic test is realized.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (16)

1. A method of automated testing, comprising:
modifying an error code enumeration class file according to the updated error code, and pushing the modified error code enumeration class file, wherein the error code enumeration class file is obtained from a data warehouse;
compiling and packaging the modified error code enumeration class file, and sending a file package of the compiled error code enumeration class file to a code server;
and the code server pushes the file packet of the compiled error code enumeration class file so as to execute automatic test by adopting the updated error code.
2. The method for automated testing according to claim 1, wherein the update error code is generated based on error code description information and an error code identification, the error code description information and the error code identification being parameters obtained in accordance with the update error code instruction.
3. The method of claim 2, wherein the updated error code is generated in an error code management platform based on the error code description information and the error code identification.
4. The method of claim 1, wherein modifying the error code enumeration class file according to the updated error code comprises:
analyzing the class file acquired from the data warehouse through an abstract syntax tree to obtain the error code enumeration class file;
and modifying the error code information of the error code enumeration type file according to the updated error code.
5. The method of claim 4, wherein parsing the class file obtained from the data repository through an abstract syntax tree to obtain the error code enumeration class file comprises:
performing class file comparison on the class files acquired from the data warehouse to obtain enumeration values of the class files acquired from the data warehouse;
and analyzing the enumeration value by adopting an abstract syntax tree to obtain the error code information of the error code enumeration type file.
6. The method for automated testing according to claim 1, wherein said pushing an updated error code enumeration class file comprises:
and pushing the updated error code enumeration class file to the data warehouse so as to be compiled into a class file in the data warehouse.
7. The method of automated testing according to claim 1, wherein the data repository comprises a git repository.
8. The method of claim 1, wherein modifying the error code enumeration class file according to the updated error code and pushing the modified error code enumeration class file comprises:
and in the error code management platform, modifying the error code enumeration class file according to the updated error code, and pushing the modified error code enumeration class file.
9. The method of claim 1, wherein compiling and packaging the modified error code enumeration class file and sending a package of the compiled error code enumeration class file to a code server comprises:
and after receiving the modified error code enumeration type file, compiling and packaging the modified error code enumeration type file, and sending a file package of the compiled error code enumeration type file to a code server.
10. The method of claim 9, wherein compiling and packaging the modified ERP enumeration class file and sending a package of compiled ERP enumeration class files to a code server comprises:
and compiling and packaging the modified error code enumeration class file in a continuous integration platform, and sending a file package of the compiled error code enumeration class file to a code server.
11. The method of claim 1, wherein the code server pushes a package of the compiled ERP enumerated class file, comprising:
and the code server pushes the file packet of the compiled error code enumeration type file through a preset message.
12. The method of automated testing according to claim 1, wherein the code server comprises a proxy server.
13. An apparatus for automated testing, comprising:
the modification module is used for modifying the error code enumeration type file according to the updated error code and pushing the modified error code enumeration type file, wherein the error code enumeration type file is obtained from a data warehouse;
the processing module is used for compiling and packaging the modified error code enumeration class file and sending a file package of the compiled error code enumeration class file to the code server;
and the control module is used for controlling the code server to push the file packet of the compiled error code enumeration class file so as to execute an automatic test by adopting the updated error code.
14. An electronic device for automated testing, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-12.
15. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-12.
16. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1-12 when executed by a processor.
CN202211536538.5A 2022-12-02 2022-12-02 Method, device, equipment and computer readable medium for automatic test Pending CN115794637A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211536538.5A CN115794637A (en) 2022-12-02 2022-12-02 Method, device, equipment and computer readable medium for automatic test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211536538.5A CN115794637A (en) 2022-12-02 2022-12-02 Method, device, equipment and computer readable medium for automatic test

Publications (1)

Publication Number Publication Date
CN115794637A true CN115794637A (en) 2023-03-14

Family

ID=85444842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211536538.5A Pending CN115794637A (en) 2022-12-02 2022-12-02 Method, device, equipment and computer readable medium for automatic test

Country Status (1)

Country Link
CN (1) CN115794637A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115994097A (en) * 2023-03-22 2023-04-21 云账户技术(天津)有限公司 Method and device for generating abnormal cash-out use cases based on error codes

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115994097A (en) * 2023-03-22 2023-04-21 云账户技术(天津)有限公司 Method and device for generating abnormal cash-out use cases based on error codes
CN115994097B (en) * 2023-03-22 2023-05-16 云账户技术(天津)有限公司 Method and device for generating abnormal cash-out use cases based on error codes

Similar Documents

Publication Publication Date Title
CN110324169B (en) Interface management method and device
CN111090423B (en) Webhook framework system and method for realizing active calling and event triggering
CN112148711A (en) Processing method and device for batch processing tasks
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN113760324A (en) Method and device for constructing micro front-end application
CN111666293A (en) Database access method and device
CN111324619A (en) Object updating method, device, equipment and storage medium in micro service system
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN115794637A (en) Method, device, equipment and computer readable medium for automatic test
CN111666079B (en) Method, apparatus, system, device and computer readable medium for software upgrade
CN111107133A (en) Generation method of difference packet, data updating method, device and storage medium
CN112835568A (en) Project construction method and device
CN113535220B (en) Code packet management method and device
CN114443076A (en) Mirror image construction method, device, equipment and storage medium
CN113138768A (en) Application package generation method and device, electronic equipment and readable storage medium
CN108845864A (en) A kind of JVM rubbish recovering method and device based on spring frame
CN109871560B (en) Method and device for operating target model
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN112783903B (en) Method and device for generating update log
CN112559001A (en) Method and device for updating application
CN113495747B (en) Gray scale release method and device
CN110727739B (en) Data storage method and device
CN108984189B (en) Module parsing method and device
CN117743156A (en) Test method, test device, electronic equipment and computer readable medium
CN116932123A (en) Method and device for displaying small component page

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