Name: pyglet
URL: https://github.com/pyglet/pyglet
Number of lines of code and the tool used to count it: 100531, calculated by Lizard:
Programming language: Python
We used Coverage (coverage.py) as recommended by the coordinators. Pyglet instructed to only run the unit tests by calling pytest on their tests/unit directory, so we did just that. The commands to execute the tests were as follows:# installing necessities
python3 -m pip install coverage
pip install --upgrade --user pyglet
pip install -r tests/requirements.txt --user
# running test and gathering results
coverage run --branch -m pytest tests/unit
coverage html
This resulted in the following coverage:
Sanne
get_document.py
https://github.com/sannedb/pyglet/commit/b4bc00c405f50ee607d8b7c33ead8e892f292338
handle_answer.py
https://github.com/sannedb/pyglet/commit/b4bc00c405f50ee607d8b7c33ead8e892f292338
Sepaanta
limit.py
https://github.com/sannedb/pyglet/commit/68bec1593026c784580dc821d2a7b42e9738bdf1
normalize.py
https://github.com/sannedb/pyglet/commit/0db04da130f651e0849d77826ba2a974ef476993
Emilija
inverse.py
https://github.com/sannedb/pyglet/commit/50ee8a173c09bc9bbfecc37ad67fdf1ce6cda241
on_key_press.py
https://github.com/sannedb/pyglet/commit/33fbb3e8d2ae0e39e8671a59c7ed0c085571a4b0
Rūta
draw_text.py
https://github.com/pyglet/pyglet/commit/423262dba9547773da371a9ad5f36e63e7455f75
tear_down.py
https://github.com/sannedb/pyglet/commit/cbda5d030a0bf155ae8cc6e51892bb93cca1209c
Sanne
Test 1: get_document.py
https://github.com/sannedb/pyglet/commit/9e643251d0b8139fafc9ac9fa928f2d5c7a3e1f0
After:
The coverage is now 100%. In essence this was not too hard, because there can only be two situations: one where there is no document so they create one, and one where there is one and they return that. I created tests for both cases. The coverage was improved because it was 0% at first, which I am assuming is because either of the situations will always be true so creating a test for this function may not have had the highest priority for Pyglet's developer team. Below you can find the proof of improvement after checking with coverage.py:
Test 2: handle_answer.py
https://github.com/sannedb/pyglet/commit/9e643251d0b8139fafc9ac9fa928f2d5c7a3e1f0
After:
The coverage for this function is now at 95%. I have created mock situations, that will print statements addressing what the error is, rather than raising the actual error, so that the testing can proceed without the file shutting down. Once again, there was no test made for it to begin with so its initial coverage was at 0%, meaning the coverage would have improved regardlessly even if i were to check just the 'None' situation. Below you can find the proof of improvement after checking with coverage.py:
Sepaanta
Test 1: limit.py
https://github.com/sannedb/pyglet/commit/3e7bc00ec4c81870041557bf3a7075998b088129
the coverage is now 100% from 0%. There were no tests initially, which makes it easy to improve the coverage. I tested it with border values. One where the check is barely true and one where is barely false.
Test 2: normalize.py
https://github.com/sannedb/pyglet/commit/66b3d38f7262866df85445d3283d81b2109e5069
The coverage is now 100% from 0%. There also weren't existing tests for this function. Which made it easy to improve
Emilija
Test 1: inverse.py
https://github.com/sannedb/pyglet/commit/50ee8a173c09bc9bbfecc37ad67fdf1ce6cda241
The coverage went from 54% to 86%. Because the added test functions (test_inverse_of_zero_matrix and test_inverse_of_all_same_matrix) ensured that the branches in the inverse function were executed during the tests.
Test 2: on_key_press
https://github.com/sannedb/pyglet/commit/33fbb3e8d2ae0e39e8671a59c7ed0c085571a4b0
The coverage went from 0% to 100% because the test function (test_on_key_press_pass) created ensured that the branches in on_key_press were executed.
Rūta
Test 1: draw_text.py
https://github.com/pyglet/pyglet/commit/423262dba9547773da371a9ad5f36e63e7455f75
After:
The coverage went from 0 to 12%
Test 2: tear_down.py
https://github.com/pyglet/pyglet/commit/cbda5d030a0bf155ae8cc6e51892bb93cca1209c
After:
The coverage went from 20% to 71%
Sanne:
- Tested the NLOC for this document;
- ran the coverage tool for this document;
- instrumented and tested coverage for get_document and handle_answers;
- handled README.md structure.
Sepaanta:
- Found the project;
- ran the initial coverage test;
- instrumented and tested coverage for limit.py and normalize.py
Emilija:
- Ran the initial NLOC check;
- Ran initial coverage report;
- instrumented and tested coverage for inverse and on_key_press;
Rūta:
- Did draw_text and tear_down