CN109522228B - Interface automation test data construction method, device, platform and storage medium - Google Patents

Interface automation test data construction method, device, platform and storage medium Download PDF

Info

Publication number
CN109522228B
CN109522228B CN201811359053.7A CN201811359053A CN109522228B CN 109522228 B CN109522228 B CN 109522228B CN 201811359053 A CN201811359053 A CN 201811359053A CN 109522228 B CN109522228 B CN 109522228B
Authority
CN
China
Prior art keywords
target interface
data
interface
test data
generation template
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.)
Active
Application number
CN201811359053.7A
Other languages
Chinese (zh)
Other versions
CN109522228A (en
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.)
Shenzhen Lexin Software Technology Co Ltd
Original Assignee
Shenzhen Lexin Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN201811359053.7A priority Critical patent/CN109522228B/en
Publication of CN109522228A publication Critical patent/CN109522228A/en
Application granted granted Critical
Publication of CN109522228B publication Critical patent/CN109522228B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The embodiment of the invention discloses a method, a device, a platform and a storage medium for constructing interface automation test data. Wherein, the method comprises the following steps: constructing a data generation template of the target interface according to the modified programming statement of the target interface and/or the data type of the target interface; and establishing automatic test data of the target interface according to the data generation template for testing the target interface. The technical scheme provided by the embodiment of the invention can construct different test data so as to facilitate the automatic test of the interface.

Description

Interface automation test data construction method, device, platform and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, a platform and a storage medium for constructing interface automation test data.
Background
With the increasing functions of products and the increasing complexity of system architectures, a server often involves version change or system reconfiguration, so that it is difficult to verify underlying business logic in function tests, performance tests, GUI (Graphical User Interface) autoregressive tests, and the like. In addition, a large amount of regression work needs to consume a large amount of test resources, so that the automatic interface test is carried out.
Depending on the automatic test of the interface, the change and the reconstruction of the system can be ensured by depending on the script, and the logic coverage rate of the automatic test also depends on the number and the integrity of the automatic test cases. However, the cost of implementing an automated testing system is relatively high, and particularly, a large amount of labor cost is consumed in a data manufacturing link.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a platform and a storage medium for constructing interface automation test data, which can construct different test data so as to facilitate the use of interface automation tests.
In a first aspect, an embodiment of the present invention provides an interface automation test data construction method, where the method includes:
constructing a data generation template of the target interface according to the modified programming statement of the target interface and/or the data type of the target interface;
and establishing automatic test data of the target interface according to the data generation template for testing the target interface.
In a second aspect, an embodiment of the present invention further provides an interface automation test data constructing apparatus, where the apparatus includes:
the template building module is used for building a data generation template of the target interface according to the modified programming statement of the target interface and/or the data type of the target interface;
and the test data generation module is used for constructing automatic test data of the target interface according to the data generation template and testing the target interface.
In a third aspect, an embodiment of the present invention further provides a platform, where the platform includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method for interface automated test data construction of any of the first aspects.
In a fourth aspect, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the interface automation test data construction method described in any one of the first aspects.
According to the interface automation test data construction method, the device, the platform and the storage medium provided by the embodiment of the invention, when a target interface needs to be tested, a data generation template of the target interface can be constructed according to a modified programming statement of the target interface and/or the data type of the target interface; and then, establishing automatic test data of the target interface according to the constructed data generation template, and further performing automatic test on the target interface by adopting the established automatic test data. This scheme compares in current automatic test scheme of interface, can construct different test data according to different interfaces are automatic to carry out the automatic test of interface and use, need not to consume a large amount of manpowers.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
fig. 1 is a flowchart of an interface automation test data construction method according to an embodiment of the present invention;
fig. 2 is a flowchart of an interface automation test data construction method according to a second embodiment of the present invention;
fig. 3A is a flowchart of a method for constructing interface automation test data according to a third embodiment of the present invention;
fig. 3B is a block diagram of an interface automation test system according to a third embodiment of the present invention;
fig. 4 is a block diagram illustrating an interface automation test data constructing apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a platform provided in the fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some but not all of the relevant elements of the present invention are shown in the drawings.
Example one
Fig. 1 is a flowchart of a method for constructing interface automation test data according to an embodiment of the present invention, which is suitable for a situation of how to construct test data required by an interface when an automation test is performed on the interface. The method can be executed by the interface automation test data construction device provided by the embodiment of the invention, the device can be realized in a software and/or hardware mode, and the device can be configured on an interface automation test platform or equipment. Referring to fig. 1, the method specifically includes:
s110, constructing a data generation template of the target interface according to the modified programming statement of the target interface and/or the data type of the target interface.
In this embodiment, the target interface is an interface that needs to be automatically tested; the modified program statement refers to a program statement that modifies a function or business logic of a target interface, or the like. For a database language, a programming statement may include: c + +, JAVA or SQL (structured Query language) statements, and the like. SQL is a special purpose programming language, a database query and programming language, used to access data and query, update, and manage relational database systems, and is also an extension of database script files. Therefore, in this embodiment, the modified programming statement is preferably a modified SQL statement.
The data type of the target interface refers to the type of test data required for testing the target interface, and the data type may be determined by the business logic of the target interface or the method included in the interface, and the like. For example, if two interfaces have partially the same service logic, or if two interfaces have the same method, etc., it may be determined that the two interfaces have the same data type.
In this embodiment, the data generation template refers to a template for building data required for the interface automation test with reference to the template. It should be noted that different interfaces may correspond to different data generation templates, and may also correspond to the same data generation template. For example, if interface a and interface B have the same data type, it means that interface a and interface B may share a certain data generation template. Optionally, one interface may correspond to one or more data generation templates. It should be noted that, in general, one interface corresponds to one data generation template; however, if the test data required for one interface includes a plurality of data types, a plurality of data generation templates are included.
The target interface is referred to as a. Specifically, when the interface automatic test platform performs automatic test on the target interface a, if it is detected that the data type of the test data required by the target interface a is the same as the data type of the locally stored test data, if the test data of the interface B that has completed the automatic test is the same, the data generation template of the test data of the interface B may be directly acquired as the data generation template of the target interface a, so as to construct the test data required by the target interface a, and the target interface a is tested based on the constructed test data. Namely, the interface automation test platform can directly construct the data generation template of the target interface according to the data type of the target interface.
If the data type of the locally stored test data is completely unmatched or partially matched with the data type of the test data required by the target interface A, the interface automatic test platform needs to acquire a modified programming statement of the target interface; and then constructing a data generation template of the target interface according to the modified programming statement of the target interface or the modified programming statement of the target interface and the data type of the target interface.
For example, before building the data generation template of the target interface, the method may further include: and acquiring the modified programming statement of the target interface from the master database in real time by the sniffer based on the master-slave database synchronization principle.
Wherein the sniffer is a software device that monitors the operation of network data. In this embodiment, the sniffer may be configured in the interface automation test platform; the data changes in the master database may also be monitored as a masquerading slave database, independent of the interface automation test platform. In this embodiment, the master-slave database synchronization principle may be a MySQL master-slave database synchronization principle, and the modified programming statements are obtained in real time from the master database (sniffer) based on the asynchronous replication characteristic. Specifically, the interface automation test platform can acquire a modified programming statement of the target interface from the main database in real time through a sniffer configured on the interface automation test platform; it is also possible to receive the modified programming statements of the target interface as masquerading slave database, obtained in real time from the master database.
Specifically, if the data type of the locally stored test data is completely mismatched with the data type of the test data required by the target interface a, the interface automation test platform needs to first acquire a modified programming statement of the target interface; and then analyzing the obtained modified programming statement of the target interface based on semantic syntax analysis, extracting key attributes from the modified programming statement, and further constructing a data generation template of the target interface A based on the key attributes. If the data type of the locally stored test data is partially mismatched with the data type of the test data required by the target interface A, only the modified programming statement of the target interface associated with the mismatched part is needed to be acquired; and then constructing a first data generation template of the target interface A according to the obtained target modified programming statement, locally obtaining a data generation template related to the same data type part as a second data generation template of the target interface A, and taking the first data generation template and the second data generation template as the data generation templates of the target interface A.
And S120, constructing automatic test data of the target interface according to the data generation template, and testing the target interface.
Specifically, after the data generation template of the target interface is constructed according to the modified programming statement of the target interface and/or the data type of the target interface, the automatic test data of the target interface can be constructed according to the constructed data generation template, the data amount actually required by testing the target interface and the like; and then testing the target interface based on the constructed automatic test data of the target interface.
For example, after the automated test data of the target interface is constructed according to the data generation template, the method may further include: acquiring a target interface from a locally stored interface document; and requesting automatic test data through the target interface, calling an interface automatic test engine, and executing the automatic test of the target interface.
In this embodiment, the interface document is a document that is locally stored by the interface automation test platform and is used for clearly recording all interface information on a certain system service, and may be in the form of an excel table, a word, a web page, or the like. An automated test engine may be a tool for conducting automated tests.
Specifically, after the automatic test data of the target interface is constructed according to the constructed data generation template, the data amount actually required by the test target interface and the like, the automatic test platform of the interface stores the automatic test data of the target interface at a specified position and acquires the target interface from an interface document stored in advance locally; and then requesting corresponding automated test data through the target interface, calling an interface automated test engine to enable the automated test engine to execute the automated test of the target interface by calling a specific dubbo service, and storing a correct execution result as a reference, so that the subsequent execution and the comparison are performed, and if the comparison is correct, the case is considered to pass. In addition, to prevent mutual interference between cases, all data in the master database is purged every time a case is executed.
According to the technical scheme provided by the embodiment of the invention, when the target interface needs to be tested, the data generation template of the target interface can be constructed according to the modified programming statement of the target interface and/or the data type of the target interface; and then, establishing automatic test data of the target interface according to the constructed data generation template, and further performing automatic test on the target interface by adopting the established automatic test data. This scheme compares in current automatic test scheme of interface, can construct different test data according to different interfaces are automatic to carry out the automatic test of interface and use, need not to consume a large amount of manpowers.
Example two
Fig. 2 is a flowchart of an interface automation test data construction method according to a second embodiment of the present invention, and this embodiment further explains a data generation template for constructing a target interface according to a modified programming statement of the target interface on the basis of the above embodiment. Referring to fig. 2, the method specifically includes:
and S210, extracting a programming statement module from the programming statement.
In this embodiment, the program statement module refers to a body extracted from a program statement and constituting the program statement, and may include an operation function, such as an insert function or an update function, an object or a table operated by the operation function, and at least one attribute or parameter of the table.
For example, the programming statements obtained from the sniffer are: insert inter teacher (id, grade _ id, name, t _ field1, t _ field2) values (1, 1, "teacher A", "teacher A field 1", "teacher A field 2"); insert inter teacher (id, grade _ id, name, t _ field1, t _ field2) values (2, 1, "teacher B," "teacher B field1," and "teacher B field 2"). Analyzing the programming statement to obtain a table with an operation function of insert function and a table with a function of teacher, wherein the corresponding attributes comprise teacher id, class grade _ id, name, t _ field1 and t _ field 2; the corresponding programming statement modules are: insert inter teacher (id, grade _ id, name, t _ field1, t _ field2) values (id, grade _ id, "teacher X," "teacher X field1," "teacher X field 2").
S220, determining the key attribute of the programming statement according to the table included in the programming statement module and at least one attribute of the table.
In this embodiment, the key attribute refers to a key parameter in a table in the programming statement module, and the attribute that plays a key role in the test result of the interface may include one or more. Because many attributes of the table are not the focus of attention during the interface automatic test, the test result is not influenced even if the values associated with the attributes of different test cases are the same.
For example, the values associated with the three attributes of the program statement module insert _ interior (id, grade _ id, name, t _ field1, t _ field2) values (id, grade _ id, "teacher X," "teacher X field1," "teacher X field 2"), attribute id, grade _ id, name, t _ field1, t _ field2, name, t _ field1, t _ field2 are not the points of interest for testing. Therefore, the key attributes of the programming statement extracted from the programming statement module are as follows: teacherId and gradeId.
And S230, constructing a data generation template according to the programming statement module and the key attributes of the programming statements.
For example, the programming sentence module is insert inter-team (id, grade _ id, name, t _ field1, t _ field2) values (id, grade _ id, "teacher X", "teacher X field 1", "teacher X field 2"), and the key attributes of the programming sentence are: the teacherId and the gradeId are used for constructing a data generation template of the target interface, and the data generation template comprises the following steps: insert _ teacher (id, grad _ id, name, t _ field1, t _ field2) values ([ teacherId ], [ gradeId ], "teacher X", "teacher X field 1", "teacher X field 2").
S240, automatic test data of the target interface are constructed according to the data generation template and are used for testing the target interface.
Specifically, if the number of the automated test data of the target interface is 10, the automated test data may be structured in a for loop. For example, in the case of the above teacher with 10 pieces of data, the construction of the automated test data can be carried out in a round-robin fashion.
For example, the same programming statement module may generate different automated test data for different determined key attributes. For example, the key attributes extracted from the programming statement modules insert to reach (id, grade _ id, name, t _ field1, t _ field2) values (id, grade _ id, "teacher X," "teacher X field1," "teacher X field 2") are: teacherId and gradeId, it can be considered that the constructed automated test data can be based on the same gradeId, data constructed with different teacherids.
If the key attribute extracted from the values (id, grade _ id, "teacher X," "teacher X field1," and "teacher X field 2") of the programming statement module insert to teacher (id, grade _ id, name, t _ field1, t _ field2) is teacher id, it can be considered that the constructed automation test data can be data constructed based on different teacher ids, and it is not limited whether the class gradeids are the same.
According to the technical scheme provided by the embodiment of the invention, when the target interface needs to be tested, the data generation template of the target interface can be constructed according to the modified programming statement of the target interface; and then, establishing automatic test data of the target interface according to the constructed data generation template, and further performing automatic test on the target interface by adopting the established automatic test data. This scheme compares in current automatic test scheme of interface, can construct different test data according to different interfaces are automatic to carry out the automatic test of interface and use, need not to consume a large amount of manpowers.
Different interfaces can share one data generation template if the data types of the data to be tested are the same, so that the automatic testing speed is increased. For example, according to the data type of the target interface, constructing the data generation template of the target interface may include: and if the data type of the automatic test data required by the test target interface is detected to be the same as the data type of the locally stored test data, taking the data generation template with the same data type as the data generation template of the target interface.
Specifically, when the interface automation test platform performs automation test on the target interface, it may detect whether the data type of the test data required by the target interface is the same as the data type of the locally stored test data, and if so, may use the data generation template of the same data type as the data generation template of the target interface to construct the automation test data of the target interface, or directly use the test data of the same data type as the automation test data of the target interface. In the embodiment, under the condition that the types of data required by different interfaces are the same, test data of different interfaces can be constructed by constructing the data generation template once, so that automatic tests of different interfaces are completed, the flexibility of a scheme is increased, and the complexity of constructing data is simplified.
EXAMPLE III
Fig. 3A is a flowchart of a method for constructing interface automation test data according to a third embodiment of the present invention, and fig. 3B is a block diagram of a structure of an interface automation test system according to a third embodiment of the present invention. The embodiment is further optimized on the basis of the embodiment. Referring to fig. 3A and 3B, the method specifically includes:
and S310, acquiring a modified programming statement of the target interface from the master database in real time through the sniffer based on the master-slave database synchronization principle.
For example, a user edits a class data, a teacher data and two student data in a data operation background as shown in tables 1 to 3, wherein the grade _ id in tables 2 and 3 is the class id, the grade _ id corresponds to the grade table id, and the data operation is converted into an SQL statement and stored in a database, wherein the database is equivalent to a main database; the sniffer is used as a disguised slave database, sniffs the modified SQL sentences of the target interface from the master database in real time based on the master-slave database synchronization principle, and transmits the sniffed SQL sentences to the data operation SQL of the interface automation test platform.
The SQL statements sniffed by the sniffer or stored in the data operation SQL are:
insert inter grade (id, name, c _ field1, c _ field _2) values (1, "class A", "class field 1", "class field 2");
insert inter teacher (id, grade _ id, name, t _ field1, t _ field2) values (1, 1, "teacher A", "teacher A field 1", "teacher A field 2");
insert _ identifier (id, grade _ id, name, t _ field1, t _ field2) values (1, 1, "student A", "student A field 1", "student A field 2");
insert _ identifier (id, grade _ id, name, t _ field1, t _ field2) values (2, 1, "student B," student B field1, "student B field 2").
TABLE 1 grade Table
id 1
name Class A
c_field1 Class field1
c_field2 Class field2
TABLE 2 teacher Table
id 1
grade_id 1
name Teacher A
t_field1 Teacher A field1
t_field2 Teacher A field2
TABLE 3 student Table
id 1 2
grade_id 1 1
name Student A Student B
s_field1 Student A field1 Student B field1
s_field2 Student A field2 Student B field2
S320, constructing a data generation template of the target interface according to the modified programming statement of the target interface.
Specifically, the interface automation test platform obtains the modified SQL statement of the target interface from the data operation SQL, performs semantic syntax analysis on the SQL statement, and extracts the programming language module and the key attributes from the SQL. For the modified SQL statement, the extracted key attributes may be: gradeId, teacherId, studentId. And then constructing a data generation template of the target interface based on the extracted programming statements and the key attributes.
For example, for a class grade, the constructed data generation template is: insert intra grade (id, name, c _ field1, c _ field _2) values ([ gradeId ], "class a", "class field 1", "class field 2");
for the teacher, the constructed data generation template is: insert inter teacher (id, grade _ id, name, t _ field1, t _ field2) values ([ teacherId ], [ grade ], "teacher a", "teacher a field 1", "teacher a field 2");
for student students, the constructed data generation template is: insert _ student (id, grade _ id, name, t _ field1, t _ field2) values ([ student id ] + N, 1, "student N", "student N field 1", "student N field 2"). Wherein the value of N is a positive integer from 0 to N.
S330, automatic test data of the target interface is constructed according to the data generation template and is used for testing the target interface.
For example, after the data generation template of the student is constructed, the automated test data construction can be performed in a circulating manner according to the requirements of the student data in the actual test.
S340, acquiring a target interface from the interface document stored locally.
And S350, requesting automatic test data through the target interface, calling an interface automatic test engine, and executing the automatic test of the target interface.
According to the technical scheme provided by the embodiment of the invention, when the target interface needs to be tested, the data generation template of the target interface can be constructed according to the modified programming statement of the target interface; and then, establishing automatic test data of the target interface according to the constructed data generation template, and further performing automatic test on the target interface by adopting the established automatic test data. This scheme compares in current automatic test scheme of interface, can construct different test data according to different interfaces are automatic to carry out the automatic test of interface and use, need not to consume a large amount of manpowers.
Example four
Fig. 4 is a block diagram of an interface automation test data constructing apparatus according to a fourth embodiment of the present invention, which is capable of executing the interface automation test data constructing method according to any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the executing method. As shown in fig. 4, the apparatus may include:
a template building module 410, configured to build a data generation template of the target interface according to the modified programming statement of the target interface and/or the data type of the target interface;
the test data generating module 420 is configured to construct automated test data of the target interface according to the data generating template, and is configured to test the target interface.
According to the technical scheme provided by the embodiment of the invention, when the target interface needs to be tested, the data generation template of the target interface can be constructed according to the modified programming statement of the target interface and/or the data type of the target interface; and then, establishing automatic test data of the target interface according to the constructed data generation template, and further performing automatic test on the target interface by adopting the established automatic test data. This scheme compares in current automatic test scheme of interface, can construct different test data according to different interfaces are automatic to carry out the automatic test of interface and use, need not to consume a large amount of manpowers.
Illustratively, the apparatus may further include:
and the programming statement acquisition module is used for acquiring the modified programming statement of the target interface from the main database in real time through the sniffer based on the principle of master-slave database synchronization before the modified programming statement of the target interface.
Illustratively, the template building module 410 may also be configured to:
extracting a programming statement module from a programming statement;
determining key attributes of the programming statement according to the object and at least one attribute of the object included in the programming statement module;
and constructing a data generation template according to the programming statement module and the key attributes of the programming statements.
Illustratively, the template building module 410 may also be configured to:
and if the data type of the automatic test data required by the test target interface is detected to be the same as the data type of the locally stored test data, taking the data generation template with the same data type as the data generation template of the target interface.
Illustratively, the apparatus may further include:
the target interface acquisition module is used for acquiring a target interface from a locally stored interface document after the automatic test data of the target interface is constructed according to the data generation template;
and the test module is used for requesting automatic test data through the target interface, calling the interface automatic test engine and executing the automatic test of the target interface.
EXAMPLE five
Fig. 5 is a schematic structural diagram of a platform according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary platform 12 suitable for use in implementing embodiments of the present invention. The platform 12 shown in fig. 5 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 5, the platform 12 is in the form of a general purpose computing device. The components of the platform 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Platform 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by platform 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The platform 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The platform 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the device, and/or with any devices (e.g., network card, modem, etc.) that enable the platform 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Moreover, the platform 12 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the platform 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the platform 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the interface automation test data construction method provided by the embodiment of the present invention.
Example six
The sixth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, can implement any one of the interface automation test data construction methods described in the foregoing embodiments.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may 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 (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
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.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The above example numbers are merely for description and do not represent the merits of the examples.
It will be understood by those skilled in the art that the modules or steps of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. An interface automation test data construction method is characterized by comprising the following steps:
based on the matching condition of the data type of the test data required by the target interface and the data type of the locally stored test data, constructing a data generation template of the target interface according to the modified programming statement of the target interface and/or the data type of the target interface;
according to the data generation template, automatic test data of a target interface are constructed and used for testing the target interface;
constructing a data generation template of the target interface according to the modified programming statement of the target interface, comprising:
extracting a programming statement module from the programming statement;
determining the key attribute of the programming statement according to the table included in the programming statement module and at least one attribute of the table;
constructing the data generation template according to the programming statement module and the key attributes of the programming statements;
the key attributes are key parameters of the table in the programming statement module and play a key role in the test result of the interface, wherein the key attributes comprise one or more of the key attributes;
according to the data type of the target interface, constructing a data generation template of the target interface, wherein the data generation template comprises the following steps:
and if the data type of the automatic test data required by the test target interface is detected to be the same as the data type of the locally stored test data, taking the data generation template with the same data type as the data generation template of the target interface.
2. The method of claim 1, wherein before building the data generation template for the target interface, further comprising:
and acquiring the modified programming statement of the target interface from the master database in real time by the sniffer based on the master-slave database synchronization principle.
3. The method of claim 1, wherein after building the automated test data for the target interface from the data generation template, further comprising:
acquiring the target interface from a locally stored interface document;
and requesting the automatic test data through the target interface, calling an interface automatic test engine, and executing the automatic test of the target interface.
4. An interface automation test data construction device, characterized by comprising:
the template building module is used for building a data generation template of the target interface according to the modified programming statement of the target interface and/or the data type of the target interface based on the matching condition of the data type of the test data required by the target interface and the data type of the locally stored test data;
the test data generation module is used for constructing automatic test data of a target interface according to the data generation template and testing the target interface;
a template construction module further configured to:
extracting a programming statement module from a programming statement;
determining key attributes of the programming statement according to the object and at least one attribute of the object included in the programming statement module;
constructing a data generation template according to the programming statement module and the key attributes of the programming statements;
if the data type of the automatic test data required by the test target interface is detected to be the same as the data type of the locally stored test data, taking a data generation template with the same data type as a data generation template of the target interface;
the key attributes are key parameters of the table in the programming statement module and play a key role in the test result of the interface, wherein the key attributes comprise one or more.
5. The apparatus of claim 4, further comprising:
and the programming statement acquisition module is used for acquiring the modified programming statement of the target interface from the main database in real time through the sniffer based on the principle of master-slave database synchronization before the modified programming statement of the target interface.
6. A platform, characterized in that the platform comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the interface automation test data construction method of any one of claims 1-3.
7. A storage medium on which a computer program is stored, which program, when being executed by a processor, carries out the interface automation test data construction method according to any one of claims 1 to 3.
CN201811359053.7A 2018-11-15 2018-11-15 Interface automation test data construction method, device, platform and storage medium Active CN109522228B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811359053.7A CN109522228B (en) 2018-11-15 2018-11-15 Interface automation test data construction method, device, platform and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811359053.7A CN109522228B (en) 2018-11-15 2018-11-15 Interface automation test data construction method, device, platform and storage medium

Publications (2)

Publication Number Publication Date
CN109522228A CN109522228A (en) 2019-03-26
CN109522228B true CN109522228B (en) 2022-06-24

Family

ID=65778043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811359053.7A Active CN109522228B (en) 2018-11-15 2018-11-15 Interface automation test data construction method, device, platform and storage medium

Country Status (1)

Country Link
CN (1) CN109522228B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286783A (en) * 2019-07-23 2021-01-29 北京中关村科金技术有限公司 Method and device for generating database insertion statement and performing system test
CN111190811A (en) * 2019-12-05 2020-05-22 东方微银科技(北京)有限公司 Method, device, equipment and storage medium for testing resource allocation system
CN111611174B (en) * 2020-05-28 2023-08-11 北京火山引擎科技有限公司 Method and device for constructing test data, computer equipment and storage medium
CN112181832B (en) * 2020-09-28 2023-04-11 中国平安财产保险股份有限公司 Test data generation method and device, computer equipment and storage medium
CN112199300B (en) * 2020-11-13 2022-08-19 新华三大数据技术有限公司 Interface testing method and device, electronic equipment and storage medium
CN113535543A (en) * 2021-06-09 2021-10-22 卡斯柯信号有限公司 Test data generation method, device, equipment and medium for TACS system
CN116627851B (en) * 2023-07-24 2023-10-20 恒生电子股份有限公司 Interface testing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101430661B (en) * 2008-11-18 2011-06-01 阿里巴巴集团控股有限公司 Method, system and apparatus for test data batch generation
CN104123227A (en) * 2014-08-13 2014-10-29 广东电网公司信息中心 Method for automatically generating testing cases
CN106649082A (en) * 2016-09-05 2017-05-10 中国银行股份有限公司 Test data generation method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10037266B2 (en) * 2016-04-01 2018-07-31 Sony Interactive Entertainment America Llc Game stream fuzz testing and automation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101430661B (en) * 2008-11-18 2011-06-01 阿里巴巴集团控股有限公司 Method, system and apparatus for test data batch generation
CN104123227A (en) * 2014-08-13 2014-10-29 广东电网公司信息中心 Method for automatically generating testing cases
CN106649082A (en) * 2016-09-05 2017-05-10 中国银行股份有限公司 Test data generation method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向网络游戏的自动化接口测试系统设计;周绍凯 等;《现代计算机》;20180430(第10期);全文 *

Also Published As

Publication number Publication date
CN109522228A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN109522228B (en) Interface automation test data construction method, device, platform and storage medium
US10387292B2 (en) Determining application test results using screenshot metadata
US20230281012A1 (en) Systems and methods for automating and monitoring software development operations
US20190228000A1 (en) Repairing corrupted references
CN104090776A (en) Software development method and system
CN111290956B (en) Brain graph-based test method and device, electronic equipment and storage medium
US9417991B2 (en) Translation verification testing
CN103180834B (en) Automatic operation system test frame
CN110019116B (en) Data tracing method, device, data processing equipment and computer storage medium
US9311345B2 (en) Template based database analyzer
Gao et al. What is AI software testing? and why
US9965252B2 (en) Method and system for generating stateflow models from software requirements
CN109840192B (en) Method and device for automatic testing
CN112417122A (en) Multi-turn question and answer method and device, computer readable storage medium and electronic equipment
CN109582906A (en) Determination method, apparatus, equipment and the storage medium of data reliability
KR101334806B1 (en) Method of proudcing input sets of test case in test case generating system
CN109800147B (en) Test case generation method and terminal equipment
Brent et al. A versatile framework for painless benchmarking of database management systems
CN113282504A (en) Incremental code coverage rate detection method and service development method and device
CN113688134A (en) Visual variable management method, system and equipment based on multidimensional data
CN113238901A (en) Multi-device automatic testing method and device, storage medium and computer device
CN111859985A (en) AI customer service model testing method, device, electronic equipment and storage medium
CN113360365A (en) Flow testing method and flow testing system
CN111767222A (en) Data model verification method and device, electronic equipment and storage medium
CN113254328B (en) White box testing method, system, mobile terminal and storage medium

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
GR01 Patent grant
GR01 Patent grant