Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Thermodynamic diagram-based function coverage rate detection method and system, terminal and medium

A technology of function coverage and detection method, which is applied in the direction of error detection/correction, electrical digital data processing, software testing/debugging, etc. It can solve the problems of consuming large physical computing resources, spending a lot of time and resources, and unintuitive data, etc., to achieve Strong operability and the effect of improving test efficiency

Pending Publication Date: 2022-01-28
NUCLEAR POWER INSTITUTE OF CHINA
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In scientific computing programs, there are usually complex logic and mathematical operations, and the execution of the integrated test cases requires a lot of physical computing resources and a long running time; in order to improve the function coverage, it is usually necessary to write Different test cases and repeated experiments to achieve the purpose of covering different functions; but when there are functions that are difficult to cover, such operations will consume a lot of time and resources
If this type of program uses a test tool for integration testing to obtain coverage data, since the test tool needs to record the running status of each statement, its test efficiency is very low, such as usually much lower than the efficiency in program debugging mode, sometimes even almost It cannot be completed; thus it is difficult to realize the statistics of function coverage, which greatly affects the efficiency of integration testing of such programs; and the method of stubbing can easily obtain the coverage data of functions, but the obtained data is not intuitive

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
  • Thermodynamic diagram-based function coverage rate detection method and system, terminal and medium
  • Thermodynamic diagram-based function coverage rate detection method and system, terminal and medium
  • Thermodynamic diagram-based function coverage rate detection method and system, terminal and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] Example 1: Function coverage detection method based on heat map, such as figure 1 As shown, it is specifically implemented by the following steps.

[0050] Step 1, insert a stub function in the head of all functions of the program to be tested, and use the function name as the parameter of the stub function to count the number of calls of the function; for polymorphic functions distinguished by parameters, different Function names are distinguished.

[0051] Suppose the name of the function to be counted is F1, and the prototype of the stub function is int recfunc(string), then insert the code before the first statement of the F1 function:

[0052] recfunc(string("F1"));.

[0053]Define a global variable mapmapfunc, whose members respectively represent the function name and the number of calls.

[0054] The execution logic of the recfunc function is to first check whether the function name represented by string is already in mapfunc, if not, add the function name, an...

Embodiment 2

[0065] Embodiment 2: A method for detecting functions not covered by the current test case, comprising the following steps.

[0066] Step 1 is the same as Step 1 in Embodiment 1.

[0067] Step 2. Obtain the function coverage heat map according to the execution of the test case.

[0068] The results after the execution of the test example T1 are as follows: image 3 shown.

[0069] Step 3, according to the function coverage heat map, the functions with a heat value of 0 are currently not covered functions, and other test cases need to be added to achieve coverage of these functions.

[0070] according to image 3 , in the heat diagram, the heat values ​​of functions F4, F6, and F7 are 0, indicating that they are not covered functions. It is necessary to increase the method of test cases to achieve the coverage of all functions, such as adding the first example. Case T2 and case T3.

Embodiment 3

[0071] Example 3: A function coverage detection system based on a heat map, such as Figure 7 As shown, it includes the instrumentation processing module, execution statistics module, heat map construction module, superposition processing module, coverage calculation module and example matching module. The stub processing module is used to insert the statistical stub function in the head of all functions of the program under test, and the function name is used as the parameter of the stub function; Obtain the number of calls of each function when each test example is executed; the heat map construction module is used to use the number of calls of each function when each test example is executed as a heat value to draw a corresponding function coverage heat map; the superposition processing module is used to The function coverage heat map of each test case is superimposed to obtain the function coverage summary heat map of all test cases; the coverage calculation module is 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
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a thermodynamic diagram-based function coverage rate detection method and system, a terminal and a medium, and relates to the technical field of software testing. The key points of the technical scheme are that a simple instrumentation mode is adopted to realize the statistics of the function coverage rate; meanwhile, the visual representation of a function coverage condition in an integration test is realized in a mode of drawing a function coverage thermodynamic diagram; when the function coverage rate does not reach 100%, the index functions are screened out according to the thermodynamic value distribution density in the function coverage summary thermodynamic diagram, new test examples are obtained through matching according to all the index functions, and a program is executed again until the function coverage rate reaches 100%. Compared with the prior art, the advantages of convenience, quickness and high operability for coverage rate detection and coverage rate improvement are realized, a better effect is realized in practical application, and the basic information is provided for increasing test examples, so that the coverage rate test efficiency at an integrated test stage is improved.

Description

technical field [0001] The present invention relates to the technical field of software testing, and more specifically, it relates to a function coverage detection method, system, terminal and medium based on a heat map. Background technique [0002] An important task in the phase of software integration testing is to check whether the functions of all functions or modules after assembly meet the requirements by designing and executing test cases; at the same time, it is required to achieve 100% function coverage, that is, to require the test case set After all calculation examples are executed, all functions in the program can be covered; for smaller programs, corresponding test tools can be used to obtain function coverage. [0003] In scientific computing programs, there are usually complex logic and mathematical operations, and the execution of the integrated test cases requires a lot of physical computing resources and a long running time; in order to improve the functi...

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/3676G06F11/3688Y02D10/00
Inventor 冯晋涛芦韡冯子亮张娜杨洪润卢川曾辉肖安洪马永强刘玲霜张吉斌周俊燚陈俊杰蓝晓燕寄锦芳
Owner NUCLEAR POWER INSTITUTE OF CHINA
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products