Exercise 0: Installation and self-test#

The purpose of this exercise is to install the software toolbox, set up your python development environment, and allow you to create a handin using our evaluation system Unitgrade. It is strongly recommended you create (and upload) the handin to DTU Learn, as it will ensure you won’t have technical problems with the reports.

Complete the following steps:

Testing your code and handing in#

Solving and testing the exercises

This course will use a software tool called unitgrade for handing in project solutions. Unitgrade is build on top of pythons unittest framework, which is the industry-standard way of testing and verifying python code.

It is up to you if you want to use unittests to test and debug your code, or if you only want to use unitgrade to create a handin. This section will show both approaches using the fruit-homework as an example.

Solve problems and running unittests#

This is the recommended way to run the script. In VS Code, simply click on the testing flask (see the above video), and run the tests you wish to run. The tests will call your functions with different input and compare it to the expected output. Notice that you can always see how your functions are called, and therefore I recommend you use this approach when you are working on solving your problems.

Creating your hand-in token-file#

Creating your hand-in

To create your hand-in, you have to use the fruit_project_grade.py-file. This file contains the same tests as you ran using the previous methods but without any risk of accidentally changing the test script.

You can run the file the same way you would run any other file in python or by using the command

python -m irlc.project0.fruit_project_grade

Either way, you will notice the script produces a file called

irlc/project0/FruitReport_handin_70_of_70.token

The numbers are the points you obtained. You should hand in this file without modifications. The file contains a copy of the source code you have written. Note the points are only indicative of how well you did on the public tests.