Skip to content

Commit

Permalink
Merge pull request #200 from liornoy/coverage-doc
Browse files Browse the repository at this point in the history
Add explanation to the coverage analysis tool
  • Loading branch information
liornoy authored Aug 9, 2021
2 parents 7c5af68 + 2a295fe commit 9333f86
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions documentation/coverage_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Code Coverage
#### *official documentation: https://coverage.readthedocs.io*
---

**Code coverage** is a way to determine the number of lines of code that is
successfully validated under a test procedure.
In different words, it is used to find dead code (unused) and it's a good idea
to find code that can no longer be executed and remove it.
Removing the dead code increases the source code's readability.

## Quick start

1. To run the coverage test use:
`pipenv run coverage run -m pytest`
This will execute the test suit and analyze the code coverage.

2. In Order to see the results enter:
`pipenv run coverage report`

preview of result:

![coverage_report](https://user-images.githubusercontent.com/40122521/128600397-d2be1f4f-b10a-460d-9ca6-7f80859a0e34.png)

3. A more visual and interactive report enter:
`pipenv run coverage html`
in order to see this visual report you can open it in VScode
and open htmlcov/index.html with something called Live Server.

preview:
![coverate_htm_report](https://user-images.githubusercontent.com/40122521/128600460-a111d5f9-f6a2-4377-8281-29bea0e7b41f.png)

0 comments on commit 9333f86

Please sign in to comment.