C ++ code coverage tool coverage validator

Source: Internet
Author: User

C ++ on the marketCodeMost coverage tools are charged, and coverage validator is no exception. Coverage validator should have been heard by few people.Stackoverflow. So I downloaded and tried it. If you are interested, you can go to https://www.softwareverify.com/cpp/coverage/index.htmlto learn more about the problem.

I have tried coveragemeter before, and it is quite convenient to use it. The main principle is to replace the original compiler and plug it in the code. Therefore, coveragemeter is characterized by the need to recompile the tested code. This is also a common method for most coverage tools. Coverage validator does not need to re-compile the tested code, but only needs to provide the tested binaryProgramTo calculate the code coverage. It can cover both statistical lines, branch coverage, and function coverage.

Coverage validator is also very simple to use. You only need:

1. Use coverage validator to run your tested program.

Use the menu "file"-"Start application" to specify the program to be run, and then use many options, such as program path, command line parameters, and environment variables, later, several methods were provided to start the program, such as CreateProcess, which is also the most common method.

2. view the coverage rate results in coverage validator.

It is convenient to view the results. In the code window, the lines that are overwritten and those that are not overwritten are marked by colors.

You can also:

Set filter conditions to count only the coverage data of a loaded module. For example, if you want to test a DLL, you can set a filter condition to only count the code coverage of the DLL. You can also set filtering to count only the coverage data of a class and function. The filtering method is very simple, and I will not post my own images. Menu: "Configure"-"Settings"-"filters"

The following is the interface of the referenced official website (to be honest, the interface is quite simple)

Summary Page:

 

Detailed results page:

 

Since the software is commercial and easy to use and has detailed documentation, this article does not intend to detail how coverage validator works, the purpose of this article is to let everyone know that there is such a tool that may bring you new ideas, maybe this tool is indeed useful to you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.