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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com