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
121
votes
3 answers

Differences between Line and Branch coverage

What is the difference between line and branch coverage in Cobertura Maven?
Emmanuel Demey
  • 2,158
  • 4
  • 18
  • 21
65
votes
10 answers

Coverage.py warning: No data was collected. (no-data-collected)

I am trying to find the coverage using coverage module for a django project but gets Coverage.py warning: No data was collected. (no-data-collected) My project folder has src and tests folders. When I run coverage run -m pytest && coverage…
1010101
  • 843
  • 1
  • 6
  • 11
47
votes
3 answers

IntelliJ - exclude some classes (packages) from test coverage report

I am currently using Java with Play framework. I have JUnit tests and I am trying to measure coverage with IntelliJ coverage runner. Play unfortunately generates some rubbish classes and IntelliJ includes them in the report. Is there a way of…
Xorty
  • 18,367
  • 27
  • 104
  • 155
43
votes
5 answers

how to make py.test --cov skip virtualenv directory

Should I care how my tests cover the external libraries I'm using in my project ? The py.test --cov displays how all files are covered, including ones in my virtualenv directory. How can I make the output show only the coverage of the modules I've…
David Ben Ari
  • 2,259
  • 3
  • 21
  • 40
42
votes
3 answers

Intellij Idea : view test coverage on a maven project

Is there a way to run all test in an root pom and collect test coverage in Intellij Idea ?
StKiller
  • 7,631
  • 10
  • 43
  • 56
29
votes
5 answers

Jacoco Code Coverage in android studio

I am trying to generate Jacoco code coverage report. I have used AndroidTestCase for my test classes. I have found using testCoverageEnabled true and using default android -studio default jacoco, ./gradlew connectedCheck or…
user1365169
  • 383
  • 1
  • 3
  • 10
27
votes
7 answers

Remove unused javascript code based on coverage report

There is a big javascript library (~ 40 000 lines of code) and an application which uses less than 50% of the library's code. There is a test which utilizes all the needed functionality from the library and can produce coverage report. How to remove…
Oleg Mikhailov
  • 5,751
  • 4
  • 46
  • 54
25
votes
4 answers

XCode 5.1 Unit Test Coverage Analysis Fails On Files Using Blocks

Today I was tasked with adding unit test coverage analysis to our code base. Today is also the day iOS 7.1 is released along with XCode 5.1. From the release notes: The gcov tool for code coverage testing has been reimplemented. The new version…
LeffelMania
  • 12,765
  • 4
  • 32
  • 34
24
votes
4 answers

How to measure Golang integration test coverage?

I am trying to use go test -cover to measure the test coverage of a service I am building. It is a REST API and I am testing it by spinning it up, making test HTTP requests and reviewing the HTTP responses. These tests are not part of the packages…
Anton Evangelatov
  • 1,397
  • 2
  • 14
  • 31
21
votes
1 answer

Exclude a function from coverage

I am using coverage.py to get the test coverage of the code. Suppose I have two functions with the same name in two different modules # foo/foo.py def get_something(): # fetch something # 10 line of branch code return "something…
JPG
  • 82,442
  • 19
  • 127
  • 206
18
votes
1 answer

Jacoco code coverage in Android Studio with flavors

I've been trying to run Jacoco test coverage for quiet some time now. I've tried several possible solutions reported in these topics: Android test code coverage with JaCoCo Gradle plugin How do I get a jacoco coverage report using Android gradle…
Adr3nl
  • 453
  • 2
  • 5
  • 19
15
votes
3 answers

Jacoco Coverage Report issues

I am trying to define the location, where jacoco will create the coverage file for instrumentation tests running on real devices. From the --debug run of the gradle task I see this log: [DEBUG] [org.gradle.api.Task] DeviceConnector 'Nexus 5X -…
WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
14
votes
3 answers

Istanbul coverage nested directories in HTML report

The unit test coverage report from Istanbul in HTML format displays every single folder of the project in the index.html. It actually flattens the directory structure. Is there an option to render the html report with nested folders?
sod
  • 3,804
  • 5
  • 22
  • 28
12
votes
3 answers

Remove some java files from jacoco test coverage using gradle

I want to exclude some source files in Jacaco Test coverage report.For other generated code I have done like this: classDirectories = fileTree( dir: "${project.buildDir}/intermediates/classes/debug/com", excludes: [ …
Shubham
  • 2,627
  • 3
  • 20
  • 36
12
votes
2 answers

Maven Jacoco Configuration for multi-module projects

I was trying to generate code coverage reports using jacoco plugin in maven for a multi module project that I was working on. I added the following in my parent pom.xml within the build tags. org.jacoco
John
  • 2,445
  • 2
  • 17
  • 25
1
2 3
25 26