Unlock instant, AI-driven research and patent intelligence for your innovation.

Source code level program variation generation method and device

A technology of program variation and source code, applied in instruments, electrical digital data processing, computing, etc., can solve problems such as helpless defect positioning, developer reading and understanding, and inability to inject mutations in the intermediate code stage, etc., to achieve easy positioning Effect

Pending Publication Date: 2021-12-10
NANJING UNIV
View PDF6 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The problem to be solved by the present invention: the variation injected in the intermediate code stage cannot be read and understood by developers, and it is not helpful for the positioning of defect problems

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
  • Source code level program variation generation method and device
  • Source code level program variation generation method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0041] The present invention will be described in further detail below in conjunction with the accompanying drawings.

[0042] Such as figure 1 As shown, a method for generating program variation at the source code level of the present invention includes the following steps: a data acquisition step, an initialization step, a variation information set construction step, and a code stub injection step.

[0043] Wherein, the data acquisition step is the aforementioned step S1, which is to acquire source code and variation range definition information. The variation range definition information is used to define where the source code is to be mutated. In this embodiment, the information of the function to be mutated is used to describe. Specifically, the variation range definition information is a collection of information of the function to be variated. Each information of the function to be mutated corresponds to a function to be mutated, and usually includes information such ...

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 source code level program variation generation method and device. According to the method, a to-be-varied function is obtained, an abstract syntax tree is constructed, and literal constants and object classes capable of being called by variation are extracted through analysis of the abstract syntax tree. Then the abstract syntax sub-trees of the function to be varied is traversed, if the nodes are variables, whether the variables have variable conditions are judged, and if the variables have variable conditions, corresponding variation information is constructed to form a variation set; the variation information comprises variation statements. The variation statements are divided into literal constant assignment statements of the basic class variables and statements of the object class methods capable of being called for variation calling of the object classes. And finally, a corresponding variation function is constructed for each piece of variation information, and a variation response code is inserted into the original function to be varied. The variation response code calls a corresponding variation function through an externally acquired variation ID. In this way, during testing, which variation function is called is determined through external configuration.

Description

technical field [0001] The invention relates to software testing, in particular to variation testing at the level of software source codes. Background technique [0002] It is an important indicator of software testing to evaluate whether the testing process of software program is perfect. In software testing, a good testing process should be able to perceive subtle changes in the program under test. If the testing process cannot perceive subtle changes in the program under test, it indicates that the testing process is flawed, or the testing is not perfect. [0003] Mutation testing is a testing process evaluation technique based on the above principles. The principle of this technology is to produce slight variations to the original program, and then test through the testing process to determine whether the testing process can perceive such subtle variations. [0004] Existing program mutation tools, such as PIT and Major, inject mutations in the intermediate code stage...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3604
Inventor 张天潘敏学罗雯波
Owner NANJING UNIV