CN114385483B - Database interface testing method, device, equipment and storage medium - Google Patents
Database interface testing method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN114385483B CN114385483B CN202111480491.0A CN202111480491A CN114385483B CN 114385483 B CN114385483 B CN 114385483B CN 202111480491 A CN202111480491 A CN 202111480491A CN 114385483 B CN114385483 B CN 114385483B
- Authority
- CN
- China
- Prior art keywords
- interface
- database
- universal
- operation type
- target parameter
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 238
- 238000000034 method Methods 0.000 claims abstract description 71
- 230000008569 process Effects 0.000 claims abstract description 35
- 238000012986 modification Methods 0.000 claims description 27
- 230000004048 modification Effects 0.000 claims description 27
- 238000012217 deletion Methods 0.000 claims description 14
- 230000037430 deletion Effects 0.000 claims description 14
- 238000004891 communication Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 9
- 238000012812 general test Methods 0.000 claims description 9
- 238000012545 processing Methods 0.000 claims description 6
- 238000004806 packaging method and process Methods 0.000 description 8
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000012795 verification Methods 0.000 description 3
- 230000006978 adaptation Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000013515 script Methods 0.000 description 2
- 238000012800 visualization Methods 0.000 description 2
- 241001442302 Pyrestes Species 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application relates to a database interface testing method, a device, equipment and a storage medium, and relates to the field of database testing. The database interface testing method comprises the following steps: running a test case instance of the database to be tested; in the running process, a target parameter is adopted to call a universal interface of a database to be tested; identifying an operation type interface corresponding to the target parameter through the universal interface, and calling the operation type interface to acquire test data and returning the test data; and testing the test data through the test case instance. The method and the device are used for solving the problem that test cases need to be rewritten when different databases are tested.
Description
Technical Field
The present application relates to the field of database testing, and in particular, to a method, an apparatus, a device, and a storage medium for testing a database interface.
Background
In order to meet the increasing performance demands of clients, the blockchain platform continuously breaks through the performance bottleneck, wherein the storage module is continuously optimized and modified, and various low-level storage-dependent KV (Key-Value, key Value pair storage data) databases are designed. Each KV database provides a complete database interface for external service call, and the databases can be tested independently for comparison of performance optimization effects, so that a large number of repeated test works are brought.
Referring generally to database testing, there are many open-source performance benchmark tools such as sysbench, unit test tools such as DBUnit, etc., but there are no existing open-source test tools for integrated testing or interface testing of databases.
The completeness test of the database function is generally carried out by covering interfaces provided by the database, designing the value range of corresponding interface parameters and splicing a plurality of interfaces to carry out interface scene test. If the test object changes a new database, the test script of the part of the database can not be reused, and the test scene is generally redesigned once to perform functional completeness verification of another database. This part of the work brings about a large number of repeated test works.
Disclosure of Invention
The application provides a database interface testing method, a device, equipment and a storage medium, which are used for solving the problem that test cases need to be rewritten when different databases are tested.
In a first aspect, an embodiment of the present application provides a method for testing a database interface, including:
running a test case instance of the database to be tested;
In the running process, a target parameter is adopted to call a universal interface of the database to be tested;
identifying an operation type interface corresponding to the target parameter through the universal interface, and calling the operation type interface to acquire test data and returning the test data;
and testing the test data through the test case examples.
Optionally, before the operation type interface corresponding to the target parameter is identified through the universal interface, the method further includes:
and packaging the operation type interface according to the format of the universal interface.
Optionally, after the testing of the test data by the test case instance, the method further includes:
obtaining a test result;
And generating a test report according to the test result.
Optionally, the operation type interface includes a query and modification type interface;
And in the running process, calling the universal interface of the database to be tested by adopting the target parameters, wherein the method comprises the following steps:
in the running process, a target parameter is adopted to call a query interface and a modification interface of the database to be tested;
The identifying, through the universal interface, an operation type interface corresponding to the target parameter includes:
and identifying the query corresponding to the target parameter and modifying a type interface through the query interface and the modification interface.
Optionally, the operation type interface comprises a query and delete type interface;
And in the running process, calling the universal interface of the database to be tested by adopting the target parameters, wherein the method comprises the following steps:
in the running process, a target parameter is adopted to call a query interface and a deletion interface of the database to be tested;
The identifying, through the universal interface, an operation type interface corresponding to the target parameter includes:
and identifying the query and deletion type interface corresponding to the target parameter through the query interface and the deletion interface.
Optionally, before the target parameter is adopted to call the universal interface of the database to be tested in the running process, the method further comprises:
the universal interface is configured, wherein the universal interface comprises at least one of an add interface, a delete interface, a modify interface, and a query interface.
Optionally, before the running of the test case instance of the database to be tested, the method further includes:
And acquiring the test case instance from a general test case set, wherein the general test case set comprises at least one of a test case of general operation of a database, a test case of scene operation of the database and a test case of a specified database.
In a second aspect, an embodiment of the present application provides a database interface testing apparatus, including:
The operation module is used for operating the test case instance of the database to be tested;
the calling module is used for calling the universal interface of the database to be tested by adopting the target parameters in the running process;
The identification module is used for identifying an operation type interface corresponding to the target parameter through the universal interface, and calling the operation type interface to acquire test data and returning the test data;
and the processing module is used for testing the test data through the test case examples.
Optionally, the database interface testing device further comprises a packaging module;
And the packaging module is used for packaging the operation type interface according to the format of the universal interface.
Optionally, the database interface testing device further comprises a first acquisition module and a generation module;
The first acquisition module is used for acquiring a test result;
the generating module is used for generating a test report according to the test result.
Optionally, the operation type interface includes a query and modification type interface;
the calling module is specifically used for calling a query interface and a modification interface of the database to be tested by adopting target parameters in the running process;
The identification module is specifically configured to identify the query and modification type interface corresponding to the target parameter through the query interface and the modification interface, and call the query and modification type interface to obtain test data and return the test data.
Optionally, the operation type interface comprises a query and delete type interface;
The calling module is specifically used for calling a query interface and a deletion interface of the database to be tested by adopting target parameters in the running process;
The identification module is specifically configured to identify the query and delete type interface corresponding to the target parameter through the query interface and the delete interface, and call the query and delete type interface to obtain test data and return the test data.
Optionally, the database interface testing device further comprises a configuration module;
The configuration module is configured to configure the universal interface, where the universal interface includes at least one of an add interface, a delete interface, a modify interface, and a query interface.
Optionally, the database interface testing device further comprises a second acquisition module;
the second obtaining module is configured to obtain the test case instance from a general test case set, where the general test case set includes at least one of a test case of a database general operation, a test case of a database scenerization operation, and a test case of a specified database.
In a third aspect, an embodiment of the present application provides an electronic device, including: the device comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus;
The memory is used for storing a computer program;
The processor is configured to execute the program stored in the memory, and implement the database interface testing method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium storing a computer program, where the computer program when executed by a processor implements the database interface testing method according to the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method provided by the embodiment of the application, the test case instance of the database to be tested is operated, in the operation process, the target parameter is adopted to call the universal interface of the database to be tested, the operation type interface corresponding to the target parameter is identified through the universal interface, the operation type interface is called to acquire test data and return, and the test data is tested through the test case instance.
Compared with the situation that the test case is required to be rewritten when different databases are tested in the prior art, the method and the device do not need to rewrite the test case, the universal interface of the database to be tested is called in the process of running the test case instance of the database to be tested, the subsequent operation is executed through the universal interface, the test case instance only needs to be written according to the universal interface, the method and the device are suitable for different databases, and the same test case instance can test different databases. The generic interfaces of the different databases are identical and the operation type interfaces of the different databases are different. The specific operation of different databases is to identify an operation type interface corresponding to the target parameter through a universal interface, and call the operation type interface to acquire test data and return the test data, so that the operation type interface is called through the universal interface, and further the test case instance is used for testing the specific database to be tested. The method and the device realize that the same test case instance tests different databases, verify the functional completeness of the databases, do not need to write a large number of test cases, greatly improve the test efficiency and shorten the functional verification period of the database objects.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a database interface test system according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for testing a database interface according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for testing a database interface according to an embodiment of the present application;
FIG. 4 is a flow chart of a method for testing a database interface according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a database interface testing apparatus according to an embodiment of the present application;
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The embodiment of the application provides a database interface testing method which is applied to a database interface testing system.
In the embodiment of the application, as shown in fig. 1, a database interface test system includes a use case set, an execution layer and an adaptation layer.
Use case set: the test case is mainly composed of test cases, and each test case is composed of parameter configuration and test scripts. And the parameter configuration can directly specify the thread concurrency number and the thread circulation times of the test case. The parameter configuration may be set as desired.
The execution layer: the execution layer can set a random concurrent execution mode of the test case to simulate random read-write operation of the database under the test scene, and the test report reading module is responsible for collecting test results and reporting the test results to the visualization tool. The interface realizing part converts the database operation of the general operation into the operation of a specific database, finally feeds the test result back to the test report collecting module, and finally displays the test result in a visual mode.
An adaptation layer: including common, utils and dbs. common provides some basic public operations, some packages of small tool operations, some public operations on general databases are packaged in utils, and database objects to be tested and packages of the database interfaces are accessed under dbs.
In the embodiment of the present application, as shown in fig. 2, the flow of the method for testing the database interface mainly includes:
Step 201, running test case instances of the database to be tested.
In a specific embodiment, before running the test case instance of the database to be tested, the database interface testing method further includes: and acquiring test case examples from the universal test case set, wherein the universal test case set comprises at least one of a test case of a database universal operation, a test case of a database scene operation and a test case of a specified database.
The test cases of the general operation of the database refer to the test cases of the general operations such as adding, deleting, modifying, inquiring and the like of the database. The test cases of database scenerization operation refer to the test cases of database scenerization operation such as random concurrent execution mode. Test cases of a specified database, that is, test cases that only work on the specified database, require a decorator, such as a pyrest. Mark. Skip, or other means to filter out unmatched databases. The generic test case set is defined in advance.
When different databases are not required to be tested, the test case examples are rewritten each time, and the test case examples suitable for the databases to be tested are obtained only in a general test case set defined in advance.
Step 202, in the running process, the target parameters are adopted to call the universal interface of the database to be tested.
The target parameter may be a type of a general interface to be called, for example, the target parameter is a query interface and a modification interface, the target parameter may also be an operation type corresponding to an operation type interface of the database to be tested, for example, the target parameter is a query and modification type, the target parameter may also be an expression described by the operation type interface according to a format of the general interface, for example, the target parameter is an expression described by the operation type interface a=k1 by the general interface a+k2 by the general interface b, the operation type interface a is described by the general interface a and the general interface b according to the format, and k1 and k2 are constants.
The type of the universal interface to be called can be determined according to the target parameters. The target parameter may be other parameters as required, and the present application is not limited to the specific content of the target parameter.
In a specific embodiment, before the target parameter is adopted to call the universal interface of the database to be tested in the running process, the database interface testing method further comprises the following steps: the method comprises configuring a generic interface, wherein the generic interface comprises at least one of an add interface, a delete interface, a modify interface, and a query interface.
Adding interfaces, deleting interfaces, modifying interfaces and querying interfaces are database common operations that are used more frequently.
The generic interfaces may include database generic operations such as Insert add interface, delete interface, update modify interface, select query interface, write interface, read interface, reset interface, roolback rollback interface, close interface, new build interface, etc. The universal interface may also include the universal operation of iterator Iterator provided by the database, such as, for example, newIterator new iterator interface, seek iterator find interface, first get First element interface, last get Last element interface, next return iteration Next element interface, prev return iteration Last element interface, key Value get interface, value store data get interface, release interface, etc.
The universal interface is applicable to different databases.
Step 203, identifying an operation type interface corresponding to the target parameter through the universal interface, and calling the operation type interface to acquire test data and returning.
The target parameter may be a type of a general interface to be called, for example, the target parameter is a query interface and a modification interface, the target parameter may also be an operation type corresponding to an operation type interface of the database to be tested, for example, the target parameter is a query and modification type, the target parameter may also be an expression described by the operation type interface according to a format of the general interface, for example, the target parameter is an expression described by the operation type interface a=k1 by the general interface a+k2 by the general interface b, the operation type interface a is described by the general interface a and the general interface b according to the format, and k1 and k2 are constants.
The type of the operation type interface to be called can be determined according to the target parameters. The target parameter may be other parameters as required, and the present application is not limited to the specific content of the target parameter.
The test data may be obtained by calling an operation type interface through a universal interface, or may be obtained from a database to be tested by calling an operation type interface through a universal interface.
In a specific embodiment, before identifying the operation type interface corresponding to the target parameter through the universal interface, the database interface testing method further includes: and encapsulating the operation type interface according to the format of the universal interface.
According to the format of the universal interface, the operation type interface is encapsulated, for example, the operation type interface a=k1 is a universal interface a+k2 is a universal interface b, the operation type interface a is encapsulated according to the formats of the universal interface a and the universal interface b, and k1 and k2 are constants. Database attributes will be written directly into the interface that created the database.
In one particular embodiment, the operation type interface includes querying and modifying the type interface. In the running process, a target parameter is adopted to call a universal interface of a database to be tested, and the method comprises the following steps: and in the running process, calling a query interface and a modification interface of the database to be tested by adopting the target parameters. Identifying an operation type interface corresponding to the target parameter through the universal interface, comprising: and identifying the query corresponding to the target parameter and modifying the type interface through the query interface and the modification interface.
When the operation type interface comprises a query and modification type interface, the universal interface to be called is a query interface and a modification interface, and the query and modification type interface corresponding to the target parameter is identified through the query interface and the modification interface, and the query and modification type interface is called to acquire test data and return.
In one particular embodiment, the operation type interface includes a query and delete type interface. In the running process, a target parameter is adopted to call a universal interface of a database to be tested, and the method comprises the following steps: and in the running process, calling a query interface and a deletion interface of the database to be tested by adopting the target parameters. Identifying an operation type interface corresponding to the target parameter through the universal interface, comprising: and identifying the query corresponding to the target parameter and deleting the type interface through the query interface and the deleting interface.
When the operation type interface comprises a query and deletion type interface, the universal interfaces to be called are a query interface and a deletion interface, and the query and deletion type interface corresponding to the target parameter is identified through the query interface and the deletion interface, and the query and deletion type interface is called to acquire test data and return.
The operation type interface can also comprise other interfaces according to the requirement, so that the general interface corresponding to the operation type interface can be called, and the operation type interface is called to acquire test data and return through the general interface.
And 204, testing the test data through the test case instance.
In a specific embodiment, after the test data is tested by the test case instance, the database interface testing method further includes: obtaining a test result; and generating a test report according to the test result.
The test report is presented by visualization tools.
In one embodiment, as shown in fig. 3, the method flow of the database interface test mainly includes:
Step 301, obtaining a test case instance from a general test case set.
Step 302, running a test case instance of the database to be tested.
Step 303, in the running process, the target parameter is used to call the universal interface of the database to be tested.
Step 304, identifying an operation type interface corresponding to the target parameter through the universal interface, and calling the operation type interface to acquire test data and returning.
Step 305, test data is tested by the test case instance.
And 306, obtaining a test result.
Step 307, generating a test report according to the test result.
In one embodiment, as shown in fig. 4, the method flow of the database interface test mainly includes:
step 401, packaging the interface of the database db1 to be tested according to the format of the universal interface of the test framework, defining the database attribute of db1 in the configuration file of db1, and enabling the attribute defined in advance when db1 is started to take effect.
Step 402, generating a test case instance of db1 according to the defined universal test case template in the test framework.
Step 403, executing the test case instance and obtaining the test report.
In summary, the method provided by the embodiment of the application operates the test case instance of the database to be tested, and in the operation process, the target parameter is adopted to call the universal interface of the database to be tested, the operation type interface corresponding to the target parameter is identified through the universal interface, the operation type interface is called to acquire test data and return, and the test data is tested through the test case instance.
Compared with the situation that the test case is required to be rewritten when different databases are tested in the prior art, the method and the device do not need to rewrite the test case, the universal interface of the database to be tested is called in the process of running the test case instance of the database to be tested, the subsequent operation is executed through the universal interface, the test case instance only needs to be written according to the universal interface, the method and the device are suitable for different databases, and the same test case instance can test different databases. The generic interfaces of the different databases are identical and the operation type interfaces of the different databases are different. The specific operation of different databases is to identify an operation type interface corresponding to the target parameter through a universal interface, and call the operation type interface to acquire test data and return the test data, so that the operation type interface is called through the universal interface, and further the test case instance is used for testing the specific database to be tested. The method and the device realize that the same test case instance tests different databases, verify the functional completeness of the databases, do not need to write a large number of test cases, greatly improve the test efficiency and shorten the functional verification period of the database objects.
Based on the same conception, the embodiment of the present application provides a database interface testing device, and the specific implementation of the device may be referred to the description of the embodiment of the method, and the repetition is omitted, as shown in fig. 5, where the device mainly includes:
The operation module 501 is configured to operate a test case instance of the database to be tested;
the calling module 502 is configured to call the universal interface of the database to be tested by using a target parameter in a running process;
the identifying module 503 is configured to identify, through the universal interface, an operation type interface corresponding to the target parameter, and call the operation type interface to obtain test data and return the test data;
and the processing module 504 is configured to test the test data through the test case instance.
Optionally, the database interface testing device further comprises a packaging module;
And the packaging module is used for packaging the operation type interface according to the format of the universal interface.
Optionally, the database interface testing device further comprises a first acquisition module and a generation module;
The first acquisition module is used for acquiring a test result;
the generating module is used for generating a test report according to the test result.
Optionally, the operation type interface includes a query and modification type interface;
the calling module is specifically used for calling a query interface and a modification interface of the database to be tested by adopting target parameters in the running process;
The identification module is specifically configured to identify the query and modification type interface corresponding to the target parameter through the query interface and the modification interface, and call the query and modification type interface to obtain test data and return the test data.
Optionally, the operation type interface comprises a query and delete type interface;
The calling module is specifically used for calling a query interface and a deletion interface of the database to be tested by adopting target parameters in the running process;
The identification module is specifically configured to identify the query and delete type interface corresponding to the target parameter through the query interface and the delete interface, and call the query and delete type interface to obtain test data and return the test data.
Optionally, the database interface testing device further comprises a configuration module;
The configuration module is configured to configure the universal interface, where the universal interface includes at least one of an add interface, a delete interface, a modify interface, and a query interface.
Optionally, the database interface testing device further comprises a second acquisition module;
the second obtaining module is configured to obtain the test case instance from a general test case set, where the general test case set includes at least one of a test case of a database general operation, a test case of a database scenerization operation, and a test case of a specified database.
Based on the same concept, the embodiment of the application also provides an electronic device, as shown in fig. 6, where the electronic device mainly includes: processor 601, memory 602, and communication bus 603, wherein processor 601 and memory 602 accomplish communication with each other through communication bus 603. The memory 602 stores a program executable by the processor 601, and the processor 601 executes the program stored in the memory 602 to implement the following steps:
Running a test case instance of the database to be tested; in the running process, a target parameter is adopted to call a universal interface of a database to be tested; identifying an operation type interface corresponding to the target parameter through the universal interface, and calling the operation type interface to acquire test data and returning the test data; and testing the test data through the test case instance.
The communication bus 603 mentioned in the above-mentioned electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, or the like. The communication bus 603 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 6, but not only one bus or one type of bus.
The memory 602 may include random access memory (Random Access Memory, RAM) or may include non-volatile memory (nonvolatile memory), such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the aforementioned processor 601.
The processor 601 may be a general-purpose processor, including a central Processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), a digital signal processor (DIGITAL SIGNAL Processing, DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
In yet another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to perform the database interface testing method described in the above embodiment.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, by a wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, microwave, etc.) means from one website, computer, server, or data center to another. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape, etc.), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (8)
1. A database interface testing method, comprising:
Operating a test case instance of a database to be tested, wherein the test case instance is obtained from a general test case set;
In the running process, a target parameter is adopted to call a universal interface of the database to be tested;
identifying an operation type interface corresponding to the target parameter through the universal interface, and calling the operation type interface to acquire test data and returning the test data;
Testing the test data through the test case instance;
the target parameter is the type of the universal interface to be called, or the target parameter is the operation type corresponding to the operation type interface of the database to be tested, or the target parameter is an expression of the operation type interface described according to the format of the universal interface;
The universal interface at least comprises an adding interface, a deleting interface, a modifying interface and a query interface, and is applicable to different databases;
the method further comprises the steps of: according to the format of the universal interface, an operation type interface is encapsulated, which operation type interface=first universal interface+second universal interface.
2. The method of claim 1, wherein after the test data is tested by the test case instance, the method further comprises:
obtaining a test result;
And generating a test report according to the test result.
3. The database interface testing method of claim 1, wherein the operation type interface comprises querying and modifying a type interface;
And in the running process, calling the universal interface of the database to be tested by adopting the target parameters, wherein the method comprises the following steps:
in the running process, a target parameter is adopted to call a query interface and a modification interface of the database to be tested;
The identifying, through the universal interface, an operation type interface corresponding to the target parameter includes:
and identifying the query corresponding to the target parameter and modifying a type interface through the query interface and the modification interface.
4. The database interface testing method of claim 1, wherein the operation type interface comprises a query and delete type interface;
And in the running process, calling the universal interface of the database to be tested by adopting the target parameters, wherein the method comprises the following steps:
in the running process, a target parameter is adopted to call a query interface and a deletion interface of the database to be tested;
The identifying, through the universal interface, an operation type interface corresponding to the target parameter includes:
and identifying the query and deletion type interface corresponding to the target parameter through the query interface and the deletion interface.
5. The method of claim 1, wherein the generic test case set includes at least one of a test case for a database generic operation, a test case for a database schematization operation, and a test case for a specified database.
6. A database interface testing apparatus, comprising:
the operation module is used for operating the test case instance of the database to be tested, wherein the test case instance is obtained from the universal test case set;
the calling module is used for calling the universal interface of the database to be tested by adopting the target parameters in the running process;
The identification module is used for identifying an operation type interface corresponding to the target parameter through the universal interface, and calling the operation type interface to acquire test data and returning the test data;
the processing module is used for testing the test data through the test case instance;
the target parameter is the type of the universal interface to be called, or the target parameter is the operation type corresponding to the operation type interface of the database to be tested, or the target parameter is an expression of the operation type interface described according to the format of the universal interface;
The universal interface at least comprises an adding interface, a deleting interface, a modifying interface and a query interface, and is applicable to different databases;
The apparatus further comprises: according to the format of the universal interface, an operation type interface is encapsulated, which operation type interface=first universal interface+second universal interface.
7. An electronic device, comprising: the device comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus;
The memory is used for storing a computer program;
The processor is configured to execute a program stored in the memory, and implement the database interface testing method of any one of claims 1 to 5.
8. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the database interface testing method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111480491.0A CN114385483B (en) | 2021-12-06 | 2021-12-06 | Database interface testing method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111480491.0A CN114385483B (en) | 2021-12-06 | 2021-12-06 | Database interface testing method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114385483A CN114385483A (en) | 2022-04-22 |
CN114385483B true CN114385483B (en) | 2024-10-29 |
Family
ID=81195770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111480491.0A Active CN114385483B (en) | 2021-12-06 | 2021-12-06 | Database interface testing method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114385483B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115061926A (en) * | 2022-06-27 | 2022-09-16 | 平安壹钱包电子商务有限公司 | Method, device and equipment for testing different database types in system docking |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110058995A (en) * | 2019-03-05 | 2019-07-26 | 王长磊 | A kind of the data library test method and system of the interference of avoidable type of database |
CN113094281A (en) * | 2021-04-28 | 2021-07-09 | 杭州网易云音乐科技有限公司 | Hybrid App testing method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8386419B2 (en) * | 2011-05-12 | 2013-02-26 | Narendar Yalamanchilli | Data extraction and testing method and system |
CN113641590A (en) * | 2021-09-03 | 2021-11-12 | 中国银行股份有限公司 | Method and device for generating test case of PLSQL program and electronic equipment |
-
2021
- 2021-12-06 CN CN202111480491.0A patent/CN114385483B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110058995A (en) * | 2019-03-05 | 2019-07-26 | 王长磊 | A kind of the data library test method and system of the interference of avoidable type of database |
CN113094281A (en) * | 2021-04-28 | 2021-07-09 | 杭州网易云音乐科技有限公司 | Hybrid App testing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN114385483A (en) | 2022-04-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020233053A1 (en) | Method, apparatus, device, and storage medium for making test page script | |
CN111104392B (en) | Database migration method and device, electronic equipment and storage medium | |
CN108459962B (en) | Code normalization detection method and device, terminal equipment and storage medium | |
CN110309051B (en) | Method, system, equipment and storage medium for managing test cases | |
US10824541B1 (en) | System and method for test data fabrication | |
US11422917B2 (en) | Deriving software application dependency trees for white-box testing | |
CN114385483B (en) | Database interface testing method, device, equipment and storage medium | |
CN112882933A (en) | Script recording method, device, equipment and storage medium | |
CN114968817A (en) | Method, device, equipment and storage medium for evaluating code change influence range | |
CN109558145B (en) | Installation package volume optimization method and device for android application | |
CN103186463A (en) | Method and system for determining testing range of software | |
CN111046073A (en) | Test case query method and device and readable storage medium | |
CN117850866A (en) | Data verification test method and system | |
CN110968339B (en) | Method and device for front-end building tool and electronic equipment | |
CN114328060B (en) | Reusable test case framework, construction method and electronic equipment | |
CN115757172A (en) | Test execution method and device, storage medium and computer equipment | |
CN112965905B (en) | Data testing method, device, equipment and storage medium | |
CN113672509A (en) | Automatic testing method, device, testing platform and storage medium | |
CN109446091B (en) | Business entity object testing method and device | |
CN113098961A (en) | Component uploading method, device and system, computer equipment and readable storage medium | |
CN112363944A (en) | Method and equipment for comparing return values of multiple environment interfaces | |
CN112559331A (en) | Test method and device | |
CN115758976B (en) | Method for comparing device differences in PDK, electronic equipment and computer readable medium | |
CN111782629A (en) | Feature processing script generation method and device | |
CN115129355B (en) | Page repair method, system and computer equipment thereof |
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 |