Nothing Special   »   [go: up one dir, main page]

CN114721958A - Automatic interface testing method and terminal for multi-database system - Google Patents

Automatic interface testing method and terminal for multi-database system Download PDF

Info

Publication number
CN114721958A
CN114721958A CN202210403634.6A CN202210403634A CN114721958A CN 114721958 A CN114721958 A CN 114721958A CN 202210403634 A CN202210403634 A CN 202210403634A CN 114721958 A CN114721958 A CN 114721958A
Authority
CN
China
Prior art keywords
database
target
testing
tested
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
CN202210403634.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.)
Istrong Technology Co ltd
Original Assignee
Istrong 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 Istrong Technology Co ltd filed Critical Istrong Technology Co ltd
Priority to CN202210403634.6A priority Critical patent/CN114721958A/en
Publication of CN114721958A publication Critical patent/CN114721958A/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/3664Environments for testing or debugging software
    • 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/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses an interface automatic test method and a terminal of a multi-database system, which are used for obtaining a database list, wherein the database list comprises a database and configuration information corresponding to the database; traversing the database list, marking the traversed database as a target database, connecting the target database according to target configuration information corresponding to the target database, and testing the target database according to a preset rule; the invention realizes the automatic switching of the database connection in the test process, does not need to manually switch the database, and realizes the full automation of the interface test, thereby improving the efficiency of the interface test.

Description

Automatic interface testing method and terminal for multi-database system
Technical Field
The invention relates to the technical field of network security, in particular to an interface automatic testing method and terminal for a multi-database system.
Background
Interface testing is a test that tests an interface between components of a system. The interface test is mainly used for detecting interaction points between an external system and the system and between subsystems in the system. The main function is to check whether the returned result is the desired result through the corresponding interface of the request server or other modules.
The basic syntax of each database is slightly different, the writing methods of specific functions, variables and the like are more different, and in most cases, only one kind of data (such as one of the following databases: SqlServer, Oracle, MySQL, DM, Kingbase and the like) needs to be supported by the background of one system. However, in some systems, in order to meet the development requirement, a plurality of databases need to be supported at the same time so as to meet the requirement of more projects on the databases, such as: the item A needs a SqlServer database; the project B needs an Oracle database, the project C needs a MySQL database, but the projects are developed by the same frame, so if a certain module in the frame needs to test functions of adding, modifying, deleting, inquiring and the like, all the databases need to be tested once. If n databases exist in total, the test workload is increased by n times. However, the traditional interface automatic test cannot realize that n databases are tested in the same test task.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the interface automatic testing method and the terminal of the multi-database system can improve the efficiency of database interface testing.
In order to solve the technical problems, the invention adopts a technical scheme that:
an automatic interface test method for a multi-database system comprises the following steps:
acquiring a database list, wherein the database list comprises a database and configuration information corresponding to the database;
and traversing the database list, marking the traversed database as a target database, connecting the target database according to target configuration information corresponding to the target database, and testing the target database according to a preset rule.
In order to solve the technical problem, the invention adopts another technical scheme as follows:
an interface automation test terminal of a multi-database system, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring a database list, wherein the database list comprises a database and configuration information corresponding to the database;
traversing the database list, marking the traversed database as a target database, connecting the target database according to target configuration information corresponding to the target database, and testing the target database according to a preset rule.
The invention has the beneficial effects that: the database list is used for recording the identification of the databases to be tested and the configuration information corresponding to each database to be tested, and in the testing process, the database list is traversed, the configuration information is connected with the databases to be tested, so that the automatic connection with the databases is guaranteed under the condition that the databases are not omitted, the databases are not required to be manually switched, the databases are automatically switched in the interface testing process, the full automation of the interface testing is realized, and the efficiency of the interface testing is improved.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for automated testing of interfaces of multiple database systems according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating another step of a method for automated testing of interfaces of multiple database systems according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an interface automation test terminal of a multi-database system according to an embodiment of the present invention;
description of reference numerals:
1. an interface automation test terminal of a multi-database system; 2. a processor; 3. a memory.
Detailed Description
In order to explain the technical contents, the objects and the effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
Referring to fig. 1 and fig. 2, an embodiment of the present invention provides an interface automation testing method for multiple database systems, including the steps of:
acquiring a database list, wherein the database list comprises a database and configuration information corresponding to the database;
traversing the database list, marking the traversed database as a target database, connecting the target database according to target configuration information corresponding to the target database, and testing the target database according to a preset rule.
As can be seen from the above description, the beneficial effects of the present invention are: the database list is used for recording the identification of the databases to be tested and the configuration information corresponding to each database to be tested, and in the testing process, the database list is traversed, the configuration information is connected with the databases to be tested, so that the automatic connection with the databases is guaranteed under the condition that the databases are not omitted, the databases are not required to be manually switched, the databases are automatically switched in the interface testing process, the full automation of the interface testing is realized, and the efficiency of the interface testing is improved.
Further, the preset rule comprises preset test data;
and the preset test data for testing each target database are the same.
According to the above description, the preset test data of each target database is controlled to be the same, and the test result can be predicted, so that the test result of the database can be better judged, and the test item corresponding to a certain database cannot be omitted.
Further, the testing the target database according to the preset rule comprises:
traversing the interfaces to be tested of the target database, marking the traversed interfaces to be tested as target interfaces to be tested, and testing the target interfaces to be tested according to the preset rule.
According to the description, after the target database is automatically connected, the automatic test is realized on the to-be-tested interface corresponding to the target database according to the preset rule, so that the workload of personnel is further reduced, and the efficiency of interface test is improved.
Further, the configuration information includes connection string information.
As can be seen from the above description, the connection string information can ensure that the connection with the target database can be smoothly established in the automatic test process.
Further, traversing the database list further comprises:
and generating and outputting a test report.
According to the description, the test report is generated and output after the database list is traversed, the report result is materialized, and the test report is convenient for testers to check and correspondingly check.
Referring to fig. 2, an interface automation test terminal of a multi-database system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the following steps:
acquiring a database list, wherein the database list comprises a database and configuration information corresponding to the database;
traversing the database list, marking the traversed database as a target database, connecting the target database according to target configuration information corresponding to the target database, and testing the target database according to a preset rule.
As can be seen from the above description, the beneficial effects of the present invention are: the database list is used for recording the identification of the databases to be tested and the configuration information corresponding to each database to be tested, and in the testing process, the database list is traversed, the configuration information is connected with the databases to be tested, so that the automatic connection with the databases is guaranteed under the condition that the databases are not omitted, the databases do not need to be manually switched, the full automation of interface testing is realized, and the efficiency of the interface testing is improved.
Further, the preset rule comprises preset test data;
and the preset test data for testing each target database are the same.
According to the above description, the preset test data of each target database is controlled to be the same, and the test result can be predicted, so that the test result of the database can be better judged, and the test item corresponding to a certain database cannot be omitted.
Further, the testing the target database according to the preset rule includes:
traversing the interfaces to be tested of the target database, marking the traversed interfaces to be tested as target interfaces to be tested, and testing the target interfaces to be tested according to the preset rule.
According to the description, after the target database is automatically connected, the automatic test is realized on the to-be-tested interface corresponding to the target database according to the preset rule, so that the workload of personnel is further reduced, and the efficiency of interface test is improved.
Further, the configuration information includes connection string information.
As can be seen from the above description, connection with the target database can be smoothly established in the automatic test process through the connection string information.
Further, traversing the database list further comprises:
and generating and outputting a test report.
According to the description, the test report is generated and output after the database list is traversed, the report result is materialized, and the test report is convenient for testers to check and correspondingly check.
The automatic interface testing method for a multi-database system can be applied to testing of a system which needs to be connected with a plurality of databases, and is described by the following specific embodiments:
example one
Referring to fig. 1 and 2, an automated testing method for an interface of a multi-database system includes:
s1, acquiring a database list, wherein the database list comprises a database and configuration information corresponding to the database;
in an optional implementation, the configuration information includes connection string information, and a connection can be established with the database according to the connection string information;
in an optional implementation mode, the database list is stored in a preset database, the system reads the database list by establishing connection with the preset database, searching, updating and modifying are facilitated, the database list is stored in the database, connection string information can be locally and directly configured through connection of a database tool, common configuration files need to be connected with correspondingly deployed servers, and the configuration files can be modified only if found; the migration is convenient, the configuration file mode can change along with the position of the automatic environment deployment, and the use of the database can not be changed by the change of the deployment environment; the management is convenient, the database is used for storing the connection string information, so that the connection string information in all the items can be conveniently and uniformly displayed and checked, for example, the connection string information of ten items exists, if configuration files need to be stored in ten different configuration files respectively, ten files are required to be opened respectively by checking at the same time, and only a certain table needs to be opened in the database;
s2, traversing the database list, marking the traversed database as a target database, connecting the target database according to target configuration information corresponding to the target database, and testing the target database according to a preset rule;
in an alternative embodiment, by using pytest main in the pytest framework, py-s-count (the number of databases, i.e. the number of times a loop is executed); testing the database;
wherein the testing the target database according to a preset rule comprises:
traversing the to-be-tested interfaces of the target database, marking the traversed to-be-tested interfaces as target to-be-tested interfaces, and testing the target to-be-tested interfaces according to the preset rule;
in an optional embodiment, the preset rule includes preset test data, and the preset test data for testing each target database is the same; whether the test results of different databases are consistent with the preset result or not is conveniently compared, if the test results are inconsistent with the preset result, the test is regarded as failed, and the storage space of the preset rule can be saved;
referring to fig. 2, in an alternative embodiment, S2 specifically includes S21-S26:
s21, connecting the preset database, and reading the database list from the preset database;
s22, judging whether a currently connected target database exists, if so, executing S23, otherwise, executing S24;
s23, judging whether the currently connected target database is the last database in the database list, if so, executing a step S3, otherwise, acquiring a next database corresponding to the currently connected target database as a new target database, and executing S25;
s24, if no target database is connected currently, acquiring a first database in the database list as a target database;
s25, establishing connection with a target database according to the configuration information in the database list; restarting the system, judging whether the system is normally started, if so, executing the step S26, otherwise, keeping a waiting state until the system is normally started, and executing the step S26; restarting judgment in the database switching process is automatically carried out, and abnormity in the database switching process is avoided;
s26, after testing the target database according to a preset rule, jumping to S21;
and S3, generating and outputting a test report, and ending the test.
Referring to fig. 3, the second embodiment of the present invention is:
an interface automation test terminal 1 of a multi-database system comprises a processor 2, a memory 3 and a computer program stored on the memory 3 and capable of running on the processor 2, wherein the processor 2 implements the steps of the first embodiment when executing the computer program.
In summary, according to the interface automation test method and the terminal for the multi-database system provided by the invention, the database and the configuration information corresponding to the database, such as the connection string information, are stored, so that the automatic switching of the database connected to the system in the test process is realized, the complexity of manual switching is avoided, the labor cost is reduced, and the efficiency of the interface automation test is improved; the switching of the connection strings is automatically carried out, so that the process is smoother; the invention realizes the test of a plurality of databases together, for example, the original 4 databases need to be tested for 1+1+1+1 times and generate 4 independent test reports, the invention realizes the test of 4 databases once and only generates 1 test report, and the report content can be divided according to the database type and avoids the repeated display of redundant parts, thus being more concise; a plurality of reports are changed into one report, so that the test reports can be more conveniently checked; original dispersed contents are collected together, so that the difference of each database is more conveniently compared; meanwhile, in the process of testing the database, the same preset test data are adopted, so that the final test result is convenient to compare, and the test result can be predicted; in the whole process of system operation and maintenance, all databases need to be tested for many times, and the test method can be continuously used only by once maintenance, so that the overall operation and maintenance cost is reduced, and the operation and maintenance efficiency is improved.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (10)

1. An automatic interface testing method for a multi-database system is characterized by comprising the following steps:
acquiring a database list, wherein the database list comprises a database and configuration information corresponding to the database;
traversing the database list, marking the traversed database as a target database, connecting the target database according to target configuration information corresponding to the target database, and testing the target database according to a preset rule.
2. The method of claim 1, wherein the predetermined rules include predetermined test data;
and the preset test data for testing each target database are the same.
3. The method as claimed in claim 1, wherein the testing the target database according to the predetermined rule comprises:
traversing the interfaces to be tested of the target database, marking the traversed interfaces to be tested as target interfaces to be tested, and testing the target interfaces to be tested according to the preset rule.
4. The method of claim 1, wherein said configuration information includes connection string information.
5. The method for automated testing of interfaces of multiple database systems as claimed in claim 1, wherein said traversing said database list further comprises:
and generating and outputting a test report.
6. An interface automation test terminal of a multi-database system, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
acquiring a database list, wherein the database list comprises a database and configuration information corresponding to the database;
traversing the database list, marking the traversed database as a target database, connecting the target database according to target configuration information corresponding to the target database, and testing the target database according to a preset rule.
7. The automated test terminal for interfacing to multiple database systems of claim 6, wherein said predetermined rules comprise predetermined test data;
and the preset test data for testing each target database are the same.
8. The terminal of claim 6, wherein the testing the target database according to the predetermined rule comprises:
traversing the interfaces to be tested of the target database, marking the traversed interfaces to be tested as target interfaces to be tested, and testing the target interfaces to be tested according to the preset rule.
9. The interface automation test terminal for multiple database systems of claim 6 wherein the configuration information includes connection string information.
10. The automated test terminal for interfacing to multiple database systems of claim 6, wherein said traversing said database list further comprises:
and generating and outputting a test report.
CN202210403634.6A 2022-04-18 2022-04-18 Automatic interface testing method and terminal for multi-database system Pending CN114721958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210403634.6A CN114721958A (en) 2022-04-18 2022-04-18 Automatic interface testing method and terminal for multi-database system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210403634.6A CN114721958A (en) 2022-04-18 2022-04-18 Automatic interface testing method and terminal for multi-database system

Publications (1)

Publication Number Publication Date
CN114721958A true CN114721958A (en) 2022-07-08

Family

ID=82244042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210403634.6A Pending CN114721958A (en) 2022-04-18 2022-04-18 Automatic interface testing method and terminal for multi-database system

Country Status (1)

Country Link
CN (1) CN114721958A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050086257A1 (en) * 2003-10-17 2005-04-21 Measured Progress, Inc. Item tracking, database management, and relational database system associated with multiple large scale test and assessment projects
KR20100070713A (en) * 2008-12-18 2010-06-28 주식회사 코아로직 Method and system for automatically testing database system based on scenario
US20120136602A1 (en) * 2010-05-07 2012-05-31 Salesforce.Com, Inc. Method and system for automated performance testing in a multi-tenant environment
CN102521354A (en) * 2011-12-13 2012-06-27 北京天融信科技有限公司 Auditing and testing method and auditing and testing device for data base protocol
CN103810196A (en) * 2012-11-09 2014-05-21 阿里巴巴集团控股有限公司 Method for testing performance of database on basis of business model
CN105447012A (en) * 2014-08-15 2016-03-30 阿里巴巴集团控股有限公司 Write-in exclusive method and device used for database
CN107122365A (en) * 2016-02-25 2017-09-01 阿里巴巴集团控股有限公司 The access method and device of heterogeneous database
CN107608902A (en) * 2017-10-23 2018-01-19 中国联合网络通信集团有限公司 Routine interface method of testing and device
CN112131126A (en) * 2020-09-28 2020-12-25 中国银行股份有限公司 Test environment switching method and device
CN113704107A (en) * 2021-08-26 2021-11-26 平安国际智慧城市科技股份有限公司 Application testing method, device, equipment and computer readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050086257A1 (en) * 2003-10-17 2005-04-21 Measured Progress, Inc. Item tracking, database management, and relational database system associated with multiple large scale test and assessment projects
KR20100070713A (en) * 2008-12-18 2010-06-28 주식회사 코아로직 Method and system for automatically testing database system based on scenario
US20120136602A1 (en) * 2010-05-07 2012-05-31 Salesforce.Com, Inc. Method and system for automated performance testing in a multi-tenant environment
CN102521354A (en) * 2011-12-13 2012-06-27 北京天融信科技有限公司 Auditing and testing method and auditing and testing device for data base protocol
CN103810196A (en) * 2012-11-09 2014-05-21 阿里巴巴集团控股有限公司 Method for testing performance of database on basis of business model
CN105447012A (en) * 2014-08-15 2016-03-30 阿里巴巴集团控股有限公司 Write-in exclusive method and device used for database
CN107122365A (en) * 2016-02-25 2017-09-01 阿里巴巴集团控股有限公司 The access method and device of heterogeneous database
CN107608902A (en) * 2017-10-23 2018-01-19 中国联合网络通信集团有限公司 Routine interface method of testing and device
CN112131126A (en) * 2020-09-28 2020-12-25 中国银行股份有限公司 Test environment switching method and device
CN113704107A (en) * 2021-08-26 2021-11-26 平安国际智慧城市科技股份有限公司 Application testing method, device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
US12130732B2 (en) System and method for performing automated API tests
US6182245B1 (en) Software test case client/server system and method
CN100401265C (en) Keyword-driven automatic testing system and method
CN100401264C (en) Data-driven automatic testing system and method
US8296732B2 (en) Computer-implemented systems and methods for analyzing product configuration and data
CN107665171B (en) Automatic regression testing method and device
US7917895B2 (en) Automated software testing and validation system
CN112506807B (en) Automatic test system for interface serving multiple systems
CN108763091B (en) Method, device and system for regression testing
CN108038054B (en) Automatic testing method and device and computer readable storage medium
CN112699055B (en) Software automatic test method and system with lower maintenance cost
US20180165179A1 (en) Determining incompatibilities of automated test cases with modified user interfaces
US10990515B2 (en) Automated unit testing in a mainframe environment
CN112306861A (en) Unittest and Jenkins tool-based interface automatic testing system and method
WO2023231704A1 (en) Algorithm running method, apparatus and device, and storage medium
US11341030B2 (en) Scriptless software test automation
CN112685312A (en) Test case recommendation method and device for uncovered codes
CN103064780B (en) A kind of method of software test and device
CN114996127A (en) Intelligent test method and system for solid state disk firmware module
CN115292307A (en) Data synchronization system, method and corresponding computer equipment and storage medium
CN112100066B (en) Verification method for accuracy of data index and automatic test tool
CN114721958A (en) Automatic interface testing method and terminal for multi-database system
CN115757090A (en) Software testing system, method, device and medium
CN113238901B (en) Multi-device automatic testing method and device, storage medium and computer device
CN115269387A (en) Automatic interface testing method and device

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