[go: up one dir, main page]

CN110287111B - A method and device for generating test cases for user interface - Google Patents

A method and device for generating test cases for user interface Download PDF

Info

Publication number
CN110287111B
CN110287111B CN201910540156.1A CN201910540156A CN110287111B CN 110287111 B CN110287111 B CN 110287111B CN 201910540156 A CN201910540156 A CN 201910540156A CN 110287111 B CN110287111 B CN 110287111B
Authority
CN
China
Prior art keywords
user interface
test
control module
control
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910540156.1A
Other languages
Chinese (zh)
Other versions
CN110287111A (en
Inventor
袁文静
周杰
方镇举
卢道和
翁玉萍
陈文龙
黄涛
韩海燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910540156.1A priority Critical patent/CN110287111B/en
Publication of CN110287111A publication Critical patent/CN110287111A/en
Priority to PCT/CN2020/091930 priority patent/WO2020253466A1/en
Application granted granted Critical
Publication of CN110287111B publication Critical patent/CN110287111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明实施例提供了一种用户界面的测试用例生成方法及装置,涉及金融科技技术领域,该方法包括:采用图像识别模型识别用户界面的图像特征,确定用户界面中的控件模块,每个控件模块包括控件类型信息和控件位置信息,然后根据每个控件模块及预设的控件操作生成用户界面的测试用例,而不需要人工识别用户界面中的控件并编写代码生成测试用例,从而提高了生成测试用例的效率,进一步可以提高用户界面的测试效率,降低用户界面的测试成本。通过比较不同版本的用户界面的差异度判断用户界面是否更新,若更新,则重新生成用户界面的测试用例来更新历史版本界面的测试用例,无需人工参更新和维护,从而提高用户界面的测试用例的更新效率。

The embodiment of the present invention provides a method and device for generating test cases for a user interface, which relates to the field of financial technology. The method includes: using an image recognition model to identify image features of a user interface, determining control modules in the user interface, each control module including control type information and control location information, and then generating test cases for the user interface according to each control module and preset control operations, without the need to manually identify controls in the user interface and write code to generate test cases, thereby improving the efficiency of generating test cases, further improving the testing efficiency of the user interface, and reducing the testing cost of the user interface. By comparing the differences between different versions of the user interface, it is determined whether the user interface is updated. If updated, the test cases of the user interface are regenerated to update the test cases of the historical version interface, without the need for manual update and maintenance, thereby improving the update efficiency of the test cases of the user interface.

Description

Test case generation method and device for user interface
Technical Field
The embodiment of the invention relates to the technical field of financial science and technology, in particular to a method and a device for generating a test case of a user interface.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changed to the financial technology (Fintech), but due to the requirements of safety and real-time performance of the financial industry, the requirements of the technology are also higher. At present, more and more user interface software in the financial industry has higher and higher requirements for automatic testing of the user interface software. In some test modes, when the test cases are generated, the control in the user interface is required to be manually participated in recognition, and codes are manually written to generate the test cases.
Disclosure of Invention
Due to the fact that the method for manually generating the test cases is low in efficiency, the embodiment of the invention provides a method and a device for generating the test cases of a user interface.
In one aspect, an embodiment of the present invention provides a method for generating a test case of a user interface, including:
Acquiring a user interface;
Identifying image characteristics of the user interface by adopting an image identification model, and determining control modules in the user interface, wherein each control module comprises control type information and control position information;
and generating a test case of the user interface according to each control module and preset control operation.
Optionally, the generating the test case of the user interface according to each control module and a preset control operation includes:
Decoding control type information and control position information of each control module by adopting a cyclic neural network model, and generating a test code corresponding to the user interface;
compiling the test codes corresponding to the user interface and preset control operation to generate a test case of the user interface.
Optionally, the method further comprises:
And executing the test case of the user interface to obtain a test result of the user interface.
Optionally, the method further comprises:
Generating a test case set according to the test cases of the plurality of user interfaces;
and executing the test case set to obtain test results of a plurality of user interfaces.
Optionally, the image recognition module is used for recognizing the image features of the user interface, determining a control module in the user interface, and further comprising:
Comparing the user interface with a history version interface of the user interface;
and when the difference degree between the user interface and the historical version interface is larger than a preset threshold, adopting an image recognition model to recognize the image characteristics of the user interface, and determining a control module in the user interface.
Optionally, the method further comprises:
and updating the test cases of the history version interface by adopting the test cases of the user interface.
In one aspect, an embodiment of the present invention provides a test case generating device for a user interface, including:
the acquisition module is used for acquiring a user interface;
the identification module is used for identifying the image characteristics of the user interface by adopting an image identification model, and determining control modules in the user interface, wherein each control module comprises control type information and control position information;
And the processing module is used for generating the test case of the user interface according to each control module and the preset control operation.
Optionally, the processing module is specifically configured to:
Decoding control type information and control position information of each control module by adopting a cyclic neural network model, and generating a test code corresponding to the user interface;
compiling the test codes corresponding to the user interface and preset control operation to generate a test case of the user interface.
Optionally, the processing module is further configured to:
And executing the test case of the user interface to obtain a test result of the user interface.
Optionally, the processing module is further configured to:
Generating a test case set according to the test cases of the plurality of user interfaces;
and executing the test case set to obtain test results of a plurality of user interfaces.
Optionally, the identifying is specifically used for:
Comparing the user interface with a history version interface of the user interface;
and when the difference degree between the user interface and the historical version interface is larger than a preset threshold, adopting an image recognition model to recognize the image characteristics of the user interface, and determining a control module in the user interface.
Optionally, the system further comprises an updating module;
The updating module is specifically configured to:
and updating the test cases of the history version interface by adopting the test cases of the user interface.
In one aspect, an embodiment of the present invention provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of a test case generation method of a user interface when the program is executed.
In one aspect, embodiments of the present invention provide a computer-readable storage medium storing a computer program executable by a computer device, which when run on the computer device, causes the computer device to perform the steps of a test case generation method of a user interface.
In the embodiment of the invention, the image recognition model is adopted to recognize the image characteristics of the user interface, the control modules in the user interface are determined, each control module comprises control type information and control position information, and then the test case of the user interface is generated according to each control module and the preset control operation. And the control in the user interface is not required to be identified manually and the code is written to generate the test case, so that the efficiency of generating the test case is improved, the test efficiency of the user interface is further improved, and the test cost of the user interface is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present invention;
FIG. 2 is a flowchart of a method for generating test cases of a user interface according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a user interface according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a user interface according to an embodiment of the present invention;
FIG. 5 is a flowchart of a method for generating test cases of a user interface according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a device for generating test cases of a user interface according to an embodiment of the present invention;
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantageous effects of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
For ease of understanding, the terms involved in the embodiments of the present invention are explained below.
UI (User Interface), medium for interaction and information exchange between system and User.
CNN (Convolutional Neural Networks, convolutional neural network), a feed-forward neural network, consists of one or more convolutional layers and top fully connected layers (corresponding to classical neural networks) and also includes associated weights and pooling layers. Convolutional neural networks have excellent performance in terms of image processing.
RNNs (Recurrent Neural Network, recurrent neural networks), a class of neural networks with short-term memory capabilities. In the recurrent neural network, neurons can receive not only information of other neurons but also information of the neurons themselves, and a network structure with loops is formed.
DSL (domain-specific language, domain specific language).
The test case generation method of the user interface in the embodiment of the invention can be applied to an application scene shown in fig. 1, wherein the application scene comprises front-end equipment 101 and a test system 102. The front-end device 101 may be a smart phone, tablet or portable personal computer, etc. The front-end equipment 101 pre-installs the application software related to the financial industry, the front-end equipment 101 runs the application software, intercepts the user interface of the application software and sends the user interface to the test system 102. The test system 102 includes a continuous integrated test platform 1021, an update test platform 1022. The continuous integrated test platform 1021 adopts an image recognition model to recognize image characteristics of a user interface, determines control modules in the user interface, each control module comprises control type information and control position information, then generates test cases of the user interface according to each control module and preset control operation, and then generates test case sets according to the test cases of a plurality of user interfaces. The continuous integrated test platform 1021 executes the test case set to obtain test results of a plurality of user interfaces. The update detection platform 1022 compares the user interface with the historical version interface of the user interface, and when the difference degree between the user interface and the historical version interface is determined to be greater than a preset threshold value, the test case of the historical version interface is updated by using the test case of the user interface.
Based on the application scenario diagram shown in fig. 1, the embodiment of the present invention provides a flow of a method for generating a test case of a user interface, where the flow of the method may be executed by a test case generating device of the user interface, and the test case generating device of the user interface may be the test system 102 in fig. 1, as shown in fig. 2, and includes the following steps:
Step S201, a user interface is acquired.
Specifically, the user interface is an image taken from application software executing on the front-end device. Illustratively, in the user interface shown in FIG. 3, a switch, an add button, a slider bar are included.
Step S202, the image recognition model is adopted to recognize the image characteristics of the user interface, and a control module in the user interface is determined.
Specifically, the image recognition model may be a convolutional neural network model, a forward neural network model, or the like. Because different controls have different image features, the image recognition model recognizes the image features of the user interface, and the user interface can be divided into a plurality of control modules, each of which includes control type information and control position information. Illustratively, as shown in fig. 4, the image features of the user interface shown in fig. 3 are identified by using a convolutional neural network model, the user interface shown in fig. 3 is divided into 3 control modules, which can be divided into a switch control module, an add button control module and a slider control module according to control types, the switch control module includes position information of the switch control, the add button control module includes position information of the add button, and the slider control module includes position information of the slider control.
Step S203, a test case of the user interface is generated according to each control module and the preset control operation.
Specifically, the control operations include clicking, inputting, sliding, and the like.
In the embodiment of the invention, the image recognition model is adopted to recognize the image characteristics of the user interface, the control modules in the user interface are determined, each control module comprises control type information and control position information, then the test case of the user interface is generated according to each control module and the preset control operation, and the control in the user interface is not required to be manually recognized and the code is written to generate the test case, so that the efficiency of generating the test case is improved, the test efficiency of the user interface is further improved, and the test cost of the user interface is reduced.
Optionally, in the step S203, embodiments of the present invention provide at least the following two implementations of test cases for generating a user interface:
In one possible implementation, the control type information and the control position information of each control module are decoded by using a cyclic neural network model, and a test code corresponding to the user interface is generated. Compiling the test codes corresponding to the user interface and preset control operation to generate a test case of the user interface.
Specifically, the cyclic neural network model decodes the control type information and the control position information of each control module, each hidden state of the cyclic neural network model contains the context information of the control module, and then generates test codes according to the context information and the corresponding control module, wherein the test codes can be DSL codes. The DSL codes corresponding to the control module are generated by decoding control type information and control position information of the switch control module by adopting a cyclic neural network model, wherein the label is a label, the switch is a switch, x and y are coordinates of the control, l is the length of the control, and w is the width of the control. DSL codes corresponding to other control modules in the user interface can be generated by adopting the same method, and finally the DSL codes of the user interface are obtained by adopting the context information of the control module identified by the cyclic neural network model and the DSL codes corresponding to the control module. Compiling the DSL code and the preset control operation corresponding to each control module in the user interface to generate a test case of the user interface. The control module in the user interface image is converted into the test code by adopting the cyclic neural network model, and then the test code and the control operation are compiled into the test case, so that the test code does not need to be manually written and maintained, and the efficiency of generating the test case is improved.
In one possible implementation, the test code corresponding to each control module is generated according to the control type information and the control position information of each control module. And combining the control position information of each control module with the test codes corresponding to all the control modules to generate the test codes corresponding to the user interface. Compiling the test codes corresponding to the user interface and preset control operation to generate a test case of the user interface.
When testing the user interface, the embodiment of the invention at least provides the following two testing modes:
In one possible implementation manner, after the test case of the user interface is generated, the test case of the user interface may be executed to obtain the test result of the user interface, and further, the test result of the user interface may be sent to the related tester to implement the test on the user interface.
In another possible implementation manner, after the test cases of the user interfaces are generated, a test case set is generated according to the test cases of the plurality of user interfaces, and then the test case set is executed to obtain test results of the plurality of user interfaces. Further, a test report may be generated based on the test results of the plurality of user interfaces and sent to a tester, thereby enabling testing of the batch of user interfaces.
Optionally, in step S202, after the user interface is obtained, the user interface may be compared with a historical version interface of the user interface, and when it is determined that the difference between the user interface and the historical version interface is greater than a preset threshold, an image recognition model is used to recognize image features of the user interface, and a control module in the user interface is determined.
Specifically, with the update of the version of the application software, the corresponding user interface may or may not be updated, so that when the version of the application software is updated, whether the user interface is updated can be judged first, and then whether the test case of the user interface needs to be generated can be further determined. The degree of difference between the user interface and the historical version interface may be determined using an average hash (dhash) algorithm, a perceptual hash (phash) algorithm, a difference value hash (dhash) algorithm, or the like. When the difference is larger than the preset threshold, the user interface of the current version is changed compared with the user interface of the historical version, and when the user interface of the current version is tested by adopting the test cases of the historical version interface, the test results deviate, so that the test cases need to be regenerated. When the difference degree is not greater than the preset threshold value, the user interface of the current version is basically unchanged compared with the user interface of the historical version, the user interface of the current version can be tested by adopting the test cases of the interface of the historical version, and the test cases of the user interface do not need to be repeatedly generated.
Further, after the test cases of the user interface are generated, the test cases of the history version interface may be updated by using the test cases of the user interface. For example, the test cases of the user interface may be directly replaced with the test cases of the history version interface. And judging whether the user interface is updated or not by comparing the difference degrees of the user interfaces of different versions, and if so, regenerating the test cases of the user interface to update the test cases of the historical version interface without manually updating and maintaining, thereby improving the updating efficiency of the test cases of the user interface.
In order to better explain the embodiment of the present invention, the method for generating a test case of a user interface according to the embodiment of the present invention is described below in conjunction with a specific implementation scenario, where the method is executed by a test case generating device of the user interface, as shown in fig. 5, and includes the following steps:
Step S501, a user interface is acquired.
Step S502, a difference value hash algorithm is adopted to determine the difference degree between the user interface and the historical version interface of the user interface.
Step S503, judging whether the difference degree between the user interface and the history version interface is larger than a preset threshold, if yes, executing step S504, otherwise executing step S511.
Specifically, a variability test report is generated between the user interface and a historical version interface of the user interface.
Step S504, adopting a convolutional neural network model to identify the image characteristics of the user interface, and determining a control module in the user interface.
Each control module includes control type information and control location information.
And step S505, decoding the control type information and the control position information of each control module by adopting the cyclic neural network model, and generating a test code corresponding to the user interface.
Step S506, compiling the test codes corresponding to the user interface and the preset control operation to generate the test case of the user interface.
Step S507, the test cases of the history version interface are updated by adopting the test cases of the user interface.
Step S508, generating test case sets according to the test cases of the plurality of user interfaces.
Step S509, executing the test case set to obtain test results of a plurality of user interfaces.
Step S510, generating a test report and sending the test report to a tester.
Step S511, executing the test cases of the history version interface to obtain the test result of the user interface.
In the embodiment of the invention, the image recognition model is adopted to recognize the image characteristics of the user interface, the control modules in the user interface are determined, each control module comprises control type information and control position information, then the test case of the user interface is generated according to each control module and the preset control operation, and the control in the user interface is not required to be manually recognized and the code is written to generate the test case, so that the efficiency of generating the test case is improved, the test efficiency of the user interface is further improved, and the test cost of the user interface is reduced. And the control in the user interface image is converted into a test code by adopting a cyclic neural network model, and then the test code and the control operation are compiled into the test case, so that the test code does not need to be manually written and maintained, and the efficiency of generating the test case is improved. And judging whether the user interface is updated or not by comparing the difference degrees of the user interfaces of different versions, and if so, regenerating the test cases of the user interface to update the test cases of the historical version interface without manually updating and maintaining, thereby improving the updating efficiency of the test cases of the user interface.
In order to better explain the embodiment of the present invention, a method for testing a user interface of financial application software is described below by taking the user interface as an example, where the method is interactively performed by a front-end device and a testing system, and includes:
The front-end equipment is provided with financial application software to be tested and runs the financial application software, the front-end equipment intercepts a user interface of the financial application software and sends the user interface to the testing system, and the intercepted user interface comprises a login interface, a financial business operation interface and the like. Aiming at a login interface, a testing system adopts a convolutional neural network model to identify image characteristics of the login interface, a control module in the login interface is determined, the control module in the login interface comprises a user name input box module, a password input box module and a login button module, and each control module comprises control type information and control position information. And then, decoding the control type information and the control position information of each control module by adopting the cyclic neural network model, and generating a test code corresponding to the login interface. Compiling the test codes corresponding to the login interface and preset control operation to generate a test case of the login interface. Test cases of other user interfaces such as the financial business operation interface are generated according to the same method, and are not repeated here. And generating test case sets from the test cases of the plurality of user interfaces intercepted by the financial application software, then executing the test cases, generating a user interface test report of the financial application software and sending the test report to a tester.
Based on the same technical concept, an embodiment of the present invention provides a test case generating device of a user interface, as shown in fig. 6, the device 600 includes:
an obtaining module 601, configured to obtain a user interface;
The identification module 602 is configured to identify image features of the user interface by using an image identification model, and determine control modules in the user interface, where each control module includes control type information and control position information;
And the processing module 603 is configured to generate a test case of the user interface according to each control module and a preset control operation.
Optionally, the processing module 603 is specifically configured to:
Decoding control type information and control position information of each control module by adopting a cyclic neural network model, and generating a test code corresponding to the user interface;
compiling the test codes corresponding to the user interface and preset control operation to generate a test case of the user interface.
Optionally, the processing module 603 is further configured to:
And executing the test case of the user interface to obtain a test result of the user interface.
Optionally, the processing module 603 is further configured to:
Generating a test case set according to the test cases of the plurality of user interfaces;
and executing the test case set to obtain test results of a plurality of user interfaces.
Optionally, the identification module 602 is specifically configured to:
Comparing the user interface with a history version interface of the user interface;
and when the difference degree between the user interface and the historical version interface is larger than a preset threshold, adopting an image recognition model to recognize the image characteristics of the user interface, and determining a control module in the user interface.
Optionally, an update module 604 is also included;
the update module 604 is specifically configured to:
and updating the test cases of the history version interface by adopting the test cases of the user interface.
Based on the same technical concept, an embodiment of the present invention provides a computer device, as shown in fig. 7, including at least one processor 701, and a memory 702 connected to the at least one processor, where a specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present invention, and in fig. 7, the processor 701 and the memory 702 are connected by a bus, for example. The buses may be divided into address buses, data buses, control buses, etc.
In the embodiment of the present invention, the memory 702 stores instructions executable by the at least one processor 701, and the at least one processor 701 can execute the steps included in the test case generating method of the user interface by executing the instructions stored in the memory 702.
The processor 701 is a control center of a computer device, and may use various interfaces and lines to connect various parts of the computer device, and generate test cases by executing or executing instructions stored in the memory 702 and invoking data stored in the memory 702. Alternatively, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor primarily processes an operating system, a user interface, and application programs, etc., and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701. In some embodiments, processor 701 and memory 702 may be implemented on the same chip, or they may be implemented separately on separate chips in some embodiments.
The processor 701 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor, application SPECIFIC INTEGRATED Circuit (ASIC), field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or a combination thereof, that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the invention. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 702 may include at least one type of storage medium, and may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), magnetic Memory, magnetic disk, optical disk, and the like. Memory 702 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 702 in embodiments of the present invention may also be circuitry or any other device capable of performing storage functions for storing program instructions and/or data.
Based on the same technical idea, an embodiment of the present invention provides a computer-readable storage medium storing a computer program executable by a computer device, which when run on the computer device, causes the computer device to execute the steps of a test case generating method of a user interface.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, or as a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (6)

1.一种用户界面的测试用例生成方法,其特征在于,包括:1. A method for generating a test case for a user interface, comprising: 获取用户界面;Get the user interface; 将所述用户界面与所述用户界面的历史版本界面进行比对;Comparing the user interface with a historical version interface of the user interface; 基于哈希算法确定所述用户界面和所述历史版本界面的差异度大于预设阈值时,判断所述用户界面需要更新,则采用图像识别模型识别所述用户界面的图像特征,确定所述用户界面中的控件模块,每个控件模块包括控件类型信息和控件位置信息;When it is determined based on the hash algorithm that the difference between the user interface and the historical version interface is greater than a preset threshold, it is determined that the user interface needs to be updated, and an image recognition model is used to identify image features of the user interface to determine control modules in the user interface, each control module including control type information and control location information; 采用循环神经网络模型解码每个控件模块的控件类型信息和控件位置信息,所述循环神经网络模型每一个隐藏状态包含控件模块的上下文信息,根据上下文信息和对应的控件模块生成所述控件模块的测试代码;A recurrent neural network model is used to decode the control type information and control location information of each control module, wherein each hidden state of the recurrent neural network model contains context information of the control module, and a test code of the control module is generated according to the context information and the corresponding control module; 采用每个控件模块的上下文信息以及每个控件模块对应的测试代码,生成所述用户界面对应的测试代码;Using the context information of each control module and the test code corresponding to each control module, generate the test code corresponding to the user interface; 将所述用户界面对应的测试代码和所述用户界面中每个控件模块对应的预设控件操作进行编译,生成所述用户界面的测试用例;采用所述测试用例测试所述用户界面;Compile the test code corresponding to the user interface and the preset control operation corresponding to each control module in the user interface to generate a test case for the user interface; and use the test case to test the user interface; 若所述用户界面和所述历史版本界面的差异度不大于预设阈值时,则采用所述历史版本界面的测试用例测试所述用户界面。If the difference between the user interface and the historical version interface is not greater than a preset threshold, the user interface is tested using the test case of the historical version interface. 2.如权利要求1所述的方法,其特征在于,还包括:2. The method according to claim 1, further comprising: 执行所述用户界面的测试用例获得所述用户界面的测试结果。The test case of the user interface is executed to obtain the test result of the user interface. 3.如权利要求1所述的方法,其特征在于,还包括:3. The method according to claim 1, further comprising: 根据多个用户界面的测试用例生成测试用例集;Generate test case suites based on test cases for multiple user interfaces; 执行所述测试用例集,获得多个用户界面的测试结果。The test case set is executed to obtain test results of multiple user interfaces. 4.一种用户界面的测试用例生成装置,其特征在于,包括:4. A test case generating device for a user interface, characterized in that it comprises: 获取模块,用于获取用户界面;An acquisition module, used to acquire a user interface; 识别模块,用于将所述用户界面与所述用户界面的历史版本界面进行比对;An identification module, used for comparing the user interface with a historical version interface of the user interface; 基于哈希算法确定所述用户界面和所述历史版本界面的差异度大于预设阈值时,判断所述用户界面需要更新,则采用图像识别模型识别所述用户界面的图像特征,确定所述用户界面中的控件模块,每个控件模块包括控件类型信息和控件位置信息;When it is determined based on the hash algorithm that the difference between the user interface and the historical version interface is greater than a preset threshold, it is determined that the user interface needs to be updated, and an image recognition model is used to identify image features of the user interface to determine control modules in the user interface, each control module including control type information and control location information; 处理模块,用于采用循环神经网络模型解码每个控件模块的控件类型信息和控件位置信息,所述循环神经网络模型每一个隐藏状态包含控件模块的上下文信息,根据上下文信息和对应的控件模块生成所述控件模块的测试代码;A processing module, used to decode the control type information and control location information of each control module by using a recurrent neural network model, wherein each hidden state of the recurrent neural network model contains context information of the control module, and generate a test code of the control module according to the context information and the corresponding control module; 采用每个控件模块的上下文信息以及每个控件模块对应的测试代码,生成所述用户界面对应的测试代码;Using the context information of each control module and the test code corresponding to each control module, generate the test code corresponding to the user interface; 将所述用户界面对应的测试代码和所述用户界面中每个控件模块对应的预设控件操作进行编译,生成所述用户界面的测试用例,采用所述测试用例测试所述用户界面;Compile the test code corresponding to the user interface and the preset control operation corresponding to each control module in the user interface to generate a test case for the user interface, and use the test case to test the user interface; 若所述用户界面和所述历史版本界面的差异度不大于预设阈值时,则采用所述历史版本界面的测试用例测试所述用户界面。If the difference between the user interface and the historical version interface is not greater than a preset threshold, the user interface is tested using the test case of the historical version interface. 5.一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1~3任一所述方法的步骤。5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods of claims 1 to 3 when executing the program. 6.一种计算机可读存储介质,其特征在于,其存储有可由计算机设备执行的计算机程序,当所述程序在计算机设备上运行时,使得所述计算机设备执行权利要求1~3任一所述方法的步骤。6. A computer-readable storage medium, characterized in that it stores a computer program executable by a computer device, and when the program is run on the computer device, the computer device executes the steps of any one of the methods of claims 1 to 3.
CN201910540156.1A 2019-06-21 2019-06-21 A method and device for generating test cases for user interface Active CN110287111B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910540156.1A CN110287111B (en) 2019-06-21 2019-06-21 A method and device for generating test cases for user interface
PCT/CN2020/091930 WO2020253466A1 (en) 2019-06-21 2020-05-22 Method and device for generating test case of user interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910540156.1A CN110287111B (en) 2019-06-21 2019-06-21 A method and device for generating test cases for user interface

Publications (2)

Publication Number Publication Date
CN110287111A CN110287111A (en) 2019-09-27
CN110287111B true CN110287111B (en) 2025-04-22

Family

ID=68005118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910540156.1A Active CN110287111B (en) 2019-06-21 2019-06-21 A method and device for generating test cases for user interface

Country Status (2)

Country Link
CN (1) CN110287111B (en)
WO (1) WO2020253466A1 (en)

Families Citing this family (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287111B (en) * 2019-06-21 2025-04-22 深圳前海微众银行股份有限公司 A method and device for generating test cases for user interface
CN110879777A (en) * 2019-10-12 2020-03-13 平安普惠企业管理有限公司 Control testing method, device, computer equipment and storage medium for application interface
CN110750193B (en) * 2019-10-17 2022-01-14 腾讯科技(深圳)有限公司 Scene topology determination method and device based on artificial intelligence
CN111045941B (en) * 2019-12-09 2023-08-18 广州品唯软件有限公司 Positioning method and device for user interface control and storage medium
CN110990289B (en) * 2019-12-12 2023-05-16 锐捷网络股份有限公司 Method and device for automatically submitting bug, electronic equipment and storage medium
CN112749081B (en) * 2020-03-23 2023-09-22 腾讯科技(深圳)有限公司 User interface testing method and related device
CN111522615B (en) * 2020-04-23 2023-08-15 深圳赛安特技术服务有限公司 Method, device, equipment and storage medium for updating command line interface
CN111767228B (en) * 2020-06-30 2024-02-06 深圳赛安特技术服务有限公司 Interface testing method, device, equipment and medium based on artificial intelligence
CN111694752B (en) * 2020-07-28 2023-09-05 中移(杭州)信息技术有限公司 Application testing method, electronic device and storage medium
CN111897740B (en) * 2020-08-24 2023-06-13 抖音视界有限公司 User interface testing method and device, electronic equipment and computer readable medium
CN112559372B (en) * 2020-12-24 2024-05-14 南方电网数字平台科技(广东)有限公司 Method, system and storage medium for generating interface test case
CN113094257B (en) * 2021-03-08 2024-04-05 上海硬通网络科技有限公司 Application testing method and device and electronic equipment
CN115269359A (en) * 2021-04-29 2022-11-01 漳州立达信光电子科技有限公司 Terminal interface testing method and device
CN113254338B (en) * 2021-05-25 2023-01-24 深圳前海微众银行股份有限公司 Test case generation method, device and equipment
CN113641587A (en) * 2021-08-26 2021-11-12 北京字跳网络技术有限公司 Operation interface test method, device, terminal and storage medium
CN113791786B (en) * 2021-09-23 2024-01-19 安然 APP page control automation method and device based on IOS system
CN114461529B (en) * 2022-02-09 2025-09-23 中国农业银行股份有限公司 Automatic testing method, device, electronic device and storage medium for password control
CN114691501A (en) * 2022-03-18 2022-07-01 浪潮软件集团有限公司 Component-level cross-platform intelligent automated testing methods and tools
CN116302925A (en) * 2022-12-15 2023-06-23 深圳市鸿合创新信息技术有限责任公司 Automated testing method, device, electronic equipment and readable storage medium
CN116069658A (en) * 2023-02-15 2023-05-05 阳光保险集团股份有限公司 Software layered testing method, device, equipment and storage medium
CN118796658B (en) * 2023-10-20 2025-11-07 中移动金融科技有限公司 Unit test method, device, equipment and storage medium
CN117873907B (en) * 2024-03-12 2024-06-07 麒麟软件有限公司 Control element testing method and device and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021102A (en) * 2016-05-16 2016-10-12 北京奇虎科技有限公司 Automated test file generation method and apparatus

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0625578D0 (en) * 2006-12-21 2007-01-31 Ibm Method and system for graphical user interface testing
CN104516812A (en) * 2013-09-27 2015-04-15 腾讯科技(深圳)有限公司 Method and device for testing software
US9846634B2 (en) * 2014-06-25 2017-12-19 Vmware, Inc. Visual graphical user interface verification
CN105808416B (en) * 2014-12-27 2018-04-13 南车株洲电力机车研究所有限公司 A kind of automated testing method and system of man-machine figure interactive interface
US10254935B2 (en) * 2016-06-29 2019-04-09 Google Llc Systems and methods of providing content selection
US10108535B2 (en) * 2016-07-08 2018-10-23 Accenture Global Solutions Limited Web application test script generation to test software functionality
CN106502890A (en) * 2016-10-18 2017-03-15 乐视控股(北京)有限公司 Method for generating test case and system
CN107704392B (en) * 2017-09-30 2021-05-18 华为技术有限公司 A test case processing method and server
CN109901988A (en) * 2017-12-11 2019-06-18 北京京东尚科信息技术有限公司 A kind of page elements localization method and device for automatic test
CN108427642A (en) * 2018-03-05 2018-08-21 深圳市买买提信息科技有限公司 The method and apparatus of components testing in a kind of interface
CN110287111B (en) * 2019-06-21 2025-04-22 深圳前海微众银行股份有限公司 A method and device for generating test cases for user interface

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021102A (en) * 2016-05-16 2016-10-12 北京奇虎科技有限公司 Automated test file generation method and apparatus

Also Published As

Publication number Publication date
WO2020253466A1 (en) 2020-12-24
CN110287111A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
CN110287111B (en) A method and device for generating test cases for user interface
US10380236B1 (en) Machine learning system for annotating unstructured text
US11704500B2 (en) Techniques to add smart device information to machine learning for increased context
US20180268296A1 (en) Machine learning-based network model building method and apparatus
CN112528637A (en) Text processing model training method and device, computer equipment and storage medium
CN109583325A (en) Face samples pictures mask method, device, computer equipment and storage medium
US20170140273A1 (en) System and method for automatic selection of deep learning architecture
CN112397057B (en) Voice processing method, device, equipment and medium based on generation countermeasure network
KR102074909B1 (en) Apparatus and method for classifying software vulnerability
US11403550B2 (en) Classifier
CN112119410B (en) System and method for debugging neural networks using coverage-guided fuzz testing
CN111143178A (en) User behavior analysis method, device and equipment
CN112529078B (en) Service processing method, device and equipment
CN113196232A (en) Neural network scheduling method and device, computer equipment and readable storage medium
CN109816043A (en) Method and device for determining user identification model, electronic equipment and storage medium
US10984288B2 (en) Malicious software recognition apparatus and method
CN113408558B (en) Method, apparatus, device and medium for model verification
US20180189571A1 (en) Method and apparatus for determining signature actor and identifying video based on probability of appearance of signature actor
CN113160795A (en) Language feature extraction model training method, device, equipment and storage medium
CN114185766A (en) Code detection method and device, electronic equipment and storage medium
JP7120326B2 (en) Information processing device, information processing method, recording medium
US12387459B2 (en) System and method for image de-identification to humans while remaining recognizable by machines
US11636022B2 (en) Server and control method thereof
CN112232417A (en) Classification method and device, storage medium and terminal
CN117710763B (en) Image noise recognition model training method, image noise recognition method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant