CN116662209A - Automatic test method, device, equipment and storage medium for database interface - Google Patents

Automatic test method, device, equipment and storage medium for database interface Download PDF

Info

Publication number
CN116662209A
CN116662209A CN202310928870.4A CN202310928870A CN116662209A CN 116662209 A CN116662209 A CN 116662209A CN 202310928870 A CN202310928870 A CN 202310928870A CN 116662209 A CN116662209 A CN 116662209A
Authority
CN
China
Prior art keywords
interface
database
information
results
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310928870.4A
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.)
Jinzhuan Xinke Co Ltd
Original Assignee
Jinzhuan Xinke 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 Jinzhuan Xinke Co Ltd filed Critical Jinzhuan Xinke Co Ltd
Priority to CN202310928870.4A priority Critical patent/CN116662209A/en
Publication of CN116662209A publication Critical patent/CN116662209A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3452Performance evaluation by statistical analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to the technical field of A/B testing in the database field, and provides a database interface automatic testing method, a device, equipment and a storage medium. The method can automatically deploy various interface testing tools and collect and compare testing results, effectively saves a great deal of manpower and material resources required by testing the multi-type database of the multi-type interface, and improves the research and development and testing efficiency.

Description

Automatic test method, device, equipment and storage medium for database interface
Technical Field
The application relates to the technical field of A/B testing in the field of databases, in particular to a database interface automatic testing method, a device, equipment and a storage medium.
Background
The purpose of the database interface test is to verify the correctness and stability of the database, a process in which the simulation client sends a request to the database and returns a response, exposing the database BUG as early as possible. For more complex system interfaces, the interface test can improve the test efficiency and reduce the research and development cost.
The database A/B test means that under a plurality of identical conditions, a certain factor is changed to obtain the influence of the database result. The method can test the accuracy of the database in parallel, reduce the test cost and improve the test efficiency.
The existing interface test tools are all connection tools of single type interfaces, are pale and weak when facing to the test requirements of multiple types of interfaces, and can only send requests and return results to a single database, so that the comparison test can not be performed. The existing test method is used for testing the multi-type interfaces and the multi-type databases, testers need to learn to use various interface connection tools, and the various database returned information needs to be respectively subjected to induction analysis, so that the whole process certainly needs to consume a great deal of manpower and time cost.
Disclosure of Invention
In order to solve the problems in the prior art, an embodiment of the present application provides an automated testing method for a database interface, which is characterized by comprising:
interface connection information is configured, wherein the interface connection information comprises interface information and database information which need to be connected, and directory information stored in a test service file;
performing environment deployment and initialization of each interface according to the interface information;
connecting each interface with each database according to the interface information and the database information;
acquiring the service file according to the directory information;
analyzing the service file to obtain a service statement;
sending the business statement to each database for execution through each interface;
collecting the execution results of the databases;
comparing the execution results of the databases;
and carrying out statistics archiving on the execution results and comparison results of the databases, and outputting an execution result comparison report.
The embodiment of the application also provides an automatic testing device for the database interface, which is characterized by comprising the following components:
the configuration module is used for configuring interface connection information, wherein the interface connection information comprises interface information and database information which need to be connected, and directory information stored in the test service file;
the interface deployment module is used for carrying out environment deployment and initialization of each interface according to the interface information;
the database connection detection module is used for connecting each interface with each database according to the interface information and the database information;
the service file acquisition module is used for acquiring the service file according to the directory information;
the analysis module is used for analyzing the service file to obtain a service statement;
the sending module is used for sending the business statement to each database for execution through each interface;
the collection module is used for collecting the execution results of the databases;
the comparison module is used for comparing the execution results of the databases;
and the statistics module is used for statistically archiving the execution results and the comparison results of the databases and outputting an execution result comparison report.
The embodiment of the application also provides electronic equipment, which comprises a processor and a memory, wherein the memory stores a program capable of running on the processor, and the method is characterized in that the steps of the database interface automatic test method are realized when the program is executed by the processor.
The embodiment of the application also provides a computer readable storage medium storing at least one program, which is characterized in that the at least one program can be executed by at least one processor to realize the steps of the database interface automatic test method.
The database interface automatic test method provided by the embodiment of the application is a multi-interface multi-database oriented database interface automatic test method, the connection between a corresponding interface and a corresponding database is established by configuring interface connection information, after analyzing a test service file, the test service file is sent to the corresponding database for execution through the corresponding interface, and the execution results of the databases are collected for comparison. The automatic test method for the database interface provided by the embodiment of the application can automatically deploy various interface test tools and collect comparison test results, effectively saves a great deal of manpower and material resources required to be consumed by testing the multi-type database of the multi-type interface, and improves the research and development and test efficiency.
Drawings
FIG. 1 is a schematic flow chart of an automated testing method for a database interface according to an embodiment of the present application;
FIG. 2 is a flow chart of a comparison method of execution results of various databases according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an automated testing device for a database interface according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a comparison module according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical scheme of the present application more clearly understood, the technical scheme of the present application will be described in further detail below according to specific embodiments with reference to the accompanying drawings. It is obvious that the following examples are only some examples of the present application and do not limit the technical solution of the present application. Other embodiments may be made by those of ordinary skill in the art without departing from the inventive concepts herein.
It should be noted that, the step sequence described in the method embodiments in the following embodiments does not limit the technical solution of the present application, and it is possible for a person skilled in the art to reasonably adjust some step sequences according to the embodiments of the present application without any inventive effort.
Example 1
The embodiment provides a database interface automatic test method, which is a database interface automatic test method for multiple interfaces and multiple databases, as shown in fig. 1, and comprises the following steps:
step 101, interface connection information is configured, wherein the interface connection information comprises interface information and database information which need to be connected, and directory information stored in a test service file.
Specifically, the present embodiment configures interface connection information using a database connection string. For example:
mysql connection JDBC under JDBC mysql:// XX.XX.XX.XX: XXXX/XXXXXX;
oracle connection under JDBC JDBC Oracle: thin @ XX. XX: XXXX: XX.
And 102, performing environment deployment and initialization of each interface according to the interface information in the configured interface connection information.
Specifically, the environment deployment and initialization of the interface includes installing the corresponding interface tool, releasing the environment memory handle port, and the like. After the interface environment is deployed and initialized, a result log can be output: when the interface environment is successfully deployed and initialized, the log prints Initialize Success keywords; when the interface environment deployment and initialization fail, the log prints the interface connection serial number: initialize Failed key.
And step 103, establishing connection between each interface and each database according to the interface information and the database information in the configured interface connection information.
Specifically, after the connection between each interface and each database is established, whether the databases are normally connected is detected, and a result log is output: when the database is successfully connected, printing a Connect Success keyword by the log; the database cannot be successfully connected, and the log print interface is connected with the serial number +connect Failed keyword.
And 104, acquiring the service file according to the directory information in the configured interface connection information.
The test service file is placed under a specified directory, and the configured interface connection information contains the directory information, and the test service file can be obtained according to the directory information.
And 105, analyzing the service file to obtain a service statement.
And step 106, sending the analyzed business statement to each database for execution through each interface.
The interface is successfully connected with the database, and the analyzed business statement can be sent to the database for execution through the interface so as to verify the correctness and stability of the database.
And step 107, collecting execution results of each database.
During the period of collecting the execution result, the execution result log can be output in real time, success is printed in the log when the business statement is executed successfully, and the statement + keyword + error reporting information of the execution is printed when the business statement is failed.
And step 108, comparing the execution results of the databases.
And according to the collected execution results, automatically comparing the execution results of the databases.
And 109, statistically archiving the execution results and comparison results of the databases, and outputting an execution result comparison report.
Specifically, the execution result comparison report includes execution business statement information, execution database information, execution result information, and execution time information.
Specifically, as shown in fig. 2, the step 108 may include: the comparison of the execution results of a single database is performed, and the comparison of the execution results of a plurality of databases is performed.
Step 1081, comparing the execution results of the single database.
Correspondingly, the execution result comparison report comprises comparison results of execution results of a single database, and the comparison results comprise execution results of different interfaces connected with the single database.
Taking an example of the execution result comparison report in which a single database a is connected to different interfaces A, B, C …, the execution result comparison report is as follows: the business statement |results are compared with the |database A interface A execution results|database A interface B execution results|database A interface C execution results|database A interface.
Step 1082, comparing the execution results of the plurality of databases.
Correspondingly, the execution result comparison report comprises comparison results of execution results of a plurality of databases, and the comparison results comprise execution results of the databases connected with different interfaces.
Taking the database A, B, C … to connect with the execution result comparison report of the different interfaces A, B, C … as an example, the execution result comparison report is as follows: the business statement |results compare whether the |database a interface a execution results |database a interface B execution results |database a interface C execution results |database a interface a.|database B interface a execution results |database B interface B execution results|database B interface C execution results |database B interface.|execution time.
According to the automatic test method for the database interface, the interface connection information containing the interface information to be connected and the database information is configured, the connection between the corresponding interface and the corresponding database is established, the test service file is analyzed and then is sent to the corresponding database for execution through the corresponding interface, the execution results of the databases are automatically collected for automatic comparison, and the comparison report of the execution results is output.
Example two
The embodiment provides an automatic testing device for a database interface, which is a multi-interface multi-database oriented automatic testing device for a database interface, as shown in fig. 3, and includes:
a configuration module 21, configured to configure the interface connection information. The interface connection information comprises interface information and database information which need to be connected, and directory information stored in the test service file.
Specifically, the configuration module 21 configures the above-described interface connection information using the database connection string. For example:
mysql connection JDBC under JDBC mysql:// XX.XX.XX.XX: XXXX/XXXXXX;
oracle connection under JDBC JDBC Oracle: thin @ XX. XX: XXXX: XX.
The interface deployment module 22 is configured to perform environment deployment and initialization of each interface according to the interface information in the configured interface connection information.
Specifically, the environment deployment and initialization of the interface includes installing the corresponding interface tool, releasing the environment memory handle port, and the like. After the interface environment is deployed and initialized, the interface deployment module 22 may output a result log: when the interface environment is successfully deployed and initialized, the log prints Initialize Success keywords; when the interface environment deployment and initialization fail, the log prints the interface connection serial number: initialize Failed key.
The database connection detection module 23 is configured to establish connection between each interface and each database according to the interface information and the database information in the configured interface connection information.
Specifically, the database connection detection module 23 detects whether the databases are normally connected after establishing connection between each interface and each database, and outputs a result log: when the database is successfully connected, printing a Connect Success keyword by the log; the database cannot be successfully connected, and the log print interface is connected with the serial number +connect Failed keyword.
The service file obtaining module 24 is configured to obtain a service file for testing according to the directory information in the configured interface connection information.
The test service file is placed under a specified directory, and the configured interface connection information contains the directory information, and the test service file can be obtained according to the directory information.
And the parsing module 25 is configured to parse the test service file to obtain a service statement.
The parsing module 25 parses the service file to obtain a service statement by using the prior art, and the parsing process is not described in detail in this embodiment.
And the sending module 26 is configured to send the service statement obtained by the parsing module 25 to each database for execution through each interface.
And the collection module 27 is used for collecting the execution result of the business statement by each database.
During the process of collecting the execution result, the collecting module 27 can output an execution result log in real time, print success in the log if the business statement is executed successfully, and print statement+keyword+error reporting information of the execution if the business statement is failed.
And a comparison module 28 for comparing the execution results of the databases.
Specifically, the comparison module 28 automatically compares the execution results of the databases according to the execution results of the databases collected by the collection module 27 on the business statement.
And the statistics module 29 is used for statistically archiving the execution results and comparison results of the databases and outputting comparison reports of the execution results.
Specifically, the execution result comparison report includes execution business statement information, execution database information, execution result information, and execution time information.
Specifically, as shown in fig. 4, the comparison module 28 may include:
the single database comparison module 2801 is used for comparing the execution results of the single database.
Correspondingly, the execution result comparison report comprises comparison results of execution results of a single database, and the comparison results comprise execution results of different interfaces connected with the single database.
Taking an example of the execution result comparison report in which a single database a is connected to different interfaces A, B, C …, the execution result comparison report is as follows: the business statement |results are compared with the |database A interface A execution results|database A interface B execution results|database A interface C execution results|database A interface.
The multi-database comparison module 2802 is configured to compare execution results of a plurality of databases.
Correspondingly, the execution result comparison report comprises comparison results of execution results of a plurality of databases, and the comparison results comprise execution results of the databases connected with different interfaces.
Taking the database A, B, C … to connect with the execution result comparison report of the different interfaces A, B, C … as an example, the execution result comparison report is as follows: the business statement |results compare whether the |database a interface a execution results |database a interface B execution results |database a interface C execution results |database a interface a.|database B interface a execution results |database B interface B execution results|database B interface C execution results |database B interface.|execution time.
The database interface automatic testing device of the embodiment can be deployed on multiple types of servers such as LINUX and WINDOWS, can send business sentences to the multiple types of databases for execution in a multiple type interface connection mode, collects results returned by the databases through interfaces, and finally outputs a comparison result report, thereby being the testing device with higher automation level.
Example III
The present embodiment provides an electronic device, as shown in fig. 5, including a processor 31 and a memory 32 communicatively connected to the processor 31. The memory 32 stores a program executable on the processor 31, which when executed by the processor 31 implements the steps of the database interface automation test method provided in the above embodiment. The above-described program of the present embodiment may be implemented based on the JAVA language.
Example IV
The present embodiment provides a computer readable storage medium storing at least one program executable by at least one processor to implement the steps of the database interface automation test method provided in the above embodiment. The storage medium described above includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk. The above-described program of the present embodiment may be implemented based on the JAVA language.
It will be appreciated by those of ordinary skill in the art that the foregoing embodiments are specific examples of implementing the application, and that the application may be practiced otherwise than as specifically described. All technical schemes formed by equivalent substitution or equivalent transformation fall within the protection scope of the application.

Claims (9)

1. A method for automated testing of a database interface, comprising:
interface connection information is configured, wherein the interface connection information comprises interface information and database information which need to be connected, and directory information stored in a test service file;
performing environment deployment and initialization of each interface according to the interface information;
connecting each interface with each database according to the interface information and the database information;
acquiring the service file according to the directory information;
analyzing the service file to obtain a service statement;
sending the business statement to each database for execution through each interface;
collecting the execution results of the databases;
comparing the execution results of the databases;
and carrying out statistics archiving on the execution results and comparison results of the databases, and outputting an execution result comparison report.
2. The method for automated testing of a database interface of claim 1, wherein configuring interface connection information comprises: the interface connection information is configured using a database connection string.
3. The automated testing method of database interfaces of claim 1, wherein the performing environmental deployment and initialization of each interface according to the interface information comprises: installing a corresponding interface tool and releasing an environment memory handle port.
4. The automated testing method of database interfaces of claim 1, wherein the performing the comparison of the results of the database executions comprises: comparing the execution results of the single database;
the execution result comparison report comprises comparison results of the execution results of the single database, and the comparison results comprise the execution results of the single database connected with different interfaces.
5. The automated testing method of database interfaces of claim 1, wherein the performing the comparison of the results of the database executions comprises: comparing the execution results of the databases;
the execution result comparison report comprises comparison results of the execution results of the databases, wherein the comparison results comprise the execution results of the databases connected with different interfaces.
6. An automated testing device for a database interface, comprising:
the configuration module is used for configuring interface connection information, wherein the interface connection information comprises interface information and database information which need to be connected, and directory information stored in the test service file;
the interface deployment module is used for carrying out environment deployment and initialization of each interface according to the interface information;
the database connection detection module is used for connecting each interface with each database according to the interface information and the database information;
the service file acquisition module is used for acquiring the service file according to the directory information;
the analysis module is used for analyzing the service file to obtain a service statement;
the sending module is used for sending the business statement to each database for execution through each interface;
the collection module is used for collecting the execution results of the databases;
the comparison module is used for comparing the execution results of the databases;
and the statistics module is used for statistically archiving the execution results and the comparison results of the databases and outputting an execution result comparison report.
7. The database interface automated testing apparatus of claim 6, wherein the comparison module comprises:
the single database comparison module is used for comparing the execution results of the single database;
and the multi-database comparison module is used for comparing the execution results of the databases.
8. An electronic device comprising a processor and a memory, the memory storing a program executable on the processor, wherein the program when executed by the processor implements the steps of the database interface automation test method of any of claims 1-5.
9. A computer readable storage medium storing at least one program, wherein the at least one program is executable by at least one processor to implement the steps of the database interface automation test method of any one of claims 1-5.
CN202310928870.4A 2023-07-27 2023-07-27 Automatic test method, device, equipment and storage medium for database interface Pending CN116662209A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310928870.4A CN116662209A (en) 2023-07-27 2023-07-27 Automatic test method, device, equipment and storage medium for database interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310928870.4A CN116662209A (en) 2023-07-27 2023-07-27 Automatic test method, device, equipment and storage medium for database interface

Publications (1)

Publication Number Publication Date
CN116662209A true CN116662209A (en) 2023-08-29

Family

ID=87717393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310928870.4A Pending CN116662209A (en) 2023-07-27 2023-07-27 Automatic test method, device, equipment and storage medium for database interface

Country Status (1)

Country Link
CN (1) CN116662209A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7403901B1 (en) * 2000-04-13 2008-07-22 Accenture Llp Error and load summary reporting in a health care solution environment
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN111240961A (en) * 2019-12-31 2020-06-05 中国电力科学研究院有限公司 Database performance test system and method based on power grid big data platform
CN114443165A (en) * 2022-01-24 2022-05-06 浪潮软件集团有限公司 SQL file checking method and system based on domestic CPU and database
CN116431512A (en) * 2023-04-23 2023-07-14 同方知网数字出版技术股份有限公司 Automatic test system and method adapting to multiple databases

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7403901B1 (en) * 2000-04-13 2008-07-22 Accenture Llp Error and load summary reporting in a health care solution environment
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN111240961A (en) * 2019-12-31 2020-06-05 中国电力科学研究院有限公司 Database performance test system and method based on power grid big data platform
CN114443165A (en) * 2022-01-24 2022-05-06 浪潮软件集团有限公司 SQL file checking method and system based on domestic CPU and database
CN116431512A (en) * 2023-04-23 2023-07-14 同方知网数字出版技术股份有限公司 Automatic test system and method adapting to multiple databases

Similar Documents

Publication Publication Date Title
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
US6598183B1 (en) Software tool for automated diagnosis and resolution of problems of voice, data and VoIP communications networks
US7664986B2 (en) System and method for determining fault isolation in an enterprise computing system
CN109614313A (en) Automated testing method, device and computer readable storage medium
CN101324860B (en) Mainboard test system and test method
CN101145964A (en) An automatic smoke testing method and system for network management system
CN109344060A (en) A kind of analysis method and device of automatic test
US8327189B1 (en) Diagnosing an incident on a computer system using a diagnostics analyzer database
CN110928796B (en) Automatic test platform
CN109684204A (en) A kind of http interface automatic test approach
CN110740071A (en) network interface monitoring method, device and system
CN108009086B (en) System automation test method based on case decomposition and function learning
CN116662209A (en) Automatic test method, device, equipment and storage medium for database interface
US9354962B1 (en) Memory dump file collection and analysis using analysis server and cloud knowledge base
CN115934559A (en) Testing method of intelligent form testing system
CN115292159A (en) Test debugging method and system, corresponding computer equipment and storage medium
CN107635247A (en) Terminal log store method in a kind of LTE automatic tests
CN112231202A (en) Automatic Bug lifting method based on log monitoring and monitored module monitoring
CN115878448A (en) Database test method, distributed database and storage medium
CN111694752A (en) Application testing method, electronic device and storage medium
CN111813665A (en) Big data platform interface data testing method and system based on python
CN114064387A (en) Log monitoring method, system, device and computer readable storage medium
CN113010417A (en) Script execution method and device based on automatic test
CN111835590A (en) Automatic interface test architecture and test method for cloud host product
CN111953544B (en) Fault detection method, device, equipment and storage medium of server

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