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
3
votes
1 answer

Jest Test On TeamCity

I have a react application that uses Jest and jest-teamcity-reporter as a testResultsProcessor my npm test scripts is as follow : the problem is when i run my build in team city which contains test coverage, the test is running but i cannot see…
Amazoom
  • 631
  • 1
  • 6
  • 9
3
votes
2 answers

Should unit tests cover constants changing?

I am creating a unit test for my presenter. I have 2 constants for a ranges which definitely can be in future changed to a requests from server. So I wrote all my code in the way that it will work with any value of this constants. And now I have…
3
votes
1 answer

Why empty line is not included in code coverage?

I am using Java 8.0, Springboot and Junit. After writing my unit tests for my Application class I get following stats: Application class: Line Coverage: 95% (22/23) So I looked after the line and get: Marked with pink dots, this is the line that…
Tagamoga
  • 332
  • 4
  • 18
3
votes
2 answers

Is there any means by which I could evaluate the test-coverage of drl files in Drools rule engine?

I am trying to derive test-coverage for unit-tests running across rules written in drl files(Drools rule engine). Basically I want to derive the percentage of the rule execution which has been actually covered by the unit tests written around them.…
3
votes
0 answers

Spring Boot Rest integration testing - How to analyse API coverage?

I want to analyse API coverage of my spring boot rest project. (During the intergration test which endpoints are used, and related details) My strategy is like that, during the integration test; Run /mappings endpoint once, and get the total…
Erce Tilav
  • 1,073
  • 1
  • 12
  • 20
3
votes
2 answers

Mock code reducing code coverage

I am working with Golang and using mockhiato to generate mocks for all interfaces. This tool generates mocked implementation in mocks.go file within the same package. I can't rename mocks.go to mocks_test.go as this mock file is consumed by other…
Rahul Garg
  • 4,069
  • 1
  • 34
  • 31
3
votes
3 answers

What kind of test coverage criteria Eclipse uses?

I am trying to understand what type of test coverage metric Eclipse uses. I wrote two simple functions as follows: public class Hello { public void f(int a, int b) { int sum = a + b; if (sum > 0) print("blue"); else if…
CEGRD
  • 7,787
  • 5
  • 25
  • 35
3
votes
1 answer

How to make sonarqube ignore the equals and hashcode

I'm wondering if it is currently possible to ignore the equals and hashcode method for the sonar test coverage? I have heard about the block exclusion, but it didn't work.
3
votes
0 answers

Code coverage with behat

We want to use the most current PHP_CodeCoverage API (https://github.com/sebastianbergmann/php-code-coverage) in our project. To be sure it's really the case we just made an addtional script in bin/behat-coverage #!/usr/bin/env php …
Juri Sinitson
  • 1,445
  • 1
  • 14
  • 18
3
votes
2 answers

Encountered error while trying JCov java coverage utility

Almost everywhere in INTERNET there are these basic steps: • Compile java files as usual javac • “Instrument” the byte code java -jar jcov.jar Instr • Run the code java -classpath ...:jcov_file_saver.jar…
Vikas Tawniya
  • 1,323
  • 1
  • 13
  • 22
3
votes
1 answer

SonarQube coverage not showing up

Here's a screenshot so you better understand what I'm talking about: Shouldn't all directories have coverage? I have to say that those directories (without any number) are not covered by any tests but doesn't this mean that the coverage is 0%?
3
votes
1 answer

How to run coverage.py on a long running process?

I have a bunch of processes that run continuously on my server. I can modify the invocation command, but it is difficult to kill the process just to get the coverage report. As I understand it, the .coverage file is generated only after the process…
Karthick
  • 4,456
  • 7
  • 28
  • 34
3
votes
2 answers

How to view code coverage details in Intellij

When I run Code Coverage -either as part of invoking a unit test or from Analyze | Generate Coverage Report the result is only a one-line summary as shown: Instead what we want is to see coverage by class - to hone in on the undertested areas. …
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560
3
votes
1 answer

jest --coverage show the wrong path

Like the pic above, I move the dir __tests__ and file LinkButton.js from demo to jest, then run npm test -- --coverage in Terminal. The test is passed, but the path in coverage is wrong. It seems the jest had cache the old path. What's wrong with…
codelegant
  • 583
  • 2
  • 6
  • 19
3
votes
0 answers

Can I accumulate gcov line counts? (I don't have LCOV)

The gcov data files (*.gcda) accumulate the counts across multiple tests. That is a wonderful thing. The problem is, I can't figure out how to get the .gcov files to accumulate in the same way the .gcda files do. I have a large project (53 header,…
Luv2code
  • 1,079
  • 8
  • 14