Milestone 2: Personal Contribution Page (Ali Nasra) - bounswe/bounswe2023group4 GitHub Wiki
Personal Info:
- Name: Ali Nasra
- Group: B2
Issue and wiki links:
Contribution | Related Issue(s) & Wiki Page(s) |
---|---|
Scrutinized Poll API's documentation for API implementation | #72 |
Prepared a Swagger tutorial | #96, Tutorial Page |
Third Party URIs:
Poll API was used for the purpose of initializing the polls.
- Name: Create poll
- Route: https://api.pollsapi.com/v1/create/poll
- Description: Creates a poll given a question and at most 4 multiple options.
- Name: Get all polls
- Route: https://api.pollsapi.com/v1/get/polls?offset={offset}&limit={limit}
- Description: Allows the user to view their poll feed with a limit of almost 150.
API functions:
createPoll:
- Name: createPoll
- Route: localhost:8000/api/polls_createPoll/
- Description: Enables the user to create a new poll instance on Poll API.
viewPoll:
- Name: viewPoll
- Route: localhost:8000/api/polls_viewPoll/
- Description: Enables the user to view all the polls that were initialized until this moment.
Unit tests:
- Test 1:
We check for the correct creation of polls upon each respective creation call. To verify the result, we compute the number of created polls by that time. We have created 2 poll objects, hence the result must be 2.
- Test 2:
We check if we can fetch certain polls with a specific parameter. Here, our question is about the elections. In that case, we use the question attribute of the poll to check for the correctness of the response.
- Test 3:
We demonstrate that we can create a new poll with different attributes. We verify the result by computing the number of created polls by that time. We have created 2 poll objects earlier and one now, hence the result must be 3.
Sample calls:
createPoll:
- headers: {'content-type': 'application/json'}
- status code: 200
- JSON: {'question':'How are you doing?', 'firstOption':'Fine', 'secondOption':'Good', 'thirdOption':'Bad', 'fourthOption':'Ambivalent'}
viewPoll:
- headers: No header is passed while making the call.
- status code: 200
- JSON: No JSON is passed while making the call.
Significant Work related to this release:
- My most significant side contribution is investigating Swagger, preparing a didactic tutorial for the other team members, and incorporating relevant code into the API.
Challenges encountered:
- Lack of familiarity with Backend and frontend development.
- Tackling Django and the sheer amount of embedded functionalities to be assessed.
- Finding a proper and easy API that satisfies the project's requirements and serves as a gentle introduction to backend development.
- Difficulty in writing comprehensive test cases for the code using conventional methods.