Functionality of any code coverage tool is very simple. While executing binary code coverage tool runs simultaneously. Once the execution of binary finishes, code coverage tool generates report and show how many lines or statements have been covered either in form of % or actual lines. A code coverage tool usually covers following things:
1. Function coverage.
2. Statement coverage.
3. Branch coverage.
4. Condition coverage.
I have used gcov tool in my project. Code coverage is also being used for software quality metrics. Every company follow up its own methodology and quality metrics.