swsnu / swppfall2021

Learning Software Engineering By Building Web Services
28 stars 19 forks source link

Question about contradiction in spec and FAQs of HW4 #109

Open ddony8128 opened 3 years ago

ddony8128 commented 3 years ago

Please check Q1 and Q6 of HW4 Readme.md FAQs. There are apparently noted about priority of the error status code and handling 400 bad request above, but the content of Q1 and Q6 seems to explain the opposite. Isn't it a sort of contradiction?

ttoru96 commented 3 years ago

No, they are not contradictory.

Specs and guidelines are desiderata for a well-implemented RESTful API server with Django, but Q1 ~ Q6 are references specifically for how we test your work. Thus, their goals may differ.

We have designed HW4 in such a way that you get to consider many different aspects (eg. 400 bad request, priority between status codes etc) during implementation, as if you are building a RESTful API server in a real-world setting. Such practice will help you greatly when designing your own service for the team project and also in the future when you work in the field. However, grading students' works is another, and we designed test cases very clear and simple in order to minimize students' confusion. Thus, it is true that we may not test every single item that we've asked you to implement, and if you somehow implemented less and still managed to pass all the test cases, then it will go unnoticed by us.

Followings are detailed clarification for Q6 and Q1.

Regarding Q6 We recommend you to handle 400 for the better code quality of your Django project, but we do not test 400 in order to clarify and simplify what students should implement (often times there are multiple causes for 400). Thus, we did not put 400 under specific usecase unlike other status codes but only included it in the list of response codes you should use, and also reconfirmed at FAQ that you may assume frontend always sends well-formatted data.

Regarding Q1 The context behind this Question-Answer pair is missing so that's what might have caused you confused. Please refer to https://github.com/swsnu/swppfall2019/issues/171#issuecomment-546329647 if you are interested. To rephrase the requirement for priority between status codes, you should consider priority between error status code and it is in the order of 405 > 401 > 404 > 403, as stated in spec. However, we do not test cases that are combinations of 400 + (405, 401, 404, 403). For example, we do not test cases in which the user sent un-decodable payload with not allowed HTTP request.

ddony8128 commented 3 years ago

Thank you!