A GUI test case generation method, computer program and terminal

By combining the target detection model and the multi-modal large language model to identify and understand GUI elements, the problem of insufficient parsing capabilities for complex logic and GUI components in the existing technology is solved, and more accurate and adaptable test cases are generated. Reduces testing workload and stress caused by frequent changes.

CN118519916BActive Publication Date: 2024-10-01SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410986649.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-01
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

Existing GUI test case generation methods rely on the ability of large language models to understand code, making it difficult to accurately parse complex logic and GUI components. Moreover, a single text input leads to inaccurate semantic parsing, resulting in incorrect generated test cases and frequent UI changes. This makes the test scripts obsolete and increases the testing workload.

Method used

By obtaining the hypertext markup language code of the website to be tested, using the target detection model to identify and mark user interface elements, combining the marked pictures and HTML code to input the multi-modal large language model to generate test cases, and through filtering processing and double-layer routing The attention mechanism improves feature extraction and recognition capabilities and adapts to the needs of frequent UI modifications.

Benefits of technology

It improves the accuracy and adaptability of test cases, reduces testing workload, generates high-quality feature maps and test cases, and ensures the continuity and efficiency of the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118519916B_ABST
    Figure CN118519916B_ABST
Patent Text Reader

Abstract

The present invention discloses a GUI test case generation method, a computer program and a terminal, which belong to the field of software interface testing, and include the following steps: obtaining the HTML code of the website interface to be tested; using a target detection model to identify and mark the user interface elements to obtain the marked picture; inputting the marked picture, HTML code and test requirement task into a multimodal large language model to generate a test case. The target detection model is used to identify UI elements, and the multimodal large language model is input in combination with the HTML code, so that the multimodal large language model can learn different modal data, and can more comprehensively understand the layout, function, content, etc. of the user interface, thereby improving the accuracy of test case generation and generating test cases that are highly adapted to actual UI elements and interaction logic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software interface testing, and in particular to a GUI test case generation method, a computer program and a terminal. Background Art

[0002] Traditional manual testing methods are gradually being replaced by automated testing due to their low efficiency and proneness to errors. Although automated testing has increased the speed of testing, a large number of test cases still need to be written manually. With the maturity of artificial intelligence and machine learning technologies, the technology of automated test case generation has emerged. It can automatically identify test requirements and generate test cases, further improving the automation and intelligence level of testing. This not only conforms to the rapid iteration of software development models, such as agile development and DevOps, but also better supports the practice of continuous integration / continuous deployment (CI / CD), providing effective technical support for the needs of modern software engineering. As an important part of software development, software testing can help developers discover problems in the development process, and repair functional faults and troubleshoot problems through software testing, thereby helping software projects to be smoothly and safely put into use.

[0003] In the current research context, test cases generated using large language models (LLMs) have been widely used in software testing. Some scholars have proposed a method for generating unit test cases by learning real-world focus methods and test cases written by developers. This method generates test cases based on the automatic unit test generation tool of the large language model by parsing the project, extracting necessary information, and creating an adaptive focus context. Large language models are mainly text-based models, and they have limitations in understanding specific programming logic and technical details. For example, large language models may have difficulty accurately parsing and understanding complex logic in source code, resulting in the generated test cases not being able to accurately cover all execution paths of the code. After research and analysis, the following defects exist in generating test cases using large language models:

[0004] (1) The current method is highly dependent on LLM’s ability to understand code and does not take into account its ability to understand other elements. If the training data lacks certain types of graphical user interface (GUI) components or user interaction patterns, the model will perform poorly in actual tests.

[0005] (2) The input of the current method is often a single text content, while GUI testing also requires the combination of image information. A single input will lead to inaccurate semantic parsing of the large language model and incorrect generated test cases.

[0006] (3) Due to the frequent changes in the user interface (UI) in the actual test environment, UI testing is particularly prone to becoming outdated or "fragile". This fragility requires constant updating of test scripts, increasing the testing workload. Summary of the invention

[0007] The purpose of the present invention is to overcome the problems of the prior art and provide a GUI test case generation method, a computer program and a terminal.

[0008] The purpose of the present invention is to achieve the following technical solution: a GUI test case generation method, the method comprising the following steps:

[0009] Obtain the HTML code of the website interface to be tested;

[0010] Use the object detection model to identify and mark the user interface elements to obtain the marked images;

[0011] The labeled images, HTML codes, and test requirement tasks are input into the multimodal large language model to generate test cases.

[0012] In one example, after obtaining the hypertext markup language code of the website interface to be tested, the process further includes screening the hypertext markup language code, including the following sub-steps:

[0013] Pair each element in the hypertext markup language code with the required task query and calculate the matching score. Pass the matching score through the activation function, optimize it using cross entropy loss, and output the predicted matching value. Select the top element with the largest predicted matching value among all elements of the website interface and splice it to obtain the hypertext markup language code segment.

[0014] In one example, the target detection model is a YOLO model, including a backbone network, a neck network, and a detection head connected in sequence; when the convolution blocks in the backbone network and the neck network perform convolution operations, the following sub-steps are performed:

[0015] A random coordinate algorithm is used to determine the initial position of the convolution kernel. The shape and size of the user interface at each different position are changed by the coordinate offset. Then, new coordinate positions are generated through resampling and reshaping operations, and finally a feature map is generated.

[0016] In one example, when the backbone network performs feature extraction, the double-layer routing attention mechanism is introduced into the convolution block attention module to form a double-layer routing attention mechanism, and the double-layer routing attention mechanism is used to extract features; when the neck network performs feature fusion processing, the double-layer routing attention mechanism is introduced into the convolution block attention module to form a double-layer routing attention mechanism, and the double-layer routing attention mechanism is used to fuse feature information.

[0017] In one example, the backbone network and the neck network both include a C2f module, and the bottleneck blocks of the C2f modules in the backbone network and the neck network are replaced with an hourglass network; the hourglass network includes a stem layer, a hierarchical tile, a learnable downsampling layer, a global average pooling layer, a final convolution and a fully connected layer, and the hourglass network is used for feature extraction; the stem layer and the hierarchical tile are connected in sequence, a learnable downsampling layer is provided between the hierarchical tiles, the hierarchical tiles and the learnable downsampling layer are connected to the global average pooling layer, and the global average pooling layer is connected to the final convolution and fully connected layer.

[0018] In one example, the detection head further includes a first sub-detection auxiliary head and a second sub-detection auxiliary head, and the first sub-detection auxiliary head and the second sub-detection auxiliary head are respectively connected to output ends of different splicing layers in the neck network.

[0019] In one example, before the labeled image is input into the multimodal large language model, the following steps are also included:

[0020] Convert the marked image into binary data, convert the binary data into Base64 encoding, and use Base64 encoding to replace the marked image and input it into the large language model.

[0021] In one example, after the test case is generated, the test case is also verified:

[0022] Run the generated test cases to confirm whether there are any errors during the running process. If there are no errors, the test passes; otherwise, the error information, the test cases that have not passed the verification, and the required tasks are input into the large language model to generate new test cases, and then the new test cases are verified until they pass the verification.

[0023] It should be further explained that the technical features corresponding to the above examples can be combined or replaced with each other to form a new technical solution.

[0024] The present invention also includes a computer program product, including a computer program, which, when executed by a processor, implements the steps of the GUI test case generation method formed by any one of the above examples or a combination of multiple examples.

[0025] The present invention also includes a terminal, including a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, and when the processor executes the computer instructions, the steps of the GUI test case generation method formed by any one or more of the above examples are executed.

[0026] Compared with the prior art, the present invention has the following beneficial effects:

[0027] 1. In one example, the target detection model is used to identify UI elements, and the multimodal large language model is input with HyperText Markup Language (HTML) code, so that the multimodal large language model can learn different modal data (including pictures of UI elements and HTML codes), and can more comprehensively understand the layout, functions, content, etc. of the user interface, thereby improving the accuracy of test case generation and generating test cases that are highly adapted to actual UI elements and interaction logic; at the same time, the target detection model can effectively and quickly identify UI elements, and can well adapt to the UI test's need for frequent modifications to the user interface. Combined with the automatic generation of test cases by the large language model, the testing workload is greatly reduced.

[0028] 2. In one example, by screening HTML codes, code segments that better match the required tasks can be effectively extracted, reducing the interference of irrelevant code segments on the results and ensuring the reliability of test case generation.

[0029] 3. In one example, when the convolution block of the present invention performs convolution operation, the size of the convolution kernel can be adaptively changed, so that more abundant sample shape information can be collected, solving the problem that the information of target elements of different shapes in different web page UIs cannot be fully captured, thereby generating a higher quality feature map.

[0030] 4. In one example, the double-layer routing attention mechanism is used to fully integrate feature information, which not only enables the network to pay more attention to important features and areas and has strong generalization ability, but also saves matrix calculation time and memory, achieving the requirements of lightweight attention.

[0031] 5. In one example, the bottleneck block in the C2f module is replaced with an hourglass network to obtain the C2f_HG_Net block. The hierarchical idea of ​​the C2f_HG_Net block is used to extract features. When identifying UI elements, learning can be done at different scales and abstraction levels, improving the processing capability of the hourglass network to handle complex image data, making the target detection model more lightweight and easier to deploy.

[0032] 6. In one example, two auxiliary detection sub-heads are added to the original single or multiple detection sub-heads, which respectively receive the information output by different splicing layers in the neck network (Neck), so as to realize the detection of tiny targets.

[0033] 7. In one example, by verifying the test cases, the test cases that failed the verification were repaired through the large language model. When dealing with complex test scenarios and edge cases, problems can be located and adjusted quickly and accurately, ensuring the continuity and efficiency of the test process. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The specific implementation methods of the present invention are further described in detail below in conjunction with the accompanying drawings. The accompanying drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The same reference numerals are used in these drawings to represent the same or similar parts. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.

[0035] Figure 1 A method flow chart provided for an example of the present invention;

[0036] Figure 2 A YOLOv8 model structure diagram provided for an example of the present invention;

[0037] Figure 3 A convolution block structure diagram provided for an example of the present invention;

[0038] Figure 4 The SPPF module structure diagram provided for an example of the present invention;

[0039] Figure 5 A C2f_HG_Net structure diagram provided for an example of the present invention;

[0040] Figure 6 A method architecture diagram provided for a preferred example of the present invention. DETAILED DESCRIPTION

[0041] The technical solution of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] In the description of the present invention, ordinal numbers (e.g., "first and second", "first to fourth", etc.) are used to distinguish objects, but are not limited to the order, and cannot be understood as indicating or implying relative importance. Unless otherwise clearly specified and limited, "connected" should be understood in a broad sense, for example, it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0043] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0044] In one example, if Figure 1 As shown, a GUI test case generation method comprises the following steps:

[0045] S1: Get the HTML code of the website interface to be tested;

[0046] S2: Use the object detection model to identify UI elements and mark them to obtain marked images;

[0047] S3: Input the marked images, HTML codes, and test requirement tasks into the multimodal large language model, and generate test cases based on the multimodal large language model's ability to analyze and understand the marked images and HTML codes and the current test requirements (the test requirement tasks include test requirement information that can reflect the current UI test).

[0048] Among them, steps S1 and S2 can be executed in reverse order or synchronously. In step S1, the outerHTML (external hypertext markup language code) of the website interface (Web) to be tested is obtained through the written Python script. In step S2, the target detection model can be any one or two or more of the YOLO series models, SSD (Single Shot MultiBox Detector), Faster R-CNN (Region-based Convolutional Neural Networks), etc. When multiple target detection models are used, the output results of the two models or multiple models can be weighted fused to obtain the final target recognition result. The present invention preferably uses the YOLOv8 model to identify UI elements (different image targets on the web page). In step S3, the multimodal large language model is preferably a GPT series model, which can process text, image information, etc., and then realize the classification and recognition of UI elements to identify buttons, text boxes, icons, menu items and other targets in the picture; marking is to draw bounding boxes for buttons, text boxes, icons, menu items and other targets, and optionally, different category labels can be set for different types of targets.

[0049] The present invention utilizes a target detection model to identify UI elements, and combines HTML code input into a multimodal large language model, so that the multimodal large language model can learn data of different modalities (images, HTML codes), and can more comprehensively understand the layout, functions, content, etc. of the user interface, thereby improving the accuracy of test case generation, and generating test cases that are highly adapted to actual UI elements and interaction logic; at the same time, the target detection model can effectively and quickly identify UI elements, and can well adapt to the UI test's requirement for frequent modifications to the user interface. Combined with the automatic generation of test cases by the large language model, compared with manually writing test cases, the testing workload is greatly reduced, and human errors and omissions are reduced, which can significantly improve the overall efficiency and output quality of the test process.

[0050] In one example, after obtaining the hypertext markup language code of the website interface to be tested, the process further includes screening the external hypertext markup language code, including the following sub-steps:

[0051] Pair each DOM (representing an element or structure in an HTML document) element in the HTML code with the required task query and calculate the matching score. Pass the matching score through the activation function, optimize it using the cross entropy loss, and output the predicted matching value. Select the top element with the largest predicted matching value among all elements of the website interface and splice it to obtain the Hypertext Markup Language code segment.

[0052] Specifically, the code model Deberta-v3-base is used to clean and filter the HTML code in combination with the test requirements to achieve preliminary screening. At this time, the model's instructions are entered for: ,in, Indicates prompt; HTML stands for Hypertext Markup Language code; Indicates the test requirement task; at this time, the processing steps of the code model Deberta-v3-base are: code to be filtered > input instruction > code model > filtered code segment. This step scientifically filters and splices the redundant HTML to obtain a refined HTML code segment as one of the inputs of the large language model.

[0053] Further, each DOM element in the HTML is paired with the required task query, and the DOM element is paired with the required task query through the cross-encoder architecture to provide an encoder-only code model, thereby generating a matching score, which is then passed through the activation function and optimized using the binary cross entropy loss. Finally, at inference time, all elements in the web page are scored and selected. (Model output value, i.e. predicted matching value) The largest front Elements are spliced ​​into code segments. Sort the labels for the elements. Specifically, by cosine similarity ( ) Calculate the matching score to evaluate the matching degree between DOM elements and queries. The calculation formula of cosine similarity is:

[0054] ;

[0055] In the formula, and In the present invention, they represent DOM elements and required tasks respectively; and Representation vector and The norm (modulus) of is usually calculated using the Euclidean norm, which is the square root of the sum of the squares of the vector elements.

[0056] Furthermore, the Sigmoid activation function is used The matching score is converted into a probability output, which is calculated as:

[0057] ;

[0058] In the formula, is the value input to the activation function, usually the output of a linear combination. Represents the matching score, which is converted into probability output through calculation; e represents the base of the natural logarithm.

[0059] Furthermore, the cross entropy loss Used to optimize the model, it is a common classification problem loss function, and its calculation formula is:

[0060] ;

[0061] In the formula, represents the sample size; Indicates The true label of the sample, whose value is 0 or 1; , for The model prediction value of the sample ranges from 0 to 1. The final .

[0062] In one example, the target detection model is a YOLOv8 model, including a backbone network (Backone), a neck network (Neck), and a detection head (Head) connected in sequence. The backbone network is used to extract features from the image. The backbone network includes a convolution block, a C2f module, and a spatial pyramid pooling fast (SPPF) module. The C2f module consists of a convolution block, a feature map splitting block, a Bottleneck block, and a final convolution block. The C2f module model can better extract image features while reducing computational complexity. The neck network includes a C2f module, a convolution block, an upsampling layer, and a concatenation layer. The neck network is responsible for the fusion of multi-scale features, and fuses feature maps at different stages of the backbone network to enhance feature representation capabilities. Optionally, the neck network fuses global and local information based on a path aggregation network (PAN) to improve the accuracy of target detection. The detection head is responsible for the final target detection and classification tasks, including three sub-detection heads and one classification head.

[0063] Optionally, the convolution blocks in the backbone network and the neck network of the present invention perform convolution operations based on an adaptive convolution kernel size. Specifically, the convolution blocks (Conv Block) in the backbone network and the neck network in the existing YOLO series models include a Conv2d layer (two-dimensional convolution layer), a two-dimensional batch normalization layer (BatchNorm2d) and a Sigmoid linear activation function. The Conv2d layer completes the convolution operation, slides a small matrix onto the input data, performs element multiplication, and sums the results to generate a feature map. The layer has parameters such as convolution kernel size, stride, padding, and input channels. The convolution kernel size is a pre-set parameter fixed to k*k. On the one hand, this setting causes the operation to be limited to the information contained in the local window involved in the convolution kernel, and the global information cannot be obtained. On the other hand, because the target position and size of the elements on the web page interface UI picture data set are different, the fixed convolution kernel size cannot adapt to the constantly changing target, resulting in low detection accuracy. In view of the problems faced by the fixed convolution kernel size, the present invention proposes a variable convolution kernel size convolution block (Variable Convolutional KernelConv block, VCKConv) to replace the original convolution block. VCKConv includes a two-dimensional convolution layer (Conv2d layer), a resampling layer (resample), a reshape layer (reshape), a two-dimensional batch normalization layer (BatchNorm2d) and a Sigmoid linear activation function connected in sequence. The idea of ​​VCKConv is to use a random coordinate algorithm to determine the initial position of the convolution kernel, and then change the shape and size of the sample (UI) at each different position by the coordinate offset, and then generate a new coordinate position through resampling (Resample) and reshape (Reshape) operations, so that the window can better match the target shape after each movement, and finally generate a better feature map. With the increase of the size of VCKConv, the shapes of the samples sampled by VCKConv will be more diverse, and the generated feature map contains richer feature information. Introducing convolution blocks with variable convolution kernel sizes in the backbone network and the neck network solves the problem that the information of target elements of different shapes in different web page UIs cannot be fully captured, which helps to generate high-quality feature maps. The coordinate offset calculation formula of the above processing process is as follows:

[0064] ;

[0065] In the formula, are the initial coordinates, is a random offset, is the final coordinate; for a two-dimensional image, given coordinates , and its interpolation result is:

[0066] ;

[0067] in, Indicates pixel coordinates; Indicates the given horizontal coordinate; , Respectively represent the horizontal axis The left and right adjacent horizontal coordinates of ; Indicates a given vertical coordinate; , Respectively represent the vertical coordinates The left and right adjacent vertical coordinates of , reshaped into a new dimension and , which can be expressed as:

[0068] ;

[0069] In the formula, represents the reshaped matrix.

[0070] Optionally, a SE-Net (Squeeze-and-Excitation Networks) module is introduced after each two-dimensional convolutional layer in the convolutional block. When processing complex interfaces or diversified UI components, especially small-sized or overlapping UI elements, the YOLOv8 model still has the problem of insufficient recognition accuracy. In order to solve this problem, the present invention introduces a SE-Net module after each two-dimensional convolutional layer, which is equivalent to adding a modulation step for automatically recalibrating the feature channels output by the convolutional layer. At this time, the target detection model not only learns which features are important, but also learns how to improve the accuracy of target recognition by enhancing the response of key features. Specifically, the SE-Net module includes a compression layer, a fully connected layer, and an activation function layer connected in sequence. The compression stage compresses the spatial dimension of the feature map of each channel into a single value through a global average pooling operation, thereby abstracting the global context information. This step effectively aggregates the spatial information of each channel into a descriptor, so that the model can better evaluate the importance of each channel. In the excitation phase, a gating mechanism is constructed through two fully connected layers and a ReLU activation function, which adjusts the activation state of the channel according to the weights learned from the global information of each channel. This allows the model to dynamically adjust the importance of each channel, optimize the information flow and enhance the response to key features. The calculation formula of the compression phase is as follows:

[0071] ;

[0072] In the formula, Indicates Global average output of the channel; and The formula is the height and width of the feature map; It is Channel in position The excitation phase uses a gating mechanism to learn the nonlinearity and dependency in the channel dimension. The calculation formula is as follows:

[0073] ;

[0074] In the formula, Represents the final weighted vector, which is different from the vector obtained after compression The dimensions are the same; Represents the Sigmoid activation function, which is used to form the importance weight of each channel; is the ReLU activation function, used to increase nonlinearity; and is the weight matrix of the two fully connected layers. By introducing the SE-Net module, this example can more accurately locate and identify various UI elements, including small-sized or highly overlapping elements that are difficult to detect in traditional models.

[0075] In one example, when the backbone network performs feature extraction, the double-layer routing attention mechanism is introduced into the convolutional block attention module to form a double-layer routing attention mechanism, and the double-layer routing attention mechanism is used to extract features; optionally, when the neck network performs feature fusion processing, the double-layer routing attention mechanism is introduced into the convolutional block attention module to form a double-layer routing attention mechanism, and the double-layer routing attention mechanism is used to fuse feature information. Specifically, the CBAM (Convolutional Block Attention Module) attention mechanism is generally applied to the backbone network and the neck network. The CBAM attention mechanism includes a channel attention module (CAM) and a spatial attention module (SAM), which are used to reduce parameters and consider global information as much as possible, so that the backbone network or the neck network can pay more attention to important features and regions, thereby improving the performance and interpretability of the model. However, the CBAM attention mechanism does not pay enough attention to content and is not wide enough, which may lead to poor generalization ability of the model and fail to achieve the expectation of fast and accurate recognition. To solve this problem, the present invention introduces a two-layer routing attention mechanism (Bi Level Attention, BLA) into CBAM to form a new attention mechanism BCSAM (BiLevel andChannel Attention Module and Spatial Attention Module). For a query request, BCSAM first filters out irrelevant key-value pairs in a local range, and then applies fine-grained token-to-token attention to calculate the relationship matrix in the union of the routing area. The two-layer routing attention mechanism uses the sparsity of the matrix to save computing time and memory, and only involves medium-sized dense matrix multiplication. In this example, the attention mechanism is set after the SPPF module to fully fuse feature information. Of course, BCSAM can also be set after the upsampling and concatenation (concat) operations in the neck network. BCSAM not only allows the network to pay more attention to important features and areas, but also saves matrix calculation time and memory, meeting the requirements of lightweight attention. The calculation formula of the BCSAM attention mechanism is as follows:

[0076] ;

[0077] ;

[0078] ;

[0079] ;

[0080] ;

[0081] in, A vector representing the channel attention weights; Represents the scaling factor in the channel attention calculation process; , denote the query and key vectors respectively; Represents vector transpose; is the number of channels; A matrix representing spatial attention weights; Represents the scaling factor in the spatial attention calculation process; and Represent the height and width of the feature map respectively; , Corresponding positions The query vector and key vector of Respectively represent the position index in the vertical direction (height) and horizontal direction (width); Represents the feature map weighted by channel attention; Represents element-wise multiplication; is the original feature map; Represents the feature map weighted by spatial attention; Represents the final output feature map after two layers of attention weighting.

[0082] In one example, the C2f module in the backbone network and the neck network can provide enhanced and fused feature maps, so that the target detection model can make full use of multi-level and multi-type information. However, in the UI element scenario of the present invention, elements are often misidentified and the parameters are too redundant. The trained target detection model is too bloated and not lightweight enough in actual use. To solve this problem, in this example, the bottleneck block in the C2f module in the backbone network and the neck network is replaced with the HG_Net network (hourglass network) to obtain the C2f_HG_Net block, and the C2f_HG_Net block is used for feature extraction. The hourglass network includes a stem layer, multiple hierarchical tiles, a learnable downsampling layer, a global average pooling layer, a final convolution and a fully connected layer. The stem layer and the hierarchical tiles are connected in sequence, and a learnable downsampling layer is provided between the hierarchical tiles. The hierarchical tiles and the learnable downsampling layer are all connected to the global average pooling layer, and the global average pooling layer is connected to the final convolution and fully connected layer. Specifically, the Stem layer is the initial preprocessing layer of the hourglass network, which usually contains convolutional layers to start extracting features from the raw input data. The HG (Hierarchical Graph) block is the core component of the network and is used to process data in a hierarchical manner. Each HG block may process a different level of abstraction of the data, allowing the hourglass network to learn from both low-level and high-level features. The LDS (Learnable Downsampling) layer is located between the HG blocks and performs downsampling operations between the HG blocks, reducing the spatial dimensions of the feature map, reducing the computational load and potentially increasing the receptive field of subsequent layers. Before the final classification, a GAP (Global Average Pooling) layer is used to reduce the spatial dimensions of the feature map to each feature. Figure 1 vectors, which helps improve the network's robustness to spatial transformations of the input data. The final convolutional and fully connected layers are used to perform the final classification task. Usually involves a convolutional layer (optionally a 1x1 convolution) to combine features, and then maps the combined features to a fully connected layer with the required number of output categories. This example uses the hierarchical method in the C2f_HG_Net block to extract features. When recognizing UI elements, it can learn at different scales and levels of abstraction, improve the ability of the hourglass network to handle complex image data, and make the object detection model more lightweight and easy to deploy.

[0083] Furthermore, in the existing YOLOv8 model, the detection head includes a first sub-detection head for detecting small targets, a second sub-detection head for detecting medium-sized targets, and a third sub-detection head for detecting large targets. Although the three sub-detection heads can realize multi-scale target detection, there is still a problem that the detection accuracy of small targets is not high enough. In one example, the detection head of the present invention also includes a first sub-detection auxiliary head and a second sub-detection auxiliary head. The first sub-detection auxiliary head and the second sub-detection auxiliary head are respectively connected to the output ends of different concatenation layers (concat) of the neck network, and respectively receive the information output by different concatenation layers in the neck network (Neck), so as to realize the detection of small targets, such as small UI elements, to meet the detection tasks of multiple precision sizes and improve the detection effect.

[0084] In one example, before using the target detection model to identify and mark the user interface elements, the target detection model is trained based on the generalized intersection over union loss using a dataset labeled with the user interface elements. Specifically, in the development of the target detection model, accurate boundary positioning is one of the key factors to ensure high model performance, especially in the website interface UI element detection scenario. Due to the diversity of elements and the complexity of the interface, the traditional intersection over union (IoU) loss function performs poorly when processing blurred images or slightly overlapping bounding boxes, resulting in the model facing the problem of reduced accuracy in practical applications, especially in the detection of elements such as small icons or buttons commonly seen in website interfaces. In order to overcome this technical problem, the present invention first adopts the generalized intersection over union (GIoU) ​​loss function in the model training and evaluation process. The principle of GIoU is further developed on the basis of the traditional IoU loss, which not only considers the intersection over union of the predicted box and the true box, but also introduces a penalty term, which includes the area of ​​the minimum closed area of ​​the predicted box and the true box. This design enables the GIoU loss to effectively handle the situation where the target boundaries do not overlap at all or the overlapping part is extremely small. Specifically, the generalized intersection-over-union (GIoU) ​​calculation expression is:

[0085] ;

[0086] In the formula, Represents the intersection-over-union ratio of the predicted box and the true box; is the area of ​​the smallest enclosing rectangle that contains the predicted box and the true box; is the union area of ​​the predicted box and the true box. The penalty term is based on the degree of spatial separation between the predicted box and the true box, thereby providing more comprehensive gradient information during training and helping to improve the model's performance in boundary positioning.

[0087] After the GIoU loss is introduced in this example, the model shows higher boundary positioning accuracy in the detection of UI elements on the website interface, and also has high positioning accuracy for small-sized or close-to-each UI components, such as buttons, icons, and input boxes. GIoU loss enhances the model's adaptability to complex website interfaces by handling the problem of bounding box positioning in various complex scenarios, allowing it to maintain high accuracy in a changing test environment. In the detection task of UI elements on the website interface, the model using the GIoU loss function shows significant improvements in bounding box accuracy and overlap processing compared to the model using the traditional IoU loss. The GIoU loss significantly improves the model's average precision (AP) and detection efficiency.

[0088] Optionally, the data set needs to be prepared before model training. In the data preparation phase, 3,000 real websites in the real world were accessed through an automatic script to obtain UI screenshots of each web page. The screenshot size was 1920*956. Then, 2,917 pictures were obtained through cleaning, deduplication and other operations. The 2,917 pictures were then annotated using a third-party tool. There were 34 types of annotations required. Subsequently, due to the insufficient number of pictures and low quality, the 2,917 pictures were also subjected to flip, scaling, rotation, mix-up, cutout and other operations. Finally, 14,585 pictures were obtained. Finally, the pictures were divided into three files: Train, Val and Test to prepare for training.

[0089] In one example, in the post-processing stage of the target detection model (after the model completes the forward propagation calculation of the input data and generates the preliminary detection results, the detection results are further processed to optimize the final detection performance of the data processing stage), the soft non-maximum suppression (Soft-NMS) algorithm is used to remove overlapping prediction boxes. Specifically, in the target detection task, especially in the scenario of website interface UI element recognition, due to the dense arrangement and high overlap rate between interface elements, once the traditional non-maximum suppression (NMS) algorithm finds that the overlap of multiple bounding boxes exceeds the preset threshold, only the one with the highest score is retained, and all other overlapping bounding boxes are directly deleted. This process may incorrectly delete the correct bounding box, thereby reducing the accuracy of the detection. In order to solve this problem, the present invention introduces Soft-NMS in the post-processing stage of the model. The algorithm does not directly delete these overlapping bounding boxes, but dynamically adjusts the confidence of other bounding boxes according to the degree of overlap with the highest scoring bounding box. Specifically, if the overlap between two bounding boxes is high, the confidence of the overlapping bounding box will decrease according to a decay function, thereby reducing the probability of mistakenly deleting it. There is a confidence score of Candidate box , which has the highest overlap with the box The generalized intersection ratio of , in the Soft-NMS algorithm The calculation formula is as follows:

[0090] ;

[0091] ;

[0092] In the formula, Indicates The confidence score of the bounding boxes after generalized intersection and union processing; Represents the adjustment factor, which is used to adjust the confidence score; It is a function about GIoU, which is used to reduce the confidence. The function adopts Gaussian weight decay; is a parameter of decay speed. After the present invention introduces Soft-NMS, in the recognition of UI elements on website interfaces, such as recognition scenarios where buttons, icons and links are closely arranged, the use of Soft-NMS can effectively reduce the problem of reduced UI element detection accuracy due to overlapping and erroneous deletion; it also helps the model to more accurately identify and locate targets in complex Web pages by retaining bounding boxes with small errors but overlaps, especially to more effectively identify UI elements in dense and multi-level interface layouts.

[0093] Optionally, multiple examples of the above target detection model are combined. In this case, the YOLOv8 model includes a backbone network, a neck network, and a detection head. The backbone network includes a convolution block with a variable convolution kernel size, a C2f_HG_Net block, and an SPPF module. The neck network includes a C2f_HG_Net block, a convolution block with a variable convolution kernel size, an upsampling layer, and a concatenation layer. The backbone network uses a two-layer routing attention mechanism BCSAM to fuse feature information. The detection head introduces two sub-detection auxiliary heads based on the original three sub-detection heads. Specifically, Figure 2 As shown, the backbone network includes the first convolution block, the second convolution block, the first C2f_HG_Net block (C2f_HG_Net1), the third convolution block, the second C2f_HG_Net block (C2f_HG_Net2), the fourth convolution block, the third C2f_HG_Net block (C2f_HG_Net3), the fifth convolution block, the fourth C2f_HG_Net block (C2f_HG_Net4) and the SPPF module connected in sequence; the neck network includes the first upsampling layer, the first splicing layer, the fifth C2f_HG_Net block (C2f_HG_Net5), the second upsampling layer, the second splicing layer, the sixth C2f_HG_Net block (C2f_HG_Net6), the sixth convolution block, the third splicing layer, the seventh C2f_HG_Net block (C2f_HG_Net7), the seventh convolution block, the fourth concatenation layer and the eighth C2f_HG_Net block (C2f_HG_Net8), the SPPF module is connected to the first upsampling layer through the double-layer routing attention mechanism BCSAM, and the SPPF module is connected to the fourth concatenation layer through the double-layer routing attention mechanism BCSAM; C2f_HG_Net2 is connected to the second concatenation layer, C2f_HG_Net3 is connected to the first concatenation layer, C2f_HG_Net6 is connected to the first sub-detection head, C2f_HG_Net7 is connected to the second sub-detection head, C2f_HG_Net8 is connected to the third sub-detection head, the second concatenation layer is connected to the first sub-detection auxiliary head, and the first concatenation layer is connected to the second sub-detection auxiliary head. Among them, if Figure 3 As shown in , the convolution blocks in the backbone network and the neck network include a two-dimensional convolution layer, a resampling layer, a reshaping layer, a two-dimensional batch normalization layer, and a Sigmoid linear activation function layer connected in sequence. Figure 4 As shown in , the SPPF module includes the first convolution block, three two-dimensional maximum pooling layers, a concatenation layer, and the last convolution block connected in sequence, and the outputs of the first convolution block, the three two-dimensional maximum pooling layers, and the concatenation layer are all used as the input of the last convolution block. Figure 5As shown, C2f_HG_Net includes the first convolution block, the feature map splitting block, three HG_Nets, the splicing layer, and the last convolution block connected in sequence, and the first HG_Net, the second HG_Net, and the feature map splitting block are all connected to the splicing layer.

[0094] On the basis of completing the construction of the YOLOv8 model, the target detection model is trained based on the generalized intersection-over-union loss using a dataset with labeled user interface elements, and the Soft-NMS algorithm is introduced in the post-processing stage of the model to improve the model detection performance. The YOLOv8 model built and trained by the above method solves the problem that the website interface UI images are complex and too many to be trained, and the trained model is too bloated and inconvenient to deploy in practical applications. During the training process, the model pays full attention to the feature extraction and fusion of global information, and then quickly, accurately and efficiently identifies the UI elements that appear in the image, providing a good foundation for generating high-quality test cases.

[0095] Optionally, after training the YOLOv8 model, introduce indicators such as precision, recall, average precision (AP) and mean average precision (mAP) to evaluate the model performance. Specifically, precision is the proportion of samples predicted to be positive by the measurement model that are actually positive, and its calculation formula is:

[0096] ;

[0097] In the formula, TP (True Positives) represents the number of correctly predicted positive samples; FP (False Positives) represents the number of negative samples that are incorrectly predicted as positive. Recall is the ratio of positive samples detected by the measurement model to all actual positive samples. The calculation formula is:

[0098] ;

[0099] In the formula, FN (False Negatives) represents the number of actual positive samples that are not detected. Average precision (AP) is the average precision calculated at different recall levels. The calculation of AP involves integrating the area under the precision-recall curve, which can be approximated by numerical integration methods such as the trapezoidal rule. Mean average precision (mAP) is the AP averaged over multiple categories. It is a key indicator for measuring the overall performance of the model. The level of mAP can reflect the model's ability to handle multi-class target detection tasks. The calculation formula can be expressed as:

[0100] ;

[0101] In the formula, is the total number of categories; It is AP of the category. High precision means that a high proportion of the results predicted by the model as positive are actually positive, which is very important in avoiding false positives; high recall means that the model can capture most of the true positive samples, which is critical in ensuring that no important targets are missed; AP indicates that the model can maintain a good balance between precision and recall at different operating points; high mAP indicates that the model can show good recognition accuracy and completeness in all categories, so as to perform stably in different scenes and objects. Evaluating the performance of the model can ensure that a high-precision object detection model is obtained, through which the UI elements of unknown web interfaces can be detected and labeled, and the labeled images can be saved as input to the large language model.

[0102] In one example, before the labeled image is input into the multimodal large language model, the following steps are also included:

[0103] Convert the marked image into binary data, convert the binary data into Base64 encoding, and use Base64 encoding to replace the marked image and input it into the large language model. Base64 is a method of representing arbitrary binary data with 64 characters. Specifically, the calculation formula for converting binary data into Base64 encoding is:

[0104] ;

[0105] in, Represents Base64 characters; Represents a binary value; Indicates the index position of the currently processed binary bit in the overall data; Used to determine the displacement of each group of binary numbers in the overall binary data stream; represents the modulo operation, Used to convert binary to an integer between 0 and 63. At this point, based on the HTML code of the web interface to be tested and the marked web interface screenshots (marked pictures), it is preferred to combine the required tasks ( ) and tips for large language models ( ), and use the above four elements as the input of the large language model ( ): The input is in JSON format and is used to communicate with the large language model through the API call mode. It indicates the format of the expected large language model output content. The large language model output ( )for: , It represents a batch of HTML code snippets that match the required tasks. The code snippets must contain (unique identifier), (Type of data structure), (element category), (placeholder), (XML path language), through which the large language model also returns the second part of the information: Python code based on Selenium (automated testing tool for Web applications). Further, PythonCode represents code written in the programming language Python. By integrating multiple data types (such as images, HTML codes, task descriptions) into a single multimodal large language model, the flexibility and efficiency of data processing are significantly improved, so that the large language model can more comprehensively understand and analyze complex Web interfaces, thereby generating more accurate and relevant test cases. For example, converting PNG images into Base64 format and combining them with HTML code enables the model to parse visual and structural information at the same time, thereby generating more accurate test actions. At the same time, the present invention also constructs the input and output instructions and output format of the multimodal large language model, so that the test method can not only adapt to the standard Web interface test requirements, but also cope with a variety of complex and non-standard test environments, thereby enhancing adaptability and stability, so that the method of the present invention is widely used in different test scenarios, and continuously provides stable and reliable test support.

[0106] Optionally, the generated test cases can also be evaluated, specifically from the aspects of task pass rate, widget coverage, number of questions, screen coverage, test efficiency, etc. Specifically, the Task Pass Rate (TPR) refers to the proportion of tasks correctly completed by the test case to all tasks, reflecting whether the functional implementation of the website (software) to be tested meets expectations. It is a direct criterion for measuring the success of the test. The calculation formula is as follows:

[0107] ;

[0108] in, Indicates the number of test cases that completed successfully; Represents the total number of test cases. Widget Coverage (WC) measures the proportion of GUI components covered in the test, with the goal of ensuring that all important interface elements are verified, thereby reducing the risk of missing defects. The calculation formula is as follows:

[0109] ;

[0110] in, Indicates the number of GUI widgets tested; Indicates the total number of GUI widgets. The number of problems is a statistical count of the problems or defects found during the test process. It is used to evaluate the current quality of the software and help determine whether further testing or improvement is needed. Screen Coverage (SC) is the ratio of different screens or views covered in the test. The purpose is to ensure that all interfaces of the application are tested and reduce problems caused by interface errors. The calculation formula is as follows:

[0111] ;

[0112] in, Indicates the number of screens tested; Indicates the total number of screens. Test efficiency focuses on the ability to complete test tasks within limited time and resources, with an emphasis on evaluating the time efficiency of the test process.

[0113] The above evaluation indicators can be used to understand the technical advantages of the test cases generated by the present invention compared with those generated by other methods. The present invention automatically captures necessary elements such as ID, Type, etc. from the website interface through a script, and generates corresponding test cases based on this information combined with the target detection model and the large language model, which greatly speeds up the test preparation and reduces errors caused by manual coding.

[0114] After generating a test case in an example, the test case is also verified:

[0115] Run the generated test cases to confirm whether there are any errors during the running process. If there are no errors, the test passes; otherwise, the error information, the test cases that have not passed the verification, and the required tasks are input into the large language model. At this time, the input of the large language model is: , which enables the large language model to continue to fix errors and output new test cases , until the generated test case passes the verification. Wherein, Error represents error information. This method integrates a real-time feedback and repair mechanism in the test execution. When an error occurs in the test case execution or fails to meet expectations, the system can automatically collect error information and readjust the model input, requesting the model to dynamically generate a corrected test case based on the specific error. By continuously monitoring and analyzing the test results (such as task pass rate, widget coverage and other indicators), the present invention can continuously optimize the test strategy and use cases. For example, if it is found that the test coverage of a certain interface element is insufficient, the system can automatically adjust the test case to ensure that all key GUI components are fully tested.

[0116] In one example, the above examples are combined to obtain a preferred example of the present invention, such as Figure 6 As shown, at this time, the method of the present invention comprises the following steps:

[0117] S1': Obtain the HTML code of the website interface to be tested, and clean and filter the HTML code;

[0118] S2': Build a YOLOv8 model, including a backbone network, a neck network, and a detection head; the backbone network includes a convolution block with a variable convolution kernel size, a C2f_HG_Net block, and an SPPF module; the neck network includes a C2f_HG_Net block, a convolution block with a variable convolution kernel size, an upsampling layer, and a concatenation layer, and uses a two-layer routing attention mechanism to fuse feature information; the detection head introduces two sub-detection auxiliary heads on the basis of the original three sub-detection heads; the target detection model is trained using a dataset with labeled user interface elements and based on the generalized intersection-over-union loss, and the Soft-NMS algorithm is introduced in the post-processing stage of the model; the trained target detection model is used to identify and mark user interface elements to obtain marked images;

[0119] S3': Input the marked images, HTML codes, test requirements, tasks, prompts, and output content formats into the multimodal large language model to generate test cases;

[0120] S4': Run the generated test cases to confirm whether there are any errors during the running process. If there are no errors, the test passes; otherwise, the error information, the test cases that have not passed the verification, and the required tasks are input into the large language model to generate new test cases, and then the new test cases are verified until they pass the verification.

[0121] The present invention utilizes the text analysis, image understanding and code generation capabilities of a multimodal large language model to improve the efficiency of GUI testing and the pass rate of test cases. Specifically, HTML code processed by a code model and images marked by a target detection model are used as main inputs, supplemented by the constructed large language model instructions and test requirement tasks input into the large language model, the large language model generates Selenium-based test cases, and finally the test cases are verified and repaired to complete the automated testing process. The above automated testing process omits the process of manually writing test cases and manually clicking on various UI elements, thereby improving the efficiency and intelligence of the test, and the final verification and repair process ensures the high accuracy of the test.

[0122] An example of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the GUI test case generation method formed by any one of the above examples or a combination of multiple examples. The processor may be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.

[0123] An example of the present invention also provides a storage medium, which has the same inventive concept as a GUI test case generation method formed by any one of the above examples or a combination of multiple examples, and stores computer instructions thereon, which, when executed, execute the steps of the GUI test case generation method formed by any one of the above examples or a combination of multiple examples.

[0124] Based on this understanding, the technical solution of this embodiment, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0125] An example of the present invention further provides a terminal, which has the same inventive concept as any example or a combination of multiple examples corresponding to the above-mentioned GUI test case generation method, including a memory and a processor, wherein the memory stores computer instructions that can be run on the processor, and the processor executes the steps of the above-mentioned GUI test case generation method when running the computer instructions. The processor can be a single-core or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the present invention.

[0126] In one example, the terminal, i.e., the electronic device, is presented in the form of a general-purpose computing device, and the components of the electronic device may include but are not limited to: at least one processing unit (processor) mentioned above, at least one storage unit mentioned above, and a bus connecting different system components (including storage units and processing units).

[0127] The storage unit stores a program code, and the program code can be executed by the processing unit, so that the processing unit performs the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of this specification. For example, the processing unit can perform the above-mentioned GUI test case generation method.

[0128] The storage unit may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 3201 and / or a cache memory unit, and may further include a read-only memory unit (ROM).

[0129] The storage unit may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0130] The bus may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0131] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0132] Through the above description, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to this exemplary embodiment can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method of the exemplary embodiment of the present application.

[0133] The above specific implementation methods are detailed descriptions of the present invention. It cannot be determined that the specific implementation methods of the present invention are limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions and substitutions can be made without departing from the concept of the present invention, which should be regarded as belonging to the protection scope of the present invention.

Claims

1. A GUI test case generation method, characterized in that: The following steps are involved: Get the HTML code of the website interface to be tested: Screening and processing the hypertext markup language code includes the following sub-steps: Pair each element in the HTML code with the required task query and calculate the matching score. Pass the matching score through the activation function, optimize it with the cross entropy loss and output the predicted matching value. Select the top element with the largest predicted matching value among all elements in the website interface and splice it to get the HTML code segment. Use the object detection model to identify and mark the user interface elements to obtain the marked images; The labeled images, HTML codes, and test requirement tasks are input into the multimodal large language model to generate test cases.

2. The GUI test case generation method according to claim 1, characterized in that: The target detection model is a YOLO model, which includes a backbone network, a neck network and a detection head connected in sequence; when the convolution blocks in the backbone network and the neck network perform convolution operations, the following sub-steps are performed: A random coordinate algorithm is used to determine the initial position of the convolution kernel. The shape and size of the user interface at each different position are changed by the coordinate offset. Then, new coordinate positions are generated through resampling and reshaping operations, and finally a feature map is generated.

3. The GUI test case generation method according to claim 2, characterized in that: When the backbone network performs feature extraction, the double-layer routing attention mechanism is introduced into the convolution block attention module to form a double-layer routing attention mechanism, and the double-layer routing attention mechanism is used to extract features; when the neck network performs feature fusion processing, the double-layer routing attention mechanism is introduced into the convolution block attention module to form a double-layer routing attention mechanism, and the double-layer routing attention mechanism is used to fuse feature information.

4. The GUI test case generation method according to claim 2, characterized in that: The backbone network and the neck network both include a C2f module, and the bottleneck blocks of the C2f modules in the backbone network and the neck network are replaced with an hourglass network; the hourglass network includes a stem layer, a hierarchical tile, a learnable downsampling layer, a global average pooling layer, a final convolution and a fully connected layer, and the hourglass network is used for feature extraction; the stem layer and the hierarchical tile are connected in sequence, a learnable downsampling layer is provided between the hierarchical tiles, the hierarchical tiles and the learnable downsampling layer are both connected to the global average pooling layer, and the global average pooling layer is connected to the final convolution and the fully connected layer.

5. The GUI test case generation method according to claim 2, characterized in that: The detection head also includes a first sub-detection auxiliary head and a second sub-detection auxiliary head. The first sub-detection auxiliary head and the second sub-detection auxiliary head are respectively connected to output ends of different splicing layers in the neck network.

6. The GUI test case generation method according to claim 1, characterized in that: Before feeding the labeled image into the multimodal large language model, it also includes: Convert the marked image into binary data, convert the binary data into Base64 encoding, and use Base64 encoding to replace the marked image and input it into the large language model.

7. The GUI test case generation method according to claim 1, characterized in that: After the test cases are generated, the following steps are also required to verify the test cases: Run the generated test cases to confirm whether there are any errors during the running process. If there are no errors, the test passes; otherwise, the error information, the test cases that have not passed the verification, and the required tasks are input into the large language model to generate new test cases, and then the new test cases are verified until they pass the verification.

8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the GUI test case generation method according to any one of claims 1 to 7 are implemented.

9. A terminal comprising a memory and a processor, wherein the memory stores computer instructions that can be executed on the processor, characterized in that: When the processor runs the computer instructions, the steps of the GUI test case generation method according to any one of claims 1 to 7 are performed.

Citation Information

Cited By

  • Icon and text positioning method based on multi-modal large model

    CN121561451A