Method and equipment for obtaining code coverage rate
A code coverage, equipment technology, applied in software testing/debugging, etc., can solve the problem of not being able to accurately indicate that the code has not been tested
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0025] Embodiment 1 of the present application provides a method for obtaining code coverage, which is used to calculate code coverage (Code Coverage). It can be subdivided into line code coverage, function coverage, branch coverage, condition coverage, etc. In the embodiment of this application, the method for obtaining line code coverage is as follows: figure 1 As shown, the method may at least include the following steps:
[0026] Step 101, when performing a code coverage test on multiple source code files of a test object, obtain the number of executed code lines and the number of all compiled code lines during the test.
[0027] Step 102, calculating the line code coverage of the test object: the number of executed code lines / the number of all compiled code lines.
[0028] In the embodiment of the present application, code coverage testing can be performed on multiple source code files of the test object through code coverage testing tools (such as gcov, lcov, etc.), and...
Embodiment 2
[0055] Based on the same application idea as the above method, an embodiment of the present application also provides a device for obtaining code coverage, such as figure 2 As shown, the equipment includes:
[0056] The obtaining module 11 is used to obtain the number of lines of code executed during the test and the number of all lines of code compiled when performing code coverage testing on multiple source code files of the test object;
[0057] The calculation module 12 is configured to calculate the line code coverage ratio of the test object: the number of executed code lines / the number of all compiled code lines.
[0058] The obtaining module 11 specifically includes:
[0059] Generate sub-module 111, for generating the corresponding code coverage intermediate result file of source code file when carrying out code coverage rate test to each source code file;
[0060] The code coverage intermediate result file corresponding to the source code file records the number o...
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