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
0 answers

I embed a Python interpreter in my C program. How do I evaluate my Python plugin coverage?

I have a C program that embeds the Python interpreter and is partially written in Python. I have tests written in C and when they run, the Python code is being executed. How do I measure my test coverage of the Python code in this setting?
user7610
  • 25,267
  • 15
  • 124
  • 150
3
votes
0 answers

Android Multi Module Project With TestCoverageEnabled Throws Data Binding Errors

I have a multi module project which is structured something like this. Here is the code to play around with this error: https://github.com/ajitsing/MultiModuleAndroid Root |- App Module (Application, Data binding enabled) |- Lib Module…
Ajit Singh
  • 2,436
  • 23
  • 27
3
votes
2 answers

Basic vs. compound condition coverage

I'm trying to get my head around the differences between these 2 coverage criteria and I can't work out how they differ. I think I'm failing to understand exactly what decision coverage is. My software testing textbook states that compound decision…
user3186023
3
votes
1 answer

Coverage test django logout

I got the django logout function inside my views.py : def logout_view(request): logout(request) return HttpResponseRedirect(reverse('cost_control_app:login')) And im trying to test it using coverage with this code: class…
jsanchezs
  • 1,992
  • 3
  • 25
  • 51
3
votes
2 answers

Monkey patch python with statement

I am using py.test for my python unit testing. Consider following code: def mytest(): "Test method" print "Before with statement" with TestClass('file.zip', 'r') as test_obj: print "This shouldn't print after patching." #…
Jatin Kumar
  • 2,635
  • 9
  • 36
  • 46
3
votes
5 answers

JUnit report to show test functionality, not coverage

One of the problems of a team lead is that people on the team (sometimes even including myself) often create JUnit tests without any testing functionality. It's easily done since the developers use their JUnit test as a harness to launch the part…
Adam
  • 5,215
  • 5
  • 51
  • 90
3
votes
1 answer

Cover report from Common Test when using rebar

I have an Erlang application that uses Rebar, and has tests written using Common Test. I'd like to see the test coverage report for these tests, so I included the following line in my rebar.config file: {cover_enabled, true}. However, the…
legoscia
  • 39,593
  • 22
  • 116
  • 167
3
votes
2 answers

Sonarqube API single class test coverage

I am trying to retrieve the unit test code coverage for individual classes through the SonarQube API (Sonar version 4.1.2). Everything is working fine, and I can see the metrics okay when I go directly to the sonar dashboard and go to the coverage…
Leo
  • 137
  • 1
  • 7
3
votes
1 answer

Cobertura 2.0.3 - unable to instrument

I am using Corbetura-2.0.3 with java 1.7 and I am trying to instrument the classes in our build system via command line. Stuck at instrumenting classes. Please assist. Here is the command: ./cobertura-instrument.sh --basedir…
2
votes
0 answers

Get code coverage in truffle test smart contracts

I am working on a blockchain project and have several smart contracts to be tested. For that, I use the Truffle test suite and write JavaScript tests. I want to know, is there any way to get the code coverage for smart contracts in the Truffle…
2
votes
0 answers

How to write unit test for BigQuery Java code

Can you help me write the Java unit test cases for increasing the coverage for the below Java code which retrieves the data from the BigQuery using the given query ? BigQuery bigQueryInst = …
2
votes
0 answers

Jacoco missing coverage when test is created

I have a project with spring-boot 2, JUnit 4, jacoco 0.8.6 and I use maven to run unit test, I have the following class: @Component public class AccountVOValidator implements FormValidator { @Override public void…
2
votes
0 answers

How can I get the lines that were covered by a particular test method?

I was trying to get all the lines that a test case covered. For…
2
votes
1 answer

How to fully test coverage a constructor that has a System.getenv("name") operation inside

I am using JUNIT5, have been trying to fully coverage a piece of code that involves System.getenv(""); I writed a couple classes to replicate what I am experiencing right now and so you can use them to understand me also (minimal reproducible…
BugsOverflow
  • 386
  • 3
  • 19
2
votes
0 answers

How to disable "branchesTrue" property in jest coverage-summary.json

I am trying to generate a coverage-summary.json file using jest but I noticed something new with it... total now shows a fifth property called branchesTrue. This didn't happen before and I can't pinpoint what version of jest it started writing this…