Methods, apparatus, devices, and computer readable media for automated testing

By generating and updating error codes through an error code management platform and a continuous integration platform, and parsing and pushing error code enumeration class files, the problem of chaotic error code references in Java microservices is solved, and the standardization and accuracy of automated testing are achieved.

CN115794637BActive Publication Date: 2026-04-17CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2022-12-02
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, Java microservice error codes are manually maintained, leading to confusion in references and making automated testing impossible.

Method used

The error code management platform generates and updates error codes, uses abstract syntax tree parsing to obtain class files from the data warehouse, modifies the error code enumeration class files, and pushes the compiled error code enumeration class file package through the continuous integration platform and code server to execute automated tests.

Benefits of technology

It has achieved standardized management of error codes, reduced referencing errors, and enabled automated testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115794637B_ABST
    Figure CN115794637B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and computer-readable medium for automated testing, relating to the field of big data intelligent analysis technology. One specific embodiment of the method includes: modifying an error code enumeration class file according to updated error codes, 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 the compiled error code enumeration class file package to a code server; the code server pushing the compiled error code enumeration class file package to perform automated testing using the updated error codes. This embodiment can reduce error code referencing errors and achieve automated testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data intelligent analysis technology, and in particular to an automated testing method, apparatus, device, and computer-readable medium. Background Technology

[0002] Currently, when an error occurs within the system, the interface provided by a Java microservice typically returns a specific error code corresponding to the error. In Java, error codes are usually returned directly by developers through the interface or maintained in constant classes or enumeration classes, and then added or modified manually.

[0003] Each error code corresponds to a fixed error description. By using the error description, the API caller can quickly understand the cause of the error and track down the problem in the backend.

[0004] In the process of realizing this invention, the inventors discovered that the prior art has at least the following problems: the manual maintenance to update error codes leads to confusion in error code references, making it impossible to achieve automated testing. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method, apparatus, device, and computer-readable medium for automated testing, which can reduce error code referencing errors and achieve automated testing.

[0006] To achieve the above objectives, according to one aspect of the present invention, an automated testing method is provided, comprising:

[0007] The error code enumeration class file is modified according to the updated error code, and the modified error code enumeration class file is pushed. The error code enumeration class file is obtained from the data warehouse.

[0008] Compile and package the modified error code enumeration class file, and send the file package of the compiled error code enumeration class file to the code server;

[0009] The code server pushes the file package of the compiled error code enumeration class file to perform automated tests using the updated error codes.

[0010] The updated error code is generated based on the error code description information and the error code identifier, which are parameters obtained according to the updated error code instruction.

[0011] The updated error code is generated in the error code management platform based on the error code description information and the error code identifier.

[0012] The step of modifying the error code enumeration class file according to the updated error code includes:

[0013] The error code enumeration class file is obtained by parsing the class file obtained from the data warehouse using an abstract syntax tree;

[0014] Based on the updated error code, modify the error code information in the error code enumeration class file.

[0015] The step of parsing the class files obtained from the data warehouse using an abstract syntax tree to obtain the error code enumeration class file includes:

[0016] The class files obtained from the data warehouse are compared to obtain an enumeration value of the class files obtained from the data warehouse.

[0017] The enumeration values ​​are parsed using an abstract syntax tree to obtain the error code information of the error code enumeration class file.

[0018] The push notification has been updated with an updated error code enumeration file, including:

[0019] The updated error code enumeration class file is pushed to the data warehouse for compilation into a class file in the data warehouse.

[0020] The data warehouse includes a Git repository.

[0021] The step of modifying the error code enumeration class file according to the updated error code and pushing the modified error code enumeration class file includes:

[0022] 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.

[0023] The process of compiling and packaging the modified error code enumeration class file, and sending the compiled error code enumeration class file package to the code server, includes:

[0024] Upon receiving the modified error code enumeration class file, the modified error code enumeration class file is compiled and packaged, and the file package of the compiled error code enumeration class file is sent to the code server.

[0025] The process of compiling and packaging the modified error code enumeration class file, and sending the compiled error code enumeration class file package to the code server, includes:

[0026] In the continuous integration platform, the modified error code enumeration class file is compiled and packaged, and the file package of the compiled error code enumeration class file is sent to the code server.

[0027] The code server pushes a file package containing the compiled error code enumeration class files, including:

[0028] The code server pushes the file package of the compiled error code enumeration class file through a preset message.

[0029] The code server includes a proxy server.

[0030] According to a second aspect of the present invention, an apparatus for automated testing is provided, comprising:

[0031] The modification module is used to modify the error code enumeration class file according to the updated error code, and push the modified error code enumeration class file, which is obtained from the data warehouse;

[0032] The processing module is used to compile and package the modified error code enumeration class file, and send the file package of the compiled error code enumeration class file to the code server;

[0033] The control module is used to control the code server to push the file package of the compiled error code enumeration class file, so as to perform automated testing using the updated error code.

[0034] According to a third aspect of the present invention, an electronic device for automated testing is provided, comprising:

[0035] One or more processors;

[0036] Storage device for storing one or more programs.

[0037] When the one or more programs are executed by the one or more processors, the one or more processors perform the methods described above.

[0038] According to a fourth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method as described above.

[0039] According to a fifth aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method as described above in the embodiments of the present invention.

[0040] One embodiment of the above invention has the following advantages or beneficial effects: The error code enumeration class file is modified according to the updated error code, and the modified error code enumeration class file, obtained from a data warehouse, is pushed; the modified error code enumeration class file is compiled and packaged, and the file package of the compiled error code enumeration class file is sent to the code server; the code server pushes the file package of the compiled error code enumeration class file to perform automated testing using the updated error code. By modifying and pushing the error code enumeration class file using the updated error code, and sending the updated error code in a file package manner, the updated error code can be used in the automated testing process, thus reducing error code referencing errors and achieving automated testing.

[0041] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0042] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0043] Figure 1 This is a schematic diagram of the main flow of an automated testing method according to an embodiment of the present invention;

[0044] Figure 2 This is a flowchart illustrating the process of modifying the error code enumeration class file according to an embodiment of the present invention;

[0045] Figure 3 This is a flowchart illustrating the process of obtaining an error code enumeration class file according to an embodiment of the present invention;

[0046] Figure 4 This is a schematic diagram of the structure of the error code enumeration class file according to an embodiment of the present invention;

[0047] Figure 5 This is a schematic diagram of the main structure of an automated testing apparatus according to an embodiment of the present invention;

[0048] Figure 6 This is a schematic diagram illustrating the application of an automated testing apparatus according to an embodiment of the present invention;

[0049] Figure 7 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0050] Figure 8 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0051] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with relevant national laws and regulations.

[0052] Currently, Java microservice error codes are maintained manually. Manually maintaining error codes can easily lead to the following problems.

[0053] (1) Different service error codes are defined in different classes, and the same error code is defined repeatedly in multiple classes.

[0054] (2) The encoding format of error codes is inconsistent. There are combinations of letters and numbers, combinations of only numbers, and combinations of letters, underscores, and numbers.

[0055] (3) The error code referencing method is inconsistent.

[0056] (4) There are cases where the interface can be filled with arbitrary error codes.

[0057] In summary, manually maintaining error codes leads to chaotic error code references and makes automated testing impossible.

[0058] To address the technical problem of confusing error code references and the inability to achieve automated testing, the following technical solutions from the embodiments of the present invention can be adopted.

[0059] See Figure 1 , Figure 1 This is a schematic diagram of the main flow of an automated testing method according to an embodiment of the present invention, which updates the error codes, modifies the error code enumeration class file, and then performs automated testing based on the error codes in the file package of the compiled error code enumeration class file. Figure 1 As shown, the specific steps include:

[0060] S101. Modify the error code enumeration class file according to the updated error code, and push the modified error code enumeration class file. The error code enumeration class file is obtained from the data warehouse.

[0061] In this embodiment of the invention, the developer, i.e., the operator of the automated test, determines the updated error code by sending an update error code command. The error code command includes error code description information and an error code identifier. The error code description information describes the content of the error code identifier. As an example, the error code description information includes: formatting error. The error code identifier includes Chinese characters and / or English characters.

[0062] An updated error code is generated based on the error code description information and the error code identifier. In other words, the updated error code is generated based on the error code description information and the error code identifier, which are parameters obtained according to the update error code instruction.

[0063] In one embodiment of the present invention, considering the characteristics of error codes being numerous and diverse, an error code management platform can be used to input update error code commands. In the error code management platform, developers input update error code commands, including error code description information and error code identifiers, through an interactive interface. Subsequently, the error code management platform generates updated error codes based on the error code description information and error code identifiers.

[0064] In other words, the updated error code is generated in the error code management platform based on the error code description information and the error code identifier.

[0065] By operating error codes through the error code management platform, on the one hand, error codes are modified using update error code commands to avoid the confusion caused by directly modifying error codes; on the other hand, each command is recorded to standardize the operation of error codes.

[0066] See Figure 2 , Figure 2 This is a flowchart illustrating the process of modifying an error code enumeration class file according to an embodiment of the present invention. Specifically, it includes the following steps:

[0067] S201. Parse the class files obtained from the data warehouse using the abstract syntax tree to obtain the error code enumeration class files.

[0068] In this embodiment of the invention, the file that maintains error codes is called an error code enumeration class file. The error code enumeration class file belongs to the enumeration class file category. This is because enumeration classes, compared to Map classes and constant classes, can contain richer supplementary information.

[0069] The class files are stored in a data warehouse. When the error code enumeration class file is modified, the class file is retrieved from the data warehouse. Then, the class file retrieved from the data warehouse is parsed using an abstract syntax tree to obtain the error code enumeration class file.

[0070] The class file contains complete information about the error code. As an example, complete error code information includes: enumeration name, code, Chinese identifier, English identifier, Chinese description, version number, whether it is enabled, the name of the person who added it, and the time it was added. The enumeration name and code are globally unique. That is, the error code can be uniquely identified based on the enumeration name or code.

[0071] See Figure 3 , Figure 3 This is a schematic diagram illustrating the process of obtaining an error code enumeration class file according to an embodiment of the present invention. Specifically, it includes the following steps:

[0072] S301. Compare the class files obtained from the data warehouse to obtain the enumeration value of the class files obtained from the data warehouse.

[0073] This involves comparing class files retrieved from a data warehouse to obtain an enumeration of class files from the data warehouse. As an example, the Java Virtual Machine compares the loaded class files during the loading process to obtain the enumeration values.

[0074] For example, a GenderEnum enumeration class has two enumeration values: MAN and WOMAN. By comparing the class files of the GenderEnum enumeration class, the enumeration values ​​MAN and WOMAN can be obtained.

[0075] S302. Use an abstract syntax tree to parse the enumeration values ​​and obtain the error code information of the error code enumeration class file.

[0076] An abstract syntax tree (AST) is an abstract representation of the syntax structure of source code. It represents the syntax structure of a programming language in a tree-like format, where each node in the tree represents a structure within the source code. By parsing enumeration values ​​using an AST, one can obtain the error code information from the error code enumeration class file.

[0077] See Figure 4 , Figure 4 This is a structural diagram of an error code enumeration class file according to an embodiment of the present invention. The error code enumeration class file contains n enumeration values ​​under an enumeration class, where n is an integer greater than or equal to 2. Each enumeration value has attributes such as encoding, Chinese identifier, English identifier, version, release date, and publisher.

[0078] As an example, a GenderEnum enumeration class has two enumeration values, MAN and WOMAN. Each enumeration value has attributes such as encoding, Chinese identifier, English identifier, and Chinese description. By parsing the abstract syntax tree of the class file, the two enumeration values ​​MAN and WOMAN and all their attributes in the GenderEnum enumeration class can be extracted.

[0079] exist Figure 3 In the embodiment, an abstract syntax tree is used to obtain the error code information of the error code enumeration class file, thereby laying the foundation for modifying the error code information.

[0080] S202. Based on the updated error codes, modify the error code information in the error code enumeration class file.

[0081] Updated error codes are generated based on error code descriptions and identifiers. Updated error codes include descriptions of newly added or deleted error codes and their identifiers. By updating error codes, the current requirements for error codes can be reflected.

[0082] As an example, updating error codes includes adding error code description information and adding error code identifiers, indicating that the error code information in the error code enumeration class file cannot meet the needs of automated testing, and new error codes need to be added.

[0083] As another example, updating error codes includes deleting error code description information and deleting error code identifiers, indicating that there is too much error code information in the error code enumeration class file and error codes need to be deleted.

[0084] The error code enumeration class file contains existing error code information. The error code update function modifies the error code information in the error code enumeration class file. As an example, the error code update function adds or deletes error code information in the error code enumeration class file, resulting in a modified error code enumeration class file.

[0085] exist Figure 2 In this embodiment, the error code enumeration class file is modified to update the existing error codes, thereby meeting the actual needs of automated testing.

[0086] After modifying the error code enumeration class file, the modified file needs to be pushed. The destination can be a data warehouse. In the data warehouse, the modified error code enumeration class file can be compiled into a class file for use in subsequent modifications. Specifically, the updated error code enumeration class file is pushed to the data warehouse for compilation into a class file.

[0087] In one embodiment of the invention, the data warehouse includes a Git repository. Git repositories support distributed deployment and can efficiently and quickly manage projects ranging from very small to very large.

[0088] In one embodiment of the present invention, considering the requirements of automated testing, it is necessary to record the instructions for each test. An error code management platform is used to modify and send the enumeration class file. 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 has an interactive interface through which update error code instructions are received.

[0089] S102. Compile and package the modified error code enumeration class file, and send the file package of the compiled error code enumeration class file to the code server.

[0090] The modified error code enumeration class file is encoded and packaged to obtain a file package of compiled error code enumeration class files. This file package is then sent to the code server.

[0091] In one embodiment of the present invention, the trigger condition for encoding and packaging is receiving a modified error code enumeration class file in order to update error codes in a timely manner. That is, once the modified error code enumeration class file is received, encoding and packaging are immediately performed to obtain a file package containing the compiled error code enumeration class file. This file package includes a JAR file.

[0092] That is, after receiving the modified error code enumeration class file, the modified error code enumeration class file is compiled and packaged, and the file package of the compiled error code enumeration class file is sent to the code server.

[0093] In one embodiment of the present invention, in a continuous integration platform, the modified error code enumeration class file is compiled and packaged, and the compiled error code enumeration class file JAR package is sent to the code server. The role of the continuous integration platform is to encode and package. Using a continuous integration platform, modified error code enumeration class files can be processed in a timely manner.

[0094] After compiling and packaging the modified error code enumeration class file, you can send the compiled error code enumeration class file JAR file to the code server. The code server stores the JAR file containing the error codes.

[0095] S103. The code server pushes a file package of compiled error code enumeration class files to perform automated tests using updated error codes.

[0096] The code server stores the JAR files of the compiled error code enumeration class files on one hand, and pushes the JAR files of the compiled error code enumeration class files on the other hand.

[0097] In one embodiment of the present invention, the code server pushes a JAR package containing a pre-compiled error code enumeration class file via a preset message. As an example, the preset message includes one or more of the following: email, SMS, and social media.

[0098] In one embodiment of the invention, the code server includes a proxy server. As an example, the proxy server includes a Maven private repository. Using a Maven private repository can improve the speed of downloading file packages containing pre-compiled error code enumeration class files.

[0099] Maven is a project management and integration tool based on the Java platform. It abstracts the project development and management process into a Project Object Model (POM). A private repository is a special type of remote repository set up on a local area network (LAN) for the purpose of proxying remote repositories and deploying third-party components.

[0100] In an embodiment of the invention, a Maven private repository stores a JAR file containing compiled error code enumeration class files. Then, the JAR file containing the compiled error code enumeration class files is pushed to perform automated tests using updated error codes.

[0101] In the embodiments of the present invention described above, the error code enumeration class file is modified according to the updated error code, and the modified error code enumeration class file, which is obtained from a data warehouse, is pushed. The modified error code enumeration class file is compiled and packaged, and the file package of the compiled error code enumeration class file is sent to the code server. The code server pushes the file package of the compiled error code enumeration class file to perform automated testing using the updated error code. By modifying and pushing the error code enumeration class file using the updated error code, and sending the updated error code in a file package manner, the updated error code can be used in the automated testing process, thus reducing error code referencing errors and realizing automated testing.

[0102] In addition, through the error code management platform, Git repository, continuous integration platform and code server, a series of unattended operations such as reading, modifying, pushing, compiling and packaging, and pushing updated error codes are completed to achieve unique and controllable management of error codes, so as to realize automated testing.

[0103] See Figure 5 , Figure 5 This is a schematic diagram of the main structure of an automated testing apparatus according to an embodiment of the present invention. The automated testing apparatus can implement automated testing methods, such as... Figure 5 As shown, the automated testing device specifically includes:

[0104] The modification module 501 is used to modify the error code enumeration class file according to the updated error code and push the modified error code enumeration class file, wherein the error code enumeration class file is obtained from the data warehouse;

[0105] Processing module 502 is used to compile and package the modified error code enumeration class file, and send the file package of the compiled error code enumeration class file to the code server;

[0106] The control module 503 is used to control the code server to push the file package of the compiled error code enumeration class file so as to perform automated testing using the updated error code.

[0107] In one embodiment of the present invention, the updated error code is generated based on error code description information and error code identifier, wherein the error code description information and the error code identifier are parameters obtained according to the updated error code instruction.

[0108] In one embodiment of the present invention, the updated error code is generated in the error code management platform based on the error code description information and the error code identifier.

[0109] In one embodiment of the present invention, the modification module 501 is specifically used to parse the class file obtained from the data warehouse through the abstract syntax tree to obtain the error code enumeration class file;

[0110] Based on the updated error code, modify the error code information in the error code enumeration class file.

[0111] In one embodiment of the present invention, the modification module 501 is specifically used to perform class file comparison on the class files obtained from the data warehouse to obtain the enumeration value of the class files obtained from the data warehouse.

[0112] The enumeration values ​​are parsed using an abstract syntax tree to obtain the error code information of the error code enumeration class file.

[0113] In one embodiment of the present invention, the modification module 501 is specifically used to push the updated error code enumeration class file to the data warehouse so as to compile it into a class file in the data warehouse.

[0114] In one embodiment of the present invention, the data warehouse includes a git repository.

[0115] In one embodiment of the present invention, the modification module 501 is specifically used to modify the error code enumeration class file according to the updated error code in the error code management platform, and push the modified error code enumeration class file.

[0116] In one embodiment of the present invention, the processing module 502 is specifically used to, after receiving the modified error code enumeration class file, compile and package the modified error code enumeration class file, and send the file package of the compiled error code enumeration class file to the code server.

[0117] In one embodiment of the present invention, the processing module 502 is specifically used to compile and package the modified error code enumeration class file in the continuous integration platform, and send the file package of the compiled error code enumeration class file to the code server.

[0118] In one embodiment of the present invention, the control module 503 is specifically used to control the code server to push the file package of the compiled error code enumeration class file through a preset message.

[0119] In one embodiment of the present invention, the code server includes a proxy server.

[0120] See Figure 6 , Figure 6 This is a schematic diagram of the application process of an automated testing device according to an embodiment of the present invention.

[0121] Developers send an update error code command to the automated testing apparatus. The apparatus modifies the error code enumeration class file according to the updated error code and pushes the modified file. It then compiles and packages the modified error code enumeration class file and sends the compiled JAR file to the code server. The code server pushes the compiled JAR file to execute the automated tests using the updated error code.

[0122] In this embodiment of the invention, error codes are updated without any manual intervention, achieving standardized management of error codes. Developers can search and view these codes through a management page, making the process more convenient and efficient.

[0123] Figure 7 An exemplary system architecture 700 is shown, which can be applied to the automated testing method or apparatus of embodiments of the present invention.

[0124] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, and 703, a network 704, and a server 705. Network 704 serves as the medium for providing communication links between terminal devices 701, 702, and 703 and server 705. Network 704 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0125] Users can use terminal devices 701, 702, and 703 to interact with server 705 via network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0126] Terminal devices 701, 702, and 703 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0127] Server 705 can be a server providing various services, such as a backend management server supporting shopping websites browsed by users using terminal devices 701, 702, and 703 (for example only). The backend management server can analyze and process data such as received product information query requests, and feed back the processing results (such as target push information, product information - for example only) to the terminal devices.

[0128] It should be noted that the automated testing method provided in this embodiment of the invention is generally executed by server 705, and correspondingly, the automated testing device is generally set in server 705.

[0129] It should be understood that Figure 7 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0130] The following is for reference. Figure 8 It shows a schematic diagram of the structure of a computer system 800 suitable for implementing a terminal device of the present invention. Figure 8 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0131] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the system 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0132] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.

[0133] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the functions defined above in the system of this invention.

[0134] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0135] The flowcharts and block diagrams in the accompanying drawings 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 a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0136] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be located in a processor; for example, a processor can be described as including a modification module, a processing module, and a control module. The names of these units do not necessarily limit the specific unit itself. For example, the modification module can also be described as "used to modify an error code enumeration class file according to updated error codes and push the modified error code enumeration class file, wherein the error code enumeration class file is obtained from a data warehouse."

[0137] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist alone and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include:

[0138] The error code enumeration class file is modified according to the updated error code, and the modified error code enumeration class file is pushed. The error code enumeration class file is obtained from the data warehouse.

[0139] Compile and package the modified error code enumeration class file, and send the file package of the compiled error code enumeration class file to the code server;

[0140] The code server pushes the file package of the compiled error code enumeration class file to perform automated tests using the updated error codes.

[0141] According to the technical solution of this invention, an error code enumeration class file is modified based on updated error codes, and the modified error code enumeration class file is pushed. The error code enumeration class file is obtained from a data warehouse. The modified error code enumeration class file is compiled and packaged, and the compiled error code enumeration class file package is sent to a code server. The code server pushes the compiled error code enumeration class file package to perform automated testing using the updated error codes. By modifying and pushing the error code enumeration class file using updated error codes, and sending the updated error codes in a package format, the updated error codes can be used during automated testing, thus reducing error code referencing errors and achieving automated testing.

[0142] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for automated testing, characterized in that, include: The error code enumeration class file is modified according to the updated error code, and the modified error code enumeration class file is pushed. The error code enumeration class file is obtained from the data warehouse. Compile and package the modified error code enumeration class file, and send the file package of the compiled error code enumeration class file to the code server; The code server pushes the file package of the compiled error code enumeration class file to perform automated testing using the updated error code; The modification of the error code enumeration class file based on the updated error code includes: The error code enumeration class file is obtained by parsing the class file obtained from the data warehouse using an abstract syntax tree; Based on the updated error code, modify the error code information in the error code enumeration class file; The step of parsing the class files obtained from the data warehouse using an abstract syntax tree to obtain the error code enumeration class file includes: The class files obtained from the data warehouse are compared to obtain an enumeration value of the class files obtained from the data warehouse. The enumeration values ​​are parsed using an abstract syntax tree to obtain the error code information of the error code enumeration class file.

2. The automated testing method according to claim 1, characterized in that, The updated error code is generated based on the error code description information and the error code identifier, which are parameters obtained according to the updated error code instruction.

3. The automated testing method according to claim 2, characterized in that, The updated error code is generated in the error code management platform based on the error code description information and the error code identifier.

4. The automated testing method according to claim 1, characterized in that, The push notification has modified the error code enumeration class file, including: The modified error code enumeration class file is pushed to the data warehouse for compilation into a class file in the data warehouse.

5. The automated testing method according to claim 1, characterized in that, The data warehouse includes a Git repository.

6. The automated testing method according to claim 1, characterized in that, The step of modifying the error code enumeration class file according to the updated error code and pushing the modified error code enumeration class file includes: 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.

7. The automated testing method according to claim 1, characterized in that, The process of compiling and packaging the modified error code enumeration class file, and sending the compiled error code enumeration class file package to the code server, includes: Upon receiving the modified error code enumeration class file, the modified error code enumeration class file is compiled and packaged, and the file package of the compiled error code enumeration class file is sent to the code server.

8. The automated testing method according to claim 7, characterized in that, The process of compiling and packaging the modified error code enumeration class file, and sending the compiled error code enumeration class file package to the code server, includes: In the continuous integration platform, the modified error code enumeration class file is compiled and packaged, and the file package of the compiled error code enumeration class file is sent to the code server.

9. The automated testing method according to claim 1, characterized in that, The code server pushes a file package containing the compiled error code enumeration class files, including: The code server pushes the file package of the compiled error code enumeration class file through a preset message.

10. The automated testing method according to claim 1, characterized in that, The code server includes a proxy server.

11. An automated testing apparatus, characterized in that, include: The modification module is used to modify the error code enumeration class file according to the updated error code, and push the modified error code enumeration class file, wherein the error code enumeration class file is obtained from the data warehouse; and to parse the class file obtained from the data warehouse through an abstract syntax tree to obtain the error code enumeration class file. Based on the updated error code, modify the error code information of the error code enumeration class file; and compare the class files obtained from the data warehouse to obtain the enumeration value of the class files obtained from the data warehouse; parse the enumeration value using an abstract syntax tree to obtain the error code information of the error code enumeration class file; The processing module is used to compile and package the modified error code enumeration class file, and send the file package of the compiled error code enumeration class file to the code server; The control module is used to control the code server to push the file package of the compiled error code enumeration class file, so as to perform automated testing using the updated error code.

12. An electronic device for automated testing, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-10.

13. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-10.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Reinforcing method of application program of Android system

    CN105426708A

  • A system error prompting method and device

    CN109240703A