Interface testing method and device, electronic equipment and storage medium

By extracting structured information from the user interface and generating test instructions and data using large language models, automated user interface testing is realized, solving the problems of high test complexity and low efficiency in the existing technology, and significantly improving the testing efficiency and coverage.

CN120123247APending Publication Date: 2025-06-10SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510283449.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The existing user interface testing technology has problems such as high operational complexity, low implementation efficiency, unstable test results, and difficulty in effectively covering in complex page multi-level jump logic and control linkage scenarios.

Method used

By extracting test indicators from the test interface, obtaining the structured information of the page, inputting it into the preset large language model, generating a test operation instruction set and associated test data set, automating the test based on these instructions and data, and monitoring the test process to generate a test report.

Benefits of technology

It reduces the dependence on testers' experience, shortens the test preparation cycle, ensures the logical rationality and fit of the test data, and can monitor and adjust test instructions in real time, significantly improving testing efficiency and coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123247A_ABST
    Figure CN120123247A_ABST
Patent Text Reader

Abstract

The invention provides an interface test method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the test index extraction of a to-be-tested interface in response to a test request, obtaining page structured information, inputting the page structured information into a preset large language model, generating a corresponding test operation instruction set and an associated test data set, and carrying out the test operation of the to-be-tested interface. Testing based on the test operation instruction set and the associated test data set, monitoring the test process to obtain interface state change information and test coverage information, and generating a test report according to the interface state change information and the test coverage information; according to the method, the test operation path is automatically reasoned by the large language model based on the extracted structured information, the dependence on artificial experience is reduced, the dynamically generated test data can ensure the logic rationality and test fitness of the generated data, and real-time state monitoring and instruction adjustment are performed based on page state change, so that the test efficiency is improved. Complex user interface test requirements can be met, and the test efficiency and the coverage rate are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to an interface testing method, device, electronic device and storage medium. Background Art

[0002] User interface refers to the graphical interface through which users interact with websites or applications, including all visual elements in websites or applications, such as layout, text, buttons, icons, etc. With the rise of responsive design, the application of user interface has gradually been upgraded to the stage of high-quality experience demand, which makes user interface design more complex and important. Therefore, the requirements for user interface testing of online products are also gradually increased.

[0003] Current user interface testing technologies mainly include two approaches: manual combined with automation and pure automation mode. In the manual combined with automation scenario, testers are often required to manually decompose the system based on a large amount of empirical data, independently write automation scripts for each sub-scenario, and rely on some fixed test data to complete verification. The testing process is highly dependent on manual experience, and professionals are required to participate deeply in scene decomposition, script writing, and data preparation, resulting in high operational complexity and low implementation efficiency. In addition, differences between user interfaces can lead to instability in test results. Therefore, more efficient and optimized automated testing solutions are widely used.

[0004] Although the automation solution covers system functions through full regression test cases, in the process of application differentiation that occurs during specific implementation, if the traditional rule engine is used to parse page elements, the test data mostly comes from preset templates, but the multi-level jump logic of complex pages and the testing of control linkage scenarios are often difficult to cover effectively, and page component identification is still mainly based on manually written parsing scripts, and the application of existing preset templates for test data is difficult to support multi-form large-scale testing needs; if the pre-parsed control information is further simply processed by natural language processing and other model technologies, the test data will be more suitable based on simple reasoning and generation, but it has not yet broken through the dual limitations of convenience and accuracy.

[0005] Therefore, the systematic defects of these existing user interface testing technologies have led to the existing solutions having problems such as narrow universal coverage of user interface testing and weak sustainable applicability when dealing with complex business scenarios with the expansion and enrichment of market application objects. Summary of the invention

[0006] The purpose of the embodiments of the present invention is to provide an interface testing method, device, electronic device and storage medium to solve the above technical problems.

[0007] The present invention provides an interface testing method, which includes: in response to a test request, extracting test metrics from the interface to be tested to obtain page structured information; inputting the page structured information into a preset large language model to generate a test operation instruction set and an associated test data set corresponding to the interface to be tested; performing tests based on the test operation instruction set and the associated test data set, and monitoring the test process to obtain interface state change information and test coverage information, so as to generate a test report according to the interface state change information and the test coverage information.

[0008] In an embodiment of the present invention, extracting test metrics from the interface to be tested includes: performing image recognition on the interface to be tested to determine the type information and spatial layout information of each interface component; extracting the structured node information and interaction constraint conditions of each interface component in the interface to be tested; based on the type information and spatial layout of each interface component, as well as the structured node information and interaction constraint conditions of each interface component, constructing a topological structure of each interface component including component association relationships, and determining the topological structure of each interface component including component association relationships as page structured information.

[0009] In an embodiment of the present invention, inputting the page structured information into a preset large language model to generate a test operation instruction set and an associated test data set corresponding to the interface to be tested includes: inputting the page structured information into a first large language sub-model to output a test operation instruction set corresponding to the interface to be tested, the preset large language model includes a first large language sub-model and a second large language sub-model, and the test operation instruction set includes a test instruction sequence of operation order, operation type and associated operation group; screening out interface components with a type information of text box in the page structured information, and inputting the interface components with a type information of text box into the second large language sub-model to output an associated test data set corresponding to the interface to be tested, and the associated test data set includes normal values, boundary values and abnormal values.

[0010] In an embodiment of the present invention, performing automated tests based on the test operation instruction set and the associated test data set includes: constructing a dynamic mapping relationship with the interface components according to the test operation instruction set and the associated test data set; deploying test process information according to the structured node information and interaction constraint conditions of each interface component based on the test operation instruction set and the associated test data set; executing a test process according to the test process information and a preset driving engine; if an abnormal test node appears in the test process, determining the interface component information, error message and node information in the test process in the abnormal test node, and updating the interface component information, error message and node information in the abnormal test node to a test exception node information list.

[0011] In an embodiment of the present invention, the test process is monitored to obtain interface state change information and test coverage information, including: obtaining interface state snapshots and test process record information according to a preset test monitoring period; performing image recognition on each of the interface state snapshots, and comparing the image recognition results of each of the interface state snapshots to obtain interface state change information; determining the number of tested components according to the test process record information, and determining test coverage information according to the number of tested components and the total number of interface components.

[0012] In an embodiment of the present invention, the interface test method further includes: if the interface state change information detects that the interface to be tested jumps to a new page, retaining the test process of the interface to be tested and triggering the test process for the new page.

[0013] In an embodiment of the present invention, generating a test report according to the interface state change information and test coverage information includes: when the test coverage rate in the test coverage information is greater than or equal to the test completion determination threshold, obtaining the interface state change information, input data, and test response information recorded during the test process, and invoking the test exception node information list to obtain test exception information; generating a test report according to the interface state change information, input data, test response information, test coverage information, and test exception information recorded during the test process; and feeding back the interface state change information, input data, and test response information recorded during the test process to a preset large language model for model optimization.

[0014] An embodiment of the present invention further provides an interface test device, including: a page parsing module, configured to extract test metrics for the interface to be tested in response to a test request to obtain page structured information; an intelligent decision-making module, configured to input the page structured information into a preset large language model to generate a test operation instruction set and an associated test data set corresponding to the interface to be tested; and a test execution and monitoring module, configured to perform tests based on the test operation instruction set and the associated test data set, and monitor the test process to obtain interface state change information and test coverage information, so as to generate a test report according to the interface state change information and test coverage information.

[0015] An embodiment of the present invention further provides an electronic device, including: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enabling the electronic device to implement the interface test method according to any one of the above embodiments.

[0016] An embodiment of the present invention also provides a computer-readable storage medium, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the interface testing method as described in any one of the above embodiments.

[0017] An interface testing method, device, electronic device, and storage medium provided by the present invention extract test indicators for an interface to be tested in response to a test request to obtain page structured information, input the page structured information into a preset large language model to generate a corresponding test operation instruction set and an associated test data set, perform testing based on the test operation instruction set and the associated test data set, monitor the testing process to obtain interface state change information and test coverage information, and generate a test report according to the interface state change information and the test coverage information; through page structured information extraction, the present application automatically infers a test operation path based on the structured information by the large language model, reduces the dependence on the experience of testers, shortens the test preparation cycle, and the pre-trained large language model dynamically generates test data according to the page structured information, which can ensure the logical rationality and test compliance of the generated data. Real-time status monitoring and instruction adjustment are performed based on the page state change, which can meet complex user interface test requirements, realize the automatic derivation of test logic with the domain knowledge of the large language model, break through the limitations of preset templates and fixed rules, and significantly improve the test efficiency and coverage.

[0018] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. In the drawings:

[0020] Figure 1 is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application;

[0021] Figure 2 is a flowchart of an interface testing method shown in an exemplary embodiment of the present application;

[0022] Figure 3 is a schematic diagram of a specific interface testing process shown in an exemplary embodiment of the present application;

[0023] Figure 4 is a schematic diagram of an interface testing device shown in an exemplary embodiment of the present application;

[0024] Figure 5 It is a schematic structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. Detailed implementation manners

[0025] The embodiments of the present invention will be described below with reference to the accompanying drawings and specific embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for explaining the present invention, rather than for limiting the protection scope of the present invention.

[0026] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Therefore, only the components related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.

[0027] In the following description, a large number of details are explored to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0028] The “and / or” mentioned in the present application describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character “ / ” generally represents an “or” relationship between the associated objects before and after.

[0029] Figure 1 It is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application.

[0030] Refer to Figure 1As shown in the figure, the system architecture may include the interface to be tested 110 and the computer device 120. Among them, the computer device 120 extracts test metrics from the interface to be tested 110 in response to a test request, obtains page structured information, inputs the page structured information into a preset large language model, generates a test operation instruction set and an associated test data set corresponding to the interface to be tested 110, conducts tests based on the test operation instruction set and the associated test data set, and monitors the test process to obtain interface state change information and test coverage information, so as to generate a test report according to the interface state change information and the test coverage information. The above-mentioned interface to be tested 110 refers to the graphical interface where users interact with websites or applications, including all visual elements in the websites or applications, such as layout, text, controls, icons, link information, etc.; the above-mentioned computer device 120 refers to the hardware device used to process, store, and transmit data, which can provide relevant computing power support and logical judgment ability, and can carry and deploy, including but not limited to microcomputers, single-chip microcomputers, virtual computers, embedded machines, etc.

[0031] Schematically, the computer device 120 extracts test metrics from the interface to be tested 110 in response to a test request, obtains page structured information, inputs the page structured information into a preset large language model to generate a corresponding test operation instruction set and an associated test data set, conducts tests based on the test operation instruction set and the associated test data set, and monitors the test process to obtain interface state change information and test coverage information, so as to generate a test report according to the interface state change information and the test coverage information; through the extraction of page structured information in this application, the large language model automatically infers the test operation path based on the structured information, reduces the dependence on the experience of testers, shortens the test preparation cycle, and the pre-trained large language model dynamically generates test data according to the page structured information, which can ensure the logical rationality and test compliance of the generated data, and can perform real-time status monitoring and instruction adjustment based on the page state change, so as to meet the complex user interface test requirements, realize the automatic derivation of test logic with the domain knowledge of the large language model, break through the limitations of preset templates and fixed rules, and significantly improve the test efficiency and coverage.

[0032] Figure 2 is a flowchart of an interface test method shown in an exemplary embodiment of the present application. This interface test method can be executed in Figure 1 the implementation environment, and can also be implemented in other implementation environments. The above implementation environment is not specifically limited herein. Referring to Figure 2 as shown, the flowchart of this interface test method at least includes steps S210 to S230, which are introduced in detail as follows:

[0033] In step S210, in response to a test request, test metrics are extracted from the interface to be tested to obtain page structured information.

[0034] In one embodiment of the present application, extracting test metrics for the interface to be tested includes performing image recognition on the interface to be tested, determining the type information and spatial layout information of each interface component, extracting the structured node information and interaction constraint conditions of each interface component in the interface to be tested, and based on the type information and spatial layout of each interface component, as well as the structured node information and interaction constraint conditions of each interface component, constructing a topological structure of each interface component including component association relationships, and determining the topological structure of each interface component including component association relationships as page structured information.

[0035] In one embodiment of the present application, the visual features of the interface to be tested are analyzed through image recognition technology to determine the type information of each component. For example, component categories such as text boxes, buttons, and drop-down menus are distinguished. Specifically, in some specific implementation processes, first, a real-time object localization algorithm is used to capture the visual element areas of the web page interface screenshot, and the position information of the interactive elements of the interface is framed by analyzing the image features. Then, a deep convolutional neural network is used to refine the classification of the located visual elements, accurately distinguishing the types of interface components such as buttons, text input areas, and option selection boxes, and simultaneously recording the positioning coordinates (including the horizontal and vertical positions of the center point) of each element on the screen and the width and height parameters of its outer contour. This combined recognition method can accurately extract the spatial layout and functional attributes of the interface components, providing structured data support for subsequent interface automation operations. And the spatial layout is recorded, such as recording the coordinate information, relative position relationship, and size parameters of the interface components. Secondly, on the basis of recognizing the physical features of the components, their functional attributes and behavior rules are further analyzed. The structured node information includes but is not limited to the unique identifier of the component, the parent-child hierarchical relationship, and the operable attributes, etc.; the interaction constraint conditions are used to define the state dependency relationship and event response logic of the components. Based on the above-mentioned relevant information of the interface components, a behavior rule library of the components is constructed to provide a basis for generating test logic.

[0036] In one embodiment of the present application, the topological structure of each interface component includes constructing a spatial topology, a logical topology, and a hierarchical topology. Specifically, a two-dimensional grid is constructed based on the coordinate data to clarify the spatial topological relationships such as adjacent and inclusion of components; a state dependency chain logical topology between components is constructed through interaction constraints; a tree-like structure is generated according to the parent-child node relationship to form a hierarchical topology.

[0037] The finally generated page structured information includes, but is not limited to: a component feature library for describing the type, size, coordinates, and style attributes of each node; an interaction rule library for describing input constraints, event response logic, and state change conditions; and a topological relationship library for describing spatial adjacency relationships, hierarchical inclusion relationships, and logical dependency relationships. This ensures accurate positioning of components during the generation of automated test scripts, compliance with input constraints during dynamic test data injection, and following the interaction dependency order during the construction of multi-step operation chains.

[0038] In step S220, the page structured information is input into a preset large language model to generate a test operation instruction set and an associated test data set corresponding to the interface to be tested.

[0039] In one embodiment of the present application, the page structured information is input into a first large language sub-model to output a test operation instruction set corresponding to the interface to be tested. The preset large language model includes a first large language sub-model and a second large language sub-model. The test operation instruction set includes a test instruction sequence of operation order, operation type, and associated operation groups.

[0040] In one embodiment of the present application, the first large language sub-model is a large language model for generating test-specific instructions. The fine-tuning training method of the first large language sub-model includes obtaining historical test scripts, parsing the association relationship between the operation step sequence and interface elements, constructing a structured training data set, generating a text-image joint feature vector based on the structure information and interface screenshots, and training using a hierarchical training strategy, including pre-training the instruction pattern based on a certain number of operation instruction data and then performing parameter-freezing fine-tuning using complex scenario test cases with annotation information. Finally, a test coverage reward function is constructed, and the instruction generation strategy is optimized through the proximal policy optimization algorithm.

[0041] In one embodiment of the present application, interface components with a type information of text box are screened out from the page structured information, and the interface components with a type information of text box are input into the second large language sub-model to output an associated test data set corresponding to the interface to be tested. The associated test data set includes normal values, boundary values, and abnormal values.

[0042] In one embodiment of the present application, the second large language sub-model is a large language model for generating test data. Its parameter optimization method includes extracting field constraint conditions from the requirements document, establishing a structured knowledge graph containing data types, format rules, and boundary values, and then using a graph attention network to perform embedding representation on the knowledge graph to generate field-level constraint feature vectors. The training of the second large language sub-model is a multi-task text generation training process based on the self-attention mechanism architecture. By setting a data validity classifier (normal / boundary / abnormal) and a format compliance discriminator, and then combining the current field attributes, associated field constraints, and historical test data, a prompt template containing multiple feature dimensions is generated and iteratively optimized to improve robustness.

[0043] In step S230, tests are performed based on the test operation instruction set and the associated test data set, and the test process is monitored to obtain interface state change information and test coverage information, so as to generate a test report according to the interface state change information and the test coverage information.

[0044] In one embodiment of the present application, a dynamic mapping relationship with the interface component is constructed according to the test operation instruction set and the associated test data set. Based on the structured node information and interaction constraint conditions of each interface component, test process information is deployed according to the test operation instruction set and the associated test data set. The test process is executed according to the test process information and a preset driving engine. If an abnormal test node appears in the test process, the interface component information, error message, and node information in the test process in the abnormal test node are determined, and the interface component information, error message, and node information in the test process in the abnormal test node are updated to the test abnormal node information list.

[0045] Specifically, the test operation instruction set, such as action sequences including but not limited to clicking, inputting, sliding, etc., is combined with the input values, expected results, etc. in the associated test data set, and a two-way binding relationship is established with the target interface component. Based on the structured node information and interaction constraint conditions of the interface component, the test instructions and data are arranged in a logical order into executable test process information, and then through a preset driving engine, which is used to simulate user operations and execute test steps according to the process, while capturing in real time interface state changes such as interface jumps and component display / hide state changes, operation feedback such as input verification prompts and network request response results, and abnormal signals such as element positioning failures and expected result mismatches. When an abnormal test node is detected, the location where the abnormality occurs, the specific error type, and the step number and pre-operation context of the abnormality in the test process are extracted, and the above information is structured and stored in the test abnormal node information list to form a traceable defect log.

[0046] In one embodiment of the present application, the test process is monitored to obtain interface state change information and test coverage information, including obtaining interface state snapshots and test process record information according to a preset test monitoring period, performing image recognition on each of the interface state snapshots, comparing the image recognition results of each of the interface state snapshots to obtain interface state change information, determining the number of tested components according to the test process record information, and determining test coverage information according to the number of tested components and the total number of interface components.

[0047] In one embodiment of the present application, if the interface state change information detects that the interface to be tested jumps to a new page, the test process of the interface to be tested is retained, and the test process of the new page is triggered.

[0048] In one embodiment of the present application, when the test coverage rate in the test coverage information is greater than or equal to the test completion determination threshold, the interface state change information, input data, and test response information recorded during the test process are obtained, the test exception node information list is called to obtain test exception information, and a test report is generated according to the interface state change information, input data, test response information, test coverage information, and test exception information recorded during the test process. The interface state change information, input data, and test response information recorded during the test process are fed back to a preset large language model for model optimization.

[0049] Specifically, the proportion of the executed test paths in the preset total paths is statistically calculated, including the interface component test coverage rate and the operation path test coverage rate, and the current test coverage rate is determined after weighted averaging. When the test coverage rate is greater than or equal to the test completion determination threshold, the report generation process is triggered. The test report includes, but is not limited to, interface state change information such as component display and hiding status, page jump records, dynamic content loading logs, etc., input data such as preset values, boundary values, and abnormal value input records in the test cases, test response information such as interface return codes, front-end prompt information, and database change records, and the test exception node information list is called to associate the context data at the time of the exception. Finally, the interface state change information, input data, and test response information recorded during the test process are used as training corpus, and the key optimization directions are marked through exception information to improve the model's understanding and prediction ability of the test scenario.

[0050] Please refer to Figure 3 , Figure 3 which is a schematic diagram of a specific interface test process shown in an exemplary embodiment of the present application, as Figure 3As shown, first, using technologies in the field of images, including but not limited to object detection, image classification, etc., and considering the DOM (Document Object Model) layer attribute information of HTML (HyperText Markup Language) pages, extract the component information of the interface to be tested, and obtain the page structured information such as the order, type, name, and related restriction conditions of the interface components on the page. Input the obtained page structured information into the first large language sub-model for behavior, that is, the instruction generation large language model. The first large language sub-model, that is, the instruction generation large language model, needs to be fine-tuned and trained in advance so that it can output operation instruction information such as the following examples: the operation instruction currently required. If there is associated information between the current components, return the information of multiple components that need to be operated simultaneously. Among them, the LLM (Large Language Model) is a natural language processing model based on deep learning technology, especially based on neural networks, which can understand and generate human language. It usually has hundreds of millions to hundreds of billions of parameters and can perform various language tasks such as text generation, translation, question answering, summarization, and dialogue through training on large-scale text data.

[0051] In a specific embodiment of the present application, at the same time, input the interface component information whose component type is a text box in the obtained page structured information into the second large language sub-model, that is, the test data automatic generation large language model. And the second large language sub-model, that is, the test data automatic generation large language model, also needs to be trained in advance, and the test data corresponding to the currently operating text box can be obtained. And the range of the test data needs to cover normal samples, critical value samples, and abnormal samples to obtain an associated test data set, including but not limited to normal values, boundary values, and abnormal values.

[0052] In a specific embodiment of the present application, execute a test script according to the operation instruction and test data for data verification, and combine visual technologies such as object detection to judge the interface state change information, such as observable change information such as successful data input, incorrect data format input, page jump, etc., and comprehensively judge the test result of the current test instruction to draw a conclusion. Among them, if an abnormal test node is found, record it and store it structurally in the test abnormal node information list, that is, the bug database. Among them, if after operating on the component being tested in the current interface, it jumps to a new page, retain the test process of the interface to be tested and test the new page according to the foregoing test steps. In some other specific embodiments, by comparing the number of components that have been tested in the current interface and the total number of components to be tested, and using the interface position and change information obtained from the image information, comprehensively judge whether the test of this interface is completed.

[0053] In a specific embodiment of the present application, after completing the automated testing of all interfaces of the system, a test report is generated. The test report includes, but is not limited to, test exception information, input data and test response information, interface status change information, etc. It can also perform data analysis and semantic reasoning based on a large language model of the semantic derivation type to generate a final test conclusion. Among them, the test data and operation instructions can be used as new training data to further optimize the accuracy of the corresponding large language generation model.

[0054] An interface testing method, device, electronic device and storage medium provided by the present invention extract test metrics for the interface to be tested in response to a test request to obtain page structured information, and input the page structured information into a preset large language model to generate a corresponding test operation instruction set and associated test data set, so as to perform tests based on the test operation instruction set and the associated test data set, and monitor the test process to obtain interface status change information and test coverage information, so as to generate a test report according to the interface status change information and the test coverage information; in this application, through page structured information extraction, the large language model automatically infers the test operation path based on the structured information, reducing the dependence on the experience of testers and shortening the test preparation cycle. Moreover, the pre-trained large language model dynamically generates test data according to the page structured information, which can ensure the logical rationality and test compliance of the generated data, and perform real-time status monitoring and instruction adjustment based on the page status change, so as to cope with complex user interface test requirements, realize the automated derivation of test logic with the domain knowledge of the large language model, break through the limitations of preset templates and fixed rules, and significantly improve the test efficiency and coverage.

[0055] The following introduces the device embodiments of the present application, which can be used to execute the interface testing method in the above embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the embodiments of the interface testing method in the above of the present application.

[0056] Figure 4 is a schematic diagram of an interface testing device shown in an exemplary embodiment of the present application. The device can be applied to Figure 2 the method implementation process shown, and the device can be based on Figure 1 executed in the implementation environment shown, and can also be applicable to other exemplary implementation environments and be specifically configured in other devices. This embodiment does not limit the implementation environment applicable to the device.

[0057] As Figure 4 shown, the exemplary interface testing device includes: a page parsing module 401, an intelligent decision-making module 402, and a test execution and monitoring module 403.

[0058] Among them, the page parsing module 401 is used to extract test metrics from the interface to be tested in response to a test request, and obtain page structured information; the intelligent decision-making module 402 is used to input the page structured information into a preset large language model to generate a test operation instruction set and an associated test data set corresponding to the interface to be tested; the test execution and monitoring module 403 is used to perform tests based on the test operation instruction set and the associated test data set, and monitor the test process to obtain interface state change information and test coverage information, so as to generate a test report according to the interface state change information and the test coverage information.

[0059] An embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enabling the electronic device to implement the interface test methods provided in the above various embodiments.

[0060] Figure 5 It is a schematic structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. It should be noted that Figure 5 The computer system 500 of the electronic device shown is only an example, and should not bring any restrictions to the functions and usage scopes of the embodiments of the present application.

[0061] As Figure 5 shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part into the random access memory (RAM) 503, such as executing the method in the above embodiment. In the RAM 503, various programs and data required for system operation are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus. The input / output (I / O) interface 505 is also connected to the bus 504.

[0062] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read from the removable medium can be installed into the storage section 508 as needed.

[0063] Specifically, according to an embodiment of the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from the removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.

[0064] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0065] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0066] In the corresponding drawings of the above embodiments, the connection lines may represent the connection relationships between various components, to represent more constituent signal paths and / or one or more ends of some lines have arrows to represent the main information flow direction. The connection lines, as a kind of identifier, are not a limitation on the solution itself, but using these lines in combination with one or more exemplary embodiments helps to more easily understand the circuit or logic unit. Any represented signal (determined by design requirements or preferences) can actually include one or more signals that can be transmitted in any one direction and can be implemented in any appropriate type of signal scheme.

[0067] The units involved in the embodiments described in this application can be implemented in software or in hardware. The described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation on the units themselves in some cases.

[0068] Another aspect of this application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the method as described above. The computer-readable storage medium can be included in the electronic device described in the above embodiments, or can exist alone without being assembled into the electronic device.

[0069] It should be noted that although several modules or units of the devices for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more of the above-described modules or units can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0070] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described here can be implemented in software or in a way that combines software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a USB flash drive, a mobile hard disk, etc.) or on the network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of this application.

[0071] Note that the present application can be used in numerous general-purpose or special-purpose computing system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on.

[0072] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include known common general knowledge or conventional technical means in the technical field not disclosed in the present application.

[0073] It should be understood that the above content of the present application is only a preferred exemplary embodiment of the present application and is not used to limit the embodiments of the present application. Those of ordinary skill in the art can make corresponding adaptations or modifications very conveniently according to the main concept and spirit of the present application. Therefore, the protection scope of the present application should be the protection scope required by the claims.

Claims

1. An interface testing method, characterized in that: The interface testing method comprises: In response to the test request, test indicators are extracted from the interface to be tested to obtain page structured information; Inputting the page structured information into a preset large language model to generate a test operation instruction set and an associated test data set corresponding to the interface to be tested; Testing is performed based on the test operation instruction set and the associated test data set, and the test process is monitored to obtain interface state change information and test coverage information, so as to generate a test report according to the interface state change information and test coverage information.

2. The interface testing method according to claim 1, characterized in that: Extracting test indicators for the interface to be tested includes: Performing image recognition on the interface to be tested to determine type information and spatial layout information of each interface component; Extracting structured node information and interaction constraints of each interface component in the interface to be tested; Based on the type information and spatial layout of each interface component, as well as the structured node information and interaction constraints of each interface component, a topological structure of each interface component including component association relationships is constructed, and the topological structure of each interface component including component association relationships is determined as page structured information.

3. The interface testing method according to claim 1, characterized in that: Inputting the page structured information into a preset large language model to generate a test operation instruction set and an associated test data set corresponding to the interface to be tested includes: Inputting the page structured information into the first large language sub-model, outputting a test operation instruction set corresponding to the interface to be tested, the preset large language model includes the first large language sub-model and the second large language sub-model, and the test operation instruction set includes a test instruction sequence of an operation order, an operation type, and an associated operation group; Interface components whose type information is a text box are filtered out from the page structured information, and the interface components whose type information is a text box are input into the second largest language sub-model, and an associated test data set corresponding to the interface to be tested is output, wherein the associated test data set includes normal values, boundary values, and abnormal values.

4. The interface testing method according to claim 1, characterized in that: Executing automated testing based on the test operation instruction set and the associated test data set includes: Constructing a dynamic mapping relationship with the interface component according to the test operation instruction set and the associated test data set; Deploy test process information according to the test operation instruction set and the associated test data set based on the structured node information and interaction constraints of each interface component; Execute the test process according to the test process information and the preset driving engine; If an abnormal test node appears in the test process, the interface component information, error information and node information in the test process in the abnormal test node are determined, and the interface component information, error information and node information in the test process in the abnormal test node are updated to the test abnormal node information list.

5. The interface testing method according to claim 4, characterized in that: Monitor the test process to obtain interface status change information and test coverage information including: Obtain interface status snapshots and test process record information according to the preset test monitoring cycle; Performing image recognition on each of the interface state snapshots, and comparing the image recognition results of each of the interface state snapshots to obtain interface state change information; The number of tested components is determined according to the test process record information, and the test coverage information is determined according to the number of tested components and the total number of interface components.

6. The interface testing method according to claim 5, characterized in that: The interface testing method also includes: If the interface state change information detects that the interface to be tested jumps to a new page, the test process of the interface to be tested is retained and the test process of the new page is triggered.

7. The interface testing method according to any one of claims 1 to 6, characterized in that: Generating a test report according to the interface state change information and the test coverage information includes: When the test coverage rate in the test coverage information is greater than or equal to the test completion judgment threshold, the interface state change information, input data and test response information recorded during the test process are obtained, and the test abnormal node information list is called to obtain the test abnormality information; Generate a test report based on the interface state change information, input data, test response information, test coverage information, and test exception information recorded during the test; The interface state change information, input data and test response information recorded during the test are fed back to the preset large language model for model optimization.

8. An interface testing device, characterized in that: The interface testing device comprises: The page parsing module is used to extract test indicators from the interface to be tested in response to the test request and obtain page structured information; An intelligent decision-making module, used for inputting the page structured information into a preset large language model to generate a test operation instruction set and an associated test data set corresponding to the interface to be tested; A test execution and monitoring module is used to perform testing based on the test operation instruction set and the associated test data set, and monitor the test process to obtain interface state change information and test coverage information, so as to generate a test report based on the interface state change information and test coverage information.

9. An electronic device, characterized in that: It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the interface testing method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the interface testing method as described in any one of claims 1-7.

Citation Information

Cited By

  • Automatic black box testing method and related device

    CN120849303A