Generating method and device for test sample

A test sample and sample technology, applied in the field of test sample generation methods and devices, can solve problems such as low code coverage, and achieve the effects of solving low code coverage, reducing the generation of meaningless samples, and improving code coverage

Active Publication Date: 2017-09-12
ALIBABA GRP HLDG LTD
View PDF6 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] The embodiment of the present invention provides a method and device for generating test samples, so as

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Generating method and device for test sample
  • Generating method and device for test sample
  • Generating method and device for test sample

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0032] According to an embodiment of the present invention, a method embodiment of a method for generating a test sample is also provided. It should be noted that the steps shown in the flow chart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions , and, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.

[0033] The method embodiment provided in Embodiment 1 of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Take running on a computer terminal as an example, figure 1 It is a block diagram of the hardware structure of a computer terminal according to a method for generating a test sample according to an embodiment of the present application. Such as figure 1 As shown, the computer terminal 10 may include one or more (only one i...

Embodiment 2

[0073] According to an embodiment of the present invention, a device for implementing the method for generating the test sample described above is also provided, Figure 5 is a structural block diagram of a device for generating a test sample according to an embodiment of the present application, such as Figure 5 As shown, the device includes:

[0074]The obtaining module 52 is used to obtain the information of the key data in the specified sample; wherein, the key data is the data of the branch instruction polluting the program under test in the specified sample;

[0075] It should be noted that the branch instruction of the program under test polluting the key data can be manifested as direct pollution and indirect pollution. Corresponding operations (such as addition, subtraction, multiplication, and division, etc.), but directly propagate to the branch instruction, which can be called direct pollution at this time; before the test program executes the branch instruction,...

Embodiment 3

[0090] Embodiments of the present invention may provide a computer terminal, and the computer terminal may be any computer terminal device in a group of computer terminals. The computer terminal may be the terminal in Embodiment 1. Optionally, in this embodiment, the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.

[0091] Optionally, in this embodiment, the foregoing computer terminal may be located in at least one network device among multiple network devices of the computer network.

[0092] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the test sample generation method: obtain the information of key data in the specified sample; wherein, the key data is the branch that pollutes the program under test in the specified sample The data of the instruction; according to the information, the key data in the specified sample is mutated to obtain the mutated speci...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a generating method and device for a test sample. The method includes the steps of obtaining information of key data in a designated sample, wherein the key data is the data of a branch instruction polluting a tested program in the designated sample; according to the information of the key data, mutating the key data in the designated sample to obtain the mutated designated sample; determining the mutated designated sample as the test sample.

Description

technical field [0001] The invention relates to the field of software security, in particular to a method and device for generating test samples. Background technique [0002] In software testing (fuzz testing), an important indicator for evaluating test results is code coverage, that is, the percentage of program execution paths accessible to the test sample set to all paths of the program code. [0003] Fuzz tools in the related art can generally be classified into two categories, blind fuzz and smart fuzz. Blind fuzz generates test samples by randomly modifying the data in the file, and smart fuzz generates file templates by parsing the file format, and mutates according to the type of file fields in the template to generate test samples. [0004] These two types of fuzz essentially discover the execution paths of the tested program in an exhaustive manner. Many paths can be found in the early stage of the test, but as the fuzz progresses, the sample files continue to in...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F11/36
CPCG06F11/3676G06F11/3688
Inventor 范祚至
Owner ALIBABA GRP HLDG LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products