Adding the documentation and screenshots

This commit is contained in:
Jannes van den Bogert 2024-06-26 23:12:11 +02:00
parent d50118bfcb
commit b47cf62fc1
8 changed files with 65 additions and 32 deletions

View file

@ -1,45 +1,78 @@
# Flask # Report for Assignment 1
Flask is a lightweight [WSGI][] web application framework. It is designed ## Project chosen
to make getting started quick and easy, with the ability to scale up to
complex applications. It began as a simple wrapper around [Werkzeug][]
and [Jinja][], and has become one of the most popular Python web
application frameworks.
Flask offers suggestions, but doesn't enforce any dependencies or Name: Flask
project layout. It is up to the developer to choose the tools and
libraries they want to use. There are many extensions provided by the
community that make adding new functionality easy.
[WSGI]: https://wsgi.readthedocs.io/ URL: https://github.com/pallets/flask
[Werkzeug]: https://werkzeug.palletsprojects.com/
[Jinja]: https://jinja.palletsprojects.com/ Number of lines of code and the tool used to count it: 782430 counted using Lizard
Programming language: Python
## Coverage measurement
### Existing tool
The existing tool used for measuring coverage is coverage.py. It was executed using the following command:
```coverage run -m pytest```
![Coverage results with the Coverage.py tool](./images/Coverage.png)
### Your own coverage tool
Group member name: Jannes van den Bogert
Function 1 name: 'get_send_file_max_age'
Commit made: [get_send_file_max_age](https://github.com/pallets/flask/commit/3c984992b97935e17d8f2d42c84128b397cd0e7e)
![JSON Dumb file for the results](./images/JsonDumpDisGet.png)
![The coverage before writing a test](./images/Old_Get_Send_File_Max.png)
## A Simple Example Function 2 name: dispatch_request
```python Commit made: [Commit for dispatch_request](https://github.com/pallets/flask/commit/3c984992b97935e17d8f2d42c84128b397cd0e7e)
# save this as app.py
from flask import Flask
app = Flask(__name__) ![JSON Dumb file for the results](./images/JsonDumpDisGet.png)
![The coverage before writing a test](./images/Old_Dispatch.png)
@app.route("/") ## Coverage improvement
def hello():
return "Hello, World!"
```
``` ### Individual tests
$ flask run
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
```
Group member name: Jannes van den Bogert
## Donate Test 1 name: test_get_send_file_max_age
The Pallets organization develops and supports Flask and the libraries <Show a patch (diff) or a link to a commit made in your forked repository that shows the new/enhanced test>
it uses. In order to grow the community of contributors and users, and
allow the maintainers to devote more time to the projects, [please
donate today][].
[please donate today]: https://palletsprojects.com/donate ![The coverage before writing a test](./images/Old_Get_Send_File_Max.png)
![The coverage after writing a test](./images/New_Get_Send_File_Max.png)
The coverage improved by 54%, from 46% to 100%.
Test 2 name: test_dispatch_request
<Show a patch (diff) or a link to a commit made in your forked repository that shows the new/enhanced test>
![The coverage before writing a test](./images/Old_Dispatch.png)
![The coverage after writing a test](./images/New_Dispatch.png)
The coverage improved by 58%, from 42% to 100%.
### Overall
![The overall coverage before writing any tests](./images/Coverage.png)
![The overall coverage before writing any tests](./images/New_Total_Coverage.png)
## Statement of individual contributions
<Write what each group member did>
Jannes van den Bogert:

BIN
images/Coverage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 KiB

BIN
images/JsonDumpDisGet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

BIN
images/New_Dispatch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

BIN
images/Old_Dispatch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB