|
| 1 | +# CS0 Lab - OOP and Unittesting with Unittest Library |
| 2 | + |
| 3 | +Possible Points: 100 |
| 4 | + |
| 5 | +Write a Python program to solve the Kattis problem - Bijele - [https://open.kattis.com/problems/bijele](https://open.kattis.com/problems/bijele) . Read the problem statement carefully to design a correct solution using OOP and unittest. |
| 6 | + |
| 7 | +## Install and Use Kattis-cli |
| 8 | + |
| 9 | +- if you've installed kattis-cli before, update it to the latest version |
| 10 | + |
| 11 | +```bash |
| 12 | +$ pip install -U kattis-cli |
| 13 | +$ python -m pip install -U kattis-cli |
| 14 | +``` |
| 15 | + |
| 16 | +- if you've not installed kattis-cli before, install it |
| 17 | + |
| 18 | +```bash |
| 19 | + $ pip install kattis-cli |
| 20 | + $ python -m pip install kattis-cli |
| 21 | +``` |
| 22 | + |
| 23 | +## Setup Kattis-cli |
| 24 | + |
| 25 | +- setup kattis-cli by providing logging in to Kattis using your Kattis username and password |
| 26 | + |
| 27 | +```bash |
| 28 | +kattis setup |
| 29 | +``` |
| 30 | + |
| 31 | +## Lab Instructions |
| 32 | + |
| 33 | +- Open your CS0Lab-... repo in VS Code |
| 34 | +- Create lab folder **unittest** inside your CS0Lab-... repository |
| 35 | +- Inside the lab folder, download the problem metadata and sample files for the problem **bijele** using Kattis-clis |
| 36 | +- Use previous lab **OOP and Unittesting** to complete this lab |
| 37 | +- Must Use **unittest** library to write unit tests for the class methods |
| 38 | +- Write at least two test methods for each class method you're testing |
| 39 | + |
| 40 | +```bash |
| 41 | +kattis get bijele |
| 42 | +``` |
| 43 | + |
| 44 | +- Inside **bijele** folder, type the partial code stub provided and fix all FIXMEs. (80 points) |
| 45 | +- Follow best programming practices by using proper white spaces, comments, etc. |
| 46 | +` |
| 47 | +- Run unit test using pytest and create screenshot when all the test cases pass. Install pytest if required. Pick one of the following ways to run pytest. |
| 48 | + |
| 49 | +```bash |
| 50 | + $ pytest --version |
| 51 | + $ pip install -U pytest |
| 52 | + $ pytest . |
| 53 | + $ python -m pytest . |
| 54 | +``` |
| 55 | + |
| 56 | + |
| 57 | +- Test the whole program using Katts-cli. (10 points) |
| 58 | + |
| 59 | +```bash |
| 60 | +$ cd bijele |
| 61 | +$ kattis test |
| 62 | +``` |
| 63 | + |
| 64 | +- Create the screenshot of the correct local test result. (10 points) |
| 65 | +- Submit the solution to Kattis using Kattis-cli. (10 points) |
| 66 | + |
| 67 | +```bash |
| 68 | +$ cd bijele |
| 69 | +$ kattis submit |
| 70 | +``` |
| 71 | + |
| 72 | +- Create screenshot of the kattis final Accepted verdict and save it to the lab folder. (10 points) |
| 73 | + |
| 74 | +- Update your README file (10 points) as shown here: [https://github.com/rambasnet/csci000-astudent](https://github.com/rambasnet/csci000-astudent) |
| 75 | + |
| 76 | +## Submission |
| 77 | + |
| 78 | +- Make sure to format the code using pep8 or black before submission. |
| 79 | +- Add all the relevant source file(s), documents, and screenshots into the correct lab folder and do a final add, commit, and push before the due date. |
| 80 | + |
| 81 | +```bash |
| 82 | +$ git pull |
| 83 | +$ git status |
| 84 | +$ git add <filename>… - add each file in the red that is part of this lab |
| 85 | +$ git status |
| 86 | +$ git commit -m "Final Submission" |
| 87 | +$ git push |
| 88 | +$ git status |
| 89 | +``` |
| 90 | + |
| 91 | +- Check and make sure the files are actually pushed to your GitHub repo on github.com. |
0 commit comments