1

My team asked me to measure the Test coverage percentage via a tool i choose ( how many tests from the app features are covered by automated testing ) , so i added the gitlab coverage badge and now i m getting a percentage of coverage but it's obviously the code coverage:

so what's the difference between code coverage and test coverage ?
this badge is displaying the percentage of what exactly ?
is there any way to calculate test coverage based on all the app   features ?

3 Answers 3

1

enter image description here

Code Coverage

  • Shows the level of code that is secured by the test cases through both manual testing and computerization testing with Selenium or some other test mechanization structure. For instance, if your source code has straightforward if… else circle, the code coverage would be 100% if your test code would cover both the situations for example in the event that and else.
  • Code coverage is performed to verify the extent to which the code has been executed. Code coverage tools use static instrumentation in which statements monitoring code execution are inserted at necessary junctures in the code. Now, adding instrumentation code does result in increased execution time and code length. But the increase is more than justified in light of the information that the tester gets because of the extra code. Code coverage scripts generate a report that details how much of the application code has been executed. This is a white-box testing technique.

Test Coverage

  • Incorporates testing the highlights actualized as piece of the Functional prerequisites detail, programming necessities particular, and other required archives. For instance, in the event that you are to perform cross program testing of your web application to guarantee whether your application is delivering admirably from various programs or not? Your test coverage would be around the quantity of programs + OS mixes over which you have approved program similarity of your web application. With the comprehension of the essential contrast between code coverage versus test coverage, let us hop into further subtleties around code coverage and test coverage.
  • Unlike code coverage, test coverage is a black-box testing technique. It monitors the number of tests that have been executed. Test cases are written to ensure maximum coverage of requirements outlined in multiple documents – FRS (Functional Requirements Specification), SRS (Software Requirements Specification), URS (User Requirement Specification), etc. The test coverage report provides information about parts of the software where test coverage is being implemented. Essentially, it provides information about the tests executed on an application or website.

References:

1

Code coverage, as it's usually defined, is a type of test coverage. Code coverage refers to how certain parts of the code (lines, statements, branches) are exercised when a certain set of automated checks are executed.

Michael Bolton proposes testing coverage as:

“X coverage is how thoroughly we have examined the product with respect to some model of X”.

And he completes:

"Test coverage, like quality, is not something that yields very well to quantitative measurements, except when we’re talking of very narrow and specific conditions."

You can think about the different types of coverage in relation to each element of your system. The Heuristic Testing Strategy Model shows a list of possible elements you may want to take a look:

enter image description here enter image description here

(You can download the mindmap above here)

E.g., you can think of coverage in terms of types of users you have, you can think of timings and interruptions, in terms of concurrency, etc.

1

Code coverage is simply a measurement of how much of your code was exercised by your tests, it has different implementations like branch coverage or line coverage but the underlying idea is the same- measure at the code level.

ISTQB has actually a good definition to test coverage

The degree, expressed as a percentage, to which a specified coverage item has been exercised by a test suite.

It is vague on purpose since there is no one metric that fits all. You can measure coverage of Requirements with at least one test (very common), coverage of common business flows or coverage of executed tests from the entire test suite (unfortunately common but wrong)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.