Coventry University Logo
4061CEM - Programming and Algorithms 1
  • Documentation and Commenting
    0
  • Task 1
    0
  • Task 2
    0

Documentation and Commenting

Before you attempt this activity, it is best that you review lecture video one from week ten. You can find the video and slides on the module page. . For this activity you will be using the integrated development environment recommended by the module leader. If you need to set up your development environment, it is recommended that you check out the instructions from activity four of week one.

Are You Struggling?

If you have trouble with any of the tasks or want to check your answers are correct, then please make yourself known to a member of staff.

Task 1

From the tasks in week seven, where you had to create a class Student, provide some documentation and comments explaining the body of your. To ensure this task is completed correctly, you need to meet the following conditions:

  • Use type hinting to highlight input and return types
  • Make use of the function docstrings so when the help function is called, appropriate information is returned about the function
  • Use class docstrings to provide a brief description of the class functions, variables and any side effects

Handy Tip

This list is not exhaustive. It is expected that you will use all methods of documenting and commenting to ensure the code is understood by someone who has not read a single piece of code before.

Task 2

From the tasks in week nine, provide documentation to explain the test cases you have designed and the purpose behind them. You may want to consider the thought process you followed to construct these unit tests, and reasons behind the assert functions you chose.