Questions tagged [test-coverage]

"Test coverage" is used both as a synonym for [code-coverage] and to mean all measures of the extent of testing of a program including both [code-coverage] and [function-coverage].

"Test coverage" is used both as a synonym for and to mean all measures of the extent of testing of a program including both and .

In the latter sense, test coverage measures the amount of testing performed by a set of tests. Wherever we can count things and can tell whether or not each of those things has been tested by some test, then we can measure coverage, known as test coverage.

More Info

Both of the above articles discuss code coverage, not test coverage in the broader sense.

377 questions
6
votes
1 answer

Using py.test --cov from inside setup.py pytest.main

I'm developing a package with some testing. Working with CMD: py.test --cov my_pkg I get the results with covarage: --------------- coverage: platform win32, python 2.7.9-final-0 ---------------- Name Stmts Miss …
Kobi K
  • 7,743
  • 6
  • 42
  • 86
6
votes
3 answers

Code Coverage Reporting with Visual Studio 2013 Professional for native C++

Using the C++ unit testing framework with Visual Studio 2013 Professional, one can write unit tests and run them from within the IDE, but in order to generate any coverage reports, apparently, one needs to have the Premium or Ultimate edition of…
Jaywalker
  • 3,079
  • 3
  • 28
  • 44
5
votes
0 answers

jest coverage - /* istanbul ignore next */ - not working

Wanted this part of the code to be ignored in jest coverage /* istanbul ignore next */ async middleware( req: Request>, _res: Response>, next:…
Aranneuxo
  • 51
  • 3
5
votes
1 answer

What is the best way to get coverage stats in cucumber js?

I'm designing my tests using the Behavior Driven Development (BDD) approach using Gherkin syntax and running my tests with Cucumber JS. I'm using Cucumber Studio to share reports and keep synced with my business stakeholders, and…
Chootti
  • 357
  • 3
  • 15
5
votes
1 answer

jest@23.1.0 collectCoverageFrom not picking the files outside root directory

When I run code coverage, code inside the root directory containing jest config works perfectly but for the code outside the root directory test cases passes but in the coverage report it shows zero percentage for all the test files outside the root…
amitraushan
  • 51
  • 1
  • 2
5
votes
1 answer

Sonar + Jacoco + Junit 5 : No information about coverage per test

I am trying to get coverage per test feature working with Sonarqube 7. I am using jacoco-maven-plugin and my tests are running with JUnit 5. I successfully managed to get global Coverage on Sonarqube dashboard, but I would like to go deeper by being…
rico
  • 1,843
  • 2
  • 24
  • 41
5
votes
0 answers

Run test with coverage failed in Android Studio 3.0

I right clicked on my LoginActivityTest file and select Run LoginActivityTest, it ran and completed all the tests. Now I want to run it with coverage. I then right clicked on the LoginActivityTest file and select Run LoginActivityTest with Coverage,…
s-hunter
  • 24,172
  • 16
  • 88
  • 130
5
votes
1 answer

Test coverage from SWIG-compiled C++/Python code

I have a classical SWIG setup where a bunch of C++ function are called from Python. Now, after adding some tests (in Python), I'd like to get test coverage on the C++ sources. The classical Python method is nosetests --with-coverage…
Nico Schlömer
  • 53,797
  • 27
  • 201
  • 249
4
votes
3 answers

how to ignore a line in `dart-lang/coverage`

use case codecov sees super as in need for test, not sure being sure if writing a test for this keyword would be meaningful how to write such a test I'd like to exclude the line from coverage until my doubts are cleared question how do I ignore a…
Francesco Iapicca
  • 2,618
  • 5
  • 40
  • 85
4
votes
2 answers

Unit testing: Entry name 'res/layout/test_toolbar.xml' collided

I've tried to do some unit test example that included in an Android Studio project like ExampleInstrumentedTest and ExampleUnitTest, so the result is : Entry name 'res/layout/test_toolbar.xml' collided I've searched everywhere on google but…
4
votes
4 answers

Cannot generate go coverage file

I tried run a sytemTest in this article: https://www.elastic.co/blog/code-coverage-for-your-golang-system-tests so follow the tips first I create a system test file named main_test.go like this: func TestSystem(t *testing.T) { t.Logf("systemtest…
bruce
  • 121
  • 6
4
votes
1 answer

Testing branch assignment in Perl for SUPER:: methods

I am about to finish to study the Intermediate Perl book. In chapter 18 Object Destruction is introduced the following DESTROY method definition: # lib/Animal.pm package Animal { # ... sub DESTROY { my $self = shift; if…
mabe02
  • 2,676
  • 2
  • 20
  • 35
4
votes
1 answer

Code coverage for functional tests

I have a Java RESTful API. I use REST Assured for my functional tests on each endpoint. Is there a way to get the code coverage for the classes/methods used behind the scene (controllers, services, DAOs/repositories, etc.) when REST Assured (or any…
Maxime Laval
  • 4,068
  • 8
  • 40
  • 60
4
votes
0 answers

Generating Coverage report for Protractor E2E test running on different machine

I want to get the coverage report for my Protractor E2E UI tests against a running node code. I have tried the following steps: Using Istanbul, I instrumented the code on one of my app server managed through Nginx. istanbul instrument .…
Rajive Pai
  • 312
  • 1
  • 13
4
votes
1 answer

How can I designate lines of code for Clover to ignore?

I would like to tell Clover to ignore particular lines of my Java code. Is there any way to do so from within the code? Something like //// IGNORE vvvvvvv System.out.println("Ignore this line and considered it covered"); //// IGNORE ^^^^^^^ If not,…
Victor Grazi
  • 15,563
  • 14
  • 61
  • 94
1 2
3
25 26