Automatic interface testing method and related device

By identifying database information and interface information in software development projects and establishing an association relationship between interfaces and databases, the problem of inefficient testing caused by insufficient server resources in the existing technology is solved, and efficient interface automation testing is achieved in a low-resource environment.

CN120492352APending Publication Date: 2025-08-15永赢金融租赁有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510668899.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Existing interface automation testing methods are inefficient in the case of insufficient server resources, especially in scenarios where external system data depend on data.

Method used

By obtaining the database's target table structure, target code and automated test model based on large language models, identifying the elements required for interface automation testing, generating test scripts and test data, and establishing an association between the interface and the database, and applying it to the automated test model to improve test accuracy.

Benefits of technology

With low server resources, the efficiency and accuracy of interface automation testing are improved, the hardware threshold is reduced, and the testing process is completed by simply deploying an automated test model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492352A_ABST
    Figure CN120492352A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic interface test method and a related device, database information and interface information in a software development project are identified through an automatic test model, an association relationship between an interface and a database is established, and when the association relationship is applied to the automatic test model, the model can learn a complex software development project, and the test efficiency is improved. The interface corresponds to the database, so that the test script and the test data corresponding to the interface can be more accurately output, the script running accuracy of automatic test is improved, the test efficiency is improved, the test process can be completed only by deploying equipment of an automatic test model, the hardware threshold is reduced, and the test efficiency is improved. Under the condition that server resources are relatively low, the efficiency of interface automatic testing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an interface automation testing method and related devices. Background Art

[0002] Interface automation testing is a method of testing interfaces in a software system through automated tools or scripts. The purpose is to verify whether the functions of the interface meet expectations and ensure the stability and reliability of the interface.

[0003] Related technologies typically use containerization and database refreshes to address the issue of non-reusable test data. However, these methods place high demands on server resources, especially in scenarios that rely on data from external systems. Each refresh requires the cooperation of the external system to refresh the database, resulting in a complex and inefficient process. Summary of the Invention

[0004] In response to the above problems, the present application provides an interface automation testing method and related devices for improving the efficiency of interface automation testing without relying on older server resources.

[0005] Based on this, this application discloses the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides an interface automation testing method, the method comprising:

[0007] Obtaining a target table structure, target code, and automated test model from a database, where the database and target code correspond to the same software development project; the automated test model is determined based on a large language model, and is used to identify elements required for automated interface testing and generate test scripts and test data;

[0008] Identify the target table structure and the interface in the target code according to the automated test model to obtain database information and interface information;

[0009] Determining, by the automated testing model, an interface-database association relationship between the database and the interface according to the database information and the interface information;

[0010] The interface-database association relationship is applied to the automated testing model to generate a test script and test data corresponding to the test script, and automated testing is performed using the test script and the test data corresponding to the test script.

[0011] In a second aspect, an embodiment of the present application provides an interface automation testing device, the device comprising: an acquisition unit, an identification unit, a determination unit, and a generation unit;

[0012] The acquisition unit is configured to acquire a target table structure, target code, and an automated test model from a database, wherein the database and the target code correspond to the same software development project, and the automated test model is determined based on a large language model, and is configured to identify elements required for automated interface testing and generate test scripts and test data;

[0013] The identification unit is used to identify the interfaces in the target code of the target table structure according to the automated test model to obtain database information and interface information;

[0014] The determining unit is configured to determine, based on the database information and the interface information, an interface-database association relationship between the database and the interface through the automated test model;

[0015] The generating unit is used to apply the interface-database association relationship to the automated testing model, generate a test script and test data corresponding to the test script, and perform automated testing using the test script and the test data corresponding to the test script.

[0016] In a third aspect, an embodiment of the present application provides a computer device, the computer device including a processor and a memory:

[0017] The memory is used to store a computer program and transmit the computer program to the processor;

[0018] The processor is configured to execute the method described in the first aspect above according to the computer program.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the first aspect above.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program, which, when executed on a computer device, enables the computer device to execute the method described in the first aspect above.

[0021] It can be seen from the above technical solutions that this application has at least the following beneficial effects:

[0022] Obtain the target table structure, target code and automated test model of the database, wherein the database and the target code correspond to the same software development project, and the automated test model is determined based on the large language model so that the automated test model has the ability to analyze the semantic information of the target code and the target table structure. The automated test model is used to identify the elements required for interface automated testing and generate test scripts and test data. According to the automated test model, the target table structure and the interface in the target code are identified respectively to obtain database information and interface information. According to the database information and interface information, the interface-database association relationship between the database and the interface is determined through the automated test model. The interface is associated with its corresponding database to determine which tables of the database will change when the interface is tested. The interface-database association relationship is applied to the automated test model to generate a test script and test data corresponding to the test script, and automated testing is performed using the test script and the test data corresponding to the test script. Therefore, the database information and interface information in the software development project are identified through the automated testing model, and the association relationship between the interface and the database is established. When it is applied to the automated testing model, the model can learn how the interface and database correspond to each other in complex software development projects, so that it can more accurately output the test scripts and test data corresponding to the interface, thereby improving the accuracy of the automated testing script operation and thus improving the testing efficiency. In addition, only the equipment of the automated testing model needs to be deployed to complete the testing process, which lowers the hardware threshold and improves the efficiency of interface automated testing when server resources are low. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 A flowchart of an interface automation testing method provided in an embodiment of the present application;

[0025] Figure 2 A flowchart of an interface automation test application scenario provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of the structure of an interface automation testing device provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are for illustrative purposes only and are not intended to limit the scope of protection of the present application.

[0029] In related technologies, containerization and database flushing are often used to address the issue of non-reusable test data. Containerization places high demands on server resources, as each container requires independent resources to run, such as a central processing unit (CPU) and memory. In resource-limited environments, containerization can lead to performance bottlenecks, impacting test efficiency. Database flushing (i.e., resetting the database to its initial state) is often used to ensure the consistency of test data. Before each test, database flushing restores the database to a known, clean state to avoid inconsistent test data and unreliable test results. However, database flushing operations typically require significant computing and storage resources, especially when processing large-scale databases, requiring significant server resources. Furthermore, if interface testing relies on data provided by an external system, each database flush requires the cooperation of the external system to refresh the database, which not only increases the complexity of the process but can also lead to inefficient testing.

[0030] In addition, in scenarios with complex relationships between databases and interfaces, the server resources required for containerization technology and database refresh will increase sharply. It can be seen that when server resources are insufficient, the efficiency of automated testing of related technologies is low.

[0031] Based on this, the embodiment of the present application provides an interface automation testing method and related devices, which identify database information and interface information in software development projects through an automated testing model and establish an association relationship between the interface and the database. When it is applied to the automated testing model, the model can learn how the interface and database correspond to each other in complex software development projects, so that it can more accurately output the test scripts and test data corresponding to the interface, thereby improving the accuracy of the automated testing script execution, thereby improving the testing efficiency, and only needing to deploy the equipment of the automated testing model to complete the testing process, which reduces the hardware threshold and improves the efficiency of interface automation testing when server resources are low.

[0032] The interface automation testing method provided in this application can be applied to computer devices with interface automation testing capabilities, such as terminal devices and servers. Specifically, the terminal device can be a desktop computer, laptop computer, mobile phone, tablet computer, etc.; the server can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers. The terminal device and server can be connected directly or indirectly via wired or wireless communication, which is not limited in this application.

[0033] See also Figure 1 , which is a flow chart of the interface automation test method provided by the embodiment of the present application. For the sake of convenience, the following embodiment is introduced by taking the execution subject of the interface automation test method as an example. Figure 1 As shown, the interface automation testing method includes S101-S104.

[0034] S101: Obtain the target table structure, target code and automated test model of the database.

[0035] The target code is the code corresponding to the interface automated testing. In the embodiments of this application, the database and the target code correspond to the same software development project. That is, the database and the target code jointly serve the same business needs and constitute a complete software development project. The target table structure is the organization and composition of the tables in the database.

[0036] The automated testing model is a model determined based on a large language model. The automated testing model is used to identify elements required for interface automated testing and generate test scripts and test data.

[0037] A test script is executable automated test code used to execute test cases and verify that the interface functions as expected. Test data is the input data used during the interface automated testing process. During the automated testing process, the interface is verified by determining the test results under different test data.

[0038] As a possible implementation method, the automated testing model can be trained in the following way:

[0039] Obtain a general large language model, test script samples, test data samples corresponding to the test script samples, code samples, and database-interface association relationship samples. The general large language model is a pre-trained large language model that has not yet been fine-tuned and has the ability of semantic analysis. The test script samples, the test data samples corresponding to the test script samples, code samples, and database-interface association relationship samples are used to fine-tune the general large language model. The test script samples and test data samples are predetermined and have high accuracy. The code samples and database-code association relationship samples are processed according to the general large language model to generate predicted test scripts and predicted test data. According to the first difference between the test script sample and the predicted test script, and the second difference between the test data sample and the predicted test data, the general large language model is fine-tuned to obtain an automated test model.

[0040] Therefore, by fine-tuning the general large language model that already has semantic analysis capabilities, the general large language model's ability to understand the relationship between databases and interfaces, as well as the accuracy of its output of test scripts and test data, is enhanced. This allows the fine-tuned automated testing model to understand complex software projects, especially complex database and interface relationships, and the output of test scripts and test data is more accurate.

[0041] S102: Identify the target table structure and the interface in the target code according to the automated test model to obtain database information and interface information.

[0042] Database information is information related to the database and automated testing, such as table names, field names, data types, field lengths, field constraints, etc. The automated testing model identifies the target table structure, which is structured information, and can disassemble and organize the target table structure to obtain database information.

[0043] As a possible implementation method, the database includes multiple tables. The target table structure can be identified through the automated testing model to obtain the table association relationship between each table. The table association relationship is a type of database information.

[0044] Tables in a database can be associated with each other in various ways, such as through foreign keys. The table association relationship determined by foreign keys can be identified through the table structure. In one possible implementation, if the database tables are associated with each other through target code, the database table association relationship can be identified as follows. Take the first and second tables in multiple tables as an example:

[0045] Get the entity relationship diagram and annotation information corresponding to the first table and the second table.

[0046] An Entity-Relationship Diagram (ER diagram) is a diagram used to represent the relationships between tables in a database. Annotation information is text information used to explain and illustrate the structure and content of database tables.

[0047] The entity relationship diagram and annotation information corresponding to the first table and the second table are identified according to the automated testing model to obtain a table association relationship between the first table and the second table.

[0048] Therefore, by obtaining the entity relationship diagram and annotation information of the first table and the second table, the automated testing model can understand the table association relationship established by the target code at the application level, enriching the way of understanding the table association relationship, and facilitating the automated testing model to understand the full set of database tables related to the interface, thereby further improving the accuracy of the test script and test data output.

[0049] Interface information is information related to the interface and automated testing in the target code, such as interface name, request body format, request method, etc. By identifying the target code through the automated testing model, the interface information can be obtained based on the semantic analysis capability of the automated testing model.

[0050] As a possible implementation approach, the automated testing model can identify key code snippets based on the target code framework type and obtain interface information through these key code snippets. For example, if the target code is a Spring Boot framework, the automated testing model can use annotations such as @RequestMapping and @PostMapping to obtain the path parameters and request method of the corresponding request interface. It can then analyze the fields of the interface request and response parameters based on the request body and return parameters in the method.

[0051] S103: Determine the interface-database association relationship between the database and the interface through an automated testing model based on the database information and the interface information.

[0052] The database information and interface information generated in S102 are input into the automated test model, and the interface-database association relationship between the database and the interface is determined by the automated test model. For example, the interface-database association relationship is that the call of a certain interface leads to the insertion or update of a certain record in a certain table in the database.

[0053] As a possible implementation method, by obtaining interface-database association relationship samples, such as association relationship tables, and corresponding database information samples and interface information samples, the general large language model can be fine-tuned to obtain an automated testing model capable of accurately generating interface-database association relationships.

[0054] It should be noted that the automated testing model can be a complete model or a model composed of multiple modules, namely, an identification model with the function of identifying database information and interface information, an association model with the ability to determine the interface-database association relationship, and a generation model with the ability to generate test scripts and test data. Each model is obtained through individual training, and when applied, each model in the automated testing model is called through the model interface.

[0055] S104: Apply the interface-database association relationship to the automated testing model, generate a test script and test data corresponding to the test script, and perform automated testing using the test script and the test data corresponding to the test script.

[0056] Applying the interface-database association relationship to the automated testing model means that when the automated testing model explicitly calls the interface, the database table where data changes occurs. Since the automated testing model is determined based on the large language model, the semantic analysis and text output capabilities of the automated testing model can be used to generate test scripts and test data corresponding to the test scripts. For example, a test script for an interface corresponds to a set of test data.

[0057] In one possible implementation, after applying the interface-database association relationship to the automated test model, the automated test model can be used to identify multiple request methods corresponding to the target interface and generate test data corresponding to the multiple request methods.

[0058] For example, you can instruct the automated test model to read interface information, obtain the corresponding interface fields and constraints, and generate test data based on preset scenarios. For example, for query interfaces (with a GET request method), test data can be generated based on scenarios such as whether login verification is required, whether role isolation exists, and whether input parameters are empty. The automated test model can then adjust the parameter values of each interface in the test script based on different test scenarios and request parameter conditions, simulating the generation of different test data corresponding to the interface.

[0059] In this way, corresponding scenarios can be determined for interfaces with different request methods, thereby accurately generating test data that can cover different scenarios and improving the comprehensiveness of automated testing.

[0060] By performing automated testing on the test scripts and test data generated by the automated testing model, the test results are obtained. For example, the test scripts are executed with the test data as input data to obtain the corresponding test results.

[0061] It can be seen from the above technical solution that the target table structure, target code and automated test model of the database are obtained, wherein the database and the target code correspond to the same software development project, and the automated test model is determined based on the large language model so that the automated test model has the ability to analyze the semantic information of the target code and the target table structure. The automated test model is used to identify the elements required for interface automated testing and generate test scripts and test data. According to the automated test model, the target table structure and the interface in the target code are respectively identified to obtain database information and interface information. According to the database information and interface information, the interface-database association relationship between the database and the interface is determined through the automated test model. The interface is associated with its corresponding database to determine which tables of the database will change when the interface is tested. The interface-database association relationship is applied to the automated test model to generate test scripts and test data corresponding to the test scripts, and automated testing is performed using the test scripts and the test data corresponding to the test scripts. Therefore, the database information and interface information in the software development project are identified through the automated testing model, and the association relationship between the interface and the database is established. When it is applied to the automated testing model, the model can learn how the interface and database correspond to each other in complex software development projects, so that it can more accurately output the test scripts and test data corresponding to the interface, thereby improving the accuracy of the automated testing script operation and thus improving the testing efficiency. In addition, only the equipment of the automated testing model needs to be deployed to complete the testing process, which lowers the hardware threshold and improves the efficiency of interface automated testing when server resources are low.

[0062] In one possible implementation, after applying the interface-database association to an automated test model, the automated test model can identify keywords corresponding to the target interface in the target code for a target interface among multiple interfaces, and generate test scripts for different test scenarios corresponding to the target interface. For example, an instruction to identify keywords for the target interface in the target code is sent to the automated test model, so that the automated test model can identify the test scenarios corresponding to the target interface through the keywords, thereby generating test scripts covering different test scenarios.

[0063] For example, based on keywords such as judgment statements (such as: if), custom exceptions (such as: XXXException), and exception capture and processing (such as: try catch) in the target code, the parameter verification and exception error reporting scenarios are identified, and then the interface parameter request conditions under the corresponding scenarios are obtained to generate a test script for the target interface.

[0064] Therefore, by adding the step of identifying keywords, the automated testing model can more clearly define the test scenarios of the interface based on keywords, thereby generating test scripts covering various test scenarios and improving the comprehensiveness of the test.

[0065] As a possible implementation method, after identifying the interface information, a directory for each interface can be established, and the interface requests of each interface can be placed in the corresponding directory for management, so that the test scripts and test data corresponding to each interface can be stored in the directory of the corresponding interface for easy management.

[0066] In a possible implementation, in response to updating a database or updating an object code, the updated location of the database or the object code is marked.

[0067] According to the update location, the updated database is used as the database, or the updated target code is used as the target code, and the steps of obtaining the target table structure, target code and automated test model of the database and subsequent steps are executed to obtain the updated test script and the test data corresponding to the updated test script, and automated testing is performed using the updated test script and the test data corresponding to the updated test script.

[0068] Specifically, after updating the database, mark the update location of the database; after updating the target code, mark the update location of the target code. The corresponding test script and test data can be determined based on the update location, so that S101-S104 can be executed to obtain the updated test script and updated test data, and re-automated testing can be performed to obtain new test results.

[0069] Therefore, after the target code or database changes, the test scripts and test data can be quickly updated, ensuring the real-time nature of automated testing. At the same time, by determining the update location, only the test scripts and test data involved in the update can be updated, which is more accurate and improves the efficiency of generating test scripts and test data.

[0070] Furthermore, after multiple updates occur, in response to updating the database or the target code, an update timestamp is obtained, which is the timestamp corresponding to the database update or the target code update. The updated test scripts and the test data corresponding to the updated test scripts can be classified and stored based on the update timestamp.

[0071] In this way, test scripts and test data can be updated automatically, and each updated test script and test data can be managed more efficiently through timestamps, making it easier for engineers to review and trace back.

[0072] In one possible implementation, when automated testing is required for multiple interfaces, the automated testing model can be used to identify the interfaces corresponding to the test scripts and obtain the dependencies between the multiple interfaces. For example, the login interface and the authentication interface have dependencies in the project, which is determined by the business scenario.

[0073] Determine the running order of the test scripts based on the dependency relationship, and perform automated testing using the test scripts and the test data corresponding to the test scripts in this running order.

[0074] Specifically, the automated test model can generate sequence identifiers corresponding to the dependency relationships of the various interfaces, so that the corresponding test scripts and test data can be run in sequence according to the order represented by the sequence identifiers.

[0075] Therefore, by simulating the environment of each interface in the actual business scenario and testing in the order indicated by the dependency, the authenticity and accuracy of the automated testing are improved.

[0076] See also Figure 2 , which is a flow chart of an interface automation testing application scenario provided in an embodiment of this application.

[0077] The database information and interface information are obtained through the recognition module of the large model. The large model is an automated testing model. Then, the test script and corresponding test data are generated. The automated test is performed according to the test script and test data through the execution and reporting module, and the corresponding test report is generated. When the database is updated or the target code is updated, the above steps are re-executed through the timing update module to obtain the updated test script and test data. If there is no update, the automated testing process is terminated.

[0078] See also Figure 3 , Figure 3 An interface automation testing device provided in an embodiment of the present application includes an acquisition unit 301, an identification unit 302, a determination unit 303, and a generation unit 304.

[0079] The acquisition unit 301 is configured to acquire a target table structure, target code, and an automated test model from a database, wherein the database and target code correspond to the same software development project. The automated test model is determined based on a large language model and is used to identify elements required for automated interface testing and generate test scripts and test data.

[0080] The identification unit 302 is used to identify the interfaces in the target code of the target table structure according to the automated test model to obtain database information and interface information;

[0081] The determining unit 303 is configured to determine, based on the database information and the interface information, an interface-database association relationship between the database and the interface through the automated testing model;

[0082] The generating unit 304 is configured to apply the interface-database association relationship to the automated testing model, generate a test script and test data corresponding to the test script, and perform automated testing using the test script and the test data corresponding to the test script.

[0083] As can be seen from the above technical solution, the target table structure, target code and automated test model of the database are obtained by the acquisition unit, wherein the database and the target code correspond to the same software development project, and the automated test model is determined based on the large language model so that the automated test model has the ability to analyze the semantic information of the target code and the target table structure. The automated test model is used to identify the elements required for interface automated testing and generate test scripts and test data. The recognition unit identifies the target table structure and the interface in the target code according to the automated test model, thereby obtaining database information and interface information. The determination unit determines the interface-database association relationship between the database and the interface through the automated test model based on the database information and the interface information. The interface is associated with its corresponding database to determine which tables of the database will change when the interface is tested. The generation unit applies the interface-database association relationship to the automated test model to generate a test script and test data corresponding to the test script, and then performs automated testing using the test script and the test data corresponding to the test script. Therefore, the database information and interface information in the software development project are identified through the automated testing model, and the association relationship between the interface and the database is established. When it is applied to the automated testing model, the model can learn how the interface and database correspond to each other in complex software development projects, so that it can more accurately output the test scripts and test data corresponding to the interface, thereby improving the accuracy of the automated testing script operation and thus improving the testing efficiency. In addition, only the equipment of the automated testing model needs to be deployed to complete the testing process, which lowers the hardware threshold and improves the efficiency of interface automated testing when server resources are low.

[0084] As a possible implementation, the database includes multiple tables, and the database information includes table association relationships between the tables. If the first table and the second table in the multiple tables determine the corresponding table association relationship through the target code, the apparatus 300 further includes a database acquisition unit configured to:

[0085] Obtaining entity relationship diagrams and annotation information corresponding to the first table and the second table;

[0086] The entity relationship diagram and annotation information corresponding to the first table and the second table are identified according to the automated testing model to obtain a table association relationship between the first table and the second table.

[0087] As a possible implementation, the interface includes multiple interfaces, and the generating unit 304 is specifically configured to:

[0088] Applying the interface-database association relationship to the automated test model;

[0089] For a target interface, the automated test model is used to identify keywords corresponding to the target interface in the target code, and test scripts corresponding to different test scenarios for the target interface are generated. The target interface is one of the multiple interfaces.

[0090] As a possible implementation, the apparatus 300 further includes an updating unit configured to:

[0091] In response to updating the database or updating the object code, marking an updated location of the database or the object code;

[0092] According to the update location, the updated database is used as the database, or the updated target code is used as the target code, and the steps of obtaining the target table structure, target code and automated test model of the database and subsequent steps are executed to obtain the updated test script and the test data corresponding to the updated test script, and automated testing is performed using the updated test script and the test data corresponding to the updated test script.

[0093] As a possible implementation, the apparatus 300 further includes a classification unit configured to:

[0094] In response to updating the database or updating the target code, obtaining an update timestamp;

[0095] The updated test script and the test data corresponding to the updated test script are classified and stored according to the update timestamp.

[0096] As a possible implementation, the interface includes multiple interfaces, and the generating unit 304 is specifically configured to:

[0097] Applying the interface-database association relationship to the automated testing model;

[0098] For a target interface, multiple request modes corresponding to the target interface are identified through the automated test model, and test data corresponding to the multiple request modes are generated.

[0099] As a possible implementation, the interface includes multiple interfaces, and the generating unit 304 is specifically configured to:

[0100] Identify the interfaces corresponding to the test scripts through the automated test model to obtain dependency relationships corresponding to the multiple interfaces;

[0101] The running order of the test scripts is determined according to the dependency relationship, and automated testing is performed using the test scripts and the test data corresponding to the test scripts according to the running order.

[0102] See also Figure 4 , an embodiment of the present application further provides a computer device, the computer device comprising a memory 401 and a processor 402:

[0103] The memory is used to store a computer program and transmit the computer program to the processor;

[0104] The processor is configured to execute the method of the above method embodiment according to the computer program.

[0105] An embodiment of the present application further provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method of the above method embodiment.

[0106] An embodiment of the present application further provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method of the above method embodiment.

[0107] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems or devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0108] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0109] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or plural.

[0110] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0111] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0112] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An interface automation testing method, characterized in that: The method comprises: Obtaining a target table structure, target code, and automated test model from a database, where the database and target code correspond to the same software development project; the automated test model is determined based on a large language model, and is used to identify elements required for automated interface testing and generate test scripts and test data; Identify the target table structure and the interface in the target code according to the automated test model to obtain database information and interface information; Determining, by the automated testing model, an interface-database association relationship between the database and the interface according to the database information and the interface information; The interface-database association relationship is applied to the automated testing model to generate a test script and test data corresponding to the test script, and automated testing is performed using the test script and the test data corresponding to the test script.

2. The method according to claim 1, characterized in that The database includes a plurality of tables, and the database information includes table association relationships between the tables. If a first table and a second table in the plurality of tables determine a corresponding table association relationship through the target code, the method further includes: Obtaining entity relationship diagrams and annotation information corresponding to the first table and the second table; The entity relationship diagram and annotation information corresponding to the first table and the second table are identified according to the automated testing model to obtain a table association relationship between the first table and the second table.

3. The method according to claim 1, characterized in that The interface includes a plurality of interfaces, and applying the interface-database association relationship to the automated test model to generate a test script and test data corresponding to the test script includes: Applying the interface-database association relationship to the automated test model; For a target interface, the automated test model is used to identify keywords corresponding to the target interface in the target code, and test scripts corresponding to different test scenarios for the target interface are generated. The target interface is one of the multiple interfaces.

4. The method according to claim 1, wherein The method further comprises: In response to updating the database or updating the object code, marking an updated location of the database or the object code; According to the update location, the updated database is used as the database, or the updated target code is used as the target code, and the steps of obtaining the target table structure, target code and automated test model of the database and subsequent steps are executed to obtain the updated test script and the test data corresponding to the updated test script, and automated testing is performed using the updated test script and the test data corresponding to the updated test script.

5. The method according to claim 4, characterized in that The method further comprises: In response to updating the database or updating the target code, obtaining an update timestamp; The updated test script and the test data corresponding to the updated test script are classified and stored according to the update timestamp.

6. The method according to claim 1, characterized in that The interface includes a plurality of interfaces, and applying the interface-database association relationship to the automated test model to generate a test script and test data corresponding to the test script includes: Applying the interface-database association relationship to the automated testing model; For a target interface, multiple request modes corresponding to the target interface are identified through the automated test model, and test data corresponding to the multiple request modes are generated.

7. The method according to any one of claims 1 to 6, characterized in that The interfaces include multiple interfaces, and the automated testing is performed using the test scripts and the test data corresponding to the test scripts, including: Identify the interfaces corresponding to the test scripts through the automated test model to obtain dependency relationships corresponding to the multiple interfaces; The running order of the test scripts is determined according to the dependency relationship, and automated testing is performed using the test scripts and the test data corresponding to the test scripts according to the running order.

8. An interface automation testing device, characterized in that: The device includes an acquisition unit, an identification unit, a determination unit, and a generation unit; The acquisition unit is configured to acquire a target table structure, target code, and an automated test model from a database, wherein the database and the target code correspond to the same software development project, and the automated test model is determined based on a large language model, and is configured to identify elements required for automated interface testing and generate test scripts and test data; The identification unit is used to identify the interfaces in the target code of the target table structure according to the automated test model to obtain database information and interface information; The determining unit is configured to determine, based on the database information and the interface information, an interface-database association relationship between the database and the interface through the automated test model; The generating unit is used to apply the interface-database association relationship to the automated testing model, generate a test script and test data corresponding to the test script, and perform automated testing using the test script and the test data corresponding to the test script.

9. A computer device, characterized in that: The computer device includes a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 7 according to the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.