Method and system for processing loop codes in software testing

A technology of software testing and processing methods, which is applied in the field of cyclic code processing in software testing, and can solve problems such as increased labor costs, missing test paths, and poor flexibility of manual methods

Inactive Publication Date: 2016-04-06
BEIJING UNIV OF POSTS & TELECOMM
View PDF2 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

When the nodes in the program control flow graph are all sequential nodes, that is, the source program is all sequential statements, a clear test path can be generated; but when there are branch nodes in the program control flow graph, that is, there are loop statements in the source program, now There are conventional processing methods such as 0-1 strategy or 0-K strategy. The loop statement is treated as a judgment statement, which invisibly misses the generation of some test paths. The incomplete generation of test paths reduces the accuracy of software testing.
In addition, loop statements can also be processed through manual methods such as manually specifying test paths, which increases labor costs; moreover, manual methods have poor flexibility and are difficult to adapt to the needs of different engineering projects

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
  • Method and system for processing loop codes in software testing
  • Method and system for processing loop codes in software testing
  • Method and system for processing loop codes in software testing

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0041] The invention provides a method for processing loop codes in software testing, such as figure 1 As shown, the method includes:

[0042] Step 1: Find the loop body of the code under test according to the program control flow graph;

[0043] Step 2: Determine the sub-path before the loop body of the current loop body;

[0044] Step 3: Determine all single sub-paths of the current loop body, combine the single sub-paths into a combined sub-path, and determine the combined sub-path when the set path between the sub-path before the loop body and the combined sub-path is reachable The path is a definite subpath of the current loop body;

[0045] Step 4: When it is determined that the set path between the sub-path before the loop body and the determined sub-path is reachable, generate a test case;

[0046] Step 5: Execute the code under test according to the test case, and capture the actual execution path of the current loop body.

[0047]Further, after capturing the actu...

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 method for processing loop codes in software test. The method includes: searching loop bodies of a code under test according to a program control flow graph; determining a loop body prepath of a current loop body; determining all single paths of the current loop body, combining the single paths to a combined path, and when an assembled path of the loop body prepath and the combined path is reachable, determining the combined path as a determined path of the current loop body; when an assembled path of the loop body prepath and the determined path is determined to be reachable, generating a test case; executing the code under test according to the test case, and capturing an actual execution path of the current loop body; and repeating the steps until all the loop bodies of the code under test are processed. The invention further discloses a method for processing the loop codes in software test. The method and the system are high in flexibility and capable of saving labor cost and avoiding path explosion.

Description

technical field [0001] The invention relates to software testing technology, in particular to a processing method and system for loop codes in software testing. Background technique [0002] Software testing is the process of analyzing or executing the source program (the code under test) in a controlled environment. quality. The accuracy of software testing is closely related to the comprehensiveness of test path generation. [0003] In the prior art, a test path is generated by traversing the nodes in the program control flow graph, and the source program is executed along the test path using test cases. When the nodes in the program control flow graph are all sequential nodes, that is, the source program is all sequential statements, a clear test path can be generated; but when there are branch nodes in the program control flow graph, that is, there are loop statements in the source program, now There are conventional processing methods such as 0-1 strategy or 0-K stra...

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 Patents(China)
IPC IPC(8): G06F11/36
Inventor 宫云战黄俊飞王雅文王强金大海
Owner BEIJING UNIV OF POSTS & TELECOMM
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