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

Running coverage with unittest from a separate folder gives import errors

I'm trying to run coverage with the unittest module on my python project. The project has the following structure: project/ src/ __init__.py foo1.py foo2.py tests/ __init__.py data.py …
3
votes
0 answers

Karma coverage HTML coverage report is empy

I am new to Karma with Angular 8. I have few queries and I am not getting correct result. My queries are: 1) I have karma conf file where I have configured for code Coverage to view in HTML coverage directory was created but I am not seeing…
Mr.M
  • 1,472
  • 3
  • 29
  • 76
3
votes
2 answers

.NET code coverage tools don't work on native applications that load .net assemblies

I am writing a plug-in module for Revit Architecture, which provides a .NET API. Essentially, you create an assembly with classes that implement a specific interface. Revit then loads the assembly and makes calls to the interface. I would like to…
GentlemanCoder
  • 547
  • 1
  • 5
  • 11
3
votes
1 answer

Code coverage for Angular/SPA application with e2e in selenium Java or cypress

We want to measure Angular 8 application code coverage. We have a e2e test cases written in selenium java which loads the angular application which is deployed on another machine in browser and runs some set of e2e test casess. The question is how I…
3
votes
1 answer

How to perform code coverage in C++ using meson?

I'm using meson and ninja as build system in my C++ project and I've configured catch2 as testing framework. I was wondering how to perform code coverage with the tests that I've written. I read this page, https://mesonbuild.com/Unit-tests.html…
Antonio La Marra
  • 5,949
  • 4
  • 15
  • 23
3
votes
0 answers

Perl Coverage on Debian VM running Bugzilla

I am trying to record Perl coverage. I use the ready to use Debian VM from Turnkey running Bugzilla. (https://www.turnkeylinux.org/download?file=turnkey-bugzilla-14.2-jessie-amd64-vmdk.zip) I was able to install the perl coverage module…
sfischer
  • 41
  • 4
3
votes
0 answers

Using Istanbul to find code coverage with manual testing

Using step mentioned on link https://vijayt.com/post/code-coverage-of-manual-testing-using-istanbul/ to find code coverage in instanbul with manual testing but my current application in angular version 1 using parcel bundler. When I add .bablerc…
parveen
  • 557
  • 3
  • 13
3
votes
3 answers

combine coverage reports using istanbul-combine

Let's say I have these coverage reports: /coverage/libs/test/lib1/final-coverage.json /coverage/libs/test/lib2/final-coverage.json /coverage/libs/test/lib3/final-coverage.json now I would like to combine these reports and generate a html…
Alexus
  • 1,887
  • 1
  • 23
  • 50
3
votes
1 answer

How to run Python code coverage tests for Google App Engine in Eclipse or from command line

I want to run Python code coverage tests for Google App Engine in Eclipse or from command line. Normally Python program required such command line: coverage run program arguments I trying to run it for Google App Engine but no data is collected from…
Chameleon
  • 9,722
  • 16
  • 65
  • 127
3
votes
0 answers

Compiling code using MFC or ATL headers with MinGW on Windows?

I'm trying to determine if it is possible to use MinGW to compile code that requires Microsoft Foundation Classes (MFC) or Active Templace Libraries (ATL), libraries that come with Microsoft Visual C++ (MSVC). Some context: My end goal is to be…
Sakeeb Hossain
  • 662
  • 5
  • 19
3
votes
0 answers

Xcode 10.3 not generating coverage

Xcode stoped generating coverage report. It gives following error:
Tarang
  • 626
  • 2
  • 8
  • 22
3
votes
1 answer

llvm-cov: statistics for uninstantiated functions

I'm starting to work with llvm-cov to produce coverage statistics for my project. llvm-cov has several categories: line coverage, function coverage and region coverage. But they all consider only instantiated functions, functions which are not…
Jakub Klinkovský
  • 1,248
  • 1
  • 12
  • 33
3
votes
1 answer

How to run coverlet on .NET projects not using the Sdk style projects?

I would like to try coverlet, but the only examples I could find talk about running it through dotnet.exe. My problem is that our projects do not use the Sdk style, they are old .NET projects targeting .NET 4.7.2 How can I run coverlet with them?
mark
  • 59,016
  • 79
  • 296
  • 580
3
votes
4 answers

Core dump and gcov coverage report

I'm doing stress testing on multi-threaded program and collecting coverage as well. As far as I know, gcov doesn't produce .gcda files when program is terminated by _exit() or some signals such as SIGABRT, SIGSEGV and so on. When the program…
Doe
  • 141
  • 2
  • 4
3
votes
0 answers

Does OpenCover run tests in parallel? Is there an option to have it not?

I'm having some issues running OpenCover.console over some .NET assemblies. We're seeing some MSTEST tests fail, only when run under OpenCover. What's going on is that we have certain of our tests that are reading and writing to a LocalDB database.…
Jeff Dege
  • 11,190
  • 22
  • 96
  • 165