CN111026666A - Test data processing method, device, computer system and medium - Google Patents

Test data processing method, device, computer system and medium Download PDF

Info

Publication number
CN111026666A
CN111026666A CN201911254157.6A CN201911254157A CN111026666A CN 111026666 A CN111026666 A CN 111026666A CN 201911254157 A CN201911254157 A CN 201911254157A CN 111026666 A CN111026666 A CN 111026666A
Authority
CN
China
Prior art keywords
test data
format
tool class
data
test
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
CN201911254157.6A
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.)
JD Digital Technology Holdings Co Ltd
Original Assignee
JD Digital Technology Holdings 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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN201911254157.6A priority Critical patent/CN111026666A/en
Publication of CN111026666A publication Critical patent/CN111026666A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Abstract

The present disclosure provides a test data processing method, including: acquiring a tool class set, wherein the tool class set comprises at least one tool class, each tool class in the at least one tool class comprises a method, and the method of each tool class is configured to read data and convert the format of the data into a first format meeting the requirements of a test framework; based on the storage information of the test data and the tool class set, creating an object of a tool class corresponding to the test data; and calling a tool class method corresponding to the test data based on the object to read the test data and convert the format of the test data into a first format meeting the requirements of the test framework. The present disclosure also provides a test data processing apparatus, a computer system, and a computer-readable storage medium.

Description

Test data processing method, device, computer system and medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a test data processing method, apparatus, computer system, and medium.
Background
With the rapid development of computer technology and network technology, various software programs are increasingly applied to many scenes such as work and daily life. Software development and testing is also increasingly becoming specialized and automated.
However, in carrying out the presently disclosed concept, the inventors have found that there are at least the following problems in the related art. That is, in the related art, in order to meet the requirement of the test framework for the test data, the tester is usually required to repeatedly write codes to perform format processing on various test data, so that the tester often needs to perform complicated work, waste time and cost, and have low work efficiency.
Disclosure of Invention
In view of the above, the present disclosure provides a test data processing method, apparatus, computer system, and computer-readable storage medium.
One aspect of the present disclosure provides a test data processing method, including: the method comprises the steps of obtaining a tool class set, wherein the tool class set comprises at least one tool class, each tool class in the at least one tool class comprises a method, the method of each tool class is configured to read data and convert the format of the data into a first format meeting the requirements of a test framework, creating an object of the tool class corresponding to the test data based on the storage information of the test data and the tool class set, and calling the method of the tool class corresponding to the test data based on the object to read the test data and convert the format of the test data into the first format meeting the requirements of the test framework.
According to an embodiment of the present disclosure, the set of tool classes includes one or any combination of several of the following tool classes: a text document tool class, the methods of which are configured to read data from a text document and convert the data format to a first format that meets the requirements of a test framework, a table tool class, the methods of which are configured to read data from a table and convert the data format to a first format that meets the requirements of a test framework, or a database tool class, the methods of which are configured to read data from a database and convert the data format to a first format that meets the requirements of a test framework.
According to an embodiment of the present disclosure, the method further comprises: acquiring storage information of the test data, wherein the acquiring of the storage information of the test data comprises: the method comprises the steps of obtaining a text document name and a separator of test data under the condition that the test data are stored in a text document, obtaining a table name and a form name of the test data under the condition that the test data are stored in a table, and obtaining a database address, a database port, a database name, a user name and a password of the test data under the condition that the test data are stored in a database.
According to an embodiment of the present disclosure, the first format includes: HashMap array format.
According to an embodiment of the present disclosure, the method further comprises: creating a new tool class in the set of tool classes based on user input.
Another aspect of the present disclosure provides a test data processing apparatus including a set acquiring module, an object creating module, and a method calling module. The set acquisition module is used for acquiring a tool class set, the tool class set comprises at least one tool class, each tool class in the at least one tool class comprises a method, and the method of each tool class is configured to read data and convert the format of the data into a first format meeting the requirements of a test framework. And the object creating module is used for creating an object of the tool class corresponding to the test data based on the storage information of the test data and the tool class set. And the method calling module is used for calling a method of the tool class corresponding to the test data based on the object so as to read the test data and convert the format of the test data into a first format meeting the requirements of a test framework.
According to an embodiment of the present disclosure, the set of tool classes includes one or any combination of several of the following tool classes: a text document tool class, the methods of which are configured to read data from a text document and convert the data format to a first format that meets the requirements of a test framework, a table tool class, the methods of which are configured to read data from a table and convert the data format to a first format that meets the requirements of a test framework, or a database tool class, the methods of which are configured to read data from a database and convert the data format to a first format that meets the requirements of a test framework.
According to an embodiment of the present disclosure, the apparatus further comprises: and the information acquisition module is used for acquiring the storage information of the test data. Wherein the obtaining of the storage information of the test data comprises: the method comprises the steps of obtaining a text document name and a separator of test data under the condition that the test data are stored in a text document, obtaining a table name and a form name of the test data under the condition that the test data are stored in a table, and obtaining a database address, a database port, a database name, a user name and a password of the test data under the condition that the test data are stored in a database.
According to an embodiment of the present disclosure, the first format includes: HashMap array format.
According to an embodiment of the present disclosure, the apparatus further comprises: an extension module that creates a new tool class in the set of tool classes based on user input.
Another aspect of the present disclosure provides a computer system comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method as described above when executing the program.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method as described above when executed.
Another aspect of the disclosure provides a computer program comprising computer executable instructions for implementing the method as described above when executed.
According to the embodiment of the disclosure, the problem that the tester needs to write codes repeatedly to perform format processing on various test data, so that the tester often needs to perform complicated work and waste time and cost can be solved at least partially. The embodiment of the disclosure can provide a tool class set for a tester, so that the tester can directly call the corresponding tool class to complete format processing of test data, time and cost for code compiling are reduced, and working efficiency is improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture of application test data processing methods and apparatus according to embodiments of the present disclosure;
FIG. 2 schematically shows a flow diagram of an application test data processing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates an application diagram of a set of tool classes, in accordance with an embodiment of the present disclosure;
FIG. 4 schematically shows a block diagram of an application test data processing apparatus according to an embodiment of the present disclosure; and
FIG. 5 schematically shows a block diagram of a computer system suitable for implementing the test data processing method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The embodiment of the disclosure provides a test data processing method and device. The method comprises the following steps: the method comprises the steps of obtaining a tool class set, wherein the tool class set comprises at least one tool class, each tool class in the at least one tool class comprises a method, the method of each tool class is configured to read data and convert the format of the data into a first format meeting the requirements of a test framework, creating an object of the tool class corresponding to the test data based on the storage information of the test data and the tool class set, and calling the method of the tool class corresponding to the test data based on the object to read the test data and convert the format of the test data into the first format meeting the requirements of the test framework.
Fig. 1 schematically illustrates an exemplary system architecture 100 of an application test data processing method and apparatus according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like.
The terminal devices 101, 102, 103 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 terminal devices 101, 102, 103 may have installed thereon a client application of a test framework, such as a client application of a TestNG test framework (for example only).
The server 105 may be a server providing various services, such as a background management server providing support for a TestNG test framework application used by a user with the terminal device 101, 102, 103, as an example. The background management server can analyze and process the received user request and the like and feed back the processing result to the terminal equipment. The TestNG is an open-source automatic testing framework, has a perfect case management module, and can help testers or developers to efficiently complete automatic testing of functions, interfaces, units and integration by using the TestNG or combining with other frameworks.
It should be noted that the test data processing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the test data processing apparatus provided by the embodiments of the present disclosure may be generally disposed in the server 105. The test data processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the test data processing apparatus provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
FIG. 2 schematically shows a flow chart of an application test data processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S203.
In operation S201, a tool class set is obtained, the tool class set including at least one tool class, each tool class in the at least one tool class including a method, the method of each tool class configured to read data and convert a format of the data into a first format satisfying requirements of a test framework.
According to the embodiment of the disclosure, the tool class set may include a common tool class and a custom tool class. Each tool class may include methods and properties. The methods of the tool classes in the disclosed embodiments may be configured to read data from a corresponding file and convert the format of the data to a first format that satisfies the requirements of a test framework.
In the embodiment of the present disclosure, the tool class set may include, for example, one or more of a text document tool class, a table tool class, a database tool class, and the like.
For example, a method of the text document tool class may be configured to read data from a text document and convert the data format to a first format that satisfies the requirements of a test framework.
As another example, a method of the form tool class may be configured to read data from a form and convert the data format to a first format that satisfies the requirements of a test framework.
As another example, a method of a database toolclass may be configured to read data from a database and convert the data format to a first format that satisfies the requirements of a test framework.
It will be appreciated that the test data is typically stored in a document format, table format, or database format herein. Therefore, the tool class set of the embodiment of the present disclosure may include common tool classes such as a text document tool class, a table tool class, and a database tool class, so that a tester may directly call the tool classes, read test data from a file with a corresponding format, and convert the format of the read test data into a first format meeting the requirements of a test framework, thereby reducing the encoding cost of the tester.
The tool class set in the embodiment of the present disclosure may further include a custom tool class, for example, the embodiment of the present disclosure may create a new custom tool class in the tool class set based on a user input. The user-defined tool class can provide an interface for a user, and the user can define the tool class according to actual conditions, so that the tool class set disclosed by the embodiment of the invention has good expandability, a new file format for storing test data can be added, a new interface is defined, conversion of more file formats is completed, and more reading modes are provided.
In operation S202, an object of a tool class corresponding to the test data is created based on the storage information of the test data and the tool class set.
According to the embodiment of the disclosure, the tool class corresponding to the test data can be determined based on the storage information of the test data and the tool class set, and the object of the tool class is created based on the storage information, that is, the tool class is instantiated.
It can be understood that, if the text formats for storing the test data are different, the storage information of the test data to be acquired is different.
For example, in the case where test data is stored in a text document, the storage information for acquiring the test data may be a text document name and a delimiter for acquiring the test data. Thus, an object of the text document tool class can be created based on the text document name and the delimiter.
For another example, in the case where the test data is stored in a table, the storage information of the acquired test data may be a table name and a form name of the acquired test data. Thus, objects of the form tool class can be created based on the form name and the form name.
For another example, in the case where the test data is stored in the database, the storage information of the acquired test data may be a database address, a database port, a database name, a user name, and a password of the acquired test data. Objects of the database tool class may thus be created based on the database address, database port, database name, username, and password.
In operation S203, based on the created object, a method of a tool class corresponding to the test data is called to read the test data and convert a format of the test data into a first format satisfying the requirements of the test framework.
According to the embodiment of the disclosure, after the initialization of the tool class instance is completed, the method of the tool class can be directly called to complete reading of the test data and convert the format of the test data into the first format meeting the requirements of the test framework, so that the test framework can use the test data.
The method of fig. 2 is further described with reference to fig. 3 in conjunction with specific embodiments.
FIG. 3 schematically shows an application diagram of a set of tool classes according to an embodiment of the present disclosure.
As shown in FIG. 3, the test framework may be a TestNG test framework and the format that satisfies the requirements of the test framework may be, for example, an Object type array format. The tool class method of the embodiments of the present disclosure may be configured to convert the format of the test data into a hash map array format, and then convert the hash map array format into an Object type array format that meets the TestNG requirement by means of Dataprovider annotation on the hash map array format.
In the embodiment of the present disclosure, in order to facilitate the storage of the correspondence between the parameter name and the parameter value of the test data, a hash map (Hashmap) storage manner is adopted. One group of test data can correspond to a Hashmap array, and multiple groups of test data can be mapped into an array in a Hashmap array format. Since the TestNG test framework requires that the test data satisfy the Object's two-dimensional array format, the tool class method of the embodiments of the present disclosure may be configured to convert the test data format into a multi-row single-column two-dimensional array format, where each row of the array is a Hashmap array, and a Hashmap array corresponds to a set of test data.
According to the embodiment of the disclosure, in the Test case function, namely the function of the Test annotation identifier, the Hashmap parameter needs to be defined in the reference to receive the Test data transmitted by annotation, analyze the Hashmap, write the Test case, and then sequentially execute the Test case for one time by each group of Test data in the Test data.
As shown in fig. 3, the set of tool classes in the embodiments of the present disclosure may include a text document tool class, a table tool class, and a database tool class. The methods of each tool class are configured to read test data from a file in a corresponding format and convert the test data into a Hashmap array format so that the TestNG test framework can directly use the test data for testing.
For example, where test data is stored in a text document, each row may be a set of test data, and separators between different parameters within a row may take any symbol that does not conflict with the test data. When reading the parameters, a separator is designated, namely, the data of each row is read in sequence according to the separator for testing. Where the first behavior is parameter names separated by the same separator. In the instantiation process of the text document tool class of the embodiment of the disclosure, the object of the tool class can be created through the name and the separator of the text document. An interface may be provided for user invocation. The test data of each row can be read in turn by the separator character introduced during initialization when the method of the tool class is executed. For example, JAVA self-contained FileReader class can be adopted, a file is read according to lines, one line is a character string, each line is split by a split function of the character string with a designated separator, the first line is split to obtain a parameter name, the other lines are split to obtain all values, the read data is converted into a Hashmap array format, and then the Hashmap array format is converted into an Object type array format in a Dataprovider annotation mode.
For another example, when the test data is stored in a table, the organization may be, for example: the first row is the parameter name and the corresponding column is the value of the parameter. Each action is a set of test data. In the instantiation process of the table tool class of the embodiment of the disclosure, an object of the tool class can be created through a table name and a form name. An interface may be provided for user invocation. The test data contained in the corresponding table and form may be read when the methods of the tool class are executed. For example, the function provided in the POI library of apache can be adopted to obtain the data of each row and each column, assign the data to Hashmap in turn, and convert the data into Object type array format by means of Dataprovider annotation.
For another example, when the test data is stored in the database, the attribute name of each column is a parameter name, and each row is a set of test data. In the instantiation process of the database tool class of the embodiment of the disclosure, the object of the tool class can be created through the ip, the port, the database name, the user name and the password of the database. An interface may be provided for user invocation. When the method of the tool class is executed, a database can be connected in a jdbc mode, an execution result set of the SQL statement is assigned to the Hashmap, and then the result set is converted into an Object type array format in a Dataprovider annotation mode.
The embodiment of the disclosure can provide a tool class set for a tester, so that the tester can directly call the corresponding tool class to complete format processing of test data, time and cost for code compiling are reduced, and working efficiency is improved.
Fig. 4 schematically shows a block diagram of an application test data processing apparatus 400 according to an embodiment of the present disclosure.
As shown in FIG. 4, the apparatus 400 includes a collection acquisition module 410, an object creation module 420, and a method invocation module 430.
The set obtaining module 410 is configured to obtain a set of tool classes, where the set of tool classes includes at least one tool class, and each tool class in the at least one tool class includes a method, and the method of each tool class is configured to read data and convert a format of the data into a first format that meets requirements of a test framework. According to the embodiment of the present disclosure, the set obtaining module 410 may, for example, execute the method of operation S201 described with reference to fig. 2, which is not described herein again.
The object creating module 420 is configured to create an object of a tool class corresponding to the test data based on the stored information of the test data and the tool class set. According to the embodiment of the present disclosure, the object creation module 420 may, for example, execute the method of operation S202 described with reference to fig. 2, which is not described herein again.
The method calling module 430 is configured to call a method of a tool class corresponding to the test data based on the created object, so as to read the test data and convert a format of the test data into a first format meeting requirements of the test framework. According to the embodiment of the present disclosure, the method invoking module 430 may, for example, execute the method of operation S203 described with reference to fig. 2, which is not described herein again.
According to the embodiment of the disclosure, the tool class set comprises one or any combination of several of the following tool classes: a text document tool class, a table tool class, or a database tool class. The method of the text document tool class is configured to read data from a text document and convert the data format into a first format meeting the requirements of a test framework, the method of the table tool class is configured to read data from a table and convert the data format into a first format meeting the requirements of the test framework, and the method of the database tool class is configured to read data from a database and convert the data format into a first format meeting the requirements of the test framework.
According to an embodiment of the present disclosure, the apparatus 400 may further include an information obtaining module (not shown in the figure). The information acquisition module is used for acquiring the storage information of the test data. Wherein, obtaining the storage information of the test data comprises: in the case where test data is stored in a text document, a text document name and a delimiter of the test data are acquired. In the case where test data is stored in a table, a table name and a form name of the test data are acquired. And under the condition that the test data is stored in the database, acquiring the database address, the database port, the database name, the user name and the password of the test data.
According to an embodiment of the present disclosure, the first format includes a hash map array format.
The apparatus 400 further includes an expansion module (not shown), according to an embodiment of the present disclosure. The extension module is used for creating a new tool class in the tool class set based on user input.
It should be noted that the implementation, solved technical problems, implemented functions, and achieved technical effects of each module/unit/subunit and the like in the apparatus part embodiment are respectively the same as or similar to the implementation, solved technical problems, implemented functions, and achieved technical effects of each corresponding step in the method part embodiment, and are not described herein again.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
FIG. 5 schematically shows a block diagram of a computer system suitable for implementing the test data processing method according to an embodiment of the present disclosure. The computer system illustrated in FIG. 5 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 5, a computer system 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. The processor 501 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 501 may also include onboard memory for caching purposes. Processor 501 may include a single processing unit or multiple processing units for performing different acts of the method flows described with reference to fig. 2 in accordance with embodiments of the disclosure.
In the RAM 503, various programs and data necessary for the operation of the system 500 are stored. The processor 501, the ROM502, and the RAM 503 are connected to each other by a bus 504. The processor 501 performs various operations of S201 to S203 described above with reference to fig. 2 by executing programs in the ROM502 and/or the RAM 503. Note that the programs may also be stored in one or more memories other than the ROM502 and the RAM 503. The processor 501 may also perform various operations of S201 to S203 described above with reference to fig. 2 by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, system 500 may also include an input/output (I/O) interface 505, input/output (I/O) interface 505 also being connected to bus 504. The system 500 may also include one or more of the following components connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
According to an embodiment of the present disclosure, the method described above with reference to the flow chart may be implemented as a computer software program. 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 may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program, when executed by the processor 501, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media 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 disclosure, 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 contrast, in the present disclosure, 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. According to embodiments of the present disclosure, a computer-readable medium may include ROM502 and/or RAM 503 and/or one or more memories other than ROM502 and RAM 503 described above.
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 disclosure. 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.
As another aspect, the present disclosure 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 perform: obtaining a set of tool classes, the set of tool classes comprising at least one tool class, each tool class in the at least one tool class comprising a method, the method of each tool class configured to read data and convert a format of the data into a first format that satisfies requirements of a test framework; creating an object of a tool class corresponding to the test data based on the storage information of the test data and the tool class set; and calling a method of the tool class corresponding to the test data based on the object so as to read the test data and convert the format of the test data into a first format meeting the requirements of a test framework.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A test data processing method, comprising:
obtaining a set of tool classes, the set of tool classes comprising at least one tool class, each tool class in the at least one tool class comprising a method, the method of each tool class configured to read data and convert a format of the data into a first format that satisfies requirements of a test framework;
creating an object of a tool class corresponding to the test data based on the storage information of the test data and the tool class set; and
and calling a method of the tool class corresponding to the test data based on the object so as to read the test data and convert the format of the test data into a first format meeting the requirements of a test framework.
2. The method of claim 1, wherein the set of tool classes comprises any combination of one or more of the following tool classes:
a text document tool class, the method of which is configured to read data from a text document and convert the data format to a first format that meets the requirements of a test framework;
a table tool class, the method of which is configured to read data from a table and convert the data format to a first format that meets the requirements of a test framework; or
A database tool class, the method of the database tool class configured to read data from a database and convert the data format to a first format that satisfies the requirements of a test framework.
3. The method of claim 1, further comprising:
acquiring storage information of the test data;
wherein the obtaining of the storage information of the test data comprises:
under the condition that the test data are stored in a text document, acquiring a text document name and a separator of the test data;
under the condition that the test data is stored in a table, acquiring the table name and the form name of the test data;
and under the condition that the test data is stored in a database, acquiring a database address, a database port, a database name, a user name and a password of the test data.
4. The method of claim 1, wherein the first format comprises: HashMap array format.
5. The method of claim 1, further comprising:
creating a new tool class in the set of tool classes based on user input.
6. A test data processing apparatus, comprising:
the system comprises a set acquisition module, a data storage module and a data processing module, wherein the set acquisition module acquires a tool class set, the tool class set comprises at least one tool class, each tool class in the at least one tool class comprises a method, and the method of each tool class is configured to read data and convert the format of the data into a first format meeting the requirements of a test framework;
the object creating module is used for creating an object of a tool class corresponding to the test data based on the storage information of the test data and the tool class set;
and the method calling module calls a method of the tool class corresponding to the test data based on the object so as to read the test data and convert the format of the test data into a first format meeting the requirements of a test framework.
7. The apparatus of claim 6, wherein the set of tool classes comprises any combination of one or more of the following tool classes:
a text document tool class, the method of which is configured to read data from a text document and convert the data format to a first format that meets the requirements of a test framework;
a table tool class, the method of which is configured to read data from a table and convert the data format to a first format that meets the requirements of a test framework; or
A database tool class, the method of the database tool class configured to read data from a database and convert the data format to a first format that satisfies the requirements of a test framework.
8. The apparatus of claim 6, further comprising:
the information acquisition module is used for acquiring the storage information of the test data;
wherein the obtaining of the storage information of the test data comprises:
under the condition that the test data are stored in a text document, acquiring a text document name and a separator of the test data;
under the condition that the test data is stored in a table, acquiring the table name and the form name of the test data;
and under the condition that the test data is stored in a database, acquiring a database address, a database port, a database name, a user name and a password of the test data.
9. A computer system, comprising:
one or more processors;
a computer-readable storage medium for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN201911254157.6A 2019-12-06 2019-12-06 Test data processing method, device, computer system and medium Pending CN111026666A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911254157.6A CN111026666A (en) 2019-12-06 2019-12-06 Test data processing method, device, computer system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911254157.6A CN111026666A (en) 2019-12-06 2019-12-06 Test data processing method, device, computer system and medium

Publications (1)

Publication Number Publication Date
CN111026666A true CN111026666A (en) 2020-04-17

Family

ID=70208294

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911254157.6A Pending CN111026666A (en) 2019-12-06 2019-12-06 Test data processing method, device, computer system and medium

Country Status (1)

Country Link
CN (1) CN111026666A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8904353B1 (en) * 2010-11-08 2014-12-02 Amazon Technologies, Inc. Highly reusable test frameworks and tests for web services
CN108536596A (en) * 2018-04-09 2018-09-14 武汉斗鱼网络科技有限公司 Automated testing method, readable medium based on object formation data and equipment
CN108628748A (en) * 2018-05-09 2018-10-09 平安普惠企业管理有限公司 Automatic test management method and automatic test manage system
CN109189684A (en) * 2018-08-28 2019-01-11 四川长虹电器股份有限公司 Automatic interface testing method based on Python
CN109614313A (en) * 2018-10-25 2019-04-12 平安科技(深圳)有限公司 Automated testing method, device and computer readable storage medium
CN109800154A (en) * 2018-12-15 2019-05-24 深圳壹账通智能科技有限公司 Loading method, device, computer equipment and the storage medium of test data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8904353B1 (en) * 2010-11-08 2014-12-02 Amazon Technologies, Inc. Highly reusable test frameworks and tests for web services
CN108536596A (en) * 2018-04-09 2018-09-14 武汉斗鱼网络科技有限公司 Automated testing method, readable medium based on object formation data and equipment
CN108628748A (en) * 2018-05-09 2018-10-09 平安普惠企业管理有限公司 Automatic test management method and automatic test manage system
CN109189684A (en) * 2018-08-28 2019-01-11 四川长虹电器股份有限公司 Automatic interface testing method based on Python
CN109614313A (en) * 2018-10-25 2019-04-12 平安科技(深圳)有限公司 Automated testing method, device and computer readable storage medium
CN109800154A (en) * 2018-12-15 2019-05-24 深圳壹账通智能科技有限公司 Loading method, device, computer equipment and the storage medium of test data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵红芳: "基于TestNG的接口测试框架的设计与实现" *

Similar Documents

Publication Publication Date Title
CN107807815B (en) Method and device for processing tasks in distributed mode
CN111596927B (en) Service deployment method and device and electronic equipment
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN115357761A (en) Link tracking method and device, electronic equipment and storage medium
CN107368407B (en) Information processing method and device
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN112965916A (en) Page testing method, page testing device, electronic equipment and readable storage medium
CN111324470A (en) Method and device for generating information
CN113515271B (en) Service code generation method and device, electronic equipment and readable storage medium
CN116302271A (en) Page display method and device and electronic equipment
CN113535565B (en) Interface use case generation method, device, equipment and medium
CN112379967B (en) Simulator detection method, device, equipment and medium
CN113392010A (en) Common component testing method and device, electronic equipment and storage medium
CN112506781B (en) Test monitoring method, device, electronic equipment, storage medium and program product
CN114116509A (en) Program analysis method, program analysis device, electronic device, and storage medium
CN113553123A (en) Data processing method and device, electronic equipment and storage medium
CN111026666A (en) Test data processing method, device, computer system and medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN112988604A (en) Object testing method, testing system, electronic device and readable storage medium
CN113342633B (en) Performance test method and device
CN113468053B (en) Application system testing method and device
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN113778350A (en) Log printing method and device
CN114840435A (en) Method, device, equipment, storage medium and program product for determining data flow direction

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
CB02 Change of applicant information

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

CB02 Change of applicant information