Interface testing method and device, equipment and storage medium
Through an automated interface testing method, the user interface is tested using the test analysis model and a detailed test report is generated, which solves the problem of strong subjectivity of manual tests and is prone to missed interface abnormalities, and improves the testing efficiency and intelligence level.
Patent Information
- Application Number
- CN202411910805.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-22
AI Technical Summary
Existing user interface testing mainly relies on manual testing, which has the problem of strong subjectivity and easy to miss interface abnormalities.
Provides an interface testing method, by obtaining test tasks in the test request, performing test steps, generating test paths and prompt words, inputting test analysis models, and generating test reports, including functional use case evaluation results, element status check results, visual effect defects and optimization solutions.
It improves the efficiency and intelligence of interface testing, can detect interface abnormalities more efficiently and accurately, and provide optimization solutions to improve user experience.
Smart Images

Figure CN119862121A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to artificial intelligence and software testing technology, and in particular to an interface testing method, device, equipment and storage medium. Background Art
[0002] User interface (UI) refers to the overall design of the human-computer interaction, operation logic, and interface aesthetics of an application. Users can interact with computer devices through the UI, input commands through the UI, and receive feedback from the UI output. Therefore, the rationality of the UI design determines the human-computer interaction efficiency and user experience. Designers need to test the visual effects and correctness of the interaction logic of the UI before it is put into use.
[0003] Currently, user interface testing mainly relies on manual testing. Testers manually operate the test process and observe the test interface to discover and record the interaction problems and interface design problems in the test interface.
[0004] However, manual testing is highly subjective, greatly influenced by the tester's subjective judgment, and easily misses abnormal problems in the interface. Summary of the invention
[0005] The embodiments of the present disclosure provide an interface testing method, device, equipment and storage medium, which can improve the efficiency and intelligence level of interface testing.
[0006] One aspect of an embodiment of the present disclosure provides an interface testing method, including:
[0007] In response to receiving a test request, obtaining a test task in the test request, wherein the test task includes testing at least one of the execution of a functional case in the program to be tested and the status of a program interface element;
[0008] Execute test steps on the program to be tested based on the test task to obtain a test path, wherein the test path includes the test steps and an interface image of a program interface corresponding to each test step;
[0009] Inputting the prompt words corresponding to the test path and the test task into a test analysis model, generating a test report through the test analysis model, wherein the prompt words include task description information of the test task, and the test report includes at least one of the following: evaluation results of functional use cases corresponding to the test content, element status inspection results of the program interface, visual effect defects of the program interface, and optimization solutions of the program interface;
[0010] Among them, the test analysis model is obtained by knowledge enhancement based on interface testing knowledge and training based on sample data, the interface testing knowledge includes at least one of the assertion knowledge in the assertion knowledge base and the business knowledge in the business knowledge base, the assertion knowledge includes test point description information of at least one application, and the business knowledge includes standard interface description information of at least one application.
[0011] Optionally, the step of inputting the prompt words corresponding to the test path and the test task into a test analysis model, and generating a test report through the test analysis model includes:
[0012] Inputting input data into the test analysis model, wherein the input data includes the test path and the prompt word;
[0013] The test analysis model is used to extract features of the input data to obtain a feature vector, and the feature vector is decoded to generate a time step sequence corresponding to the test analysis data, wherein the test analysis data includes at least one of the following: the functional use case evaluation result, the element status inspection result, the visual effect defects and the optimization plan; the time step sequence is classified and mapped into the test analysis data in a preset form; and the test report is generated and output based on the test analysis data.
[0014] Optionally, executing test steps on the program to be tested based on the test task to obtain a test path includes:
[0015] Execute a preset number of test steps on the program to be tested based on the test task to generate a preset number of test paths;
[0016] The step of inputting the prompt words corresponding to the test path and the test task into a test analysis model and generating a test report through the test analysis model includes:
[0017] The preset number of test paths and the prompt words are input into the test analysis model, and the test report is generated by the test analysis model, wherein the functional use case evaluation results in the test report include the execution accuracy corresponding to each test step, and the execution accuracy is calculated based on the number of test paths with normal execution results of the test step and the preset number, and is used to characterize the probability of correct execution results of the test step.
[0018] Optionally, the method further includes:
[0019] The assertion knowledge base is constructed based on the assertion knowledge entered by the assertion knowledge entry operation, and the business knowledge base is constructed based on the business knowledge entered by the business knowledge entry operation, wherein the assertion knowledge includes at least one of a test object, a test task, an expected result, and an abnormal result corresponding to a test point, and the business knowledge includes at least one of an element visual effect, an element function, and an element image corresponding to an interface element;
[0020] Acquire the sample data, wherein the sample data includes a sample test path and a sample prompt word corresponding to the sample test task;
[0021] The test analysis model is trained using the assertion knowledge base, the business knowledge base, and the sample data.
[0022] Optionally, the using the assertion knowledge base, the business knowledge base, and the sample data to train the test analysis model includes:
[0023] Performing multimodal data integration on the assertion knowledge base and the business knowledge base to obtain a multimodal data set, wherein the multimodal data set stores assertion knowledge and business knowledge corresponding to at least one application program in an associated manner;
[0024] Inputting the multimodal data set into the test analysis model for knowledge enhancement;
[0025] The sample data is used to optimize the parameters of the test analysis model after model fine-tuning.
[0026] Optionally, the using the sample data to optimize parameters of the test analysis model after model fine-tuning includes:
[0027] Inputting the sample data into the test analysis model to obtain the sample prediction result output by the test analysis model;
[0028] Calculating a model loss value of the test analysis model based on the sample prediction result and a sample label corresponding to the sample data, wherein the sample label is used to characterize a standard analysis result of the sample data;
[0029] Utilizing the optimizer of the test analysis model, the model parameters of the test analysis model are adjusted based on the model loss value until the test analysis model meets the preset training conditions.
[0030] Optionally, the sample label includes at least one of an element status label, a function use case execution result label, an execution accuracy of the sample test path, and an interface optimization suggestion label;
[0031] Among them, the element status label is used to indicate abnormal elements of the sample program interface in the sample test path, the functional use case execution result label is used to indicate whether the functional use case execution result of the sample test path is correct, the execution accuracy label is used to indicate the probability that the execution results of each sample test step in the sample test path are normal, and the interface optimization suggestion label is used to indicate the visual effect defects and optimization solutions of the sample program interface.
[0032] Another aspect of the embodiments of the present disclosure provides an interface testing device, comprising:
[0033] An acquisition module, configured to acquire a test task in the test request in response to receiving the test request, wherein the test task includes at least one of the execution status of a functional case in the program to be tested and the status of a program interface element;
[0034] A test module, configured to execute test steps on the program to be tested based on the test task to obtain a test path, wherein the test path includes the test steps and an interface image of a program interface corresponding to each test step;
[0035] A generation module, used for inputting the prompt words corresponding to the test path and the test task into a test analysis model, and generating a test report through the test analysis model, wherein the test report includes at least one of the following: a function use case evaluation result corresponding to the test content, an element status check result of the program interface, a visual effect defect of the program interface, and an optimization plan of the program interface;
[0036] Among them, the test analysis model is obtained by knowledge enhancement based on interface testing knowledge and training based on sample data, the interface testing knowledge includes at least one of the assertion knowledge in the assertion knowledge base and the business knowledge in the business knowledge base, the assertion knowledge includes test point description information of at least one application, and the business knowledge includes standard interface description information of at least one application.
[0037] Another aspect of the present disclosure provides an electronic device, including:
[0038] Memory for storing computer programs;
[0039] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method described in the above aspects is implemented.
[0040] Another aspect of the embodiments of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in the above aspects is implemented.
[0041] Another aspect of the embodiments of the present disclosure provides a computer program, including computer program instructions, which implement the methods described in the above aspects when executed by a processor.
[0042] Based on the embodiment of the present disclosure, after receiving a test request, the test steps are executed based on the test task in the test request, a test path and prompt words are generated, the test path and prompt words are input into the test analysis model, the test path is analyzed using the test analysis model obtained by knowledge enhancement based on the assertion knowledge base and the business knowledge base and training based on sample data, and a test report including at least one of the function use case evaluation result, the element status inspection result of the program interface, the visual effect defects of the program interface and the optimization scheme of the program interface is generated. While executing the specified UI test task to obtain the test result, the interface test knowledge learned through knowledge enhancement can also be used to automatically identify the element status test points and element status tests of the interface image corresponding to the test step, identify other abnormal situations of the program interface involved in the test process, actively discover hidden visual effect defects for dynamically changing user interfaces, and provide optimization schemes for the defects in the program interface, which greatly improves the efficiency and intelligence level of interface testing, makes the test more efficient and accurate, and helps to optimize the user experience of the application.
[0043] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0045] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0046] Figure 1 A flowchart of an embodiment of the interface testing method disclosed herein;
[0047] Figure 2 A flowchart of another embodiment of the interface testing method disclosed herein;
[0048] Figure 3 A flowchart of another embodiment of the interface testing method disclosed herein;
[0049] Figure 4 A schematic diagram of an assertion knowledge base provided for an exemplary embodiment of the present disclosure;
[0050] Figure 5 A schematic diagram of a business knowledge base provided for an exemplary embodiment of the present disclosure;
[0051] Figure 6A flowchart of a training process provided for an exemplary embodiment of the present disclosure;
[0052] Figure 7 It is a structural block diagram of an embodiment of the interface testing device disclosed in the present invention;
[0053] Figure 8 It is a structural block diagram of another embodiment of the interface testing device disclosed in the present invention;
[0054] Fig. 9 The figure is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. DETAILED DESCRIPTION
[0055] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0056] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0057] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0058] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0059] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0060] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0061] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0062] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0063] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0064] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0065] Figure 1 A flowchart of an interface testing method provided by an exemplary embodiment of the present disclosure is shown. The interface testing method of the embodiment of the present disclosure can be implemented by an electronic device deployed with a test analysis model. The method includes the following steps:
[0066] Step 101, in response to receiving a test request, obtaining a test task in the test request, the test task including at least one of the execution status of a functional case in the program to be tested and the status of a program interface element.
[0067] The execution status of functional use cases refers to whether the UI interactive functions in the program to be tested can be completed normally, such as whether triggering the "My Collection" control can successfully jump to the corresponding content collection interface; the status of program interface elements refers to whether the display status of UI elements in the program interface complies with the specifications, such as whether the house pictures displayed on the interface are pictures in the preset format and whether the control icons in the interface are displayed in the correct position.
[0068] In a possible implementation, the tester may design a test task according to the business requirements of the program to be tested. Optionally, the test task may specifically include information such as the location of the test point and the expected result.
[0069] Illustratively, a UI card is added to the new home page interface of a house rental and sales application, and UI testing needs to be performed on the card. The test tasks may include "new home page, the third card in the list, determine whether the display title format is 'x place home buying group' and the circular avatar stacking style, and determine whether the guiding copy is a question related to house consultation."
[0070] Step 102: Execute test steps on the program to be tested based on the test task to obtain a test path.
[0071] The test path includes the executed test steps and the interface image of the program interface corresponding to each test step.
[0072] In a possible implementation, the test steps may be first determined based on the test task, the test steps may be executed in sequence, and screenshots of the program interface before and / or after the test steps are executed may be saved.
[0073] Indicatively, for the test task "New house homepage, the third card in the list, determine whether the display title format is 'x place home buying group' and the circular avatar stacking style, and determine whether the guide copy is a question related to house source consultation", it can be divided into 4 test steps: the first step is to enter the new house homepage; the second step is to slide down the interface to find the third card in the list; the third step is to check whether the display title format of the third card is "x place home buying group" and the circular avatar stacking style; the fourth step is to check whether the guide copy of the third card is a question related to house source consultation. After each step is executed, the program interface can be captured to obtain the interface image corresponding to the step.
[0074] Step 103: input the test path and the prompt words corresponding to the test task into the test analysis model, and generate a test report through the test analysis model.
[0075] Among them, the prompt words include task description information of the test task, and the test report includes at least one of the following information: functional use case evaluation results corresponding to the test content, element status inspection results of the program interface, visual effect defects of the program interface, and optimization solutions for the program interface.
[0076] Among them, the test analysis model is obtained by knowledge enhancement based on interface test knowledge and training based on sample data, and the interface test knowledge includes at least one of the assertion knowledge in the assertion knowledge base and the business knowledge in the business knowledge base. The assertion knowledge in the assertion knowledge base includes test point description information of at least one application, and the test point description information can be classified and stored according to the application. Specifically, the test point description information corresponding to different business lines can be divided under the same application, and the assertion knowledge index can be built based on the application and the business line, and the test point description information corresponding to the same business line under the same application is centrally stored; the business knowledge in the business knowledge base includes standard interface description information of at least one application, and the standard interface description information can be classified and stored according to the application. Specifically, the standard interface description information corresponding to different business lines can be divided under the same application, and the standard interface index can be built based on the application and the business line, and the standard interface description information corresponding to the same business line under the same application is centrally stored.
[0077] Optionally, the test analysis model can use a large language model, such as a bidirectional encoder model (Bidirectional Encoder Representations from Transformers, BERT), a generative pre-trained model (Generative Pre-trained Transformer, GPT), etc. This type of model can understand the semantics of input data such as prompt words and test paths, and after knowledge enhancement based on the assertion knowledge base, business knowledge base, and model fine-tuning based on sample data, it has the ability to identify UI anomalies and generate optimization solutions for various abnormal situations. The assertion knowledge in the assertion knowledge base can help the test analysis model learn the interface content that needs to be tested in various applications, and the business knowledge in the business knowledge base can help the test analysis model learn the design specifications of the program interface of various applications. The model can learn to perform various tests on the program interface of the program to be tested based on the assertion knowledge base and the business knowledge base and provide optimization solutions.
[0078] Prompt refers to the guiding text provided to the language model, which is used to guide the language model to generate corresponding output. Prompt can be used as a prompt or guide to help the model understand the needs and intentions of the user and enable the model to generate relevant responses. The prompt in the embodiment of the present disclosure includes the task description information of the test task, such as but not limited to the test type, test object, content that needs to be provided in the test report, etc., which can help the model understand the interface test requirements, so that the model pays attention to the specific information in the test path according to the guidance of the prompt, identifies the test object from the interface image corresponding to each test step, and analyzes whether there is an abnormality in the test object through the interface image based on the test type and the interface test knowledge learned through knowledge enhancement, so as to obtain the test results required by the user. Optionally, the prompt can be continuously enriched and optimized based on various types of UI test tasks, so that the model can actively identify other problems hidden in each program interface while performing test analysis based on the current test content.
[0079] Based on the embodiment of the present disclosure, after receiving a test request, a test operation is performed based on the test task in the test request, a test path and prompt words are generated, the test path and prompt words are input into a test analysis model, and the test path is analyzed using a test analysis model obtained by knowledge enhancement based on an assertion knowledge base and a business knowledge base and training based on sample data, and a test report including at least one of a functional use case evaluation result, an element status inspection result of a program interface, a visual effect defect of a program interface, and an optimization plan for the program interface is generated. While executing a specified user interface test task to obtain a test result, the interface test knowledge learned through knowledge enhancement can also be used to automatically identify element status test points and element status tests on interface images corresponding to the test steps, identify other abnormal situations of the program interface involved in the test process, actively discover hidden visual effect defects for a dynamically changing user interface, and provide optimization plans for defects in the program interface, greatly improving the efficiency and intelligence level of interface testing, making testing more efficient and accurate, and helping to optimize the user experience of the application.
[0080] Illustratively, the above prompt words may include but are not limited to information such as test type, test object, content that needs to be provided in the test report, etc. An example of a prompt word provided in the embodiment of the present disclosure is as follows:
[0081] "Your assessment assertion tasks are as follows:
[0082] a. Based on the two interface images before and after the test step and the relevant information of the test step, and based on the professional knowledge related to the evaluation assertion provided to you, determine whether the two interface images have problems in [Historical UI Error], [UI Abnormal Check], and [Operation Interaction Check]. If there is an abnormality or error, please describe it in detail and output the abnormal information; if there is no problem, please return to "No UI abnormality";
[0083] b. Analyze the expected test points of the current test task, which are generally the description of the program interface in the current task, such as: normal operation jump, normal display of XXX page, entering XXX page, etc.;
[0084] c. Based on the relevant information of the current test step and the changes in the two interface images before and after, please determine whether the test step has been completed effectively;
[0085] d. If there is no expected test point in the test task, the test task needs to be analyzed to find the expected test point;
[0086] e. Perform completion analysis of the overall expected test points of the test task: Based on the interface images after the test steps, check whether the overall expected test points of the test task have been achieved. If not, please provide reasons;
[0087] f. Visual design evaluation:
[0088] 1) Evaluate the visual design of the interface, check whether the color matching, font selection, layout balance, etc. conform to the design principles, check for hidden visual defects in the interface, and give suggestions for optimizing the interface design;
[0089] 2) Predict user preferences and reactions to different design elements, check for hidden visual defects in the interface, and provide feedback on interaction design.
[0090] In a possible implementation, the main structure of the test analysis model may include an input layer, an encoder, a decoder, and an output layer. Figure 1 For the examples shown, please refer to Figure 2 , the above step 103 may specifically include the following steps:
[0091] Step 103a: inputting input data into the test analysis model, wherein the input data includes a test path and prompt words.
[0092] Optionally, the input layer of the test analysis model can receive and process input data, perform multimodal data integration on the interactive data (test steps), visual data (interface images), and text data of prompt words contained in the test path, and input the data into the test analysis model.
[0093] Step 103b, using the test analysis model to extract features from the input data to obtain feature vectors, and decoding the feature vectors to generate a time step sequence corresponding to the test analysis data; classifying the time step sequence and mapping the time step sequence into a preset form of test analysis data; generating and outputting a test report based on the test analysis data.
[0094] Among them, the test analysis data includes at least one of the following: functional use case evaluation results corresponding to the above test content, element status inspection results, visual effect defects of the program interface, and optimization solutions for the program interface.
[0095] The encoder can convert the input data into a high-dimensional vector representation and capture context information to generate a feature vector. The decoder is responsible for converting the feature vector generated by the encoder into output data in a preset form, such as a time step sequence. The time step sequence in the embodiment of the present disclosure can be used to describe the time sequence of different events or behaviors, including the intermediate values of the output data corresponding to a series of test steps.
[0096] The output layer can further process the intermediate output (i.e., the time step sequence) generated by the decoder, map it to a specific output form, and generate the final prediction or classification result, i.e., the test analysis data. The test analysis data can include category labels (such as labels "test step a result is normal", "test step b result is abnormal", etc.) and / or predicted values (such as "the display position of the target UI element is offset to the left by 0.2 cm").
[0097] Optionally, at least one test report template may be pre-stored, and based on the test analysis data output by the test analysis model and the test report template, each test analysis data is filled into a corresponding text filling position of the test report template to generate a test report.
[0098] In a possible implementation, after receiving a test request, multiple tests may be performed on the test task therein to obtain multiple test results, and a test report may be generated based on the multiple test results, thereby improving the credibility of the test report. The above step 102 may include the following steps:
[0099] Based on the test task, a preset number of test steps are executed on the program to be tested for a preset number of times, and a preset number of test paths are generated.
[0100] Accordingly, the above step 103 may include the following steps:
[0101] A preset number of test paths and prompt words are input into the test analysis model, and a test report is generated by the test analysis model. The functional use case evaluation results in the test report include the execution accuracy corresponding to each test step, which is calculated based on the number of test paths with normal test step execution results and the preset number, and is used to characterize the probability of the test step execution result being correct.
[0102] Optionally, execution accuracy = number of test paths with normal test step execution results / preset number.
[0103] Indicatively, for the test task of "new house homepage, the third card in the list, determine whether the display title format is 'x place home buying group' and the circular avatar stacking style, and determine whether the guiding copy is a question related to house source consultation", the generated test report is as follows:
[0104] {"UI exception": "There is an exception",
[0105] "Abnormal details": "The title format of the third card does not meet expectations. The title is 'A Community' instead of 'X Land Home Buying Group'. In addition, the stacking style of the circular avatars cannot be confirmed. The guidance copy cannot confirm whether it is a question related to house consultation."
[0106] “Visual design evaluation”: “The overall interface design is relatively clear, but there are some problems. The color matching and font selection basically meet the design principles, but there are inconsistencies in the layout. For example, the card title format is not uniform, which affects the user experience. It is recommended to unify the card title format to ensure that the title format of all cards is consistent. In addition, the design of the circular avatar stacking style and the guide copy needs further confirmation and optimization.”
[0107] "Hidden issues": "1. The card title format is not uniform, which affects the user experience. 2. The circular avatar stacking style has not been confirmed, which may be a design flaw. 3. The guidance copy fails to confirm whether it is a question related to property consultation, which may affect the user's understanding and operation."
[0108] “Task completion status”: “Task not completed. The title format of the third card does not meet expectations. It is not possible to confirm whether the circular avatar stacking style and guiding copy are related to property consultation.”
[0109] Step Execution Accuracy:
[0110] Step 1: Enter the new home page.
[0111] UI accuracy: High.
[0112] Analysis: This step directly corresponds to the "new house homepage" in the original requirement and is the starting point of the task, which is in line with expectations.
[0113] Step 2: Scroll down to find the third card in the list.
[0114] UI accuracy: Medium-high.
[0115] Analysis: This step requires users to find the third card in the list. Although the description is relatively intuitive, the specific definition of the "third card" may need to be clarified (such as the size of the "card", whether it contains advertisements, etc.). If the "third card" is directly visible on the homepage, there is no need to slide; if sliding is required, the necessity and conditions of sliding should be explained.
[0116] Step 3: Check whether the title format is "x place housing purchase group" and the circular avatar stacking style.
[0117] UI accuracy: Low.
[0118] Analysis: This step accurately executes the check in the requirement of "whether the title format is 'x place home buying group' and the circular avatar stacking style". The check result shows that the title format does not meet expectations and the circular avatar stacking style cannot be confirmed.
[0119] Step 4: Check whether the format of the guiding copy is relevant to the property inquiry.
[0120] UI accuracy: Low.
[0121] Analysis: This step checks the format of the guide text in the requirements. The guide text fails to confirm whether it is a question related to the property inquiry.}
[0122] Based on the embodiments of the present disclosure, the test analysis model conducts a comprehensive analysis of the multimodal data obtained from multiple tests, detects interface anomalies, evaluates the execution of functional use cases and the execution accuracy of path generation, can provide comprehensive and accurate test reports, and can proactively provide optimization suggestions for design, aesthetics, and user experience issues, thereby improving interface testing efficiency.
[0123] In a possible implementation, the test analysis model in the above embodiments is obtained by performing knowledge enhancement based on an assertion knowledge base and a business knowledge base, and training based on sample data (including sample test paths and sample prompt words corresponding to sample test tasks). Among them, the assertion knowledge in the assertion knowledge base includes test point description information of at least one application, which is used for model learning to realize the function of automatically identifying and analyzing test points of the input interface image. For example, the assertion knowledge may include but is not limited to at least one of the test object, test task, expected result, and abnormal result; the business knowledge in the business knowledge base includes standard interface description information of at least one application, which is used for model learning to realize the function of analyzing whether each test point has an abnormality and providing optimization suggestions. For example, the business knowledge may include but is not limited to at least one of the element visual effect, element function, and element image corresponding to the interface element; the sample prompt word is a guiding text provided to the model, corresponding to the assertion knowledge, business knowledge and sample test task, for example, it may include but is not limited to information such as the test object, test type, and content that the test report needs to provide, so that the model analyzes the sample data under the guidance of the sample prompt word to obtain the sample test result, and automatically identifies the test points in the interface image involved in the sample test task based on the assertion knowledge, and identifies the hidden defects of the interface based on the business knowledge and provides an optimization solution.
[0124] Please refer to Figure 3 The interface testing method provided by the embodiment of the present disclosure further includes the following steps:
[0125] Step 301 : construct an assertion knowledge base based on the assertion knowledge entered by the assertion knowledge entry operation, and construct a business knowledge base based on the business knowledge entered by the business knowledge entry operation.
[0126] In a possible implementation, when receiving the user's assertion knowledge entry operation (for example, directly inputting the relevant text of the assertion knowledge in the knowledge base editing interface, or inputting the storage address of the assertion knowledge in the knowledge base editing interface, etc.), the received assertion knowledge is parsed and the various types of information contained therein are added to the corresponding positions of the assertion knowledge base. Correspondingly, when receiving the user's business knowledge entry operation (for example, directly inputting the relevant text of the business knowledge in the knowledge base editing interface, or inputting the storage address of the business knowledge in the knowledge base editing interface, etc.), the received business knowledge is parsed and the various types of information contained therein are added to the corresponding positions of the business knowledge base.
[0127] Assertion knowledge may include at least one of the test object, test task, expected result, and abnormal result corresponding to the test point. Among them, the test object is used to indicate the interface element that needs to be tested, the expected result is used to indicate the test result that should be obtained by executing the test steps under the normal state of the test object, and the abnormal result is used to indicate the test result that may be obtained by executing the test steps under the abnormal state of the test object. Specifically, the expected result may include text description information of the expected result and / or a schematic diagram of the expected result, and the abnormal result may include text description information of the abnormal result and / or a schematic diagram of the abnormal result.
[0128] Indicative, Figure 4 A flow chart of building an assertion knowledge base is shown. Figure 4 The process of supplementing the relevant assertion knowledge of "testing the image type of the house card". First, the first target application corresponding to this assertion knowledge is determined based on the assertion knowledge entry operation. Secondly, the business line under the first target application is selected or created based on the business line editing operation (the same application can contain the program interface of at least one business line, for example, the house rental and sale application can contain the program interfaces of multiple business lines such as house rental, house leasing, house selling, house collection, historical transaction records, etc.). Finally, the currently received assertion knowledge is supplemented to the assertion knowledge corresponding to the corresponding business line. Figure 4 The assertion knowledge in the business line shown specifically includes four types of information: test point description information, expected results, exception details, and exception pictures. Among them, the test point description information includes the test object "property card" and the test task "whether it is a placeholder image", the expected result includes the text information "display the real property picture", and the exception result includes the exception details and exception pictures, among which the exception details are the text information "the picture of the property card is displayed as a placeholder picture, and the real property picture is not displayed", and the exception picture can be a picture of the property card or an interface image containing the property card.
[0129] Business knowledge may include at least one of the element visual effects, element functions, and element images corresponding to the interface elements. Among them, the interface element refers to the description object of the business knowledge, the element visual effect is used to indicate the display state of the description object in the interface under normal circumstances (such as position, color, shape, relationship with other UI elements, etc.), the element function is used to indicate the normal UI interaction result after triggering the description object, and the element image is an image of the normal program interface containing the description object.
[0130] Indicative, Figure 5 A flow chart for building a business knowledge base is shown. Figure 5 The process shows the process of supplementing the relevant business knowledge of "New House Home Page 'My Attention' Icon". First, based on the business knowledge entry operation, the second target application corresponding to this business knowledge is determined. Secondly, based on the business line editing operation, the business line under the second target application is selected or created. Finally, the currently received business knowledge is supplemented to the business knowledge corresponding to the corresponding business line. Figure 5 The business knowledge in the business line shown specifically includes four types of information: interface elements, element visual effects, element functions, and element images. Among them, the interface element includes the description object "'My attention' in the upper right corner of the new house homepage", the element visual effect includes the text information "The icon is located in the upper right corner of the page, in the shape of a red heart", the element function includes the text information "Click to view the favorite houses", and the element image can be the interface image of the "new house homepage".
[0131] Step 302: Obtain sample data, where the sample data includes a sample test path and a sample prompt word corresponding to a sample test task.
[0132] In a possible implementation, the sample prompt words may include prompt words corresponding to multiple types of test tasks to help the test analysis model learn the test steps and test analysis required to complete various types of test tasks. The sample data includes sample test paths and sample prompt words corresponding to the sample test tasks, wherein the sample test paths may include the test paths when the sample interface is normal and the test paths when the sample interface is abnormal.
[0133] Step 303: train the test analysis model using the assertion knowledge base, the business knowledge base, and the sample data.
[0134] In the process of the test analysis model predicting sample data, the assertion knowledge base and business knowledge base are used to help the model learn the test requirements and interface design specifications of various application interface tests, so that the model can actively perform interface testing on test points other than the test tasks input by the user in the subsequent interface testing process, and use sample prompt words to help the model understand the user's current test requirements.
[0135] In a possible implementation, step 303 may include the following steps:
[0136] Step 303a, performing multimodal data integration on the assertion knowledge base and the business knowledge base to obtain a multimodal data set, wherein the multimodal data set stores assertion knowledge and business knowledge corresponding to at least one application in an associated manner.
[0137] Step 303b: input the multimodal data set into the test analysis model for knowledge enhancement.
[0138] Optional, such as Figure 6 As shown, multimodal data fusion technology can be used to fuse the text data and image data corresponding to the assertion knowledge base and the business knowledge base to obtain a multimodal dataset. This multimodal dataset can provide comprehensive interface test knowledge enhancement for the test analysis model from multiple angles, such as interface design rules of various applications, interface test points and test tasks, expected test results, and various abnormal results.
[0139] Step 303c, use the sample data to optimize the parameters of the test analysis model after knowledge enhancement. The test analysis model can perform test analysis on the sample test paths in the sample data based on the assertion knowledge base, business knowledge base and sample prompt words in the training data set, generate corresponding sample prediction results, and perform reverse parameter optimization. The sample prediction result can be a classification result of the sample test path (such as whether the function use case execution result is normal, the type of interface element abnormality) and specific prediction data (such as the offset data of the interface element position, text data including optimization suggestions, etc.).
[0140] In a possible implementation, step 303c may specifically include the following steps:
[0141] Step 1: Input sample data into the test analysis model to obtain the sample prediction results output by the test analysis model.
[0142] Step 2: Calculate the model loss value of the test analysis model based on the sample prediction results and the sample labels corresponding to the sample data. The sample labels are used to characterize the standard prediction results of the sample data.
[0143] Step three, using the optimizer of the test analysis model, adjust the model parameters of the test analysis model based on the model loss value until the test analysis model meets the preset training conditions.
[0144] Indicatively, the sample label includes at least one of an element status label, a functional use case execution result label, an execution accuracy label of a sample test path, and an interface optimization suggestion label. Among them, the element status label is used to indicate abnormal elements of the sample program interface in the sample test path, such as "the position of the 'My Interests' icon on the new house homepage is offset"; the functional use case execution result label is used to indicate whether the functional use case execution result of the sample test path is correct, such as "the business function of the 'My Interests' on the new house homepage is normal"; the execution accuracy label is used to indicate the probability that the execution result of each sample test step in the sample test path is normal, such as "the accuracy of step A is 98%"; the interface optimization suggestion label is used to indicate hidden design problems and optimization suggestions of the sample program interface, such as "the title format of the second card in the interface corresponding to step B is wrong, it is recommended to modify it to a title format consistent with other cards."
[0145] In a possible implementation, the test analysis model is provided with an optimizer and a loss function, and based on the loss function, the sample prediction results and the sample labels, the model loss value of the test analysis model is calculated, and the optimizer is used to adjust the model parameters of the test analysis model based on the model loss value, and then the sample data is input into the test analysis model with updated parameters for the next round of training until the test analysis model meets the preset training conditions. The preset training conditions may include at least one of the following: the number of training times reaches the preset number of times, the model loss value is less than the preset loss value, and the accuracy of the sample prediction results is higher than the preset accuracy.
[0146] Optionally, after the training is completed, the validation data set and the test data set can be used to evaluate the model effect and optimize the prompt words and model parameters. The specific process may include: 1. Determine the evaluation indicators, such as accuracy, recall rate, F1 score, etc.; 2. Divide the multimodal data integrated in the above steps into a training data set, a test data set and a validation data set to ensure that the data in the test data set has not been input into the test analysis model during the model training stage; 3. Use the validation data set to monitor the model performance during the model training process to prevent overfitting of the model parameters and perform hyperparameter adjustment; 4. After the model training is completed, use the test data set to evaluate the model performance, where the test data set can include at least one test data subset for a specific test field, such as test data subsets corresponding to different types of applications and test data subsets corresponding to different types of test content, so as to detect the test analysis performance of the test analysis model in various test fields respectively; 5. Identify the defects of the test analysis model based on the evaluation results of step 4 and further adjust the model parameters.
[0147] In the disclosed embodiment, an assertion knowledge base and a business knowledge base are used to help the model learn the test requirements and interface design specifications for various application program interface tests, so that the model can actively perform interface tests on test points other than the test tasks input by the user during subsequent interface testing, and use sample prompt words to help the model understand the user's current test requirements, so that the test analysis model can actively discover potential problems in each program interface in the test path based on the test analysis of the test tasks input by the user, and provide optimization suggestions, thereby having comprehensive and intelligent interface testing capabilities.
[0148] Please refer to Figure 7 , which shows a structural block diagram of an interface testing device provided by an exemplary embodiment of the present disclosure. The device includes:
[0149] The acquisition module 701 is used to obtain the test task in the test request in response to receiving the test request, wherein the test task includes at least one of the execution status of the functional use case in the program to be tested and the status of the program interface element;
[0150] A testing module 702 is used to execute test steps on the program to be tested based on the test task acquired by the acquisition module 701 to obtain a test path, where the test path includes test steps and an interface image of a program interface corresponding to each test step;
[0151] A generating module 703 is used to input the prompt words corresponding to the test path and the test task generated by the testing module 702 into the test analysis model, and generate a test report through the test analysis model, wherein the prompt words include the task description information of the test task, and the test report includes at least one of the following: the evaluation results of the functional use cases corresponding to the test content, the element status inspection results of the program interface, the visual effect defects of the program interface, and the optimization plan of the program interface;
[0152] Among them, the above-mentioned test analysis model is obtained by knowledge enhancement based on interface testing knowledge and training based on sample data. The interface testing knowledge includes at least one of the assertion knowledge in the assertion knowledge base and the business knowledge in the business knowledge base. The assertion knowledge includes test point description information of at least one application, and the business knowledge includes standard interface description information of at least one application.
[0153] Optionally, in a possible implementation manner, the generating module 703 may also be used to:
[0154] Inputting input data into the test analysis model, the input data including the test path and the prompt word;
[0155] The test analysis model is used to extract features of the input data to obtain feature vectors, and the feature vectors are decoded to generate a time step sequence corresponding to the test analysis data, where the test analysis data includes at least one of the following: functional use case evaluation results, element status inspection results, visual effect defects, and optimization solutions; the time step sequence is classified and mapped into test analysis data in a preset form; and a test report is generated and output based on the test analysis data.
[0156] Optionally, in a possible implementation manner, the test module 702 may also be used to:
[0157] Based on the test task acquired by the acquisition module 701, the test steps of the program to be tested are executed for a preset number of times, generating a preset number of test paths;
[0158] The above generation module 703 can also be used for:
[0159] A preset number of test paths and prompt words are input into the test analysis model, and a test report is generated by the test analysis model, wherein the functional use case evaluation results in the test report include the execution accuracy corresponding to each test step, which is calculated based on the number of test paths with normal execution results of the test step and the preset number, and is used to characterize the probability of correct execution results of the test step.
[0160] Optional, such as Figure 8 As shown, in a possible implementation manner, the interface testing device may further include the following structure:
[0161] A construction module 801 constructs an assertion knowledge base based on the assertion knowledge entered by the assertion knowledge entry operation, and constructs a business knowledge base based on the business knowledge entered by the business knowledge entry operation, wherein the assertion knowledge includes at least one of a test object, a test task, an expected result, and an abnormal result corresponding to a test point, and the business knowledge includes at least one of an element visual effect, an element function, and an element image corresponding to an interface element;
[0162] The sample acquisition module 802 acquires sample data, where the sample data includes a sample test path and a sample prompt word corresponding to the sample test task;
[0163] The training module 803 uses the assertion knowledge base and business knowledge base constructed by the construction module 8801 and the sample data obtained by the sample acquisition module 802 to train the test analysis model.
[0164] Optionally, in a possible implementation manner, the training module 803 may also be used to:
[0165] Performing multimodal data integration on the assertion knowledge base and the business knowledge base to obtain a multimodal data set, wherein the multimodal data set stores assertion knowledge and business knowledge corresponding to at least one application program in an associated manner;
[0166] Input multimodal datasets into the test analysis model for knowledge enhancement;
[0167] The sample data is used to optimize the parameters of the knowledge-enhanced test analysis model.
[0168] Optionally, in a possible implementation manner, the training module 803 may also be used to:
[0169] Input the sample data into the test analysis model to obtain the sample prediction results output by the test analysis model;
[0170] Calculate the model loss value of the test analysis model based on the sample prediction results and the sample labels corresponding to the sample data. The sample labels are used to characterize the standard prediction results of the sample data.
[0171] Utilize the optimizer of the test analysis model to adjust the model parameters of the test analysis model based on the model loss value until the test analysis model meets the preset training conditions.
[0172] Optionally, in a possible implementation, the sample label includes at least one of an element status label, a function use case execution result label, an execution accuracy label of a sample test path, and an interface optimization suggestion label;
[0173] Among them, the element status label is used to indicate abnormal elements of the sample program interface in the sample test path, the functional case execution result label is used to indicate whether the functional case execution result of the sample test path is correct, the execution accuracy label is used to indicate the probability that the execution results of each sample test step in the sample test path are normal, and the interface optimization suggestion label is used to indicate the visual effect defects and optimization solutions of the sample program interface.
[0174] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The parts of the same, similar or corresponding contents between the various embodiments can be referred to each other. Since the method, device, and equipment embodiments are basically corresponding, the relevant parts can be referred to the description of the corresponding parts. The methods, devices, and equipment of the embodiments of the present disclosure also correspond to each other in terms of specific implementation methods and beneficial technical effects. The relevant contents can be referred to each other and will not be repeated.
[0175] In addition, an embodiment of the present disclosure further provides an electronic device, including:
[0176] Memory for storing computer programs;
[0177] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the interface testing method described in any of the above embodiments of the present disclosure is implemented.
[0178] Fig. 9 This is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. Fig. 9 The electronic device according to the embodiment of the present disclosure is described. The electronic device may be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the collected input signals from them.
[0179] like Fig. 9 As shown, the electronic device includes one or more processors and memory.
[0180] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0181] The memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the interface testing method of each embodiment of the present disclosure described above and / or other desired functions.
[0182] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0183] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0184] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0185] Of course, to simplify, Fig. 9Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0186] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the interface testing method according to various embodiments of the present disclosure described in the above part of this specification.
[0187] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0188] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps of the interface testing method according to various embodiments of the present disclosure described in the above part of this specification.
[0189] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0190] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0191] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0192] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0193] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0194] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0195] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0196] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0197] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. An interface testing method, characterized in that: include: In response to receiving a test request, obtaining a test task in the test request, wherein the test task includes testing at least one of the execution of a functional case in the program to be tested and the status of a program interface element; Execute test steps on the program to be tested based on the test task to obtain a test path, wherein the test path includes the test steps and an interface image of a program interface corresponding to each test step; Inputting the prompt words corresponding to the test path and the test task into a test analysis model, generating a test report through the test analysis model, wherein the prompt words include task description information of the test task, and the test report includes at least one of the following: evaluation results of functional use cases corresponding to the test content, element status inspection results of the program interface, visual effect defects of the program interface, and optimization solutions of the program interface; Among them, the test analysis model is obtained by knowledge enhancement based on interface testing knowledge and training based on sample data, the interface testing knowledge includes at least one of the assertion knowledge in the assertion knowledge base and the business knowledge in the business knowledge base, the assertion knowledge includes test point description information of at least one application, and the business knowledge includes standard interface description information of at least one application.
2. The method according to claim 1, characterized in that The step of inputting the prompt words corresponding to the test path and the test task into a test analysis model and generating a test report through the test analysis model includes: Inputting input data into the test analysis model, the input data including the test path and the prompt word; The test analysis model is used to extract features of the input data to obtain a feature vector, and the feature vector is decoded to generate a time step sequence corresponding to the test analysis data, wherein the test analysis data includes at least one of the following: the functional use case evaluation result, the element status inspection result, the visual effect defects and the optimization plan; the time step sequence is classified and mapped into the test analysis data in a preset form; and the test report is generated and output based on the test analysis data.
3. The method according to claim 1, characterized in that The step of executing the test steps on the program to be tested based on the test task to obtain a test path includes: Execute a preset number of test steps on the program to be tested based on the test task to generate a preset number of test paths; The step of inputting the prompt words corresponding to the test path and the test task into a test analysis model and generating a test report through the test analysis model includes: The preset number of test paths and the prompt words are input into the test analysis model, and the test report is generated by the test analysis model, wherein the functional use case evaluation results in the test report include the execution accuracy corresponding to each test step, and the execution accuracy is calculated based on the number of test paths with normal execution results of the test step and the preset number, and is used to characterize the probability of correct execution results of the test step.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The assertion knowledge base is constructed based on the assertion knowledge entered by the assertion knowledge entry operation, and the business knowledge base is constructed based on the business knowledge entered by the business knowledge entry operation, wherein the assertion knowledge includes at least one of a test object, a test task, an expected result, and an abnormal result corresponding to a test point, and the business knowledge includes at least one of an element visual effect, an element function, and an element image corresponding to an interface element; Acquire the sample data, wherein the sample data includes a sample test path and a sample prompt word corresponding to the sample test task; The test analysis model is trained using the assertion knowledge base, the business knowledge base, and the sample data.
5. The method according to claim 4, characterized in that The using the assertion knowledge base, the business knowledge base, and the sample data to train the test analysis model includes: Performing multimodal data integration on the assertion knowledge base and the business knowledge base to obtain a multimodal data set, wherein the multimodal data set stores assertion knowledge and business knowledge corresponding to at least one application program in an associated manner; Inputting the multimodal data set into the test analysis model for knowledge enhancement; The sample data is used to optimize parameters of the test analysis model after knowledge enhancement.
6. The method according to claim 5, characterized in that The step of optimizing the parameters of the test analysis model after model fine-tuning by using the sample data includes: Inputting the sample data into the test analysis model to obtain the sample prediction result output by the test analysis model; Calculating a model loss value of the test analysis model based on the sample prediction result and a sample label corresponding to the sample data, wherein the sample label is used to characterize a standard prediction result of the sample data; Utilizing the optimizer of the test analysis model, the model parameters of the test analysis model are adjusted based on the model loss value until the test analysis model meets the preset training conditions.
7. The method according to claim 6, characterized in that The sample label includes at least one of an element status label, a function use case execution result label, an execution accuracy label of the sample test path, and an interface optimization suggestion label; Among them, the element status label is used to indicate abnormal elements of the sample program interface in the sample test path, the functional use case execution result label is used to indicate whether the functional use case execution result of the sample test path is correct, the execution accuracy label is used to indicate the probability that the execution results of each sample test step in the sample test path are normal, and the interface optimization suggestion label is used to indicate the visual effect defects and optimization solutions of the sample program interface.
8. An interface testing device, characterized in that: include: An acquisition module, configured to acquire a test task in the test request in response to receiving the test request, wherein the test task includes at least one of the execution status of a functional case in the program to be tested and the status of a program interface element; A test module, configured to execute test steps on the program to be tested based on the test task to obtain a test path, wherein the test path includes the test steps and an interface image of a program interface corresponding to each test step; A generation module, used for inputting the prompt words corresponding to the test path and the test task into a test analysis model, and generating a test report through the test analysis model, wherein the test report includes at least one of the following: a function use case evaluation result corresponding to the test content, an element status check result of the program interface, a visual effect defect of the program interface, and an optimization plan of the program interface; Among them, the test analysis model is obtained by knowledge enhancement based on interface testing knowledge and training based on sample data, the interface testing knowledge includes at least one of the assertion knowledge in the assertion knowledge base and the business knowledge in the business knowledge base, the assertion knowledge includes test point description information of at least one application, and the business knowledge includes standard interface description information of at least one application.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.
11. A computer program comprising computer program instructions, characterized in that When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Knowledge base construction method and electronic equipment
CN121212290A