Integrated testing method, system, electronic device and readable storage medium

By generating multiple records and record management objects with preset index structures, the problem of lack of dependency management among products in integration testing is solved, and efficient testing environment construction and verification is achieved, and the writing efficiency and accuracy of integration testing is improved.

CN114840413BActive Publication Date: 2025-03-11ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210306572.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2025-03-11
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

When the existing integrated testing method operates in a simulated database environment, it lacks the management of dependencies between products, resulting in the environment lacking necessary data, causing errors, affecting the effectiveness of test cases. At the same time, the code volume is large, unable to be reused, and the writing efficiency is low.

Method used

By generating multiple records with a preset index structure, creating a record management object to manage these records, and interacting with the database, the records are stored as preset format data. Use the record management object to verify the records and database data to determine whether the data meets the expected results.

Benefits of technology

Through this method, the dependencies between program products can be effectively maintained, the operation is simple and efficient, avoid direct face of the database, ensure the correctness of the test environment, and improve the writing efficiency and verification effectiveness of integration tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840413B_ABST
    Figure CN114840413B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose an integrated testing method, system, electronic device and readable storage medium. The integrated testing method includes: generating multiple records with a preset index structure, wherein a record constitutes a node of the index structure, the record stores its own attribute information, and has the ability to add child nodes and modify its own attribute information; generating a record management object for the multiple records, which is used to manage the records and interact with the database based on the managed records to store the records in the database as data in a preset format, wherein each record management object manages a class of records; using the record management object to verify the multiple records with the preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result, which can ensure the correctness of the operating environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to an integrated testing method, system, electronic device, and readable storage medium. Background Art

[0002] Integration testing can improve code coverage and ensure stability. However, the existing integration testing method is to directly insert the required data into the corresponding table through the database-related interface. In this case, multiple products need to insert data into multiple tables, and the writer needs to care about and clarify the relationship between products. In such a simulated test environment, directly operating the database does not involve the dependency between products. Once the writer is negligent, it may cause the environment prepared for the integration test to lack certain necessary data, causing errors and affecting the effectiveness of the test case. Moreover, there is a lack of convenient and effective verification method for the data persisted to the database during the test run. At the same time, the amount of code for preparing the environment is large, it cannot be reused, and the writing efficiency is very low. Summary of the invention

[0003] In order to solve the problems in the related art, the embodiments of the present disclosure provide an integrated testing method, system, electronic device and readable storage medium.

[0004] In a first aspect, an integrated testing method is provided in an embodiment of the present disclosure, including:

[0005] Generate multiple records with a preset index structure, wherein one record constitutes a node of the index structure, the record stores its own attribute information, and has the ability to add child nodes and modify its own attribute information;

[0006] Generate a record management object for the plurality of records, for managing the records and interacting with a database based on the managed records, so as to store the records in the database as data in a preset format, wherein each record management object manages a type of record;

[0007] The record management object is used to verify the plurality of records having the preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result.

[0008] In combination with the first aspect, the present disclosure, in a first implementation of the first aspect, further includes:

[0009] In response to calling a preset test interface, an external system is called, and the plurality of records with a preset index structure are queried to verify with the call parameters when calling the external system to determine whether the call parameters when calling the external system meet the second expected result.

[0010] In combination with the first aspect or the first implementation of the first aspect, the second implementation of the first aspect of the present disclosure further includes:

[0011] receiving a modification of the plurality of records having the preset index structure;

[0012] Call the preset test interface;

[0013] In response to calling a preset test interface, querying the modified multiple records with a preset index structure to determine whether the data stored in the database meets the third expected result,

[0014] and / or,

[0015] In response to calling a preset test interface, an external system is called, and the modified multiple records with a preset index structure are queried to verify with the call parameters when calling the external system to determine whether the call parameters when calling the external system meet the fourth expected result.

[0016] In combination with the first aspect or the first implementation method of the first aspect, in the third implementation method of the first aspect of the present disclosure, the preset index structure is a tree index structure, wherein each record stores the attribute information of its parent node, the attribute information of its child node, and its own attribute information.

[0017] In combination with the first aspect or the first implementation method of the first aspect, in the fourth implementation method of the first aspect of the present disclosure, the multiple records with a preset index structure have a mapping relationship with the fields of the data stored in the database, and / or the multiple records with a preset index structure have a mapping relationship with the call parameters when calling the external system.

[0018] In combination with the first aspect or the first implementation of the first aspect, in a fifth implementation of the first aspect of the present disclosure, generating a plurality of records having a preset index structure includes:

[0019] Based on a preset database simulation environment scenario and / or a preset external system simulation scenario, a plurality of records with a preset index structure are generated.

[0020] In combination with the second implementation manner of the first aspect, in a sixth implementation manner of the first aspect of the present disclosure, the multiple records with a preset index structure are provided with the first expected result, the second expected result, the third expected result, and the fourth expected result.

[0021] In combination with the first aspect, the present disclosure further includes, in a seventh implementation manner of the first aspect:

[0022] Multiple databases are saved, and different databases store records in index structures at different stages as data in a preset format.

[0023] In a second aspect, an electronic device is provided in an embodiment of the present disclosure, including a memory and a processor; wherein the processor is used to generate multiple records with a preset index structure, and the memory stores multiple records with a preset index structure, wherein one record constitutes a node of the index structure, and the record stores its own attribute information and has the ability to add child nodes and modify its own attribute information.

[0024] The processor is used to generate a record management object for the multiple records, and the memory stores the record management object, wherein the record management object is used to manage records and interact with a database based on the managed records to store the records in the database as data in a preset format, wherein each record management object manages a type of record, and the record management object verifies the multiple records with a preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result.

[0025] In combination with the second aspect, in a first implementation method of the second aspect of the present disclosure, the processor is used to call an external system in response to calling a preset test interface, and query the multiple records with a preset index structure to verify the calling parameters when calling the external system to determine whether the calling parameters when calling the external system meet the second expected result.

[0026] In combination with the second aspect or the first implementation of the second aspect, the present disclosure, in a second implementation of the second aspect, further includes using the processor to perform the following operations:

[0027] receiving a modification of the plurality of records having the preset index structure;

[0028] Call the preset test interface;

[0029] In response to calling a preset test interface, querying the modified multiple records with a preset index structure to determine whether the data stored in the database meets the third expected result,

[0030] and / or,

[0031] In response to calling a preset test interface, an external system is called, and the modified multiple records with a preset index structure are queried to verify with the call parameters when calling the external system to determine whether the call parameters when calling the external system meet the fourth expected result.

[0032] In a third aspect, a computer-readable storage medium is provided in an embodiment of the present disclosure, on which computer instructions are stored. When the computer instructions are executed by a processor, the method steps described in any one of the first aspect and the first to seventh implementations of the first aspect are implemented.

[0033] In a fifth aspect, a computer program product is provided in an embodiment of the present disclosure, which includes computer instructions, and when the computer instructions are executed by a processor, the method steps described in any one of the first aspect and the first to seventh implementations of the first aspect are implemented.

[0034] According to the technical solution provided by the embodiment of the present disclosure, by providing an integrated testing method, the method includes: generating multiple records with a preset index structure, wherein a record constitutes a node of the index structure, the record stores its own attribute information, and has the ability to add child nodes and modify its own attribute information; generating a record management object for the multiple records, which is used to manage the records and interact with the database based on the managed records, so as to store the records in the database as data in a preset format, wherein each record management object manages a type of record; using the record management object to verify the multiple records with the preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result, the dependency relationship between program products can be maintained by means of records with a preset index structure, and both addition and deletion are performed by operating the records, without directly facing the database, thereby ensuring the correctness of the operating environment. Such an operation itself does not need to pay extra attention to the data itself, the code is concise, and the efficiency is high. Moreover, the correspondence between the record and the database data can be maintained. As long as the correct expected result is set in the record, the correctness of the data in the database will be automatically verified when the interface is called. Therefore, the integrated test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integrated test writing and verifies the effectiveness of the test itself.

[0035] According to the technical solution provided by the embodiment of the present disclosure, by calling the preset test interface in response, calling the external system, querying the multiple records with the preset index structure to verify with the call parameters when calling the external system, to determine whether the call parameters when calling the external system meet the second expected result, the corresponding relationship between the record and the external system call parameters can be maintained by means of the record with the preset index structure. As long as the correct expected result is set in the record, the correctness of the call parameters will be automatically verified when the external system is called. This makes the integration test qualitatively improved in terms of convenience and accuracy.

[0036] According to the technical solution provided by the embodiment of the present disclosure, by receiving the modification of the multiple records with the preset index structure; calling the preset test interface; in response to calling the preset test interface, querying the multiple modified records with the preset index structure to determine whether the data stored in the database meets the third expected result, and / or, in response to calling the preset test interface, calling the external system, querying the multiple modified records with the preset index structure to verify with the call parameters when calling the external system, to determine whether the call parameters when calling the external system meet the fourth expected result, the correspondence between the record and the database data and the correspondence between the record and the external system call parameters can be maintained. As long as the correct expected result is set in the record, the correctness of the data in the database and the external system call parameters will be automatically verified when the interface is called. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0037] According to the technical solution provided by the embodiment of the present disclosure, the preset index structure is a tree index structure, wherein each record stores the attribute information of its parent node, the attribute information of its child node and its own attribute information. The dependency relationship between program products can be maintained by means of records with a preset index structure, and addition and deletion are performed by operating the records, without directly facing the database, thereby ensuring the correctness of the operating environment.

[0038] According to the technical solution provided by the embodiment of the present disclosure, the mapping relationship between the multiple records with the preset index structure and the fields of the data stored in the database, and / or the mapping relationship between the multiple records with the preset index structure and the call parameters when calling the external system can be maintained. The mapping relationship between the record and the database data and the mapping relationship between the record and the external system call parameters can be automatically verified when the interface is called as long as the correct expected result is set in the record. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0039] According to the technical solution provided by the embodiment of the present disclosure, by generating multiple records with a preset index structure, including: based on a preset database simulation environment scenario and / or a preset external system simulation scenario, generating multiple records with a preset index structure, it is easy to build records of different environment scenarios, simplifying the test environment construction. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing.

[0040] According to the technical solution provided by the embodiment of the present disclosure, the mapping relationship between the record and the database data and the mapping relationship between the record and the external system call parameters can be maintained by setting the first expected result, the second expected result, the third expected result, and the fourth expected result in the plurality of records with the preset index structure. As long as the correct expected result is set in the record, the correctness of the data in the database and the external system call parameters will be automatically verified when the interface is called. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0041] According to the technical solution provided by the embodiment of the present disclosure, by saving multiple databases, different databases store records in index structures at different stages as data in a preset format, and the correspondence between records in multiple versions of index structures and database data can be maintained, so that updates to the index structure and its records can be correspondingly saved in multiple different databases, which is convenient for maintaining records in index structures at different stages.

[0042] According to the technical solution provided by the embodiment of the present disclosure, a memory and a processor are used; wherein the processor is used to generate multiple records with a preset index structure, and the memory stores multiple records with a preset index structure, wherein a record constitutes a node of the index structure, and the record stores its own attribute information, and has the ability to add child nodes and the ability to modify its own attribute information, wherein the processor is used to generate a record management object for the multiple records, and the memory stores the record management object, wherein the record management object is used to manage records and interact with a database based on the managed records to store the records in the database as data in a preset format, wherein each record management object manages a class of records, and the record management object verifies the multiple records with the preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result, and the dependency relationship between program products can be maintained by means of records with a preset index structure, and addition and deletion are performed by operating on the records, without directly facing the database, thereby ensuring the correctness of the operating environment. Such an operation does not require additional attention to the data itself, the code is concise and efficient, and the correspondence between the record and the database data can be maintained. As long as the correct expected result is set in the record, the correctness of the data in the database will be automatically verified when the interface is called. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0043] According to the technical solution provided by the embodiment of the present disclosure, by using the processor to call the external system in response to calling the preset test interface, querying the multiple records with the preset index structure to verify with the call parameters when calling the external system, so as to determine whether the call parameters when calling the external system meet the second expected result, the corresponding relationship between the record and the external system call parameters can be maintained by means of the record with the preset index structure. As long as the correct expected result is set in the record, the correctness of the call parameters will be automatically verified when the external system is called. This makes the integration test qualitatively improved in terms of convenience and accuracy.

[0044] According to the technical solution provided by the embodiment of the present disclosure, by also including using the processor to perform the following operations: receiving modifications to the multiple records with a preset index structure; calling a preset test interface; in response to calling the preset test interface, querying the multiple modified records with a preset index structure to determine whether the data stored in the database meets the third expected result, and / or, in response to calling the preset test interface, calling an external system, querying the multiple modified records with a preset index structure to verify with the call parameters when calling the external system, to determine whether the call parameters when calling the external system meet the fourth expected result, the correspondence between the record and the database data and the correspondence between the record and the external system call parameters can be maintained. As long as the correct expected result is set in the record, the correctness of the data in the database and the external system call parameters will be automatically verified when the interface is called. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0045] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0047] Figure 1 A flow chart showing an integrated testing method according to an embodiment of the present disclosure;

[0048] Figure 2 An exemplary schematic diagram showing an integrated test implementation framework according to an embodiment of the present disclosure;

[0049] Figure 3 A structural block diagram of an integrated test system according to an embodiment of the present disclosure is shown;

[0050] Figure 4 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0051] Figure 5 A schematic diagram showing the structure of a computer device suitable for implementing the method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0052] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0053] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.

[0054] In the present disclosure, the acquisition of user information or user data is an operation authorized and confirmed by the user, or actively selected by the user.

[0055] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0056] As mentioned above, the existing integration test method is to directly insert the required data into the corresponding table through the database-related interface. In this case, multiple products need to insert data into multiple tables, and the writer needs to care about and clarify the relationship between products. In such a simulated test environment, directly operating the database does not involve the dependency between products. Once the writer is negligent, it may cause the environment prepared for the integration test to lack certain necessary data, causing errors and affecting the effectiveness of the test case. Moreover, there is a lack of convenient and effective verification method for the data persisted to the database during the test run. At the same time, the amount of code for preparing the environment is large, it cannot be reused, and the writing efficiency is very low.

[0057] In order to solve the above problems, the present disclosure proposes an integrated testing method, system, electronic device and readable storage medium.

[0058] According to the technical solution provided by the embodiment of the present disclosure, by providing an integrated testing method, the method includes: generating multiple records with a preset index structure, wherein a record constitutes a node of the index structure, the record stores its own attribute information, and has the ability to add child nodes and modify its own attribute information; generating a record management object for the multiple records, which is used to manage the records and interact with the database based on the managed records, so as to store the records in the database as data in a preset format, wherein each record management object manages a type of record; using the record management object to verify the multiple records with the preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result, the dependency relationship between program products can be maintained by means of records with a preset index structure, and both addition and deletion are performed by operating the records, without directly facing the database, thereby ensuring the correctness of the operating environment. Such an operation itself does not need to pay extra attention to the data itself, the code is concise, and the efficiency is high. Moreover, the correspondence between the record and the database data can be maintained. As long as the correct expected result is set in the record, the correctness of the data in the database will be automatically verified when the interface is called. Therefore, the integrated test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integrated test writing and verifies the effectiveness of the test itself.

[0059] The following reference Figure 1 An integrated testing method according to an embodiment of the present disclosure is described.

[0060] Figure 1 A flowchart of an integrated testing method according to an embodiment of the present disclosure is shown.

[0061] like Figure 1 As shown, the integrated testing method includes steps S101, S102, and S103.

[0062] In step S101, a plurality of records having a preset index structure are generated, wherein one record constitutes a node of the index structure, the record stores its own attribute information, and has the ability to add child nodes and modify its own attribute information.

[0063] In step S102, a record management object is generated for the plurality of records, for managing the records and interacting with a database based on the managed records, so as to store the records in the database as data in a preset format, wherein each record management object manages a type of records.

[0064] In step S103, the plurality of records having the preset index structure are verified with the data stored in the database using the record management object to determine whether the data stored in the database meets the first expected result.

[0065] In one embodiment of the present disclosure, in order to solve the problems faced when constructing an integrated testing environment using a simulated database environment in the related art, the embodiment of the present disclosure abstracts a piece of data in a data table into a record to form a record structure. In an embodiment of the present disclosure, multiple records with a preset index structure are stored in the memory, that is, multiple records with a preset index structure are generated in the memory. In one embodiment of the present disclosure, the record can adopt a hyperemic model, that is, the data and the corresponding business logic are encapsulated into the same class (domain model). The hyperemic model meets the encapsulation characteristics of object-oriented and is a typical object-oriented programming style. The use of the hyperemic model can improve the reusability, extensibility, maintainability, and readability of the code.

[0066] In one embodiment of the present disclosure, a record constitutes a node of the index structure, and each record stores its own attribute information and has the ability to add child nodes and modify its own attribute information. The attribute information of the record depends on the type of record, and the present disclosure does not limit this. In one embodiment of the present disclosure, allowing a node (a record) to add a child node (a record that references a parent node) can make the index relationship between multiple records clear and clear, prevent product relationship errors when writing an integrated test environment, and then prevent errors in the simulated test environment, without affecting the validity of the test case. In one embodiment of the present disclosure, allowing a node (a record) to modify its own attribute information allows the record to adapt to the requirements of the test environment. For example, some program products rely on other related program products when writing local integration tests. During the integration test, changes in a related program product may cause changes in other program products with which it has an index relationship. In this case, the program product as a record has the ability to modify its own attribute information and can adapt to the test environment.

[0067] In one embodiment of the present disclosure, the preset index structure may have various structures. For example, the preset index structure is a tree index structure, in which each record stores the attribute information of its parent node, the attribute information of its child node, and its own attribute information.

[0068] In one embodiment of the present disclosure, each node in the tree index structure has a parent-child relationship, a parent node (parent resource) can add a child node (resource), and the child node saves the parent node index. In one embodiment of the present disclosure, the tree index structure can have a root node (root record), that is, a root record, which can be used to index all data. In one embodiment of the present disclosure, the specific definition of the tree index structure can be obtained from the relevant technology, and the present disclosure will not elaborate on this.

[0069] According to the technical solution provided by the embodiment of the present disclosure, the preset index structure is a tree index structure, wherein each record stores the attribute information of its parent node, the attribute information of its child node and its own attribute information. The dependency relationship between program products can be maintained by means of records with a preset index structure, and addition and deletion are performed by operating the records, without directly facing the database, thereby ensuring the correctness of the operating environment.

[0070] In one embodiment of the present disclosure, each type of record can be abstracted into a record management object (or record manager) structure to manage all data in the record of this type, that is, all records of this type. According to multiple records with a preset index structure generated in the memory, multiple record management objects can be generated, and each record management object can manage a type of record. A root record management object can be defined to be responsible for the interaction between all individual record management objects and the database, including adding, updating, and deleting a piece of data in the database, and can also be used to verify whether the table data in the database is correct. In one embodiment of the present disclosure, the root record management object can be an abstract concept, which can be an abstraction of the function of all record management objects to perform interaction with the database. Specifically, each record management object can be considered to interact directly with the database, but it can also be considered to interact with the database through the root record management object. The root record management object can establish a record global index based on the root node (root record), and can perform related operations based on the record global index when interacting with the database.

[0071] In one embodiment of the present disclosure, the record management object can store records in a database as data in a preset format, for example, a class of records is stored as data in a table. In one embodiment of the present disclosure, the record management object can store records in a database as corresponding use cases, for example, use cases corresponding to a class of records. In the related art, the traditional way to simulate database construction is to directly insert the required data into the corresponding table through the database-related interface. Multiple products need to insert data into multiple tables. The writer needs to care about and sort out the relationship between products, and the simulated test environment is wrong, which affects the effectiveness of the test case; at the same time, the amount of code for preparing the environment is large, it cannot be reused, and the writing efficiency is very low. In one embodiment of the present disclosure, the above integrated test method can be applied to the integrated test writing process, and the database environment can be simulated through the above steps. By adding multiple records with a preset index structure in the memory, the index structure of the program product (for example, a dependency tree) can be constructed. After the construction is completed, the data is saved in the database through the data persistence interface between the record management object and the database, and the database environment simulation is completed. Since there is a mutual dependence between the records, the correctness of the test environment is guaranteed. Such an operation itself does not need to pay extra attention to the data itself, and the code is concise and efficient.

[0072] In one embodiment of the present disclosure, a plurality of records having a preset index structure are generated in a memory and a record management object is generated, and the database is persistently stored in a storage device such as an SSD. In one embodiment of the present disclosure, the plurality of records having a preset index structure are verified with the data stored in the database using the record management object, so as to determine whether the data stored in the database meets the first expected result, that is, whether the data stored in the database is completely consistent with the plurality of records having a preset index structure. In one embodiment of the present disclosure, the data recorded in the database and the plurality of records having a preset index structure can be verified based on the global index of the record through the root record management object to determine whether the database data meets expectations. In one embodiment of the present disclosure, the plurality of records having a preset index structure have a mapping relationship with the fields of the data stored in the database. In one embodiment of the present disclosure, a mapping relationship is maintained between the fields in the database and the fields in the record through the record management object.

[0073] In one embodiment of the present disclosure, the integrated testing method further includes:

[0074] Multiple databases are saved, and different databases store records in index structures at different stages as data in a preset format.

[0075] In one embodiment of the present disclosure, the dependency relationship between program products can be maintained by means of records with a preset index structure, and addition and deletion are performed by operating on the records, without directly facing the database. In this case, if the records with a preset index structure are constantly updated according to the test needs, and the index structure and its records are adjusted, then it may be necessary to have a correspondence between different versions of records with a preset index structure and different databases. That is, a version of a record with a preset index structure can be stored in a database as data in a preset format. Once an accident occurs and the record with a preset index structure in the memory is lost or damaged, the record with the preset index structure can also be restored using the data persisted to the corresponding database.

[0076] According to the technical solution provided by the embodiment of the present disclosure, by saving multiple databases, different databases store records in index structures at different stages as data in a preset format, and the correspondence between records in multiple versions of index structures and database data can be maintained, so that updates to the index structure and its records can be correspondingly saved in multiple different databases, which is convenient for maintaining records in index structures at different stages.

[0077] In one embodiment of the present disclosure, the integrated testing method further includes:

[0078] In response to calling a preset test interface, an external system is called, and the plurality of records with a preset index structure are queried to verify with the call parameters when calling the external system to determine whether the call parameters when calling the external system meet the second expected result.

[0079] In one embodiment of the present disclosure, the environment of the integration test includes not only a simulated database environment, but also a simulated calling external system environment. The calling parameters of the external system called during the integration test and the second expected result of the calling parameters when calling the external system can be recorded in the record. The calling parameters of the external system can include the calling parameters constructed during the integration test.

[0080] In an example, one of the multiple records may be a record of user A. During the integration test, it is necessary to call external system B to query the value of parameter C of user A. The expected value C1 of parameter C may be used as an attribute of user A or as another record. When calling external system B, the call value C2 of parameter C of user A is queried. If the call value C2 is consistent with the expected value C1, it can be determined that the integration test result meets expectations. If the call value C2 is inconsistent with the expected value C1, it can be determined that the integration test result does not meet expectations.

[0081] According to the technical solution provided by the embodiment of the present disclosure, by calling the preset test interface in response, calling the external system, querying the multiple records with the preset index structure to verify with the call parameters when calling the external system, to determine whether the call parameters when calling the external system meet the second expected result, the corresponding relationship between the record and the external system call parameters can be maintained by means of the record with the preset index structure. As long as the correct expected result is set in the record, the correctness of the call parameters will be automatically verified when the external system is called. This makes the integration test qualitatively improved in terms of convenience and accuracy.

[0082] In one embodiment of the present disclosure, an integrated test framework for implementing the integrated test method can be constructed through the above steps of the integrated test method, and the integrated test framework includes multiple records with a preset index structure, a record management object generated for the multiple records, and a database storing a mapping relationship with the multiple records with the preset index structure, and may also include an external call system. The test flow in the integrated test method is further described below.

[0083] In one embodiment of the present disclosure, the integrated testing method further includes:

[0084] receiving a modification of the plurality of records having the preset index structure;

[0085] Call the preset test interface;

[0086] In response to calling a preset test interface, querying the modified multiple records with a preset index structure to determine whether the data stored in the database meets the third expected result,

[0087] and / or,

[0088] In response to calling a preset test interface, an external system is called, and the modified multiple records with a preset index structure are queried to verify with the call parameters when calling the external system to determine whether the call parameters when calling the external system meet the fourth expected result.

[0089] In one embodiment of the present disclosure, calling a test interface may refer to calling an internal interface of a program product to be tested, or may refer to calling an external system. In one embodiment of the present disclosure, after completing the simulation of the database environment, the impact of calling the test interface may be anticipated by modifying the records in the memory. In one embodiment of the present disclosure, "modification of the multiple records with a preset index structure" does not only refer to modifying existing records, but may also refer to adding or deleting a record in the multiple records of the preset index structure. Therefore, in one embodiment of the present disclosure, the impact of calling a test interface may be anticipated by adding / deleting a record, or modifying an existing record. In one embodiment of the present disclosure, in an integrated testing process, in response to calling a test interface, an external system may be called, and the multiple modified records in the memory may be automatically queried to determine whether the calling parameters of the external system are correct, that is, whether they meet expectations.

[0090] According to the technical solution provided by the embodiment of the present disclosure, by receiving the modification of the multiple records with the preset index structure; calling the preset test interface; in response to calling the preset test interface, querying the multiple modified records with the preset index structure to determine whether the data stored in the database meets the third expected result, and / or, in response to calling the preset test interface, calling the external system, querying the multiple modified records with the preset index structure to verify with the call parameters when calling the external system, to determine whether the call parameters when calling the external system meet the fourth expected result, the correspondence between the record and the database data and the correspondence between the record and the external system call parameters can be maintained. As long as the correct expected result is set in the record, the correctness of the data in the database and the external system call parameters will be automatically verified when the interface is called. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0091] In one embodiment of the present disclosure, multiple records with a preset index structure have a mapping relationship with fields of data stored in a database, and / or multiple records with a preset index structure have a mapping relationship with call parameters when calling an external system.

[0092] In one embodiment of the present disclosure, in the built integrated test framework, a preset index structure, for example, multiple records of a tree index structure maintain the relationship between the program products to be tested (for example, a dependency tree), and addition and deletion are performed by operating the nodes (records) of the program products, without directly facing the database. The fields in the database and the fields in the records maintain a mapping relationship, ensuring the correctness of the added environment. Moreover, by querying the data of the records in the index structure, a full comparison is made with the call parameters when the external system is called to determine whether the call parameters meet expectations. Here, the fields in the call parameters maintain a mapping relationship with the fields in the records in the index structure in the memory. This solution maintains the mapping of the records in the index structure in the memory with the database fields and the external system call parameters. As long as the correct expected results are set in the records in the index structure in the memory, the correctness of the call parameters of the external system and the data in the database will be automatically verified when the interface is called. This makes the integration test qualitatively improved in terms of convenience and accuracy.

[0093] According to the technical solution provided by the embodiment of the present disclosure, the mapping relationship between the multiple records with the preset index structure and the fields of the data stored in the database, and / or the mapping relationship between the multiple records with the preset index structure and the call parameters when calling the external system can be maintained. The mapping relationship between the record and the database data and the mapping relationship between the record and the external system call parameters can be automatically verified when the interface is called as long as the correct expected result is set in the record. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0094] In one embodiment of the present disclosure, step S101 includes: generating a plurality of records having a preset index structure based on a preset database simulation environment scenario and / or a preset external system simulation scenario.

[0095] In one embodiment of the present disclosure, in an integrated test environment, there are some common scenarios in some cases, one part of which is for the inside of the test environment, that is, the database simulation environment scenario, and the other part of which is for the external system. Since the amount of code for preparing the integrated test environment in the traditional way in the related art is large and cannot be repeated, the writing efficiency is very low, that is, these common scenarios cannot be repeated in the integrated test environment. In one embodiment of the present disclosure, multiple records with a preset index structure can be generated based on the preset database simulation environment scenario and / or the preset external system simulation scenario. Such an operation itself does not require additional care about the data itself, and the code is concise and efficient. It should be noted that in the integrated test environment, the preset database simulation environment scenario and the preset external system simulation scenario are considered as needed, that is, one or both of the preset database simulation environment scenario and the preset external system simulation scenario are written into the integrated test environment.

[0096] According to the technical solution provided by the embodiment of the present disclosure, by generating multiple records with a preset index structure, including: based on a preset database simulation environment scenario and / or a preset external system simulation scenario, generating multiple records with a preset index structure, it is easy to build records of different environment scenarios, simplifying the test environment construction. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing.

[0097] In one embodiment of the present disclosure, the plurality of records with a preset index structure are provided with a first expected result, a second expected result, a third expected result, and a fourth expected result.

[0098] In one embodiment of the present disclosure, the first expected result refers to determining whether the database data meets expectations when multiple records of a preset index structure are not modified when building an integrated testing framework; the second expected result refers to determining whether the calling parameters when calling an external system meet expectations when multiple records of a preset index structure are not modified when building an integrated testing framework; the third expected result refers to determining whether the database data meets expectations when multiple records of a preset index structure are modified during the integrated testing process; the fourth expected result refers to whether the calling parameters when calling an external system meet expectations when multiple records of a preset index structure are modified during the integrated testing process.

[0099] According to the technical solution provided by the embodiment of the present disclosure, the mapping relationship between the record and the database data and the mapping relationship between the record and the external system call parameters can be maintained by setting the first expected result, the second expected result, the third expected result, and the fourth expected result in the plurality of records with the preset index structure. As long as the correct expected result is set in the record, the correctness of the data in the database and the external system call parameters will be automatically verified when the interface is called. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0100] The following reference Figure 2 The application scenario shown further describes the integrated testing framework established in the integrated testing method according to the embodiment of the present disclosure. Figure 2 An exemplary schematic diagram of an integrated test implementation framework according to an embodiment of the present disclosure is shown.

[0101] exist Figure 2 In the scenario shown, multiple records with a tree index structure 220 can be generated in the memory. The multiple records of the tree index structure 220 may include a root record RootRecord, a Vpc record VpcRecored, a Vbr record VbrRecord, a VRouter record VRouterRecord, a Vswtich record VswtichRecord, a RouteTable record RouteTableRecord, an Ipv6 record Ipv6Record, a RouteEntry record RouteEntryRecord, etc., and the dependency relationship between the records is also shown. For example, the parent node of the Vpc record VpcRecored is the root record RootRecord, and the child nodes are the Vbr record VbrRecord, the VRouter record VRouterRecord, and the Vswtich record VswtichRecord. In addition to the root record RootRecord of the overall index structure including the tree index, the remaining records may be resources of the program product to be tested. Each record constitutes a node of the tree index structure 220. Each record stores its own attribute information and has the ability to add child nodes and modify its own attribute information. Moreover, each record can store the attribute information of its parent node, the attribute information of its child nodes, and its own attribute information.

[0102] exist Figure 2In the scenario shown, a record management structure 230 can be generated in memory based on multiple records for the tree index structure 220. In other words, a record management structure is abstracted for each type of record, or it is called a record management object. For example, the record management object may include a Vpc record management object VpcRecord management object for managing Vpc records, a VswtichRecord management object for managing Vswtich records, an Ipv6Record management object for managing Ipv6 records, and the like. Each record management object manages records and interacts with a database based on the managed records to store the records in the database as data in a preset format, wherein each record management object manages a type of record, that is, all data in a type of record. A root record management object RootRecord management object can be defined to be responsible for the interaction between all individual record management objects and the database 240, including adding, updating, and deleting a piece of data in the database 240, and can also be used to verify whether the table data in the database 240 is correct. In one embodiment of the present disclosure, the root record management object RootRecord management object can be an abstract concept, which can be an abstraction of the functions of all record management objects for performing interactions with the database. Specifically, each record management object can be considered to interact directly with the database, but can also be considered to interact with the database through the root record management object. The root record management object can establish a global index of records based on the root record RootRecord, and can perform related operations based on the global index of records when interacting with the database. For example, each record management object can add, delete, modify, and query the test records stored in the database 240, that is, add data, delete data, modify data, query data, etc. For example, each record management object can also perform expected consistency verification with the database.

[0103] In one embodiment of the present disclosure, the record management object can store records in the database 240 as data in a preset format, for example, storing a type of record as data in a table. In one embodiment of the present disclosure, the record management object can store records in the database 240 as corresponding use cases, for example, use cases corresponding to a type of record, Vpc use cases, Vpc swtich use cases, Ipv6 use cases, etc. In one embodiment of the present disclosure, the above integrated test method can be applied to the integrated test writing process, and can be referenced by Figure 1The described steps simulate the database environment. By adding multiple records with a preset index structure 220 in the memory, a tree index structure of the program product can be constructed. After the construction is completed, the data is saved to the database 240 through the data persistence interface between the record management object and the database 240, such as the root record management object RootRecord management object. At this time, the database environment simulation is completed. Since there is a mutual dependence between the records, the correctness of the test environment is guaranteed. Such an operation itself does not need to pay extra attention to the data itself, and the code is concise and efficient.

[0104] In one embodiment of the present disclosure, a plurality of records having a preset index structure 220 are generated in a memory and a record management object is generated, and a database 240 is persistently stored in a storage device such as an SSD. In one embodiment of the present disclosure, by using a record management object to verify a plurality of records having a preset index structure with the data stored in the database, it can be determined whether the data stored in the database 240 meets expectations, that is, whether the data stored in the database is completely consistent with the plurality of records having a preset index structure. In one embodiment of the present disclosure, the data recorded in the database 240 and the plurality of records having a preset index structure can be verified based on a global index of the record through the root record management object RootRecord management object to determine whether the database data meets expectations. In one embodiment of the present disclosure, the plurality of records having a preset index structure 220 have a mapping relationship with the fields of the data stored in the database 240. In one embodiment of the present disclosure, through the record management object, a mapping relationship is maintained between the fields in the database and the fields in the record.

[0105] exist Figure 2 In the scenario shown, user 210 sets the database environment MOCK management scenario according to the database dependency, and sets the external system MOCK management scenario according to the situation of the external system. In the related art, MOCK is simply understood as a virtual object created for testing during the testing process for some objects that are not easy to construct or obtain. This virtual object is the MOCK object, which is a substitute for the real object during debugging. Database environment MOCK refers to database environment simulation, and external system MOCK refers to external system simulation. Figure 2 As shown, the database environment MOCK management scenario can be used to provide a preset database simulation environment scenario, and the external system MOCK management scenario can be used to provide a preset external system simulation scenario, and then generate multiple records with a preset index structure on this basis.

[0106] exist Figure 2In the scenario shown, after completing the aforementioned operation of simulating the database environment, the impact of calling the test interface can be anticipated by further modifying the records in the memory, such as adding / deleting a record, or modifying an existing record. Next, the call parameters can be constructed to call the test interface. In response to calling the test interface, when calling the external system MOCK, the call external system parameter verification is performed, and the records in the memory are automatically queried (i.e., Figure 2 The query related data shown in the figure) determines whether the call parameters of the external system call are correct. Moreover, after the test interface call is completed, the records in the memory are automatically queried to determine whether all the data in the database 240 meet expectations.

[0107] pass Figure 2 The integrated test framework shown simulates the test environment correctly and efficiently. This solution maintains the dependency tree between program products by generating records. Addition, deletion, and modification are all performed by operating product nodes with a preset index structure. There is no need to directly face the database, which ensures the correctness of the added environment. Such operations do not require additional attention to the data itself, and the code is concise and efficient. Moreover, the call parameters and database data of external system calls can be automatically verified. This solution maintains the mapping between in-memory records and database fields and external system parameters. As long as the correct expected results are set in the in-memory records, the correctness of the parameters and the data in the database will be automatically verified when the interface is called, which greatly improves both convenience and accuracy.

[0108] The following reference Figure 3 An integrated testing system according to an embodiment of the present disclosure is described.

[0109] Figure 3 The structural block diagram of the integrated test system according to the embodiment of the present disclosure is shown. The system can be implemented by software, hardware or a combination of both.

[0110] like Figure 3 As shown, the integrated test system 300 includes:

[0111] The record generation module 301 is configured to generate a plurality of records having a preset index structure, wherein a record constitutes a node of the index structure, the record stores its own attribute information, and has the ability to add child nodes and modify its own attribute information;

[0112] A record management module 302, configured to generate a record management object for the plurality of records, for managing the records and interacting with a database based on the managed records, so as to store the records in the database as data in a preset format, wherein each record management object manages a type of record;

[0113] The database verification module 303 is configured to use the record management object to verify the multiple records with the preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result.

[0114] According to the technical solution provided by the embodiment of the present disclosure, an integrated test system includes: a record generation module, which is configured to generate multiple records with a preset index structure, wherein a record constitutes a node of the index structure, the record saves its own attribute information, and has the ability to add child nodes and modify its own attribute information; a record management module, which is configured to generate a record management object for the multiple records, which is used to manage records and interact with a database based on the managed records to store the records in the database as data in a preset format, wherein each record management object manages a class of records; a database verification module, which is configured to use the record management object to verify the multiple records with the preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result, and can maintain the dependency relationship between program products by means of records with a preset index structure, and both addition and deletion are performed by operating the records, without directly facing the database, thereby ensuring the correctness of the operating environment. Such an operation itself does not need to pay extra attention to the data itself, the code is concise, and the efficiency is high. Moreover, the correspondence between the record and the database data can be maintained. As long as the correct expected result is set in the record, the correctness of the data in the database will be automatically verified when the interface is called. Therefore, the integrated test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integrated test writing and verifies the effectiveness of the test itself.

[0115] In one embodiment of the present disclosure, the integrated test system further includes:

[0116] The external system call parameter verification module is configured to call the external system in response to calling a preset test interface, query the multiple records with the preset index structure to verify the call parameters when calling the external system, so as to determine whether the call parameters when calling the external system meet the second expected result.

[0117] According to the technical solution provided by the embodiment of the present disclosure, the external system call parameter verification module is configured to call the external system in response to calling the preset test interface, query the multiple records with the preset index structure to verify with the call parameters when calling the external system, so as to determine whether the call parameters when calling the external system meet the second expected result. The corresponding relationship between the record and the external system call parameter can be maintained by means of the record with the preset index structure. As long as the correct expected result is set in the record, the correctness of the call parameter will be automatically verified when the external system call is made. This makes the integration test qualitatively improved in terms of convenience and accuracy.

[0118] In one embodiment of the present disclosure, the integrated test system further includes:

[0119] A record modification module, configured to modify the plurality of records having a preset index structure;

[0120] An interface calling module is configured to call a preset test interface;

[0121] an interface testing module, configured to query the modified multiple records having a preset index structure in response to calling a preset testing interface to determine whether the data stored in the database meets a third expected result,

[0122] and / or,

[0123] The external system call test module is configured to call the external system in response to calling a preset test interface, query the modified multiple records with the preset index structure to verify with the call parameters when calling the external system, so as to determine whether the call parameters when calling the external system meet the fourth expected result.

[0124] According to the technical solution provided by the embodiment of the present disclosure, through the record modification module, it is configured to modify the multiple records with the preset index structure; the interface call module is configured to call the preset test interface; the interface test module is configured to query the multiple modified records with the preset index structure in response to calling the preset test interface to determine whether the data stored in the database meets the third expected result, and / or the external system call test module is configured to call the external system in response to calling the preset test interface, query the multiple modified records with the preset index structure to verify with the call parameters when calling the external system, so as to determine whether the call parameters when calling the external system meet the fourth expected result, the correspondence between the record and the database data and the correspondence between the record and the external system call parameters can be maintained. As long as the correct expected result is set in the record, the correctness of the data in the database and the external system call parameters will be automatically verified when the interface is called. Therefore, the integration test standardization solution provided by the embodiment of the present disclosure improves the efficiency of integration test writing and verifies the effectiveness of the test itself.

[0125] Those skilled in the art will understand that referring to Figure 3 The technical solutions described can be compared with Figure 1 and Figure 2 The described embodiments are combined to provide a reference Figure 1 and Figure 2 The technical effects achieved by the described embodiments. Figure 1 and Figure 2 The specific content of the description will not be repeated here.

[0126] The present disclosure also discloses an electronic device, Figure 4 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0127] like Figure 4 As shown, the electronic device 400 includes a memory 401 and a processor 402, wherein the processor 402 is used to generate multiple records with a preset index structure, and the memory 401 stores multiple records with a preset index structure, wherein one record constitutes a node of the index structure, and the record stores its own attribute information and has the ability to add child nodes and modify its own attribute information.

[0128] The processor 402 is used to generate a record management object for the multiple records, and the memory 401 stores the record management object, wherein the record management object is used to manage records and interact with a database based on the managed records to store the records in the database as data in a preset format, wherein each record management object manages a class of records, and the record management object verifies the multiple records with a preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result.

[0129] In one embodiment of the present disclosure, the processor 402 is utilized to call an external system in response to calling a preset test interface, and query the multiple records with a preset index structure to verify the call parameters when calling the external system to determine whether the call parameters when calling the external system meet the second expected result.

[0130] In one embodiment of the present disclosure, the processor 402 is further included to perform the following operations:

[0131] receiving a modification of the plurality of records having the preset index structure;

[0132] Call the preset test interface;

[0133] In response to calling a preset test interface, querying the modified multiple records with a preset index structure to determine whether the data stored in the database meets the third expected result,

[0134] and / or,

[0135] In response to calling a preset test interface, an external system is called, and the modified multiple records with a preset index structure are queried to verify with the call parameters when calling the external system to determine whether the call parameters when calling the external system meet the fourth expected result.

[0136] In one embodiment of the present disclosure, the preset index structure is a tree index structure, wherein each record stores the attribute information of its parent node, the attribute information of its child nodes, and its own attribute information.

[0137] In one embodiment of the present disclosure, the multiple records with a preset index structure have a mapping relationship with fields of data stored in the database, and / or the multiple records with a preset index structure have a mapping relationship with call parameters when calling an external system.

[0138] In one embodiment of the present disclosure, the processor 402 is used to generate a plurality of records having a preset index structure, including:

[0139] The processor 402 is used to generate a plurality of records with a preset index structure based on a preset database simulation environment scenario and / or a preset external system simulation scenario.

[0140] In one embodiment of the present disclosure, the plurality of records with a preset index structure are provided with the first expected result, the second expected result, the third expected result, and the fourth expected result.

[0141] In one embodiment of the present disclosure, storing the records in the database as data in a preset format includes: storing multiple records with a preset index structure in multiple databases, and different databases store records in index structures at different stages as data in the preset format.

[0142] Figure 5 A schematic diagram showing the structure of a computer device suitable for implementing the method according to an embodiment of the present disclosure is shown.

[0143] like Figure 5 As shown, the computer device 500 includes a processing unit 501, which can perform various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 are also stored. The processing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0144] The following components are connected to the I / O interface 505: an input part 506 including a keyboard, a mouse, etc.; an output part 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part 508 including a hard disk, etc.; and a communication part 509 including a network interface card such as a LAN card, a modem, etc. The communication part 509 performs communication processing via a network such as the Internet. The drive 510 is also connected to the I / O interface 505 as needed. Removable media 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive 510 as needed, so that the computer program read therefrom is installed into the storage part 508 as needed. Among them, the processing unit 501 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.

[0145] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes computer instructions, and the computer instructions are executed by a processor to implement the method steps described above. In such an embodiment, the computer program product can be downloaded and installed from a network through the communication part 509, and / or installed from a removable medium 511.

[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the devices, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based device that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0147] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or programmable hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0148] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer device in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.

[0149] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. An integration testing method, comprising: Generate multiple records with a preset index structure, wherein one record constitutes a node of the index structure, the record stores its own attribute information, and has the ability to add child nodes and modify its own attribute information; Generate a record management object for the plurality of records, for managing the records and interacting with a database based on the managed records, so as to store the records in the database as data in a preset format, wherein each record management object manages a type of record; Using the record management object, verifying the plurality of records having the preset index structure with the data stored in the database to determine whether the data stored in the database meets the first expected result; The method further comprises: In response to calling a preset test interface, calling an external system, querying the plurality of records having a preset index structure to verify with the calling parameters when calling the external system, so as to determine whether the calling parameters when calling the external system meet the second expected result; The method further includes: receiving a modification of the plurality of records having the preset index structure; Call the preset test interface; In response to calling a preset test interface, querying the modified multiple records with a preset index structure to determine whether the data stored in the database meets the third expected result, and / or, In response to calling a preset test interface, calling an external system, querying the modified multiple records with a preset index structure to verify with the calling parameters when calling the external system, so as to determine whether the calling parameters when calling the external system meet the fourth expected result; The method comprises: Abstract a record management object from each type of record to manage all data in this type of record; Generate multiple record management objects according to multiple records with a preset index structure generated in the memory; A root record management object is defined to be responsible for the interaction between all individual record management objects and the database; the record management object is also used to verify whether the table data in the database is correct; the root record management object is an abstraction of the functions of all record management objects to interact with the database; the root record management object establishes a global record index based on the root node, and performs corresponding operations based on the global record index when interacting with the database.

2. The method according to claim 1, wherein: The preset index structure is a tree index structure, in which each record stores the attribute information of its parent node, the attribute information of its child nodes and its own attribute information.

3. The method according to claim 1, wherein: The plurality of records with the preset index structure have a mapping relationship with fields of data stored in the database, and / or the plurality of records with the preset index structure have a mapping relationship with call parameters when calling an external system.

4. The method according to claim 1, wherein: The generating of multiple records with a preset index structure includes: Based on a preset database simulation environment scenario and / or a preset external system simulation scenario, a plurality of records with a preset index structure are generated.

5. The method according to claim 1, wherein: The plurality of records with a preset index structure are provided with the first expected result, the second expected result, the third expected result, and the fourth expected result.

6. The method according to claim 1, wherein: Also includes: Multiple databases are saved, and different databases store records in index structures at different stages as data in a preset format.

7. An electronic device comprising a memory and a processor; wherein: The processor is used to generate a plurality of records having a preset index structure, and the memory stores the plurality of records having the preset index structure, wherein a record constitutes a node of the index structure, the record stores its own attribute information, and has the ability to add child nodes and modify its own attribute information, wherein the processor is used to generate a record management object for the plurality of records, the memory stores the record management object, wherein the record management object is used to manage records and interact with a database based on the managed records, so as to store the records in the database as data in a preset format, wherein each record management object manages a type of record, and the record management object verifies the plurality of records having a preset index structure with the data stored in the database, so as to determine whether the data stored in the database meets the first expected result; wherein, in response to calling a preset test interface, the processor calls an external system, queries the plurality of records having a preset index structure to verify with the calling parameters when calling the external system, so as to determine whether the calling parameters when calling the external system meet the second expected result; The process further includes using the processor to perform the following operations: receiving a modification of the plurality of records having the preset index structure; Call the preset test interface; In response to calling a preset test interface, querying the modified multiple records with a preset index structure to determine whether the data stored in the database meets the third expected result, and / or, In response to calling a preset test interface, calling an external system, querying the modified multiple records with a preset index structure to verify with the calling parameters when calling the external system, so as to determine whether the calling parameters when calling the external system meet the fourth expected result; The process further includes using the processor to perform the following operations: Abstract a record management object from each type of record to manage all data in this type of record; Generate multiple record management objects according to multiple records with a preset index structure generated in the memory; A root record management object is defined to be responsible for the interaction between all individual record management objects and the database; the record management object is also used to verify whether the table data in the database is correct; the root record management object is an abstraction of the functions of all record management objects to interact with the database; the root record management object establishes a global record index based on the root node, and performs corresponding operations based on the global record index when interacting with the database.

8. A readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method steps described in any one of claims 1 to 6.

9. A computer program product comprising computer instructions, which, when executed by a processor, implement the method steps of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Interface testing method and device, client and computer readable storage medium

    CN107741911A

  • Software testing method and device and storage medium

    CN112286796A