Automatic interface testing method and device, electronic equipment and storage medium

By constructing a multimodal generation model and using a multimodal dataset to generate interface test cases and scripts, the problem of not being able to automatically generate test cases in existing technologies is solved. This enables the verification of database and log information, ensuring data consistency and testing efficiency.

CN120929378APending Publication Date: 2025-11-11AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511060802.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing technologies cannot automatically generate test cases and test scripts when performing interface regression testing, making it difficult to determine whether the database and logs are correct, which makes it difficult to guarantee data consistency.

Method used

By constructing a multimodal generation model, using a multimodal dataset to generate interface test cases and scripts to be executed, automated testing is performed based on software update upgrade requirement documents and code changes, and changes in database and log information are verified during the testing process.

Benefits of technology

Automated interface regression testing was implemented, ensuring data consistency and improving testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929378A_ABST
    Figure CN120929378A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic interface testing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining an upgrade demand document corresponding to a to-be-tested interface, and a code change corresponding to the upgrade demand document; inputting the upgrading demand document and the code change into a pre-constructed multi-modal generation model, and generating an interface test case and a script to be executed corresponding to each function change demand; and running the corresponding interface test case based on the to-be-executed script to obtain an interface test report. The problems that whether the database and the log are correct or not cannot be judged during interface regression testing in the prior art, and data consistency is difficult to guarantee are solved, the to-be-tested interface is automatically tested, and change information of the database and log information is verified in the testing process, so that the effect of data consistency is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automated testing technology, and in particular to an automated interface testing method, apparatus, electronic device, and storage medium. Background Technology

[0002] Interface regression testing is a crucial step in verifying the stability of the original functionality of the software interface after iterative updates. Its core objective is to prevent unexpected errors introduced by code modifications.

[0003] Currently, interface regression testing mainly relies on manual scripts or recording and playback tools. However, this testing method has the problem of limited verification dimensions and the inability to automatically generate test cases and test scripts based on software changes.

[0004] To address the aforementioned issues, improvements are needed to the methods for automated interface testing. Summary of the Invention

[0005] This invention provides an automated interface testing method, apparatus, electronic device, and storage medium to solve the problem that existing technologies cannot determine the correctness of databases and logs and cannot guarantee data consistency when performing interface regression testing.

[0006] In a first aspect, embodiments of the present invention provide an automated interface testing method, comprising:

[0007] Obtain the upgrade requirement document corresponding to the interface to be tested, and the code changes corresponding to the upgrade requirement document; wherein, the upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding code, modifying code, and deleting code;

[0008] The upgrade requirement document and the code changes are input into a pre-built multimodal generation model to generate interface test cases and scripts to be executed corresponding to each functional change requirement;

[0009] Run the corresponding interface test cases based on the script to be executed, and obtain the interface test report.

[0010] Secondly, embodiments of the present invention also provide an automated interface testing device, comprising:

[0011] The acquisition module is used to acquire the upgrade requirement document corresponding to the interface to be tested, and the code changes corresponding to the upgrade requirement document; wherein, the upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding code, modifying code, and deleting code;

[0012] The generation module is used to input the upgrade requirement document and the code changes into a pre-built multimodal generation model to generate interface test cases and scripts to be executed corresponding to each functional change requirement;

[0013] The testing module is used to run corresponding interface test cases based on the script to be executed and obtain an interface test report.

[0014] Thirdly, embodiments of the present invention also provide an electronic device, comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the interface automation testing method according to any embodiment of the present invention.

[0018] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to execute the interface automation testing method described in any embodiment of the present invention.

[0019] Fifthly, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the interface automation testing method as described in any of the embodiments of the present invention.

[0020] The technical solution of this invention involves obtaining an upgrade requirement document corresponding to the interface to be tested, and corresponding code changes. The upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding, modifying, and deleting code. The upgrade requirement document and code changes are input into a pre-built multimodal generation model to generate interface test cases and executable scripts corresponding to each functional change requirement. The corresponding interface test cases are run based on the executable scripts to obtain an interface test report. In this technical solution, a set of triples to be used is constructed using the data to be used in the multimodal dataset. These triples are then input into a general generation model for training, enabling multimodal comparative learning based on the general generation model. Simultaneously, the general generation model is optimized using a loss function and a reward function to obtain the multimodal generation model. Furthermore, the upgrade requirement document corresponding to the software update and the corresponding code changes are input into the multimodal generation model to automatically generate interface test cases and corresponding executable scripts based on the software modifications. The corresponding interface test cases are then run using the executable scripts to obtain the corresponding test results. Furthermore, after obtaining the test results, the database data and log information corresponding to the interface test cases are verified to ensure data consistency. This solves the problem that existing technologies cannot determine the correctness of the database and logs during interface regression testing, making it difficult to guarantee data consistency. It automates the testing of the interface under test and verifies changes in database and log information during the testing process, thereby ensuring data consistency.

[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of an automated interface testing method provided according to Embodiment 1 of the present invention;

[0024] Figure 2 This is a flowchart of an automated interface testing method provided according to Embodiment 2 of the present invention;

[0025] Figure 3This is a flowchart of an automated interface testing method provided according to Embodiment 2 of the present invention;

[0026] Figure 4 This is a schematic diagram of the structure of an automated interface testing device provided in Embodiment 3 of the present invention;

[0027] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the interface automated testing method of this invention. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention. The acquisition, transmission, storage, use, and processing of data in the technical solutions of this application comply with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, certain software, components, or models and other existing solutions in the industry may be mentioned. These should be considered as exemplary, and their purpose is only to illustrate the feasibility of implementing the technical solutions of this application, but it does not mean that the applicant has or necessarily used such solutions.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein.

[0030] Example 1

[0031] Figure 1 The flowchart of an interface automation testing method is provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where, when software functions change, the upgrade requirement document and corresponding code changes are processed according to a pre-built multimodal generation model to obtain corresponding interface test cases and scripts to be executed. This method can be executed by an interface automation testing device, which can be implemented in hardware and / or software and can be configured in a computing device capable of executing the interface automation testing method.

[0032] like Figure 1 As shown, the method includes:

[0033] S110. Obtain the upgrade requirement document corresponding to the interface to be tested, as well as the code changes corresponding to the upgrade requirement document.

[0034] The interface to be tested refers to the user interface that has undergone functional changes due to software upgrade requirements and needs to be verified through automated testing. For example, the interface to be tested could be a product checkout page with added payment methods, or a theme update interface with a changed theme. The upgrade requirement document includes at least one functional change requirement, and code changes include at least one of adding, modifying, and deleting code. It should be noted that functional change requirements in the upgrade requirement document do not only refer to adding a function, but can also include deleting or updating existing functions; functional change requirements refer to changes such as addition, deletion, or alteration of interface elements in the interface to be tested. Code changes refer to the set of modifications made by developers to the program source code to implement software upgrade requirements, usually manifested as differing code snippets in a version control system.

[0035] Specifically, when software functions are updated, in order to ensure the normal operation of the software, interface regression testing needs to be performed on the software before releasing the new function. Interface regression testing refers to the key step of verifying the stability of the original functions of the software interface after iterative updates. Its core objective is to prevent unexpected errors introduced by code modifications.

[0036] In this technical solution, when the software engineer performs interface regression testing on the software interface during iterative updates, it is necessary to obtain the upgrade requirement document corresponding to the software, and determine at least one functional change requirement in the software update process, as well as the code changes corresponding to each functional change requirement, based on the upgrade requirement document, and then perform automated interface regression testing on the updated content.

[0037] Optionally, before obtaining the upgrade requirement document corresponding to the interface to be tested and the code changes corresponding to the upgrade requirement document, the method further includes: obtaining a multimodal dataset and constructing corresponding types of triplets to be used based on the data to be used in the multimodal dataset; inputting at least one triplet to be used into a general generative model for multimodal contrastive learning, and performing multimodal alignment based on a loss function to obtain a model to be adjusted; outputting at least one test case and a test script corresponding to each test case based on the model to be adjusted, and testing the corresponding test cases based on the test scripts to obtain test results; calculating the reward value of the test results based on a reward function, and adjusting the parameters of the model to be adjusted based on the reward value to obtain a multimodal generative model.

[0038] The multimodal dataset includes at least one piece of data to be used, which may include functional requirements, test videos, defect reports, trigger operations, or system logs. A triplet to be used refers to a triplet constructed based on the relationships between the data to be used. The test results include positive and negative test cases that fully cover the test scope, executable test scripts, database assertions, and log verification rules. A general generative model refers to an AI generation system capable of handling multiple tasks (such as text generation, image synthesis, or code writing) and adapting to different domain requirements, typically implemented based on large-scale pre-training and self-supervised learning. A multimodal generative model refers to a model obtained by training a general generative model based on the requirements of interface regression testing. Specifically, in this technical solution, a multimodal generative model refers to a generative model capable of simultaneously processing multiple types of data input, such as text, images, and videos. For example, in this technical solution, a multimodal generative model can be a generative model jointly trained based on test case text, interface test videos (screen recordings or real-time footage), and test result records (logs and / or databases), used to understand test logic, interface element behavior, and user operation intentions.

[0039] In this technical solution, in order to ensure the accuracy of interface regression testing, it is necessary to pre-train a general generative model to obtain a multimodal generative model, and then perform automated testing on the interface to be tested based on the multimodal generative model.

[0040] For example, the diversity and quality of training data directly affect model performance. Therefore, when building a multimodal generative model, structured and unstructured data can be collected from multiple channels and standardized. For instance, multimodal datasets can be obtained from multiple channels, including various categories of data to be used. For example, code change history and commit records (i.e., functional requirements) can be extracted from code version control systems; historical defect reports and remediation plans (i.e., defect reports) can be obtained from defect management systems; positive / negative test cases can be exported from test management platforms; and screen operation videos of manual testing processes (i.e., test videos) and corresponding input parameters can be recorded.

[0041] Furthermore, a multi-task learning framework is used to transform the general generative model into a test domain-specific model (i.e., a multimodal generative model), enabling the multimodal generative model to generate test logic, parse code, and dynamically adapt. Specifically, triplets to be used are constructed based on the relationships between the data to be used, and at least one triplet to be used is input into the general generative model for multimodal comparative learning.

[0042] Optionally, based on the data to be used in the multimodal dataset, corresponding types of triples to be used are constructed, including: if the data to be used is a functional requirement, then a first triple to be used is constructed based on the functional requirement text, the corresponding functional code, and historical functional requirement test cases; if the data to be used is a test video, then a second triple to be used is constructed based on the video frame sequence in the test video, the code changes and test case assertions corresponding to the video frame sequence; if the data to be used is a defect report, then a third triple to be used is constructed based on the defect description, fix submission code, and regression test cases corresponding to the defect report; if the data to be used is a triggered operation, then a fourth triple to be used is constructed based on the triggered operation, the corresponding operation code, and the expected operation result; if the data to be used is a system log, then a fifth triple to be used is constructed based on the system log, the related code, and the abnormal test scenarios corresponding to the system log.

[0043] For example, the first triple to be used is the functional requirement text - the functional code corresponding to the functional requirement - historical functional requirement test cases; the second triple to be used is the video frame sequence in the test video - the code change corresponding to the video frame sequence - test case assertion; the third triple to be used is the defect description corresponding to the defect report - the fix submission code - regression test case; the fourth triple to be used is the trigger operation - the operation code corresponding to the trigger operation - the expected operation result; the fifth triple to be used is the system log - the relevant code corresponding to the system log - the abnormal test scenario.

[0044] It is understandable that the first, second, third, fourth, and fifth triplets to be used are only used to distinguish the triplets to be used corresponding to different categories of data to be used, and have no actual meaning.

[0045] Optionally, at least one triplet to be used is input into a general generative model for multimodal contrastive learning, and multimodal alignment is performed based on a loss function to obtain a model to be adjusted. This includes: inputting at least one triplet to be used into a general generative model, and performing vector transformation on each triplet to be used based on the general generative model to obtain a vector to be used; performing multimodal contrastive learning based on all vectors to be used, and performing multimodal alignment based on a loss function to obtain a model to be adjusted.

[0046] Building upon the example above, at least one triplet to be used is input into a general generative model, and vector transformation is performed on each triplet based on the general generative model to obtain the vector to be used. Further, data processing is performed on the input vector to be used based on the general generative model, and the general generative model is trained by using a contrastive loss function to align features of different modalities, resulting in a model to be adjusted. For example, cross-modal association can be achieved based on "requirement description (text) → code interface (code) → click operation (video)".

[0047] The loss function can be expressed by the following formula:

[0048]

[0049] Among them, L contrast Let T represent the loss function. i C is the vector to be used. j τ represents the feature vector of the corresponding code, s represents the similarity between the vector to be used and the feature vector corresponding to the code, and τ is the temperature parameter.

[0050] It should be noted that, to ensure the final multimodal generative model possesses test domain background knowledge, test domain-specific vocabulary and database validation templates need to be embedded in the input layer of the general generative model. For example, the model learns to map "verify transaction status" to SELECT status FROM orders WHERE actid = 123. Finally, reinforcement learning is used to optimize the model's knowledge density, a reward function is designed to guide the model to generate high-quality test cases, and the PPO algorithm is used to maximize the cumulative reward and optimize the model generation strategy.

[0051] The reward function can be expressed by the following formula:

[0052] R = 0.6 * P + 0.3 * C - 0.1 * T

[0053] Where R represents the reward value, P represents the pass rate, C represents the coverage rate, and T represents the execution time.

[0054] The values ​​0.6, 0.3, and -0.1 are custom parameter weights that can be modified according to actual needs. They are only used as examples in this technical solution and are not specifically limited.

[0055] Based on the model to be adjusted, at least one test case and a corresponding test script are output. After testing the corresponding test cases based on the test scripts, the test results are obtained. Furthermore, the reward value of the test results is calculated based on the reward function, and the parameters of the model to be adjusted are adjusted based on the reward value to obtain a multimodal generative model.

[0056] S120. Input the upgrade requirement document and code changes into the pre-built multimodal generation model to generate interface test cases and scripts to be executed corresponding to each functional change requirement.

[0057] The interface test cases are test specifications automatically generated based on upgrade requirements and code changes, containing interface operation sequences and expected response rules. They achieve dynamic adaptation through semantic localization and are used to verify the functional integrity and interactive correctness of the user interface. The executable script can be understood as an executable code file automatically generated by a multimodal generation model based on software upgrade requirement documents and code changes, containing semantic element localization logic and three-layer verification rules.

[0058] For example, after obtaining the fine-tuned multimodal generation model, the upgrade requirement document and code changes are used as input data, and targeted test cases and corresponding scripts to be executed are automatically generated based on the multimodal generation model.

[0059] Specifically, after inputting the upgrade requirement document, the multimodal generation model extracts functional change points (such as "adding payment methods") and related modules (such as order processing and account deduction) through semantic parsing, and combines the change code analysis to identify the scope of impact (such as modified API interfaces).

[0060] Subsequently, based on the multimodal generation model, a hierarchical test set and corresponding interface test cases are generated according to risk priority, as well as the scripts to be executed corresponding to the interface test cases. For example, the interface test cases are basic function test cases, boundary test cases, and abnormal scenario test cases. The basic function test cases cover the normal process (such as the payment success scenario), the boundary test cases are for extreme values ​​of input parameters (such as exceeding the amount limit), and the abnormal scenario test cases simulate network interruption or concurrent conflict and other failures.

[0061] S130. Run the corresponding interface test cases based on the script to be executed to obtain the interface test report.

[0062] The interface test report is a document that systematically records the verification results of the user interface functions after the interface test cases are run by the script to be executed.

[0063] Specifically, after obtaining the interface test cases and the script to be executed, the corresponding interface test cases will be run based on the script to be executed, automatically simulating user operations (such as clicking a button) and capturing the interface response in real time. For example, when testing the "payment function", the script to be executed will perform the following steps:

[0064] 1. Operation simulation: Click the payment button → Enter the amount 100 yuan → Submit;

[0065] 2. Verification logic: Check if the interface displays a "Payment successful" pop-up, and record the loading time (e.g., 500ms);

[0066] 3. Generate UI test report: If the pop-up does not appear, the report is marked as a failure and includes a screenshot of the error and the element location path for developers to quickly fix.

[0067] The technical solution of this invention involves obtaining an upgrade requirement document corresponding to the interface to be tested, and corresponding code changes. The upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding, modifying, and deleting code. The upgrade requirement document and code changes are input into a pre-built multimodal generation model to generate interface test cases and executable scripts corresponding to each functional change requirement. The corresponding interface test cases are run based on the executable scripts to obtain an interface test report. In this technical solution, a set of triples to be used is constructed using the data to be used in the multimodal dataset. These triples are then input into a general generation model for training, enabling multimodal comparative learning based on the general generation model. Simultaneously, the general generation model is optimized using a loss function and a reward function to obtain the multimodal generation model. Furthermore, the upgrade requirement document corresponding to the software update and the corresponding code changes are input into the multimodal generation model to automatically generate interface test cases and corresponding executable scripts based on the software modifications. The corresponding interface test cases are then run using the executable scripts to obtain the corresponding test results. Furthermore, after obtaining the test results, the database data and log information corresponding to the interface test cases are verified to ensure data consistency. This solves the problem that existing technologies cannot determine the correctness of the database and logs during interface regression testing, making it difficult to guarantee data consistency. It automates the testing of the interface under test and verifies changes in database and log information during the testing process, thereby ensuring data consistency.

[0068] Example 2

[0069] Figure 2 The flowchart below shows an automated interface testing method provided in Embodiment 2 of the present invention. Optionally, after running the corresponding interface test cases based on the script to be executed and obtaining the interface test report, the database corresponding to the interface to be tested is accessed based on the script to be executed, and the database change information corresponding to the execution of the interface test cases is obtained from the database; the database change information is verified based on the database consistency verification rules to obtain the database verification result.

[0070] like Figure 2 As shown, the method includes:

[0071] S210. Obtain the upgrade requirement document corresponding to the interface to be tested, as well as the code changes corresponding to the upgrade requirement document.

[0072] In a specific example, such as Figure 3 As shown, during the training data collection phase, it is necessary to collect multimodal datasets from past projects. The data to be used in the multimodal datasets include project requirement documents, design books, historical test cases, source code, defect repair records, and manual test screen recordings, etc.

[0073] Furthermore, data standardization is achieved through preprocessing methods such as data cleaning, data anonymization, and vectorization. Based on the relationships between the data to be used, corresponding categories of triplets are constructed. At least one of these triplets is input into a general generative model to fine-tune the model, resulting in multimodal generation. This multimodal generation model understands test logic, code structure, and interface interaction rules. During training, contrastive learning and reinforcement learning strategies are employed to align text descriptions, code snippets, and video operation trajectories, ensuring the generative model can cross-modal relate to requirements and implement test behaviors.

[0074] S220. Input the upgrade requirement document and code changes into the pre-built multimodal generation model to generate interface test cases and scripts to be executed corresponding to each functional change requirement.

[0075] Based on this, continue to see Figure 3 The upgrade requirement document and code changes corresponding to the software are input into a pre-built multimodal generation model. Based on the multimodal generation model, test cases (i.e., interface test cases) covering the entire process and abnormal scenarios, as well as the corresponding executable scripts, are automatically generated. For example, the multimodal generation model dynamically adapts interface elements based on semantic understanding (such as using the "login button" function description to replace fixed ID positioning).

[0076] S230. Run the corresponding interface test cases based on the script to be executed to obtain the interface test report.

[0077] S240. Access the database corresponding to the interface to be tested based on the script to be executed, and obtain the database change information corresponding to the execution of the interface test cases from the database.

[0078] Specifically, during test execution, the script to be executed actively accesses the database corresponding to the interface under test, obtains database change information caused by interface operations in real time, and compares and verifies it with the expected results. For example, the script to be executed uses timestamp association (such as payment operations and database queries within a ±2 second time window) to ensure that the obtained data changes after the operation strictly correspond to the interface behavior, realizing a precise verification closed loop of "interface action → data change".

[0079] Based on this, continue to see Figure 3During the execution and verification phase, the script to be executed is generated based on the multimodal generation model, and the script to be executed is run through the script execution tool to simulate user interface operations. Combined with the ORM framework, database queries are executed, system logs are automatically analyzed and test results are recorded, realizing end-to-end verification of the interface, database, and log layers.

[0080] S250. Verify the database change information based on the database consistency verification rules to obtain the database verification result.

[0081] Optionally, after running the corresponding interface test cases based on the script to be executed and obtaining the interface test report, the method further includes: calling the log analysis module based on the script to be executed, retrieving the logs to be verified during the testing process of the interface test cases from the log analysis module; and verifying the logs to be verified based on the log verification rules to obtain the log verification results.

[0082] Specifically, the script to be executed is run through a script execution tool (such as Selenium or Appium) to drive the browser or mobile device to simulate user operations, perform actions such as clicking or input according to the steps of the interface test cases, and capture the interface response (such as pop-up content and loading time).

[0083] After executing the interface test cases, the script to be executed accesses the database to verify transaction consistency. For example, after order payment, it checks whether the account balance deduction is accurate and whether the inventory quantity is updated synchronously.

[0084] Simultaneously, the log analysis module is invoked to parse system logs, detect error stacks (such as null pointer exceptions), performance metrics (such as API response latency), and security events (such as unauthorized access) to obtain log verification results. For example, the script to be executed invokes the log analysis module to extract log segments within the current test time window (i.e., the logs to be verified), such as 10 seconds before and after the payment test execution, and verifies the logs to be verified based on log verification rules to obtain log verification results.

[0085] Specifically, the optimization feedback system continuously expands the training dataset based on test cases, test scripts, and test results, and iteratively optimizes model parameters through reinforcement learning to continuously improve testing efficiency. For example, for test failure cases, the model automatically analyzes the causes (such as element location failure or data inconsistency) and fixes them in subsequent script generation, forming a closed-loop optimization mechanism.

[0086] Optionally, if the test result corresponding to the interface test case is a successful test, the interface test is used as a positive test case and fed back to the multimodal generation model for model optimization; or if the test result corresponding to the interface test case is a failed test, the interface test case is used as a negative test case and fed back to the multimodal generation model for model optimization.

[0087] In practical applications, closed-loop optimization and continuous integration of the multimodal generation model are key measures to ensure the long-term effectiveness of automated testing systems. Understandably, when a UI test case executes successfully, the system feeds that test case back into the multimodal generation model as a high-quality positive sample, strengthening the model's ability to remember correct patterns. When a UI test case executes unsuccessfully, the system identifies the reason for the failure and feeds it back into the model as a critical negative sample, driving targeted optimization.

[0088] Specifically, test result data (such as script execution records and defect distribution) is continuously fed back into the training dataset to increase the amount of training data. Positive and negative test cases generated after interface testing are input into the multimodal generation model for training, continuously improving the model's testing capabilities. For example, test density can be increased for modules with frequent errors, or operation timing can be adjusted to address false alarms caused by interface element loading delays. Simultaneously, the model can be integrated with the CI / CD pipeline to automatically trigger regression testing after code submission, generating relevant test cases and scripts. This process not only shortens the testing cycle but also predicts version release risks through historical data trends, providing decision support for project management.

[0089] The technical solution of this invention involves obtaining an upgrade requirement document corresponding to the interface to be tested, and corresponding code changes. The upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding, modifying, and deleting code. The upgrade requirement document and code changes are input into a pre-built multimodal generation model to generate interface test cases and executable scripts corresponding to each functional change requirement. The corresponding interface test cases are run based on the executable scripts to obtain an interface test report. In this technical solution, a set of triples to be used is constructed using the data to be used in the multimodal dataset. These triples are then input into a general generation model for training, enabling multimodal comparative learning based on the general generation model. Simultaneously, the general generation model is optimized using a loss function and a reward function to obtain the multimodal generation model. Furthermore, the upgrade requirement document corresponding to the software update and the corresponding code changes are input into the multimodal generation model to automatically generate interface test cases and corresponding executable scripts based on the software modifications. The corresponding interface test cases are then run using the executable scripts to obtain the corresponding test results. Furthermore, after obtaining the test results, the database data and log information corresponding to the interface test cases are verified to ensure data consistency. This solves the problem that existing technologies cannot determine the correctness of the database and logs during interface regression testing, making it difficult to guarantee data consistency. It automates the testing of the interface under test and verifies changes in database and log information during the testing process, thereby ensuring data consistency.

[0090] Example 3

[0091] Figure 4 This is a schematic diagram of the structure of an automated interface testing device provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes: an acquisition module 310, a generation module 320, and a testing module 330.

[0092] The acquisition module 310 is used to acquire the upgrade requirement document corresponding to the interface to be tested, and the code changes corresponding to the upgrade requirement document; wherein the upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding code, modifying code, and deleting code;

[0093] The generation module 320 is used to input the upgrade requirement document and code changes into the pre-built multimodal generation model to generate interface test cases and scripts to be executed corresponding to each functional change requirement;

[0094] Test module 330 is used to run corresponding interface test cases based on the script to be executed and obtain an interface test report.

[0095] The technical solution of this invention involves obtaining an upgrade requirement document corresponding to the interface to be tested, and corresponding code changes. The upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding, modifying, and deleting code. The upgrade requirement document and code changes are input into a pre-built multimodal generation model to generate interface test cases and executable scripts corresponding to each functional change requirement. The corresponding interface test cases are run based on the executable scripts to obtain an interface test report. In this technical solution, a set of triples to be used is constructed using the data to be used in the multimodal dataset. These triples are then input into a general generation model for training, enabling multimodal comparative learning based on the general generation model. Simultaneously, the general generation model is optimized using a loss function and a reward function to obtain the multimodal generation model. Furthermore, the upgrade requirement document corresponding to the software update and the corresponding code changes are input into the multimodal generation model to automatically generate interface test cases and corresponding executable scripts based on the software modifications. The corresponding interface test cases are then run using the executable scripts to obtain the corresponding test results. Furthermore, after obtaining the test results, the database data and log information corresponding to the interface test cases are verified to ensure data consistency. This solves the problem that existing technologies cannot determine the correctness of the database and logs during interface regression testing, making it difficult to guarantee data consistency. It automates the testing of the interface under test and verifies changes in database and log information during the testing process, thereby ensuring data consistency.

[0096] Optionally, the interface automation testing device also includes: a triplet construction unit, used to acquire a multimodal dataset before acquiring the upgrade requirement document corresponding to the interface to be tested and the code changes corresponding to the upgrade requirement document, and to construct a triplet of the corresponding type based on the data to be used in the multimodal dataset;

[0097] The model to be adjusted determination unit is used to input at least one triplet to be used into the general generative model for multimodal contrastive learning, and perform multimodal alignment based on the loss function to obtain the model to be adjusted;

[0098] The test result determination unit is used to output at least one test case and a test script corresponding to each test case based on the model to be adjusted, and to test the corresponding test cases based on the test scripts to obtain the test results; wherein, the test results include positive and negative test cases that fully cover the test scope, executable test scripts, database assertions and log verification rules;

[0099] The multimodal generative model determination unit is used to calculate the reward value of the test results based on the reward function, and to adjust the parameters of the model to be adjusted based on the reward value to obtain the multimodal generative model.

[0100] Optionally, the triplet construction unit includes: a first subunit, used to construct a first triplet to be used based on the functional requirement text, the corresponding functional code, and historical functional requirement test cases if the data to be used is a functional requirement;

[0101] The second subunit is used to construct a second triplet to be used based on the video frame sequence in the test video, as well as the code changes and test case assertions corresponding to the video frame sequence if the data to be used is a test video.

[0102] The third subunit is used to construct a third triplet to be used based on the defect description, fix submission code, and regression test cases corresponding to the defect report if the data to be used is a defect report.

[0103] The fourth subunit is used to construct a fourth triplet to be used based on the trigger operation, the corresponding operation code, and the expected operation result if the data to be used is a trigger operation.

[0104] The fifth subunit is used to construct the fifth triplet to be used based on the system log, the relevant code and exception test scenarios corresponding to the system log, if the data to be used is the system log.

[0105] Optionally, the model determination unit includes: a vector determination subunit, used to input at least one triplet to be used into the general generative model, and to perform vector transformation on each triplet to be used based on the general generative model to obtain the vector to be used;

[0106] The model to be adjusted determines the sub-units, which are used for multimodal contrastive learning based on all the vectors to be used, and multimodal alignment is performed based on the loss function to obtain the model to be adjusted.

[0107] Optionally, the interface automated testing device also includes: a database change information acquisition module, which is used to access the database corresponding to the interface to be tested based on the script to be executed after running the corresponding interface test cases based on the script to be executed and obtaining the interface test report, and to obtain the database change information corresponding to the execution of the interface test cases from the database.

[0108] The database verification result determination module is used to verify database change information based on database consistency verification rules and obtain database verification results.

[0109] Optionally, the interface automated testing device also includes: a log retrieval module, which is used to call the log analysis module based on the script to be executed after running the corresponding interface test cases based on the script to be executed and obtaining the interface test report, and retrieve the logs to be verified during the testing process of the interface test cases from the log analysis module.

[0110] The log verification result determination module is used to verify the log to be verified based on the log verification rules and obtain the log verification result.

[0111] Optionally, the interface automated testing device further includes: a first optimization module, used to, if the test result corresponding to the interface test case is a test success, feed the interface test back as a positive test case to the multimodal generation model for model optimization; or

[0112] The second optimization module is used to backflow the interface test cases as reverse test cases to the multimodal generation model for model optimization if the test result corresponding to the interface test cases is a test failure.

[0113] The interface automated testing device provided in this embodiment of the invention can execute the interface automated testing method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0114] Example 4

[0115] Figure 5 A schematic diagram of the structure of an electronic device 10 according to an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0116] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0117] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0118] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as interface automation testing methods.

[0119] In some embodiments, the interface automation testing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the interface automation testing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the interface automation testing method by any other suitable means (e.g., by means of firmware).

[0120] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0121] Computer programs used to implement the interface automation testing method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0122] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0124] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0125] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0126] Example 5

[0127] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the interface automation testing method provided in any embodiment of this application.

[0128] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0129] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for automated interface testing, characterized in that, include: Obtain the upgrade requirement document corresponding to the interface to be tested, and the code changes corresponding to the upgrade requirement document; wherein, the upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding code, modifying code, and deleting code; The upgrade requirement document and the code changes are input into a pre-built multimodal generation model to generate interface test cases and scripts to be executed corresponding to each functional change requirement; Run the corresponding interface test cases based on the script to be executed, and obtain the interface test report.

2. The method according to claim 1, characterized in that, Before obtaining the upgrade requirement document corresponding to the interface to be tested, and the code changes corresponding to the upgrade requirement document, the process also includes: Obtain a multimodal dataset and construct corresponding types of triplets based on the data to be used in the multimodal dataset; Input at least one triplet to be used into the general generative model for multimodal contrastive learning, and perform multimodal alignment based on the loss function to obtain the model to be adjusted; Based on the model to be adjusted, at least one test case and a test script corresponding to each test case are output. After testing the corresponding test cases based on the test scripts, the test results are obtained. The test results include positive and negative test cases that fully cover the test scope, executable test scripts, database assertions, and log verification rules. The reward value of the test result is calculated based on the reward function, and the parameters of the model to be adjusted are adjusted based on the reward value to obtain a multimodal generative model.

3. The method according to claim 2, characterized in that, The data to be used includes functional requirements, test videos, defect reports, trigger operations, or system logs. The construction of corresponding types of triplets based on the data to be used in the multimodal dataset includes: If the data to be used is the functional requirement, then a first triplet to be used is constructed based on the functional requirement text, the corresponding functional code and historical functional requirement test cases; If the data to be used is the test video, then a second triplet to be used is constructed based on the video frame sequence in the test video, as well as the code changes and test case assertions corresponding to the video frame sequence; If the data to be used is the defect report, then a third triplet to be used is constructed based on the defect description, fix submission code, and regression test cases corresponding to the defect report; If the data to be used is the triggering operation, then based on the triggering operation, the operation code corresponding to the triggering operation, and the expected operation result, a fourth triplet to be used is constructed; If the data to be used is the system log, then based on the system log, and the related code and abnormal test scenarios corresponding to the system log, a fifth triplet to be used is constructed.

4. The method according to claim 2, characterized in that, The step of inputting at least one triplet to be used into a general generative model for multimodal contrastive learning, and performing multimodal alignment based on a loss function to obtain the model to be adjusted, includes: Input at least one triplet to be used into a general generative model, and perform vector transformation on each triplet to be used based on the general generative model to obtain the vector to be used; Multimodal contrastive learning is performed based on all the vectors to be used, and multimodal alignment is performed based on the loss function to obtain the model to be adjusted.

5. The method according to claim 1, characterized in that, After running the corresponding interface test cases based on the script to be executed and obtaining the interface test report, the process further includes: The script to be executed accesses the database corresponding to the interface to be tested, and retrieves database change information corresponding to the execution of the interface test cases from the database. The database change information is verified based on the database consistency verification rules to obtain the database verification result.

6. The method according to claim 1, characterized in that, After running the corresponding interface test cases based on the script to be executed and obtaining the interface test report, the process further includes: Based on the script to be executed, call the log analysis module to retrieve the logs to be verified during the testing process of the interface test cases; The log to be verified is verified based on the log verification rules to obtain the log verification result.

7. The method according to claim 1, characterized in that, Also includes: If the test result corresponding to the interface test case is a test success, then the interface test is used as a positive test case and fed back to the multimodal generation model for model optimization. or If the test result corresponding to the interface test case is a test failure, the interface test case will be used as a reverse test case and fed back to the multimodal generation model for model optimization.

8. An automated interface testing device, characterized in that, include: The acquisition module is used to acquire the upgrade requirement document corresponding to the interface to be tested, and the code changes corresponding to the upgrade requirement document; wherein, the upgrade requirement document includes at least one functional change requirement, and the code changes include at least one of adding code, modifying code, and deleting code; The generation module is used to input the upgrade requirement document and the code changes into a pre-built multimodal generation model to generate interface test cases and scripts to be executed corresponding to each functional change requirement; The testing module is used to run corresponding interface test cases based on the script to be executed and obtain an interface test report.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the interface automation testing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the interface automation testing method according to any one of claims 1-7.