Skip to content

restful api implementation

Iván Sánchez edited this page Jan 20, 2020 · 35 revisions

Important information for Deadline 4

‼️  This chapter should be completed by Deadline 4 (see course information at Lovelace)


📑  Chapter summary In this section you must implement the RESTful API designed in the previous section. The minimum requirements are summarized in the Minimum Requirements section of the Project Work Assignment. If you do not meet the minimum requirements this section WILL NOT be evaluated.

CHAPTER GOALS

  • Implement a RESTful API
  • Write tests for the API


✔️     Chapter evaluation (max 18 points) You can get a maximum of 18 points after completing this section. More detailed evaluation is provided after each heading.

RESTful API implementation

List of implemented resources


📑  Content that must be included in the section A list of all implemented resources. Consider that not all resources that you have designed must be implemented.  The minimum requirements are summarized in the Minimum requirements section from the Project work assignment. You can use a table similar to the one you used to explain the uniform interface. Do not forget to include in the README.md file which is the path to access to your application remotely.


✔️     Evaluation criteria(max 0.5 points) In this section you can get a maximum of 0.5 points.
  • The table clearly shows which resources are implemented, and what requests they support: 1.0

✏️ Write here your text

Resources implementation

💻     TODO: SOFTWARE TO DELIVER IN THIS SECTION The code repository must contain:
  1. The source code for the RESTful API 
  2. The external libraries that you have used
  3. We recommend to include a set of scripts to setup and run your server
  4. A database file or the necessary files and scripts to automatically populate your database.
  5. A README.md file containing:
    • Dependencies (external libraries)
    • How to setup the framework.
    • How to populate and setup the database.
    • How to setup (e.g. modifying any configuration files) and run your RESTful API.
    • The URL to access your API (usually nameofapplication/api/version/)=> the path to your application.
NOTE: Your code MUST be clearly documented. For each public method/function you must provide: a short description of the method, input parameters, output parameters, exceptions (when the application can fail and how to handle such fail). Check Exercise 3 for examples on how to document the code.  In addition should be clear which is the code you have implemented yourself and which is the code that you have borrowed from other sources


✔️     Evaluation criteria(max 5.5 points) In this section you can get a maximum of 5.5 points:
  • Instructions to set up the API and run the tests are provided in the README.md file: 1.0
    • this means there should be no undocumented extra steps in running the code/tests!
  • The code has clear structure and naming for variables and methods: 1.0
  • You have clearly marked which parts of the code are your own work and which have been borrowed: 0.5
  • Each method's functionality is described in its documentation: 1.0
  • Documentation for auxiliar functions(if any) have correct input / output description: 0.5
  • Implementation matches the design of the previous section: 1.5 (0.75 if there are minor mismatch (e.g. missing parameters, wrong header...), 0 if several calls differ)

✏️ You do not need to write anything in this section, just complete the implementation.

RESTful API testing

💻     TODO: SOFTWARE TO DELIVER IN THIS SECTION The code repository must contain:
  1. The code to test your RESTful API (Functional test)
    • The code of the test MUST be commented indicating what you are going to test in each test case.
    • The test must include values that force error messages
  2. The external libraries that you have used
  3. We recommend to include a set of scripts to execute your tests.
  4. A database file or the necessary files and scripts to automatically populate your database.
  5. A README.md file containing:
    • Dependencies (external libraries)
    • Instructions on how to run the different tests for your application.
Do not forget to include in the README.md the instructions on how to run your tests. Discuss briefly which were the main errors that you detected thanks to the functional testing.

Remember that you MUST implement a functional testing suite. A detailed description of the input / output in the a REST client plugin.

As with the database tests, in this section it is your responsibility that your API handles requests correctly. All of the example requests in your API documentation should work, and your API must give the responses from your documentation. You also need to show that invalid requests are properly handled, and that the responses match those in the documentation.



✔️     Evaluation criteria(max 12 points) In this section you can get a maximum of 12 points:
  • Test cases run correctly: 1.0
  • Test coverage >=96%: 3.0(2.0 if coverage between 91% and 95%, 1.0 if coverage between 85% and 90%,0 otherwise)
  • Test cases cover all predictable error scenarios (various invalid requests) for all methods:3.0
  • Test output clearly describes the testing process for each case: 1.0
  • The interface works as intended (i.e. we don't find any errors. ) Errors will diminish this grade: 4.0
  • NOTE: In group with 4 people we will be more strict when assigning grades in this section.

✏️ You do not need to write anything in this section, just complete the implementation.

Resources allocation

Task Student Estimated time
=======

Important information for Deadline 4

‼️  This chapter should be completed by Deadline 4 (see course information at Lovelace)


📑  Chapter summary In this section you must implement the RESTful API designed in the previous section. The minimum requirements are summarized in the Minimum Requirements section of the Project Work Assignment. If you do not meet the minimum requirements this section WILL NOT be evaluated.

CHAPTER GOALS

  • Implement a RESTful API
  • Write tests for the API


✔️     Chapter evaluation (max 19 points) You can get a maximum of 19 points after completing this section. More detailed evaluation is provided after each heading.

RESTful API implementation

List of implemented resources


📑  Content that must be included in the section A list of all implemented resources. Consider that not all resources that you have designed must be implemented.  The minimum requirements are summarized in the Minimum requirements section from the Project work assignment. You can use a table similar to the one you used to explain the uniform interface. Do not forget to include in the README.md file which is the path to access to your application remotely.


✔️     Evaluation criteria(max 0.5 points) In this section you can get a maximum of 0.5 points.
  • The table clearly shows which resources are implemented, and what requests they support: 0.5

✏️ Write here your text

Resources implementation

💻     TODO: SOFTWARE TO DELIVER IN THIS SECTION The code repository must contain:
  1. The source code for the RESTful API 
  2. The external libraries that you have used
  3. We recommend to include a set of scripts to setup and run your server
  4. A database file or the necessary files and scripts to automatically populate your database.
  5. A README.md file containing:
    • Dependencies (external libraries)
    • How to setup the framework.
    • How to populate and setup the database.
    • How to setup (e.g. modifying any configuration files) and run your RESTful API.
    • The URL to access your API (usually nameofapplication/api/version/)=> the path to your application.
NOTE: Your code MUST be clearly documented. For each public method/function you must provide: a short description of the method, input parameters, output parameters, exceptions (when the application can fail and how to handle such fail). Check Exercise 2 and 3 for examples on how to document the code.  In addition should be clear which is the code you have implemented yourself and which is the code that you have borrowed from other sources


✔️     Evaluation criteria(max 4.5 points) In this section you can get a maximum of 4.5 points:
  • Instructions to set up the API and run the tests are provided in the README.md file: 1.0
    • this means there should be no undocumented extra steps in running the code/tests!
  • The code has clear structure and naming for variables and methods: 1.0
  • You have clearly marked which parts of the code are your own work and which have been borrowed: 0.5
  • Each method's functionality is described in its documentation: 1.0
  • Parameters read from the request are described: 0.5
  • Responses are briefly described (refer to your API documentation): 0.5

✏️ You do not need to write anything in this section, just complete the implementation.

RESTful API testing

💻     TODO: SOFTWARE TO DELIVER IN THIS SECTION The code repository must contain:
  1. The code to test your RESTful API (Functional test)
    • The code of the test MUST be commented indicating what you are going to test in each test case.
    • The test must include values that force error messages
  2. The external libraries that you have used
  3. We recommend to include a set of scripts to execute your tests.
  4. A database file or the necessary files and scripts to automatically populate your database.
  5. A README.md file containing:
    • Dependencies (external libraries)
    • Instructions on how to run the different tests for your application.
Do not forget to include in the README.md the instructions on how to run your tests. Discuss briefly which were the main errors that you detected thanks to the functional testing.

Remember that you MUST implement a functional testing suite. A detailed description of the input / output in the a REST client plugin.

As with the database tests, in this section it is your responsibility that your API handles requests correctly. All of the example requests in your API documentation should work, and your API must give the responses from your documentation. You also need to show that invalid requests are properly handled, and that the responses match those in the documentation.



✔️     Evaluation criteria(max 14 points) In this section you can get a maximum of 14 points:
  • Test cases run correctly: 1.5
  • Each method is tested with correct requests: 2.0
  • Test cases cover all predictable error scenarios (various invalid requests) for all methods:4.0
  • Test output clearly describes the testing process for each case: 1.0
  • The interface works as intended (i.e. we don't find any errors. ) Errors will diminish this grade: 5.5
  • NOTE: In group with 4 people we will be more strict when assigning grades in this section.

✏️ You do not need to write anything in this section, just complete the implementation.

Resources allocation

Task Student Estimated time