Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Latest commit

 

History

History
216 lines (118 loc) · 9.86 KB

README.md

File metadata and controls

216 lines (118 loc) · 9.86 KB

Report for Assignment 1

Project chosen

Name: discord.py

URL: https://github.com/Rapptz/discord.py

Number of lines of code and the tool used to count it: 68242 using lizard discord tests setup.py

Programming language: Python

Coverage measurement

Existing tool

The coverage tool coverage.py was used for this project. After installing the dependencies and executing coverage run -m pytest we get the following output: 63781

Running coverage html and opening the document in the browser gives the following: 23724 4629

Your own coverage tool

Thijmen

flatten_literal_params

commit

_human_join

commit

Maurice

_string_width

commit + commit

escape_markdown

commit

Yasin

_get and _aget

commit

json_or_text

commit + commit Note: the second commmit is the final instrumentation

Frank

parse_rgb_number

commit

from_str

commit

Coverage improvement

Individual tests

Thijmen

test_flatten_literal_params

commit + commit

The coverage improvement is +100%. The coverage has been improved, because flatten_literal_params used to not be tested, while the new test_flatten_literal_params considers every branch to be taken.

test__human_join

commit

The coverage improvement is +100%. The coverage has been improved, because _human_join used to not be tested, while the new test__human_join considers every branch to be taken.

Maurice

test_escape_markdown

commit

The coverage improvement is +100%. The coverage has been improved, because escape_markdown used to not be tested, while the new test_escape_markdown considers every branch to be taken.

test_string_width

commit + commit

The coverage improvement is +100%. The coverage has been improved, because string_width used to not be tested, while the new string_width considers every branch to be taken.

Yasin

test_get_find

commit

The coverage improvement is 88%. The coverage has been improved, because the previous test_get_find only considered the sync and asyn get with single values. I extended the test so that it tests these functions with multiple attributes as well, this way it currently reaches more branches and therefore the coverage improved. Additionally the previous test did not consider the case where we loop through the array and we don't find the corresponding item we are looking for, we added this case by giving an empty array as argument, which causes the code to not enter the for loop and thus reach more branches.

test_json_or_text

commit

The coverage improvement is 71%. The coverage has been improved, because the previously there was no test for json_or_text. I now added a test that considers two cases: one where the data is a json and one where the data is plain text. This way we reach two additional branches and thus the coverage improves.

Frank

test_from_str_failures

commit

The coverage of the function has improved from the original 78% to 100%, since the other two branches (1 and 3) were also covered.

test_from_str_failures

commit

The coverage improved from 85% to 100%. Since the tests resulted in each of the if statements to trigger, each of the two missing branches were also covered.

Overall

The total coverage before adding our own tests

The total coverage after adding our own tests

Statement of individual contributions

Thijmen

Maurice

Yasin

Frank