Search

CN-121996551-A - GUI automatic test method based on support vector machine

CN121996551ACN 121996551 ACN121996551 ACN 121996551ACN-121996551-A

Abstract

The invention discloses a GUI automatic test method based on a support vector machine, belongs to the field of software testing, and aims to solve the problems that a test script is high in maintenance cost, the script is easy to fail after UI (user interface) is changed and test data preparation is complicated in a traditional GUI test technology. The method comprises the steps of executing pywinauto +OCR+template matching three-stage identification on a Windows platform GUI application to be tested, extracting structural element information containing names, types, coordinates and Automation_id, generating a test input dataset by combining PICT tools and boundary value analysis based on the element information, dividing a training set and a testing set, obtaining an optimized SVM model by iterative training based on the training dataset, then transmitting the testing set into the optimizing model, obtaining expected results of the testing case by predictive decoding, assembling the testing case set, automatically executing testing, and completing assertion comparison of actual results and expected results. The method and the device realize high-precision identification of the full-class control and automatic generation of the test cases, improve the test coverage rate and efficiency, and are suitable for Windows platform GUI application test.

Inventors

  • ZHENG JIANING
  • ZHAO XIAOYING
  • SUN QIFENG

Assignees

  • 桂林电子科技大学

Dates

Publication Date
20260508
Application Date
20260119

Claims (5)

  1. 1. The GUI automatic test method based on the support vector machine is characterized by comprising the following steps of: 1) For Windows platform GUI application to be tested, extracting full-type GUI element information by adopting a three-level recognition strategy; 2) Automatically generating a test input data set by using a combined test tool PICT; 3) Automatically generating test cases by using a support vector machine model; 4) And generating a test report according to the test result, wherein the test report comprises core indexes such as generation time, total use case number, passing rate and the like.
  2. 2. The GUI automatic test method based on the support vector machine according to claim 1, wherein pywinauto control recognition is used as a core, OCR recognition and template matching recognition are used as supplements, and high-precision recognition of GUI elements in different scenes is realized.
  3. 3. The GUI automatic test method based on the support vector machine according to claim 1, wherein a standard PICT model file format is defined based on the structured information of GUI elements, the GUI element characteristic information is automatically converted into a preset PICT model file, and then a training data set is constructed by using a PICT tool and boundary value analysis.
  4. 4. The method for automatically testing a GUI based on a support vector machine according to claim 1, wherein an SVM model is constructed, and multi-dimensional GUI element information is included in the test input data set, and a plurality of training rounds are performed based on the SVM model.
  5. 5. The GUI automatic test method based on the support vector machine of claim 1, wherein the automatic test is executed according to test cases, and the actual execution result is collected and compared with the expected result. And integrating the test execution results to generate a visual HTML test report containing core indexes such as generation time, total use cases, passing rate and the like.

Description

GUI automatic test method based on support vector machine Technical Field The invention belongs to the field of software testing, and discloses a GUI automatic testing method based on a support vector machine, which is suitable for Windows application automatic testing scenes. Background Along with the development of science and technology, the software is applied to the aspects of life of people, plays an important role in various industries and fields, and the requirements on the quality of the software are gradually improved. The software test is a key work for guaranteeing good reliability of software, and can discover the problems as early as possible, thereby occupying very important position in the whole research and development process. The graphical user interface is an interactive interface in software or application, which enables a user to directly operate through visual graphical elements, and is a bridge for the communication between the software and the user. Most of software, mobile phone application programs and the like commonly used in life and work interact with users through GUI interfaces, the content display is visual, the operation is simple, a large number of GUI elements exist in interfaces of the GUI programs with rich functions, and GUI testing is more complex. Traditional manual test and test case design methods rely on manual operation, human errors and omission are easy to occur, repeatability is low, a great deal of cost and time are required, and the requirements of rapid iteration and high-quality delivery of modern software are difficult to meet. The existing automatic testing method is difficult to realize effective balance among testing efficiency, coverage area and stability, and particularly, the testing effect of the existing automatic testing method cannot reach expectations when the requirements of increasingly-improved dynamic performance, complexity and user experience of modern GUI interfaces are met. In GUI testing of Windows applications, automatic generation of test input data and automatic generation of test cases are important links for automated testing. The input data portion of the test cases is designed by the requirement document, the design document and the history test data of the software, and the automatic generation of the test cases is complicated and is not suitable for all Windows applications. Machine learning is based on a statistical learning theory, and by optimizing a loss function in a high-dimensional feature space to learn a mapping relation, the complex problems of classification, prediction, decision making and the like are efficiently solved, and rapid development has been realized in recent years and strong complex pattern recognition and prediction capability is exhibited. Under the background, the invention provides a GUI automatic test method of a support vector machine, which automatically generates input data by identifying GUI elements and applying a combined test tool, and trains an SVM model for an expected result corresponding to the generated input data. The method automatically generates input data and predicts expected output, and finally generates a test report after test is executed. The data set which is generated by applying the combined testing tool and is finally applied to generating the expected output accords with the testing coverage rate and is as small as possible, so that the testing integrity is ensured, the testing execution and maintenance cost is obviously reduced, and the testing efficiency is improved. Disclosure of Invention The invention aims to solve the problems that the traditional GUI testing technology has high maintenance cost of a testing script, easy failure of the script after UI change and complicated preparation of testing data. Although the existing method can automatically generate input parameters of test cases in batches, expected verification results corresponding to the input cannot be synchronously output, so that the generated test cases cannot be directly used for a result assertion link in an automatic test flow. The invention provides a GUI automatic test method based on a support vector machine, which is characterized in that GUI elements are identified from an application interface, test cases are generated through a combined test tool and an SVM model, some pain points encountered in the traditional automatic test are effectively solved, the double cost of test execution and script maintenance can be reduced on the basis of ensuring the comprehensiveness of test coverage, and the overall test efficiency is further improved. The technical scheme of the invention is that the GUI automatic testing method based on the support vector machine is characterized in that a control identification technology is used for extracting GUI element information from an interface of an application to be tested, the GUI element information is used as input data, and a testing tool and an SVM model