Questions tagged [code-coverage]

"Code coverage" (synonym: test coverage) is a measure of the amount of application source code that has been exercised, usually by some testing regime, often by unit testing.

Code coverage is a measure of the amount of application source code that has been exercised, usually by some testing regime, often by unit testing. There are two key questions: given an exercise regime, how much of the source code is executed (under the assumption that the exercise also shows the program effects to be correct), and, given an exercise regime, how does one increase the coverage amount by modifying the exercise.

Determining the actual coverage is normally accomplished by instrumenting the source code to track when its elements are executed, and then simply running the exercise regime. The instrumented data is collected and often displayed in a report and/or a visual display.

Improving coverage given a specific exercise regime is difficult. One must determine for some block of uncovered code, how to cause that code to be executed, often requiring a complex initialization of the program environment to trigger the code block.

Code coverage is also known as , but see that tag's wiki for an alternate meaning.

5306 questions
3
votes
0 answers

Unable to ignore third party libraries from code coverage report in iOS

Testing an iOS app with Xcode inbuilt Unit test cases which is working fine , enabled code coverage which reports third party library in code coverage report , I want to know how to exclude third party libraries from code coverage report.
3
votes
1 answer

Code coverage report incorrectly indicating 100% coverage of a controller

I'm running a series of PHPunit tests and have a controller that is reporting 100% coverage. In the coverage report however, only 5 of its 84 lines of code are marked "green" I'm wondering what factors might be causing this issue? One interesting…
Alex C
  • 16,624
  • 18
  • 66
  • 98
3
votes
0 answers

Gtest with lcov in c++

I have successfully generated the .gcda and .gcno files and they are in the same folder. The flags in the make file looks as below : CPPFLAGS += -std=c++11 --coverage -isystem $(GTEST_DIR)/include CXXFLAGS += -std=c++11 --coverage -g -Wall -Wextra…
Enjal Parajuli
  • 193
  • 1
  • 11
3
votes
0 answers

Code Coverage for ES6 using gulp istanbul

I'm trying to generate istanbul coverage report for my node js es6 application that has mocha tests. I have used isparta to instrument code and also babel to transpile from ES6 to ES5, but unfortunately nothing has worked. Is anyone successful in …
Ajay Srikanth
  • 1,095
  • 4
  • 22
  • 43
3
votes
4 answers

coverage java tool

I'm wrintting java tests to control the GUI application, and I'm searching a tool to cover the java test , what is your recommandation ? which tool is usually used to cover java tests ?
laura
  • 155
  • 3
  • 13
3
votes
1 answer

Angular - code coverage for the views

While developing applications with Angular (2,4,5,...) people are using a lot of *ngIf="whatever_condition" and less often also ngSwitch However I have not seen any tooling that would be able to provide information about how much of that code was…
kubal5003
  • 7,186
  • 8
  • 52
  • 90
3
votes
1 answer

Looking for serious code coverage tools for large Fortran projects

I am looking for serious Fortran code-coverage tools. We are working on a large project with tens of thousands of lines of code and dozens and dozens of fortran files in fixed and free form. We use the ifort compiler. I have not been able to find…
user32882
  • 5,094
  • 5
  • 43
  • 82
3
votes
1 answer

No coverage information was collected, istanbul coverage. (answer for similar issues in page is not work for me)

i user this command: set CODACY_PROJECT_TOKEN=my_token&& istanbul cover --report lcov node_modules/mocha/bin/_mocha -- -r babel-register -r ./test_helper.js \"test/**/*@(.js|.jsx)\" Then i take passed in all test case but "No coverage information…
Thanh Tài
  • 31
  • 2
3
votes
1 answer

When using dotCover in a TeamCity build configuration, is there an environment variable for code coverage percentage?

When using TeamCity to manage .net projects, we like to use dotCover to evaluate our code coverage. In the past using NCover, there was a way to retrieve the code coverage percentage using an environment variable. We liked this and we would set…
shanabus
  • 12,989
  • 6
  • 52
  • 78
3
votes
0 answers

Get code coverage report(junit and instumentation testcases) for eclipse android project

I have android project which has some Junit test-cases and some instrumentation test-cases. I am able to generate the code coverage for the Junit test-cases with help of Colver or EclEmma tool. Now i need to create the code coverage report for…
3
votes
2 answers

Unit test by skipping library functions for code coverage

I am trying to create a unit test in MS Test for a CMS application, wherein I have minority number of function that I wrote in my solution, the majority of the functions came along with CMS framework. Issue: When I take the code coverage it shows…
SmartestVEGA
  • 8,415
  • 26
  • 86
  • 139
3
votes
1 answer

Remove auto generated exception code from coverage report

Let's start with a minimal working example: main.cpp: #include #include int main() { std::cout << "hello " + std::to_string(42); return 0; } I compile this code using the following flags: [g++/clang++] -std=c++11 -g -Og…
datosh
  • 498
  • 7
  • 20
3
votes
1 answer

kcov vs lcov vs raw performance?

Anyone able to give me some info on the relative performance of code running under following conditions, Just compiled Compiled with --coverage Running under kcov Am I going to need twice a long to run my test suite if I integrated code coverage…
Paul D Smith
  • 639
  • 5
  • 16
3
votes
1 answer

Getting code coverage in .net core, xUnit project

I'm trying to get code coverage in .net core project using directions from https://github.com/Microsoft/vstest-docs/blob/master/docs/analyze.md#working-with-code-coverage Test are working correctly However, when I add code coverage option I get…
PaulJ
  • 169
  • 1
  • 2
  • 11
3
votes
2 answers

Code coverage and test results for .NET Core projects in VSTS

How do we enable code coverage and test results for .NET Core projects in VSTS? Currently, it is not enabled for a .NET Core test task.
1 2 3
99
100