CN115017059B - Fuzzy test method and system for graphical user interface program - Google Patents

Fuzzy test method and system for graphical user interface program Download PDF

Info

Publication number
CN115017059B
CN115017059B CN202210941028.XA CN202210941028A CN115017059B CN 115017059 B CN115017059 B CN 115017059B CN 202210941028 A CN202210941028 A CN 202210941028A CN 115017059 B CN115017059 B CN 115017059B
Authority
CN
China
Prior art keywords
program
fuzzy
function
target function
user 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
CN202210941028.XA
Other languages
Chinese (zh)
Other versions
CN115017059A (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.)
Beijing Peking University Software Engineering Co ltd
Original Assignee
Beijing Peking University Software Engineering 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 Beijing Peking University Software Engineering Co ltd filed Critical Beijing Peking University Software Engineering Co ltd
Priority to CN202210941028.XA priority Critical patent/CN115017059B/en
Publication of CN115017059A publication Critical patent/CN115017059A/en
Application granted granted Critical
Publication of CN115017059B publication Critical patent/CN115017059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

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)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention relates to the field of software automation test, and discloses a fuzzy test method and a system for a graphical user interface program, which comprises the following steps: selecting a graphical user interface test tool according to the type of a tested program and an operation system platform, recording the process of opening the tested program by using the graphical user interface test tool, generating an automatic operation script of the graphical user interface program, obtaining a calling process of an interception function by using a dynamic instrumentation tool, thereby obtaining a calling sequence and a context environment during calling, screening the calling sequence to obtain a candidate target function set, monitoring the operation state of the candidate target function set, obtaining a code coverage rate, selecting a target function with the maximum code coverage rate in the candidate target function set, selecting a fuzzy tester, generating a seed file, configuring parameters of the fuzzy tester, instrumenting the instrumented interception of the tested program, executing a fuzzy test, and monitoring an operation result.

Description

Fuzzy test method and system for graphical user interface program
Technical Field
The invention relates to the field of software automation test, in particular to a fuzzy test method and a fuzzy test system for a graphical user interface program.
Background
The GUI program is also called a GUI (graphical User Interface) program, and refers to a program with a User graphical Interface such as a window and a control, and the GUI program usually adopts an event-driven model and triggers execution of program logic in response to a User GUI operation.
In recent years there has been much research on automated graphical user interface program testing, for example, some solutions attempt to automate testing of graphical user interface programs using recorded/played back test scripts, which is simple and reusable to implement, but slow to run and costly to maintain test code.
In recent years, many researches on fuzz testing technology exist, but fuzz testing is mainly applied to command line programs and cannot be automatically interacted with graphical user interface programs, so that some researchers manually write additional scaffold codes to test program specific logic, but need to manually analyze programs, acquire accurate test functions and construct a context environment of a complete test interface.
Disclosure of Invention
The invention provides a fuzzy test method of a graphical user interface program, which is used for automatically testing the graphical user interface program in a fuzzy manner by combining a graphical user interface program automatic test related technology and a fuzzy test related technology.
In order to achieve the above object, the present invention provides a fuzzy testing method for a graphical user interface program, comprising:
selecting a graphical user interface test tool according to the type of a tested program and an operation system platform, recording the process of opening the tested program by using the graphical user interface test tool, and generating an automatic operation script of the graphical user interface program;
obtaining a calling process of an interception function by using a dynamic instrumentation tool so as to obtain a calling sequence and a context environment during calling, screening the calling sequence to obtain a candidate target function set, monitoring the running state of the candidate target function set to obtain a code coverage rate, and selecting the target function with the largest code coverage rate in the candidate target function set;
selecting a fuzzy tester, configuring parameters of the fuzzy tester to obtain a scheduler, running the automatic operation script through the scheduler, generating a seed file according to the tested program, inserting piles to intercept the tested program, executing a fuzzy test, and monitoring an operation result.
According to one aspect of the invention, the method by using a dynamic pile driving tool is:
and selecting the dynamic instrumentation tool according to the type of the tested program and the running system platform, if the running system of the tested program is Windows, selecting the dynamic instrumentation tool of the Windows version, and if the running system of the tested program is Linux, selecting the dynamic instrumentation tool of the Linux version.
According to one aspect of the invention, the method for obtaining the calling process of the interception function comprises the following steps:
and constructing a function tracking client according to the dynamic instrumentation, tracking the calling process of the intercepted function, recording the calling sequence and the context environment during calling, and operating the tested program by using the dynamic instrumentation and specifying the function tracking client.
According to one aspect of the present invention, the method for screening the calling sequence is:
analyzing the calling sequence, positioning a calling function of a file opening function, traversing a directly called parent function, summarizing the parent function to obtain the candidate target function set, traversing the candidate target function set, and scheduling the fuzzy tester to configure the candidate target function set.
According to one aspect of the invention, the method for generating the seed file according to the tested program comprises the following steps:
and generating the seed file supported by the graphical user interface program in a network collection and test program creation mode.
According to one aspect of the invention, the method for configuring the fuzz tester parameters comprises the following steps:
selecting the fuzzy tester according to the type of the tested program and the running system platform to obtain the scheduler, configuring parameters of the fuzzy tester, loading a file selection interception client, and specifying the path of the tested program and the parameters of the target function.
According to one aspect of the invention, the method for performing the fuzz test is as follows:
the scheduler runs the automatic operation script, the fuzzy tester saves the context environment of the target function, the interception client side intercepts the tested program and then automatically executes the callback function, the fuzzy tester compiles a file and provides the file for the tested program, when the tested program is executed to the end of the target function, the fuzzy tester restores the context environment for saving the target function, the tested program is circularly executed, and the scheduler monitors the running state of the fuzzy test.
To achieve the above object, the present invention provides a fuzz testing system of a gui program, comprising:
the script generation module: selecting a graphical user interface testing tool according to the type of a tested program and an operation system platform, recording the process of opening the tested program by using the graphical user interface testing tool, and generating an automatic operation script of the graphical user interface program;
a function positioning module: obtaining a calling process of an interception function by using a dynamic instrumentation tool so as to obtain a calling sequence and a context environment during calling, screening the calling sequence to obtain a candidate target function set, monitoring the running state of the candidate target function set to obtain a code coverage rate, and selecting the target function with the largest code coverage rate in the candidate target function set;
a fuzzy test module: selecting a fuzzy tester, configuring parameters of the fuzzy tester to obtain a scheduler, running the automatic operation script through the scheduler, generating a seed file according to the tested program, inserting piles to intercept the tested program, executing a fuzzy test, and monitoring an operation result.
In order to achieve the above object, the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the above-mentioned fuzzy testing method for the graphical user interface program.
To achieve the above object, the present invention provides a computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the above-mentioned fuzz testing method for a graphical user interface program.
Based on this, the beneficial effects of the invention are:
1. the developer can use the method of the invention to carry out automatic fuzzy test on the graphical user interface program and find the collapse error of the computer program, and the invention has higher practicability;
2. the invention has high running speed and reduces the maintenance cost of the test code.
Drawings
FIG. 1 is a flow chart that schematically illustrates a method for fuzzy testing of a graphical user interface program, in accordance with the present invention;
fig. 2 schematically shows a flow chart of a fuzzy testing system of a graphical user interface program according to the present invention.
Detailed Description
The present disclosure will now be discussed with reference to exemplary embodiments, it being understood that the embodiments discussed are merely for enabling persons of ordinary skill in the art to better understand and thus implement the present disclosure, and do not imply any limitation on the scope of the present disclosure.
As used herein, the term "include" and its variants are to be read as open-ended terms meaning "including, but not limited to. The term "based on" is to be interpreted as "based, at least in part, on" and the terms "one embodiment" and "an embodiment" are to be interpreted as "at least one embodiment".
Fig. 1 schematically shows a flow chart of a method for testing the fuzziness of a graphical user interface program according to the present invention, as shown in fig. 1, a method for testing the fuzziness of a graphical user interface program according to the present invention comprising the steps of:
selecting a graphical user interface testing tool according to the type of a tested program and an operation system platform, recording the process of opening the tested program by using the graphical user interface testing tool, and generating an automatic operation script of the graphical user interface program;
obtaining a calling process of an interception function by using a dynamic instrumentation tool so as to obtain a calling sequence and a context environment during calling, screening the calling sequence to obtain a candidate target function set, monitoring the running state of the candidate target function set to obtain a code coverage rate, and selecting the target function with the largest code coverage rate in the candidate target function set;
selecting a fuzzy tester, configuring parameters of the fuzzy tester to obtain a scheduler, running the automatic operation script through the scheduler, generating a seed file according to the tested program, inserting piles to intercept the tested program, executing a fuzzy test, and monitoring an operation result.
According to one embodiment of the invention, a dynamic instrumentation tool is selected according to the type of a tested program and an operating system platform, if the operating system of the tested program is Windows, a Dynamori Windows version is selected, if the operating system of the tested program is Linux, a Dynamori Linux version is selected, a function tracking client is constructed based on the dynamic instrumentation tool API, function call is intercepted, a call sequence and a context environment when the function is called are recorded, the dynamic instrumentation tool is operated, the function tracking client is appointed, and the tested program is operated. And after the mapping user interface program is started, displaying a main interface, waiting for user interaction, running an automatic file selection operation script, analyzing a calling sequence, positioning a file, opening a function calling function, and traversing a directly called parent function. Sequentially traversing the parent functions, adding a candidate target function set to the parent functions, traversing the candidate target function set, scheduling the fuzzy tester to configure a candidate target function for each candidate target function, starting the fuzzy tester, running for a fixed time, monitoring the running state, acquiring and recording the code coverage rate, and selecting the candidate target function with the maximum corresponding code coverage rate as the target function after traversing.
According to one embodiment of the invention, a fuzz tester is selected to generate a seed case supported by a graphical user interface program. Generating seed files through modes of network collection, test program creation and the like, and realizing a file selection interception client of a tested program based on a dynamic instrumentation, for example: the method comprises the steps of intercepting QFeILEDialog for a Qt program, wherein the method comprises the step of getOpenFileName, intercepting CFILEDialog for an MFC program, wherein the step of getFileName, the step of intercepting GetOpenFileNameA and GetOpenFileNameW for a Win32 program, the step of intercepting a client monitoring module to load an event function to obtain QFeILEDialog, wherein the step of getOpenFileName function address, the step of inserting a function, and the step of intercepting a replacement file path as a test case file path generated by a fuzzy tester in the interception function. Loading an event function at a client monitoring module to acquire a QFileDialog function address, inserting the function, reading test case content generated by the variation of the fuzzy tester by an interceptor in a callback function, writing the test case content into an intercepted file path file, selecting the fuzzy tester according to the type of a tested program and an operating system platform, realizing a scheduler, configuring parameters of the fuzzy tester, loading a file selection interception client, specifying parameters of the path of the tested program, a target function of the path of the tested program and the like, executing the fuzzy tester, executing an automatic operation script generated in the first step after the process of the tested program is started by the fuzzy tester and a user graphical interface is displayed by the scheduler, and storing a process context environment by the fuzzy tester when the tested program is executed to the target function. For example, the file selection interception client intercepts a file selection dialog box event of the program to be tested and automatically executes a callback function according to information such as a program counter and a register value. And when the tested program is executed to the calling file selection dialog box, the file selection interception client automatically intercepts the function call, the input generated by compiling the fuzzy tester is provided for the tested program, when the tested program is executed to the end of the target function, the fuzzy tester recovers the stored process context information, the control program returns to the target function, the tested program is circularly executed, and the scheduler monitors the running state of the fuzzy test. And stopping the fuzz testing process according to the scheduling strategy.
According to an embodiment of the invention, in order to check the effect of the invention, a Windows platform graphical user interface program, namely, avogado, is taken as an example, and the avogado is open source molecular editor software developed based on a Qt framework and supports cross-platform and various archive file formats.
The method comprises the steps of recording and generating an automatic operation script by using Squish software, adding a tested program Avogadro in the setup of a Squish IDE server, configuring the Avogadro as an additional process mode, designating a host and a port, operating a Squish tool startaut.exe to start the Avogadro.exe, creating a test set and a test case in the Squish IDE, recording the script, clicking a ' file ' -opening ' of an Avogadro program menu bar by using an operation mouse, clicking an ' opening ' button after selecting any legal file in a file selection dialog box, stopping recording the Squish script, and automatically generating the automatic operation script by using Squish.
Locating a target function, constructing a client recording function call based on a dynamic binary instrumentation frame of Dynamori, filtering a file opening function/method, locating the target function according to a coverage rate, selecting a Windows version of Dynamori, constructing a function tracking client based on an API of Dynamori, intercepting the function call, recording a call sequence and a context environment of the function call, such as information of a program counter, a function parameter, a function return address and the like, storing a log file to a hard disk, running a Dynamori tool drrun.exe, loading the function tracking client, and running a tested program. After a graphic user interface program is started, a main interface is displayed and user interaction is waited, an automatic operation script is operated by using a Squish tool squishunner.
And generating a test case, selecting the winafl as a fuzzy tester, intercepting a tested program to select a dialog box to perform in-process circulation fuzzy test, and selecting the winafl as the fuzzy test. Generating an Avogadro seed case, newly building and storing any file in Avogadro, generating a seed file supported by the Avogadro, realizing intercepting a file selection dialog box to select a file client, carrying out QFileDialog:: getOpenFileName based on Dynamori, realizing a file opening function interceptor client, monitoring a module loading event function at the client to obtain QFileDialog:: getOpenFileName function address, inserting the function, reading test case content generated by fuzzy tester variation in the interception function, writing the test case content into an intercepted file path file, realizing a scheduler, configuring parameters of the fuzzy tester, specifying an Avogadro program path, a target function, a seed directory and related parameters of an output directory, starting a winafl fuzzy tester, scheduling an Squal tool squrner after an Avogadro process is started by the winal fuzzy tester and displays a user graphic interface, scheduling the automatic operation script generated in the first step by the software, continuously calling the Avogadro program rendering and displaying the test result by a rendering monitor program, and displaying the test result by a working test program rendering platform. The fuzz tester is stopped according to a scheduling policy.
Furthermore, in order to achieve the above object, the present invention provides a system for testing the fuzziness of a gui program, fig. 2 schematically shows a flowchart of the system for testing the fuzziness of a gui program according to the present invention, and as shown in fig. 2, the system for testing the fuzziness of a gui program according to the present invention comprises:
the script generation module: selecting a graphical user interface testing tool according to the type of a tested program and an operation system platform, recording the process of opening the tested program by using the graphical user interface testing tool, and generating an automatic operation script of the graphical user interface program;
a function positioning module: obtaining a calling process of an interception function by using a dynamic instrumentation tool so as to obtain a calling sequence and a context environment during calling, screening the calling sequence to obtain a candidate target function set, monitoring the running state of the candidate target function set to obtain a code coverage rate, and selecting the target function with the maximum code coverage rate in the candidate target function set;
a fuzzy test module: selecting a fuzzy tester, configuring parameters of the fuzzy tester to obtain a scheduler, running the automatic operation script through the scheduler, generating a seed file according to the tested program, inserting piles to intercept the tested program, executing a fuzzy test, and monitoring an operation result.
According to one embodiment of the present invention, the method implemented by the function positioning module is: selecting a dynamic instrumentation tool according to the type of a tested program and a running system platform, selecting a Dynamori Windows version if the running system of the tested program is Windows, selecting a Dynamori Linux version if the running system of the tested program is Linux, constructing a function tracking client based on a dynamic instrumentation tool API (application programming interface), intercepting function call, recording a call sequence and a context environment when the function is called, running the dynamic instrumentation tool, designating the function tracking client, and running the tested program. And after the mapping user interface program is started, displaying a main interface, waiting for user interaction, running an automatic file selection operation script, analyzing a calling sequence, positioning a file, opening a function calling function, and traversing a directly called parent function. Sequentially traversing the parent functions, adding a candidate target function set to the parent functions, traversing the candidate target function set, scheduling the fuzzy tester to configure a candidate target function for each candidate target function, starting the fuzzy tester, running for a fixed time, monitoring the running state, acquiring and recording the code coverage rate, and selecting the candidate target function with the maximum corresponding code coverage rate as the target function after traversing.
According to one embodiment of the present invention, the method implemented by the function positioning module is: and selecting a fuzzy tester to generate a seed case supported by the graphical user interface program. Seed files are generated through modes of network collection, test program creation and the like, and a file selection interception client of a tested program is realized based on a dynamic instrumentation tool, for example: the method comprises the steps of intercepting QFeiDialog for a Qt program, wherein getOpenFileName is adopted, intercepting CFilDialog for an MFC program, wherein GetFileName is adopted, intercepting GetOpenFileNameA and GetOpenFileNameW for a Win32 program, intercepting event function loading at a client monitoring module to obtain QFeiDialog, wherein getOpenFileName function address is adopted, inserting a function is adopted, and in the interception function, a replacement file path is blocked as a test case file path generated by a fuzzy tester. Loading an event function at a client monitoring module to acquire QFileDialog, wherein getOpenFileName function address and plug the function, reading test case content generated by fuzzy tester variation by an interceptor in a callback function, writing the test case content into an intercepted file path file, selecting a fuzzy tester according to the type of a tested program and an operating system platform, realizing a scheduler, configuring parameters of the fuzzy tester, loading a file selection interception client, specifying parameters of the tested program path, a target function and the like, executing the fuzzy tester, executing an automatic operation script generated in the first step after the scheduler waits for the process of the tested program to be started by the fuzzy tester and displays a user graphical interface, and storing a process context environment by the fuzzy tester when the tested program is executed to the target function. For example, the file selection interception client side automatically executes a callback function after intercepting a file selection dialog box event of the tested program according to information such as a program counter and a register value. And when the tested program is executed to the calling file selection dialog box, the file selection interception client side automatically intercepts the function call, the input generated by compiling the fuzzy tester is provided for the tested program, when the tested program is executed to the end of the target function, the fuzzy tester recovers the stored process context information, the control program returns to the target function, the tested program is circularly executed, and the scheduler monitors the running state of the fuzzy test. And stopping the fuzz testing process according to the scheduling strategy.
According to an embodiment of the invention, in order to check the effect of the invention, a Windows platform graphical user interface program, namely, avogado, is taken as an example, and the avogado is open source molecular editor software developed based on a Qt framework and supports cross-platform and various archive file formats.
The method comprises the steps of recording and generating an automatic operation script by using Squish software, adding a tested program Avogadro in the setup of a Squish IDE server, configuring the Avogadro as an additional process mode, designating a host and a port, operating a Squish tool startaut.exe to start the Avogadro.exe, creating a test set and a test case in the Squish IDE, recording the script, clicking a ' file ' -opening ' of an Avogadro program menu bar by using an operation mouse, clicking an ' opening ' button after selecting any legal file in a file selection dialog box, stopping recording the Squish script, and automatically generating the automatic operation script by using Squish.
Locating a target function, constructing a client recording function call based on a dynamic binary instrumentation frame of Dynamori, filtering a file opening function/method, locating the target function according to a coverage rate, selecting a Dynamori Windows version, constructing a function tracking client based on a Dynamori API, intercepting the function call, recording a call sequence and a function call context environment, such as information of a program counter, a function parameter, a function return address and the like, storing a log file to a hard disk, running a Dynamori tool drive. The method comprises the steps of displaying a main interface and waiting for user interaction after a graphic user interface program is started, running an automatic operation script by using a Squish tool squishunner.exe, reading a log file, searching and positioning a Qt file selection dialog box function QFeileDialog, wherein a getOpenFileName calling point sequentially traverses a parent function, adds a candidate target function set to the parent function, traverses the candidate target function set, schedules a fuzzy tester to configure a candidate target function for each candidate target function, starts the fuzzy tester, runs for a fixed time, monitors the running state, obtains and records a code coverage rate, and selects the candidate target function corresponding to the maximum code coverage rate as the target function after traversing.
And generating a test case, selecting the winafl as a fuzzy tester, intercepting a tested program to select a dialog box to perform in-process circulation fuzzy test, and selecting the winafl as the fuzzy test. Generating an Avogadro seed case, newly building and storing any file in Avogadro, generating a seed file supported by the Avogadro seed case, realizing selection of a file client side by an interception file selection dialog, carrying out QFileDialog-in by Dynamori, getOpenFileName, realizing a file opening function interceptor client side, loading an event function on a client side monitoring module to obtain QFileDialog-in, getOpenFileName function address, inserting the function, reading test case content generated by fuzzy tester variation in the interception function, writing the test case content into an intercepted file path file, realizing a scheduler, configuring parameters of the fuzzy tester, specifying an Avogadro program path, a target function, a seed directory and output directory related parameters, starting a winafl fuzzy tester, scheduling an automatic operation script generated in the first step by the operation of a Squalroshrone tool, and displaying the test case rendering result by the Avogadro rendering test program, and displaying the test result of the Avogadro rendering test case in an Avogaro rendering process. The fuzz tester is stopped according to a scheduling policy.
To achieve the above object, the present invention also provides an electronic device, including: the system comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the fuzzy testing method of the graphical user interface program is realized.
To achieve the above object, the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for testing the fuzziness of a gui program.
Therefore, developers can use the method of the invention to carry out automatic fuzzy test on the graphical user interface program and find the breakdown error of the computer program.
Those of ordinary skill in the art will appreciate that the modules and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and devices may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present invention.
In addition, each functional module in the embodiments of the present invention may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which 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) to execute all or part of the steps of the method for transmitting/receiving the power saving signal according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention according to the present application is not limited to the specific combination of the above-mentioned features, but also covers other embodiments where any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
It should be understood that, the serial numbers of the steps in the summary and the embodiments of the present invention do not absolutely imply the sequence of execution, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

Claims (7)

1. A method for testing the fuzziness of a graphical user interface program, comprising:
selecting a graphical user interface test tool according to the type of a tested program and an operation system platform, recording the process of opening the tested program by using the graphical user interface test tool, and generating an automatic operation script of the graphical user interface program;
obtaining a calling process of an interception function by using a dynamic instrumentation tool so as to obtain a calling sequence and a context environment during calling, screening the calling sequence to obtain a candidate target function set, monitoring the running state of the candidate target function set to obtain a code coverage rate, and selecting the target function with the maximum code coverage rate in the candidate target function set;
the method for screening the call sequence comprises the steps of analyzing the call sequence, opening a call function of a function through a positioning file, traversing a directly called parent function, summarizing the parent function to obtain the candidate target function set, traversing the candidate target function set, and scheduling the fuzzy tester to configure the candidate target function set;
selecting a fuzzy tester, configuring parameters of the fuzzy tester to obtain a scheduler, running the automatic operation script through the scheduler, generating a seed file according to the tested program, inserting piles to intercept the tested program, executing a fuzzy test, and monitoring an operation result;
the method for configuring the parameters of the fuzzy tester comprises the steps of selecting the fuzzy tester according to the type of the tested program and the operating system platform to obtain the scheduler, configuring the parameters of the fuzzy tester, loading a file selection interception client, and specifying the path of the tested program and the parameters of the target function;
the method for executing the fuzzy test comprises the steps that the scheduler runs the automatic operation script, the fuzzy tester saves the context environment of the target function, the interception client side automatically executes the callback function after intercepting the tested program, the fuzzy tester compiles a file and provides the file for the tested program, when the tested program is executed to the end of the target function, the fuzzy tester restores the context environment for saving the target function, the tested program is circularly executed, and the scheduler monitors the running state of the fuzzy test.
2. The fuzz testing method of a gui program according to claim 1, wherein the method by using a dynamic instrumentation tool is:
and selecting the dynamic instrumentation tool according to the type of the tested program and the running system platform, if the running system of the tested program is Windows, selecting the dynamic instrumentation tool of the Windows version, and if the running system of the tested program is Linux, selecting the dynamic instrumentation tool of the Linux version.
3. The fuzz testing method of a gui program according to claim 2, wherein the method of obtaining the calling process of the interception function is:
and constructing a function tracking client according to the dynamic instrumentation, tracking the calling process of an interception function, recording the calling sequence and the context environment during calling, and operating the tested program by using the dynamic instrumentation and specifying the function tracking client.
4. The fuzz testing method of a gui program according to claim 3, wherein the method for generating the seed file according to the program under test is:
and generating the seed file supported by the graphical user interface program in a network collection and test program creation mode.
5. A fuzzy testing system for graphical user interface programs, comprising:
the script generation module: selecting a graphical user interface test tool according to the type of a tested program and an operation system platform, recording the process of opening the tested program by using the graphical user interface test tool, and generating an automatic operation script of the graphical user interface program;
a function positioning module: obtaining a calling process of an interception function by using a dynamic instrumentation tool, thereby obtaining a calling sequence and a context environment during calling, screening the calling sequence to obtain a candidate target function set, monitoring the running state of the candidate target function set to obtain a code coverage rate, selecting a target function with the maximum code coverage rate in the candidate target function set, wherein the method for screening the calling sequence comprises the steps of analyzing the calling sequence, opening a calling function of a function through a positioning file, traversing a directly called parent function, summarizing the parent function to obtain the candidate target function set, traversing the candidate target function set, and scheduling the fuzzy tester to configure the candidate target function set;
a fuzzing test module: selecting a fuzzy tester, configuring parameters of the fuzzy tester to obtain a scheduler, running the automatic operation script through the scheduler, generating a seed file according to the tested program, inserting piles to intercept the tested program, executing the fuzzy test and monitoring the running result, wherein the method for configuring the parameters of the fuzzy tester comprises the steps of selecting the fuzzy tester according to the type of the tested program and the running system platform to obtain the scheduler, configuring the parameters of the fuzzy tester, loading a file selection interception client and appointing the path of the tested program and the parameters of the target function; the method for executing the fuzzy test comprises the steps that the scheduler runs the automatic operation script, the fuzzy tester saves the context environment of the target function, the interception client side automatically executes the callback function after intercepting the tested program, the fuzzy tester compiles a file and provides the file for the tested program, when the tested program is executed to the end of the target function, the fuzzy tester restores the context environment for saving the target function, the tested program is circularly executed, and the scheduler monitors the running state of the fuzzy test.
6. An electronic device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing a method of fuzz testing of a graphical user interface program according to any of claims 1 to 4.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method of fuzz testing of a graphical user interface program according to any one of claims 1 to 4.
CN202210941028.XA 2022-08-08 2022-08-08 Fuzzy test method and system for graphical user interface program Active CN115017059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210941028.XA CN115017059B (en) 2022-08-08 2022-08-08 Fuzzy test method and system for graphical user interface program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210941028.XA CN115017059B (en) 2022-08-08 2022-08-08 Fuzzy test method and system for graphical user interface program

Publications (2)

Publication Number Publication Date
CN115017059A CN115017059A (en) 2022-09-06
CN115017059B true CN115017059B (en) 2022-11-11

Family

ID=83065857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210941028.XA Active CN115017059B (en) 2022-08-08 2022-08-08 Fuzzy test method and system for graphical user interface program

Country Status (1)

Country Link
CN (1) CN115017059B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699605A (en) * 2015-03-02 2015-06-10 清华大学 Measuring method and device for code coverage rate of driving program
CN110580226A (en) * 2019-09-23 2019-12-17 上海创景信息科技有限公司 object code coverage rate testing method, system and medium for operating system level program
CN114328173A (en) * 2021-10-27 2022-04-12 清华大学 Software fuzzing test method and device, electronic equipment and storage medium
CN114416520A (en) * 2021-12-08 2022-04-29 中国人民解放军战略支援部队信息工程大学 Fuzzy test method and device for bypassing Windows program graphical interface

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190108006A1 (en) * 2017-10-06 2019-04-11 Nvidia Corporation Code coverage generation in gpu by using host-device coordination

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699605A (en) * 2015-03-02 2015-06-10 清华大学 Measuring method and device for code coverage rate of driving program
CN110580226A (en) * 2019-09-23 2019-12-17 上海创景信息科技有限公司 object code coverage rate testing method, system and medium for operating system level program
CN114328173A (en) * 2021-10-27 2022-04-12 清华大学 Software fuzzing test method and device, electronic equipment and storage medium
CN114416520A (en) * 2021-12-08 2022-04-29 中国人民解放军战略支援部队信息工程大学 Fuzzy test method and device for bypassing Windows program graphical interface

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种动静结合的高代码覆盖率模糊测试方法;韩等;《信息安全研究》;20160805(第08期);全文 *

Also Published As

Publication number Publication date
CN115017059A (en) 2022-09-06

Similar Documents

Publication Publication Date Title
US6959431B1 (en) System and method to measure and report on effectiveness of software program testing
US9146831B2 (en) Sampling based runtime optimizer for efficient debugging of applications
US7627821B2 (en) Recording/playback tools for UI-based applications
US6408403B1 (en) Method for integrating automated software testing with software development
CN110554965B (en) Automated fuzz testing method, related equipment and computer readable storage medium
US20040201627A1 (en) Method and apparatus for analyzing machine control sequences
Adamoli et al. Automated GUI performance testing
US8418149B2 (en) Differential comparison system and method
US20040078784A1 (en) Collection and detection of differences of values of expressions/variables when debugging a computer process
Grechanik et al. Creating GUI testing tools using accessibility technologies
US9195562B2 (en) Recording external processes
Ma et al. An automated testing platform for mobile applications
CN114116455A (en) Clustering fuzzy test method and device for open-source basic component library
CN112527312B (en) Test method and test device for embedded system
US20050049814A1 (en) Binding a GUI element to a control in a test executive application
CN112612697A (en) Software defect testing and positioning method and system based on byte code technology
CN110633199A (en) Testing apparatus, method, and medium for block chain supporting intelligent contract
US8997048B1 (en) Method and apparatus for profiling a virtual machine
CN115017059B (en) Fuzzy test method and system for graphical user interface program
Fedorova et al. Performance comprehension at WiredTiger
US9710360B2 (en) Optimizing error parsing in an integrated development environment
us Saqib et al. Functionality, performance, and compatibility testing: a model based approach
CN113094267B (en) Test result collection method and device
CN112698881B (en) Dynamic detection method for Android picture loading behavior defect
US20220027262A1 (en) Information processing system with intelligent program smoke testing

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