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

How to show maven-surefire-plugin unit test coverage report on console

I want to show unit test coverage report in tabular format whenever someone executes mvn test on console itself. I found that maven-surefire-plugin can only produce report in XML or HTML format and even that to a directory (target/coverage-report).…
Amaresh
  • 331
  • 2
  • 5
  • 14
4
votes
2 answers

Add *.gcno and *.gcda files to the make clean rule using CMake

I have the project with structure similar like this: ├── CMakeLists.txt ├── src │   ├── logic.cpp │   └── logic.h └── test ├── CMakeLists.txt └── logic_test.cpp The main CMakeLists.txt file is: cmake_minimum_required (VERSION 2.8) project…
Gluttton
  • 5,739
  • 3
  • 31
  • 58
4
votes
1 answer

Unit Test Coverage is being pedantic

I'm using the Analyse Code Coverage tool in Visual Studio 2012. The report appears to be very pedantic about what is covered and I have no idea what else could be done to provide more coverage. The code I am testing is this: public class Factory
Hand-E-Food
  • 12,368
  • 8
  • 45
  • 80
4
votes
1 answer

Coveralls.io with Travis-CI

I have several open-source projects that use Travis-CI to check the build status on my commits. I also report my test coverage to Coveralls.io. In the past few weeks, the reliability of coveralls has been spotty at best, and I had my tests running…
tytho
  • 237
  • 2
  • 10
3
votes
0 answers

Test coverage for Kotlin Multiplatform project(KMM)

I have one project(android and iOS) where I am sharing the common code inside shared folder. I have written both unit tests under commonTest(unit-test) folder as well as Instrumentation test inside androidTest(instrumentation test) folder. It works…
3
votes
0 answers

How exactly does jest's code coverage work during integration tests?

While doing integration tests on my express server, the code coverage feature of jest seems to only be working when the server is running in the same process as the test. For example:- importing express app and passing it to the supertest function,…
3
votes
1 answer

How to generate a coverage report with vscode extension tests

I'm implementing a VSCode extension. I set up the project following this link. It generates a starter project with a src/test/runTest.ts file: import * as path from 'path'; import { runTests } from '@vscode/test-electron'; async function main() { …
3
votes
1 answer

How to get code coverage on main function in flutter app?

How do I get 100% code coverage on a main function for an application that looks like this? lib/main.dart import 'package:flutter/material.dart'; void main() { runApp(App()); } class App extends StatelessWidget { @override Widget…
Apealed
  • 1,415
  • 8
  • 29
3
votes
0 answers

Jacoco Report Aggregate Coverage Report issue on Sonar

I have a multi-module maven project. I am facing issues while generating the sonar report for the jacoco report-aggregate coverage. I have 2 modules (A and B) for which I want to generate the report. I have created another module…
3
votes
2 answers

Can't generate react test coverage using react-testing-library in windows 10

I was trying to generate test coverage for my react tests using react-testing-library in windows Powershell. But on running yarn test .\src\components\ --coverage PowerShell shows this statement Invalid testPattern .\src\components\ supplied.…
3
votes
1 answer

How to get an actual code coverage report in IntelliJ IDEA?

I have a simple class called SomeClass: public class SomeClass { public int value = 0; public void inc() { value++; } public void dec() { if (isBiggerThanFive()) value--; value--; } private…
StackExchange123
  • 1,871
  • 9
  • 24
3
votes
2 answers

Make pytest require code coverage only on full test suite run

I am using something like # .coveragerc fail_under = 100 and # pytest.ini [pytest] addopts = --cov=modname/ --cov-report=term-missing to make it so that my test suite runs the coverage and fails if it isn't 100%. This works, but the problem is…
asmeurer
  • 86,894
  • 26
  • 169
  • 240
3
votes
0 answers

How to measure Groovy code coverage when executed from Java at runtime (via ScriptEngine)?

I'm very new to test coverage, and have so far found intellij's automated testcoverage to be more than adequate. But I'm struggling to figure out how to go about extending my coverage to groovy scripts. Basically in my java code I use ScriptEngine…
John
  • 137
  • 10
3
votes
0 answers

Why Jest 24.8 Coverage produce coverage === 0

PASS ../parser/test/flatten-user-flow-shortcuts.spec.ts PASS ../parser/test/flow-spliterators.spec.ts PASS ../parser/test/circles1.spec.js PASS ../parser/test/circles.spec.ts PASS ../parser/test/replace-basic-flows.spec.ts PASS …
Stav Alfi
  • 13,139
  • 23
  • 99
  • 171
3
votes
0 answers

How to get incremental recoverage with Jacoco

I want to get a incremental code coverage report with Jacoco. I modified some codes and it can get an incremental code coverage. But I got a problem. 1.I deploy a app(v1) and test "A" file 0-100 line codes, then I got a report(r1). 2.I modified some…
red_herring
  • 157
  • 2
  • 7