Program abnormal position positioning method, test case generation method and related device

By combining image matching and text analysis, the exception interface and controls are accurately positioned from the exception screenshots and description information of the test program, and the problem of positioning difficulties in the prior art is solved and the processing efficiency and accuracy of the test report are improved.

CN120353701APending Publication Date: 2025-07-22GUANGZHOU HUYA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510412027.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

In program testing, it is difficult for the prior art to accurately locate abnormal positions, especially when multiple interfaces are similar in layout, it is difficult to accurately judge the specific interface and controls based on screenshots or text descriptions alone.

Method used

By obtaining exception screenshots and picture description information of the test program, the most similar target screenshots are determined from preset multiple standard screenshots, and combining control structure information and picture description information, the exception interface and control are accurately positioned.

Benefits of technology

It realizes efficient and accurate positioning of program abnormal locations, improves the efficiency and quality of test report processing, and reduces manual review and repetitive work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353701A_ABST
    Figure CN120353701A_ABST
Patent Text Reader

Abstract

The invention provides a program abnormal position positioning method, a test case generation method and a related device, and relates to the field of program testing. The electronic equipment obtains a to-be-analyzed report of the test program; wherein the to-be-analyzed report comprises an abnormal screenshot of the test program and picture description information for the abnormal screenshot; determining a target screenshot most similar to the abnormal screenshot from a plurality of preset standard screenshots; wherein the plurality of standard screenshots are captured from a plurality of interfaces of the test program; determining an interface corresponding to the target screenshot as an abnormal target interface; and matching preset control structure information of the target interface with the picture description information, and determining an abnormal target control in the target interface. Thus, through combination of image matching and text analysis, efficient and accurate positioning of the abnormal position is realized, and the efficiency and quality of test report processing are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of program testing. Specifically, it relates to a method for locating the position of program exceptions, a method for generating test cases, and related devices. Background Art

[0002] During the program development process, enterprises increasingly rely on crowdsourcing testing platforms to collect feedback from users and professional testers to ensure product quality. These crowdsourcing test reports usually contain rich multimodal information, such as natural language text descriptions and screenshots, which help identify various defects existing in the application.

[0003] In order to write targeted test cases for the feedback test reports, it is necessary to be precise to specific controls. However, it is found in actual operation that since a program contains numerous interfaces and the layouts of multiple interfaces may be similar. In this case, it is very difficult to accurately determine the specific interface referred to in the report only based on the screenshots or text descriptions in the crowdsourcing test report. In addition, there are cases where there are multiple controls with similar texts in many applications, and relying solely on the control texts for matching is likely to cause confusion.

[0004] Therefore, for the processing of test reports, there is a problem of difficulty in locating the position of program exceptions. Summary of the Invention

[0005] To overcome at least one deficiency in the prior art, this application provides a method for locating the position of program exceptions, a method for generating test cases, and related devices, specifically including:

[0006] In a first aspect, this application provides a method for locating the position of program exceptions, and the method includes:

[0007] Obtain a report to be analyzed of a test program, where the report to be analyzed includes an abnormal screenshot of the test program and picture description information for the abnormal screenshot;

[0008] Determine a target screenshot that is most similar to the abnormal screenshot from a preset plurality of standard screenshots, where the plurality of standard screenshots correspond to multiple interfaces of the test program;

[0009] Determine the interface corresponding to the target screenshot as the target interface where the exception occurs;

[0010] Match the preset control structure information of the target interface with the picture description information to determine the target control where the exception occurs in the target interface.

[0011] In a second aspect, this application provides a method for generating test cases, and the method includes:

[0012] Process the abnormal screenshot of the test program and the picture description information for the abnormal screenshot through the described program abnormal position location method, and determine the target interface where the abnormality occurs and the target control where the abnormality occurs in the target interface from multiple interfaces of the test program;

[0013] Generate optimized picture description information according to the interface description information of the target interface, the control description information of the target control, and the picture description information;

[0014] If the optimized picture description information cannot match a similar test case from the existing test documents, generate a new test case according to the optimized picture description information.

[0015] In a third aspect, the present application provides a device for locating the position of program abnormality, and the device includes:

[0016] A report acquisition module, configured to acquire an analysis report to be processed of a test program, where the analysis report to be processed includes an abnormal screenshot of the test program and picture description information for the abnormal screenshot;

[0017] An abnormality location module, configured to determine the target screenshot most similar to the abnormal screenshot from a preset multiple standard screenshots, where the multiple standard screenshots correspond to multiple interfaces of the test program; determine the interface corresponding to the target screenshot as the target interface where the abnormality occurs;

[0018] The abnormality location module is further configured to match the preset control structure information of the target interface with the picture description information to determine the target control where the abnormality occurs in the target interface.

[0019] In a fourth aspect, the present application provides a test case generation device, and the device includes:

[0020] An abnormality analysis module, configured to process the abnormal screenshot of the test program and the picture description information for the abnormal screenshot through the described device for locating the position of program abnormality, and determine the target interface where the abnormality occurs and the target control where the abnormality occurs in the target interface from multiple interfaces of the test program;

[0021] A test case module, configured to generate optimized picture description information according to the interface description information of the target interface, the control description information of the target control, and the picture description information; if the optimized picture description information cannot match a similar test case from the existing test documents, generate a new test case according to the optimized picture description information.

[0022] Fifth aspect, the present application provides a storage medium storing a computer program, which, when executed by a processor, implements the program exception location determination method or the test case generation method described above.

[0023] Sixth aspect, the present application provides an electronic device, which includes a processor and a memory. The memory stores a computer program, which, when executed by the processor, implements the program exception location determination method or the test case generation method described above.

[0024] Compared with the prior art, the present application has the following beneficial effects:

[0025] The present application provides a program exception location determination method, a test case generation method and related devices. An electronic device obtains an analysis report to be analyzed of a test program; wherein, the analysis report to be analyzed includes an exception screenshot of the test program and picture description information for the exception screenshot; determines a target screenshot most similar to the exception screenshot from a plurality of preset standard screenshots; wherein, the plurality of standard screenshots correspond to multiple interfaces of the test program; determines the interface corresponding to the target screenshot as the target interface where an exception occurs; matches the preset control structure information of the target interface with the picture description information to determine the target control where an exception occurs in the target interface. In this way, through the combination of image matching and text analysis, efficient and accurate location of the exception location is achieved, significantly improving the efficiency and quality of test report processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] To more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0027] Figure 1 It is a flowchart of the program exception location determination method provided by an embodiment of the present application;

[0028] Figure 2 It is one of the detailed diagrams of the program exception location determination method provided by an embodiment of the present application;

[0029] Figure 3A It is another detailed diagram of the program exception location determination method provided by an embodiment of the present application;

[0030] Figure 3B It is a third detailed diagram of the program exception location determination method provided by an embodiment of the present application;

[0031] Figure 3C The fourth detailed schematic diagram of the program exception location method provided by the embodiments of the present application;

[0032] Figure 4 The schematic diagram of the sliding window provided by the embodiments of the present application;

[0033] Figure 5 The flowchart schematic diagram of the test case generation method provided by the embodiments of the present application;

[0034] Figure 6 The structural schematic diagram of the program exception location device provided by the embodiments of the present application;

[0035] Figure 7 The structural schematic diagram of the test case generation device provided by the embodiments of the present application;

[0036] Figure 8 The structural schematic diagram of the electronic device provided by the embodiments of the present application. Detailed implementation manners

[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Usually, the components of the embodiments of the present application described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0038] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application claimed, but merely represents the selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.

[0039] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0040] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance. In addition, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0041] In order to make the solution provided in the embodiment of the present application easier to understand, before introducing the solution provided in the embodiment, the relevant professional terms that may be involved in the embodiment are first explained.

[0042] Natural Language Processing (NLP) is an important direction in the field of computer science and artificial intelligence, focusing on technologies that enable computers to understand, parse and generate human natural language. Through NLP, computers can process and analyze large amounts of text data to achieve effective communication with humans, such as automatic translation, sentiment analysis and intelligent question and answer.

[0043] Word segmentation is a basic step in natural language processing for Chinese texts. Because there are no obvious boundaries between words in Chinese sentences, it is difficult for computers to automatically recognize word boundaries. Therefore, when performing Chinese natural language processing, word segmentation is first required, that is, dividing a continuous sequence of Chinese characters into meaningful words. For example, for the sentence "I came to Tsinghua University in Beijing", the correct word segmentation result may be "I / came / Beijing / Tsinghua University". The accuracy of word segmentation directly affects the effectiveness of subsequent natural language processing tasks such as part-of-speech tagging and syntactic analysis.

[0044] Embedding is a method of converting objects obtained by word segmentation (such as text, images, controls, etc.) into numerical vectors so that these objects can be processed in mathematical space. For example, in the field of text processing, vectorization technology can convert natural language sentences or words into high-dimensional floating-point vectors through algorithms. Similarly, in the field of image processing, image data can also be converted into a feature vector. The main purpose of doing this is to be able to compare and calculate the similarity or difference between different objects in the same vector space. In this way, mathematical methods such as cosine similarity can be used to measure the distance or similarity between these vectors.

[0045] Large Language Model (LLM), as a natural language processing technology, is specifically used to process and generate natural language. Such models are usually based on the Transformer architecture, contain billions of parameters, and are trained on large-scale corpora, enabling them to understand and generate high-quality text content. Large language models perform excellently in NLP tasks and can be used in various applications such as text summarization, dialogue systems, content generation, etc.

[0046] GPT (Generative Pre-trained Transformer), as a typical large language model, is developed by OpenAI and includes multiple versions such as GPT-2, GPT-3, and GPT-4. By learning text in a large amount of corpora, this model can generate reasonable natural language text. Chat GPT is an application of GPT, focusing on building chatbots that can read and learn language patterns and grammar in training data, and thus generate corresponding responses according to user inputs.

[0047] A prompt is the guiding text provided when interacting with a large language model. Users write clear and specific prompts to accurately express their intentions and questions, so that the large language model can better understand the requirements and then provide more accurate and relevant answers. Therefore, in the process of interacting with a large language model, designing reasonable prompts is crucial for obtaining satisfactory responses.

[0048] Chain-of-Thought (CoT) is a prompt engineering method that requires the large language model to show a step-by-step reasoning process before generating an answer, making the decision-making more transparent and interpretable, and helping to reduce errors and improve the accuracy and reliability of the answer.

[0049] Multimodal interaction refers to the way people communicate with computers through multiple channels such as voice, body language, information carriers (such as text, pictures, audio, video), and the environment, simulating the interaction mode between people. Multimodal AI further integrates it, combines computer vision and interactive artificial intelligence models, enabling the computer to more comprehensively understand and process multimodal information, and thus realizing functions closer to human perception and interaction capabilities.

[0050] CLIP (Contrastive Language-Image Pre-training) is a multimodal large language model that can process text and image data simultaneously and establish connections between these two different types of information. By training on a large scale of text-image pairs, CLIP has learned to map text and images into the same high-dimensional vector space. This means that both text and images can be represented as vectors in the same space, enabling the use of mathematical methods to calculate the similarity between them.

[0051] Cosine similarity is a commonly used method to measure the angle between two vectors, with a value range from [-1, 1], where 1 represents exactly the same direction (i.e., maximum similarity), 0 represents orthogonality (i.e., no similarity), and -1 represents exactly the opposite direction. In the application of CLIP, cosine similarity is used to quantify the similarity between text vectors and image vectors. Due to its strong generality and high accuracy, CLIP has become an important tool when dealing with tasks involving text and images.

[0052] The Jaccard coefficient is an index to measure the similarity between two sets, defined as the ratio of the number of elements in the intersection of the two sets to the number of elements in the union of the two sets. In text similarity calculation, by tokenizing text A and B respectively to obtain two sets of tokenization results, and then calculating the Jaccard coefficient of these two sets to represent the similarity between text A and B. The value of this coefficient ranges from 0 to 1, and the closer the value is to 1, the more similar the two texts are.

[0053] The Graphical User Interface (GUI) refers to a user interface that is displayed and operated through graphical elements (such as windows, buttons, menus, etc.). On mobile platforms (such as Android), the GUI of an application is presented by Activity components. Each Activity can contain one or more GUI states, and these states contain different controls. When the user triggers a certain control, it may switch to another GUI state, which may belong to the same Activity or a new Activity.

[0054] K-Means clustering is a commonly used unsupervised machine learning algorithm mainly used to divide a dataset into a predefined number (K) of clusters. To achieve this goal, first, in the initialization phase, K points are randomly selected as the initial cluster centers (Centroids), where K represents the number of clusters one hopes to divide into. Next is the assignment phase. For each vectorized crowdsourcing test report, calculate the distances (usually Euclidean distance or cosine similarity, etc.) between it and all the cluster centers, and then assign it to the cluster with the closest distance. Subsequently, in the update phase, recalculate the new center position of each cluster, which is the average value of all the member vectors within that cluster. The whole process is achieved through iterative optimization: repeat the assignment-update steps until one of the following conditions is met: the cluster assignments no longer change; the maximum number of predefined iterations is reached; or the distance the center points move is less than a certain threshold.

[0055] Based on the above statements, as introduced in the background art, in order to write targeted test cases for the feedback test reports, it is necessary to be precise to specific controls. However, in actual operation, it is found that since a program contains numerous interfaces and the layouts of multiple interfaces may be similar; therefore, when processing test reports, there is a problem of difficult positioning of program abnormal positions.

[0056] Exemplarily, a payment application may contain multiple interfaces, such as the "Payment Interface (PaymentActivity)" and the "Recharge Interface (RechargeActivity)". In this case, sometimes it is very difficult to accurately determine the specific interface referred to in the report only based on the screenshots or text descriptions in the crowdsourcing test reports. For another example, the report mentions "payment failed", and the user may upload a screenshot of a payment interface. However, since the layouts of the payment interface and the recharge interface are similar, it is very difficult to directly determine which interface has a problem.

[0057] Based on the discovery of the above technical problems, the inventor has proposed the following technical solutions through creative labor to solve or improve the above problems. It should be noted that the defects existing in the above solutions in the prior art are the results obtained by the inventor through practice and careful research. Therefore, the process of discovering the above problems and the solutions proposed by the embodiments of the present application below for the above problems should be the contributions made by the inventor to the present application during the invention creation process, rather than being understood as the technical content known to those skilled in the art.

[0058] In view of the above, an embodiment of the present application (hereinafter simply referred to as this embodiment) provides a method for positioning program abnormal positions. As Figure 1 shown, the method includes:

[0059] S1, obtaining the report to be analyzed of the test program.

[0060] Among them, the report to be analyzed includes the abnormal screenshots of the test program and the picture description information for the abnormal screenshots.

[0061] S2. Determine the target screenshot that is most similar to the abnormal screenshot from multiple preset standard screenshots.

[0062] Among them, the multiple standard screenshots correspond to multiple interfaces of the test program;

[0063] S3. Determine the target interface where the abnormality occurs as the interface corresponding to the target screenshot;

[0064] S4. Match the preset control structure information of the target interface with the picture description information to determine the target control where the abnormality occurs in the target interface.

[0065] Among them, the control structure information describes the controls existing in the target interface and the relationships between the controls.

[0066] In this way, through the combination of image matching and text analysis, the efficient and accurate positioning of the abnormal location is realized, and the efficiency and quality of test report processing are significantly improved.

[0067] It should be understood that for the program abnormal location positioning method provided in this embodiment, the electronic device implementing this method can be, but is not limited to, a mobile terminal, a laptop computer, a desktop computer, a server, etc. The server can be a single server or a server group. The server group can be centralized or distributed (for example, the server can be a distributed system). In some embodiments, the server can be local or remote relative to the user terminal. In some embodiments, the server can be implemented on a cloud platform; only as an example, the cloud platform can include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an inter-cloud, a multi-cloud, etc., or any combination thereof. In some embodiments, the server can be implemented on an electronic device having one or more components.

[0068] To make the solution provided in this embodiment clearer, the following Figure 1 elaborates on each step of the method shown. However, it should be understood that the operations in the flowchart can be implemented out of order, and the steps without logical context relationships can be reversed or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of this application. Continuing to refer to Figure 1 , the method includes:

[0069] S1. Obtain the report to be analyzed of the test program.

[0070] Among them, the report to be analyzed includes the abnormal screenshots of the test program and the picture description information for the abnormal screenshots. The so-called abnormal screenshots refer to the screen screenshots taken when abnormal situations occur during the execution of the test program. Therefore, this screenshot records the user interface state when the abnormality occurs, which helps to visually display the specific manifestation form of the problem. The picture description information is the text description of the problem shown in the abnormal screenshot. For example, it usually includes information such as the specific steps where the problem occurs, the detailed description of the abnormal phenomenon, and the possible scope of influence. These description information can help developers better find the cause of the abnormality.

[0071] In this embodiment, the above-mentioned report to be analyzed can be a test report extracted from the crowdsourcing testing report. However, it is found that more and more enterprises choose to release applications to external users or professional testers through crowdsourcing testing platforms to quickly collect test reports in real terminals and various network environments. Therefore, the test reports obtained through this crowdsourcing testing method are usually large in number and diverse in content, covering different problems and scenarios. Since different users may describe the same problem differently, the reports may seem different, which results in a large number of duplicate test reports often existing in these test reports. Currently, the processing of test reports obtained through crowdsourcing testing mainly relies on manual review and simple keyword matching, which leads to problems such as low efficiency, repetitive work, and difficult positioning. Developers need to read each report one by one, but due to different users' descriptions of the same problem, the same test report may be submitted multiple times, increasing the processing time and resource consumption.

[0072] In view of the above problems, in this embodiment, natural language processing technology is used to automatically classify multiple test reports obtained through crowdsourcing testing, reducing repetitive work and improving processing efficiency; then, the reports to be analyzed are extracted from the classification set to ensure that developers can focus on the representative reports to be analyzed for targeted analysis and processing. Therefore, Figure 1 The step S1 in

[0073] S1-1, obtain multiple test reports of the test program.

[0074] S1-2, classify the multiple test reports to obtain a classification set of the multiple test reports.

[0075] As an optional implementation manner, each test report includes the abnormal screenshot of the test program and the picture description information for the abnormal screenshot. In this regard, the server can extract the features in the abnormal screenshot and the picture description information of each test report to obtain the feature vector of each test report; cluster according to the feature vectors of each test report to obtain a classification set of multiple test reports.

[0076] It should be understood that since the test reports are presented in a multimodal manner, which usually includes screenshots and descriptive text. Moreover, the texts submitted by different users may vary greatly, and the screenshot timing and angles are also different; some descriptions may seem unrelated but actually point to the same functional defect. Therefore, in order to extract the features in the abnormal screenshots and picture description information in each test report and obtain the feature vector of each test report. For this, this embodiment can use the CLIP model to perform feature extraction on each test report. Of course, other feature extraction models can also be used, and this embodiment does not make specific limitations in this regard.

[0077] For the text in the test report, the server can perform Chinese word segmentation and stop word filtering on the text description in the report to remove irrelevant words and make the text more concise and meaningful; then, input the processed text into the CLIP text encoder to obtain a vector representing the text features. For the screenshots in the test report, the server can perform resolution normalization and denoising processing on the screenshots to ensure the consistency of all images in terms of size and quality; then, input the processed images into the CLIP image encoder to obtain a vector representing the image features. Finally, the server fuses the text vector and the image vector to generate a comprehensive multimodal vector. Among them, the fusion method between the two can be in a concatenated manner or a weighted manner to obtain a feature vector containing the overall information of the text and the image.

[0078] Based on the feature vector containing multimodal information obtained from the above implementation, the server can further perform clustering to obtain a classification set of multiple test reports. Taking the K-means clustering algorithm as an example, assume that 10 test reports (R1 - R10) are collected through the crowdsourcing testing platform, and each report contains a text description and a screenshot. The server first performs multimodal encoding on these 10 test reports. Specifically, it can encode and fuse the text description and the screenshot of each test report respectively to obtain a multimodal feature vector. Then, the server uses the cosine similarity combined with the K-Means algorithm for clustering, selects K = 3, and the clustering results are as follows:

[0079] Cluster A (related to payment / recharge): R1, R2, R6, R7, R9

[0080] Cluster B (related to login): R3, R8

[0081] Cluster C (related to orders): R4, R5, R10

[0082] In this way, the 10 test reports are classified into 3 classification sets through the K-means clustering algorithm, realizing the efficient classification and organization of a large number of test reports.

[0083] Based on the above description of the classification set of multiple test reports in step S1-2 of the above implementation, step S1 further includes:

[0084] S1-3. Extract the report to be analyzed from the classification set.

[0085] In this embodiment, the most representative report can be extracted from each classification set by machine scoring or manual extraction to improve the processing efficiency. The following details these two extraction methods.

[0086] Machine scoring

[0087] The server can use a pre-trained large language model to score each report within each cluster. The large language model will evaluate factors such as the content quality, information integrity, screenshot clarity, and description detail of each report according to its internal complex algorithm, and score each report; then, according to the scoring results of the large language model, sort from high to low scores, and select the report with the highest score as the representative report of this classification set. In this way, the most representative report can be efficiently selected in an automated manner, thereby reducing the workload of manual screening and improving the accuracy and efficiency of report selection.

[0088] Manual extraction

[0089] Developers browse the reports within each classification set through the server, evaluating factors such as the content quality, information integrity, screenshot clarity, and description detail of each report; then, the server responds to the manual selection operation of the developers and determines the most representative 1 to 2 reports from each classification set. In this way, through manual screening, it can be ensured that the selected reports are the most representative and detailed information sources, thereby effectively reducing the subsequent workload.

[0090] The above implementation introduced Figure 1 the method for obtaining the report to be analyzed in step S1. Next, continue to explain Figure 1 step S2 in

[0091] S2. Determine the target screenshot that is most similar to the abnormal screenshot from multiple preset standard screenshots.

[0092] Among them, multiple standard screenshots correspond to multiple interfaces of the test program. In this embodiment, the multiple standard screenshots can be design drawings of multiple interfaces, or can be obtained by traversing the test program through a script. The so-called design drawing refers to the interface prototype made by the design team using professional tools during the development stage of the test program, which completely presents the visual design scheme of each functional interface of the application program, including all visual details such as layout structure, color specification, control style, icon elements, etc., representing the correct presentation state that the interface should have. The so-called traversal through a script means using an automated testing tool to simulate user operations, triggering the correct presentation state of each interface of the application program in accordance with a preset path, and automatically capturing the screen image as a reference.

[0093] Exemplarily, assume that the test program is an APP of a certain mobile terminal. Developers can manually or through an automated traversal script collect the standard screenshots of the program interface of the APP and associate the interface description information of each standard screenshot. For example, the collected screenshots include the payment interface with the picture name "PaymentScreen.png", the login interface with the picture name "LoginScreen.png", the order interface with the picture name "OrderScreen.png", etc. The server will convert each standard screenshot into a vector through the CLIP model; and convert the abnormal screenshot into a vector through the CLIP model as well.

[0094] Then, the server compares the vector of the abnormal screenshot with the vectors of each standard screenshot. Among them, the similarity calculation can be completed by comparing the distance between two vectors or other similarity metrics. If the comparison result indicates that the similarity with a certain standard screenshot is much higher than the similarity with other standard screenshots, then it can be determined that the interface corresponding to the standard screenshot is the target interface.

[0095] However, it is found in the actual process that in some cases, the similarities between multiple standard screenshots and the abnormal screenshot are relatively close. In this regard, this embodiment combines the keywords in the picture description information for auxiliary judgment. Therefore, as Figure 2 shown, this embodiment also provides the following optional implementation manner of step S2:

[0096] S2-1A, obtain the maximum similarity between the abnormal screenshot and multiple standard screenshots;

[0097] S2-2A, determine whether multiple candidate screenshots can be determined from multiple standard screenshots. If so, execute Figure 2 S2-3A in Figure 2 otherwise, execute

[0098] Among them, the difference between the similarity between the candidate screenshot and the abnormal screenshot and the maximum similarity is less than the first threshold. The first threshold is a value greater than 0. Therefore, this difference can be obtained by subtracting the similarity between the candidate screenshot and the abnormal screenshot from the maximum similarity. Therefore, it can be understood that multiple candidate screenshots include the standard screenshot corresponding to the maximum similarity, and also include standard screenshots whose similarity to the abnormal screenshot is close to the maximum similarity. When multiple candidate screenshots appear, in this embodiment, the picture description information of the abnormal screenshot is further combined to screen the multiple candidate screenshots to obtain the target screenshot that is most similar to the abnormal screenshot. Therefore, step S2 further includes:

[0099] S2-3A, match the picture description information with the interface description information of the corresponding interface of each candidate screenshot, and determine the target screenshot from the multiple candidate screenshots.

[0100] Exemplarily, the server first calculates the similarity between the abnormal screenshot and multiple standard screenshots, and finds the maximum similarity. Here, it is assumed that there are multiple standard screenshots, which are the login screenshot of the login interface, the payment screenshot of the payment interface, and the order screenshot of the order interface respectively. When an abnormal screenshot is compared with these standard screenshots, it is found that the similarity with the payment screenshot is the highest, that is, the maximum similarity, but the similarity with the order screenshot is also very close, that is, the difference from the maximum similarity is less than the first threshold. At this time, the order screenshot and the payment screenshot can be used as candidate screenshots respectively.

[0101] Then, the server further discovers that "payment failed" is mentioned in the picture description information. Then, the interface description information corresponding to the payment screenshot better conforms to this description, so that the target screenshot can be determined to be the payment screenshot. In this way, even if the similarities between multiple standard screenshots and the abnormal screenshot are similar, the keyword in the picture description information can be used for auxiliary judgment to more accurately determine the most similar standard screenshot.

[0102] S2-4A, use the standard screenshot corresponding to the maximum similarity as the target screenshot.

[0103] In this regard, it can be understood that the maximum similarity is far from the similarity between the abnormal screenshot and other standard screenshots. At this time, the standard screenshot corresponding to the maximum similarity can be directly used as the target screenshot.

[0104] In addition, it was also found during the practical process that although the obtained maximum similarity is much higher than that of other standard screenshots, the maximum similarity is likely to be relatively small itself. For example, sometimes the obtained maximum similarity does not even reach 0.5. After research, it was found that this is mainly because when the user takes a screenshot, they may only capture a partial area of the test program interface, while the standard screenshot is a screenshot of the entire screen, thus affecting the matching effect. Therefore, in this embodiment, when the maximum similarity is small, the standard screenshot is cropped to a smaller size and then matched with the abnormal screenshot more precisely. Thus, as Figure 3A shown, this embodiment also provides the following optional implementation manners of step S2:

[0105] S2-1B, obtain the maximum similarity between the abnormal screenshot and multiple standard screenshots.

[0106] S2-2B, determine whether the maximum similarity is greater than a second threshold. If so, execute Figure 3B S2-3B in Figure 3C , otherwise, execute

[0107] S2-6B in Figure 3B Figure 3B

[0108]

[0109] wherein, the difference between the similarity between the candidate screenshot and the abnormal screenshot and the maximum similarity is less than a first threshold.

[0110] S2-4B, match the picture description information with the interface description information of the corresponding interface of each candidate screenshot, and determine the target screenshot from multiple candidate screenshots.

[0110] S2-5B, use the standard screenshot corresponding to the maximum similarity as the target screenshot.

[0111] It can be understood that in this embodiment, if the maximum similarity with multiple standard screenshots is greater than the set second threshold, it means that the matching result has a high credibility. Therefore, the maximum similarity can be continued to be used to find the target screenshot. Conversely, if the maximum similarity with multiple standard screenshots is less than or equal to the set second threshold, it means that the credibility of the matching result is low, and a more refined matching of the abnormal screenshot is required to find the target screenshot. Therefore, if the maximum similarity is less than or equal to the second threshold, then execute Figure 3C step S2-6B in

[0112] S2-6B, determine whether the abnormal screenshot is captured from a partial area of the complete interface of the test program. If so, execute Figure 3CIn step S2-7B therein, conversely, execute Figure 3C step S2-12B therein.

[0113] Optionally, the server can make a judgment based on the aspect ratio and / or absolute size of the abnormal screenshot. Taking the aspect ratio as an example, the server can extract the aspect ratio of the abnormal screenshot and compare it with the ratio of the complete interface screenshot. If there is a significant difference in the aspect ratio, it is considered a partial area screenshot. Taking the absolute size as an example, the server can measure the actual size of the abnormal screenshot and compare it with the size of the complete interface screenshot. If the size is significantly smaller, it can also be judged as a partial area screenshot.

[0114] For the method of determining whether the abnormal screenshot is taken from a partial area of the complete interface of the test program introduced in the above embodiments, next, continue with Figure 3C the description of step S2-7B therein:

[0115] S2-7B, select an unprocessed standard screenshot from multiple standard screenshots as the screenshot to be segmented.

[0116] In this regard, in this embodiment, the server can sort multiple standard screenshots according to the similarity from high to low to ensure that the most likely matching screenshot is ranked first. Then, select an unprocessed standard screenshot from the sorting result as the screenshot to be segmented. In addition, an unprocessed standard screenshot can also be randomly selected from multiple standard screenshots as the screenshot to be segmented.

[0117] Based on the above description of the method for selecting the screenshot to be segmented, next, continue with Figure 3C the description of step S2-8B therein:

[0118] S2-8B, segment the screenshot to be segmented into multiple sub-images through a sliding window.

[0119] Among them, the size of the sliding window is the size of the abnormal screenshot. It should be understood that segmenting the screenshot to be segmented into multiple sub-images through a sliding window aims to match the abnormal screenshot at a finer granularity. Therefore, setting the size of the sliding window to the same size as the abnormal screenshot can ensure that each sub-image has the same resolution and ratio as the abnormal screenshot, thereby improving the accuracy of matching. In this way, the part most similar to the abnormal screenshot can be found in the local area of the screenshot to be segmented, and then the interface and controls where the abnormality occurs can be more accurately located.

[0120] Exemplarily, such as Figure 4As shown in the figure, the screenshot 11 to be segmented is shown, and this screenshot 11 to be segmented is intercepted from the payment interface of a certain test program. The server can segment the screenshot 11 to be segmented along a preset direction through a sliding window 12 with the same size as the abnormal screenshot, so that the screenshot 11 to be segmented can be segmented into multiple sub-images. Among them, the step size of each slide of the sliding window 12 can be set as needed. For example, if you want to improve the matching accuracy, the step size can be set smaller. If you want to improve the matching efficiency, the step size can be set larger.

[0121] Based on the above description of the sub-image interception method in the embodiment, the following continues to describe Figure 3C step S2-9B in

[0122] S2-9B, obtain the maximum local similarity between the abnormal screenshot and multiple sub-images.

[0123] In this regard, the server can calculate the similarity between each sub-image and the abnormal screenshot to find the similarity value between each pair of sub-images and the abnormal screenshot. Among them, the similarity calculation can be realized through a variety of image processing technologies, such as using cosine similarity, Euclidean distance or other image matching algorithms. Finally, the server can find the maximum similarity value from the similarity values of all sub-images, and this maximum value is the maximum local similarity between the abnormal screenshot and multiple sub-images.

[0124] S2-10B, judge whether the maximum local similarity is less than the second threshold. If so, return to step S2-7B and continue to execute, otherwise, execute S2-11B:

[0125] S2-11B, take the sub-image corresponding to the maximum local similarity as the target sub-image, and take the standard screenshot to which the target sub-image belongs as the target screenshot.

[0126] S2-12B, send an alarm message to the tester.

[0127] In this regard, it should be understood that if the target screenshot still cannot be found after more refined matching of the abnormal screenshot, it may be that the user has made complex annotations or edits in the intercepted abnormal screenshot, resulting in too much interference information in the abnormal screenshot, affecting the matching effect. Therefore, for such abnormal situations, an alarm message can be sent to the tester for manual intervention and processing.

[0128] Based on the target screenshot obtained from the above embodiment, the following continues to describe Figure 1 、 Figure 2 or Figure 3A step S3 in

[0129] S3, determine the interface corresponding to the target screenshot as the target interface where the abnormality occurs.

[0130] Since multiple standard screenshots correspond to multiple interfaces of the test program, which means each standard screenshot corresponds to one interface of the test program, therefore, the interface corresponding to the target screenshot can be used as the target interface.

[0131] S4. Match the preset control structure information of the target interface with the picture description information to determine the target control with an abnormality in the target interface.

[0132] Among them, the control structure information describes the controls existing in the target interface and the relationships between the controls, usually including the ID, type, visible text / prompt of the control, as well as the coordinate size and parent-child hierarchy. This information can be stored in the form of JSON or XML.

[0133] Exemplarily, assume that the target interface is a payment interface. The server can analyze the key phrases in the picture description information by means of word segmentation. Here, assume that "confirm payment" is mentioned in the picture description information. Then, the server encodes "confirm payment", converts it into a corresponding word vector, and compares the cosine similarity between the encoded report text vector and the text vector of each control. If the word vector of "confirm payment" is relatively close to the text vector of a certain control, the server can determine that the control is the target control with an abnormality. Finally, the server can output abnormality location information such as "the confirm payment button on the payment interface".

[0134] It should be understood that every time a new abnormality is found in the test program, new test cases will be generated, and these new test cases will be added to the existing test case library, thus forming a continuously improved and perfected test system. However, for a test program, there are often a large number of test cases before crowdsourcing testing, but it still requires manual comparison of texts one by one to determine whether a certain new abnormality has been covered. If the scale of the use case library is large (from several hundred to thousands of items), this process will be very time-consuming and laborious. Even if it is finally determined that this scenario has not been covered, it is necessary to manually write a complete description of the test steps, which also requires a lot of energy.

[0135] In view of this, as Figure 5 shown, this embodiment further provides a test case generation method, and this method includes:

[0136] S5. Process the abnormal screenshot of the test program and the picture description information for the abnormal screenshot through the program abnormal position location method to determine the target interface with an abnormality and the target control with an abnormality in the target interface from multiple interfaces of the test program.

[0137] In this embodiment, the target interface where the test program has an exception and the target control in the target interface where the exception occurs can be determined through the above-mentioned exception location method. For the implementation details of the program exception location method, reference can be made to the above-mentioned implementation manners, and details will not be elaborated here.

[0138] Based on the above description of the target interface and the target control, the following continues to describe Figure 5 step S6 in

[0139] S6. Generate optimized picture description information according to the interface description information of the target interface, the control description information of the target control, and the picture description information of the exception screenshot.

[0140] Exemplarily, here it is assumed that the target interface is the "Payment Interface", and its corresponding interface description information includes information such as the name and function of the payment interface. The target control is the "Confirm Payment Button" in the payment interface, and the control description information includes information such as the name, usage method, and function of the confirm payment button. The picture description information of the exception screenshot is "The exception screenshot shows that the application crashed after this operation". The server can call the large language model to process this information and generate the optimized picture description information "After clicking the confirm payment button on the payment interface, the application crashes".

[0141] Based on the above description of the picture description information optimization method, continue to refer to Figure 5 and the following continues to describe Figure 5 step S6 in

[0142] S7. If the optimized picture description information cannot match a similar test case from the existing test documents, generate a new test case according to the optimized picture description information.

[0143] Exemplarily, the server vectorizes the optimized picture description information "After clicking the confirm payment button on the payment interface, the application crashes" through the CLIP model; then, combines the title, operation steps, and expected results of each test case in the existing test documents into a paragraph of text and encodes it into a vector, and calculates the cosine similarity between the two. If the cosine similarity < 0.7, it indicates that this defect scenario is likely not covered and a new test case needs to be generated.

[0144] If a new test case needs to be generated, the server can submit the above picture description information "After clicking the confirm payment button on the payment interface, the application crashes" to the large language model, and generate the following test case through the large language model:

[0145] Title: "Payment Interface_Confirm Payment Button_Crash Test"

[0146] Prerequisite: "Install the App and log in, enter the PaymentScreen"

[0147] Steps:

[0148] Click confirm_button "Confirm payment button"

[0149] Observe whether there is a flashback or crash

[0150] Expected result: "The App should jump to the next page normally and should not crash"

[0151] Based on the same inventive concept as the program abnormality location location method provided in this embodiment, this embodiment also provides a program abnormality location location device. The device includes at least one software function module that can be stored in a memory or fixed in an electronic device in the form of software. The processor in the electronic device is used to execute the executable module stored in the memory. For example, the software function module and computer program included in the device. Please refer to Figure 6 , functionally speaking, the device may include:

[0152] A report acquisition module 21 is used to acquire a report to be analyzed of the test program, wherein the report to be analyzed includes an abnormal screenshot of the test program and image description information for the abnormal screenshot;

[0153] The abnormality locating module 22 is used to determine the target screenshot that is most similar to the abnormal screenshot from a plurality of preset standard screenshots, wherein the plurality of standard screenshots correspond to a plurality of interfaces of the test program; and determine the interface corresponding to the target screenshot as the target interface where the abnormality occurs;

[0154] The abnormality locating module 22 is also used to match the control structure information preset in the target interface with the image description information to determine the target control where the abnormality occurs in the target interface, wherein the control structure information describes the controls existing in the target interface and the relationship between the controls.

[0155] In this embodiment, the report acquisition module 21 is used to implement Figure 1 In step S1, the abnormality location module 22 is used to implement Figure 1 Therefore, for the detailed description of the above modules, please refer to the specific implementation of the corresponding steps.

[0156] In addition, since the method for locating the position of anomaly in a program has the same inventive concept as that provided in this embodiment, the device for locating the position of anomaly in a program can also implement other steps or sub-steps of the method through the above modules.

[0157] Optionally, the abnormality locating module 22 is further specifically configured to:

[0158] Obtain the maximum similarity between the abnormal screenshot and multiple standard screenshots;

[0159] Determine whether multiple candidate screenshots can be determined from multiple standard screenshots, where the difference between the similarity between the candidate screenshot and the abnormal screenshot and the maximum similarity is less than the first threshold;

[0160] If multiple candidate screenshots can be determined, match the picture description information with the interface description information of each candidate screenshot's corresponding interface, and determine the target screenshot from multiple candidate screenshots.

[0161] Optionally, after the abnormal location module 22 obtains the maximum similarity between the abnormal screenshot and multiple standard screenshots, the abnormal location module 22 is further configured to:

[0162] Judge whether the maximum similarity is greater than the second threshold;

[0163] If it is greater than the second threshold, execute the step of determining whether multiple candidate screenshots can be determined from multiple standard screenshots.

[0164] Optionally, the abnormal location module 22 is further configured to:

[0165] If it is less than or equal to the second threshold, judge whether the abnormal screenshot is intercepted from a partial area of the complete interface of the test program;

[0166] If it is intercepted from a partial area of the complete interface of the test program, select an unprocessed standard screenshot from multiple standard screenshots as the screenshot to be segmented;

[0167] Segment the screenshot to be segmented into multiple sub-images through a sliding window, where the size of the sliding window is the size of the abnormal screenshot;

[0168] Obtain the maximum local similarity between the abnormal screenshot and multiple sub-images;

[0169] If the maximum local similarity is less than the second threshold, return to the step of selecting an unprocessed standard screenshot from multiple standard screenshots as the screenshot to be segmented until a target sub-image whose maximum local similarity with the abnormal screenshot is greater than the second threshold is determined;

[0170] Use the standard screenshot to which the target sub-image belongs as the target screenshot.

[0171] Optionally, the report acquisition module 21 is further specifically configured to:

[0172] Obtain multiple test reports of the test program;

[0173] Classify the multiple test reports to obtain a classification set of the multiple test reports;

[0174] Extract the report to be analyzed from the classification set.

[0175] Optionally, each test report includes a screenshot of the exception of the test program and picture description information for the screenshot of the exception; the report acquisition module 21 is further specifically configured to:

[0176] Extract the features in the screenshot of the exception and the picture description information in each test report to obtain the feature vector of each test report;

[0177] Perform clustering based on the feature vectors of each test report to obtain the classification set of multiple test reports.

[0178] Based on the same inventive concept as the test case generation method, as Figure 7 shown, this embodiment further provides a test case generation device, and the device includes:

[0179] An exception analysis module 23, configured to process the screenshot of the exception of the test program and the picture description information for the screenshot of the exception by using a program exception location positioning method, and determine the target interface where the exception occurs and the target control where the exception occurs in the target interface from multiple interfaces of the test program;

[0180] A test case module 24, configured to generate optimized picture description information according to the interface description information of the target interface, the control description information of the target control, and the picture description information; if the optimized picture description information cannot match a similar test case from the existing test documents, generate a new test case according to the optimized picture description information.

[0181] In this embodiment, the exception analysis module 23 is used to implement Figure 5 step S5 in, and the test case module 24 is used to implement Figure 5 steps S6 and S7 in. Therefore, for the detailed descriptions of the above modules, reference can be made to the specific implementation manners of the corresponding steps.

[0182] In addition, in each embodiment of the present application, the functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.

[0183] It should also be understood that if the above embodiments are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application.

[0184] Therefore, this embodiment also provides a storage medium, which is a computer-readable storage medium. This storage medium stores a computer program, and when the computer program is executed by a processor, it implements the program exception location method or the test case generation method provided in this embodiment. Among them, the storage medium can be various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc.

[0185] An electronic device for implementing the program exception location method provided in this embodiment. As Figure 8 shown, the electronic device may include a processor 32 and a memory 31. And, the memory 31 stores a computer program, and the processor reads and executes the computer program corresponding to the above embodiments in the memory 31 to implement the program exception location method or the test case generation method provided in this embodiment.

[0186] Continue to refer to Figure 8 , the electronic device further includes a communication unit 33. Each element of the memory 31, the processor 32, and the communication unit 33 is directly or indirectly electrically connected through a system bus 34 to realize data transmission or interaction.

[0187] Among them, the memory 31 can be an information recording device based on any electronic, magnetic, optical, or other physical principles for recording execution instructions, data, etc. In some embodiments, the memory 31 can be, but is not limited to, a volatile memory, a non-volatile memory, a storage drive, etc.

[0188] In some embodiments, the volatile memory may be a Random Access Memory (RAM); in some embodiments, the non-volatile memory may be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electric Erasable Programmable Read-Only Memory (EEPROM), a flash memory, etc.; in some embodiments, the storage drive may be a disk drive, a solid state drive, any type of storage disk (such as an optical disk, a DVD, etc.), or a similar storage medium, or a combination thereof, etc.

[0189] The communication unit 33 is configured to transmit and receive data via a network. In some embodiments, the network may include a wired network, a wireless network, an optical fiber network, a telecommunication network, an intranet, the Internet, a Local Area Network (LAN), a Wide Area Network (WAN), a Wireless Local Area Networks (WLAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a Public Switched Telephone Network (PSTN), a Bluetooth network, a ZigBee network, or a Near Field Communication (NFC) network, etc., or any combination thereof. In some embodiments, the network may include one or more network access points. For example, the network may include a wired or wireless network access point, such as a base station and / or a network switching node, and one or more components of the service request processing system may be connected to the network via the access point to exchange data and / or information.

[0190] The processor 32 may be an integrated circuit chip with signal processing capabilities, and the processor may include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the above-mentioned processor may include a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), an Application Specific Instruction-set Processor (ASIP), a Graphics Processing Unit (GPU), a Physics Processing Unit (PPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), a Programmable Logic Device (PLD), a controller, a microcontroller unit, a Reduced Instruction Set Computing (RISC), or a microprocessor, etc., or any combination thereof.

[0191] It can be understood that Figure 8 the structure shown is only schematic. The electronic device may also have more or fewer components than Figure 8 shown, or have a different configuration from Figure 8 that shown. Figure 8 Each of the components shown may be implemented using hardware, software, or a combination thereof.

[0192] It should be understood that the devices and methods disclosed in the above embodiments can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0193] As described above, these are only various embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for locating the position of program anomalies, characterized in that, The method includes: Obtaining an analysis - to - be - reported of a test program, where the analysis - to - be - reported includes an abnormal screenshot of the test program and picture description information for the abnormal screenshot; Determining a target screenshot that is most similar to the abnormal screenshot from a preset multiple standard screenshots, where the multiple standard screenshots correspond to multiple interfaces of the test program; Determining the interface corresponding to the target screenshot as the target interface where an abnormality occurs; Matching the preset control structure information of the target interface with the picture description information to determine the target control where an abnormality occurs in the target interface.

2. The method for locating the program exception position according to claim 1, wherein Determining a target screenshot that is most similar to the abnormal screenshot from a preset multiple standard screenshots includes: Obtaining the maximum similarity between the abnormal screenshot and the multiple standard screenshots; Judging whether multiple candidate screenshots can be determined from the multiple standard screenshots, where the difference between the similarity between a candidate screenshot and the abnormal screenshot and the maximum similarity is less than a first threshold; If multiple candidate screenshots can be determined, then matching the picture description information with the interface description information of the interface corresponding to each candidate screenshot, and determining the target screenshot from the multiple candidate screenshots.

3. The method for locating the program anomaly position according to claim 2, characterized in that, After obtaining the maximum similarity between the abnormal screenshot and the multiple standard screenshots, the method further includes: Judging whether the maximum similarity is greater than a second threshold; If it is greater than the second threshold, then execute the step of judging whether multiple candidate screenshots can be determined from the multiple standard screenshots.

4. The program exception location positioning method according to claim 3, wherein The method further includes: If it is less than or equal to the second threshold, then judging whether the abnormal screenshot is taken from a partial area of the complete interface of the test program; If it is taken from a partial area of the complete interface of the test program, then selecting an unprocessed standard screenshot from the multiple standard screenshots as the screenshot to be segmented; Dividing the screenshot to be segmented into multiple sub - images through a sliding window, where the size of the sliding window is the size of the abnormal screenshot; Obtaining the maximum local similarity between the abnormal screenshot and the multiple sub - images; If the maximum local similarity is less than the second threshold, then return to the step of selecting an unprocessed standard screenshot from the multiple standard screenshots as the screenshot to be segmented until a target sub - image with a maximum local similarity greater than the second threshold between the abnormal screenshot and the target sub - image is determined; Taking the standard screenshot to which the target sub - image belongs as the target screenshot.

5. The method for locating the program exception position according to any one of claims 1-4, characterized in that Obtaining an analysis - to - be - reported of a test program includes: Obtaining multiple test reports of the test program; Classifying the multiple test reports to obtain a classification set of the multiple test reports; Extracting the analysis - to - be - reported from the classification set.

6. The method for locating the program exception position according to claim 5, characterized in that, Each test report includes an abnormal screenshot of the test program and picture description information for the abnormal screenshot; Classifying the multiple test reports to obtain a classification set of the multiple test reports includes: Extracting features in the abnormal screenshot and the picture description information of each test report to obtain a feature vector of each test report; Cluster according to the eigenvectors of each of the said test reports to obtain the classification set of the said multiple test reports.

7. A test case generation method, characterized in that, The said method includes: Process the abnormal screenshots of the test program and the picture description information for the said abnormal screenshots through the program abnormal position locating method according to any one of claims 1-6, and determine the target interface where the abnormality occurs and the target control where the abnormality occurs in the said target interface from among the multiple interfaces of the test program; Generate optimized picture description information according to the interface description information of the said target interface, the control description information of the said target control, and the picture description information of the said abnormal screenshot; If the optimized picture description information cannot match a similar test case from the existing test documents, generate a new test case according to the optimized picture description information.

8. A program exception location positioning device, characterized in that, The said device includes: A report acquisition module, configured to acquire the report to be analyzed of the test program, wherein the said report to be analyzed includes the abnormal screenshots of the test program and the picture description information for the said abnormal screenshots; An abnormality location module, configured to determine the target screenshot most similar to the said abnormal screenshot from among a preset multiple standard screenshots, wherein the said multiple standard screenshots correspond to multiple interfaces of the test program; determine the interface corresponding to the said target screenshot as the target interface where the abnormality occurs; The said abnormality location module is further configured to match the preset control structure information of the said target interface with the picture description information to determine the target control where the abnormality occurs in the said target interface.

9. A test case generation device, characterized in that The said device includes: An abnormality parsing module, configured to process the abnormal screenshots of the test program and the picture description information for the said abnormal screenshots through the program abnormal position locating device according to claim 8, and determine the target interface where the abnormality occurs and the target control where the abnormality occurs in the said target interface from among the multiple interfaces of the test program; A test case module, configured to generate optimized picture description information according to the interface description information of the said target interface, the control description information of the said target control, and the picture description information; if the optimized picture description information cannot match a similar test case from the existing test documents, generate a new test case according to the optimized picture description information.

10. A storage medium, characterized in that, The said storage medium stores a computer program, which, when executed by a processor, implements the program abnormal position locating method according to any one of claims 1-6 or the test case generation method according to claim 7.

11. An electronic device, characterized in that, The said electronic device includes a processor and a memory, the memory stores a computer program, which, when executed by the said processor, implements the program abnormal position locating method according to any one of claims 1-6 or the test case generation method according to claim 7.