Practice Problem Sets
CSCM602023 Advanced Programming @ Faculty of Computer Science Universitas Indonesia, Term 2 2020/2021
Table of Contents
- Practice 1: Unit Testing and Input Space Partitioning
- Practice 2: Refactoring and Clean Code
- Practice 3: Concurrency
- Practice 4: Profiling
- Practice 5: Asynchronous Programming
- Practice 6: 12 Factors App
- Practice 7: Docker Container and Orchestration
TL;DR
Initial setup:
-
Open the GitLab subgroup at GitLab CS named after your student ID (NPM). For example, if your student ID is
1906000001
, then the URL to your own GitLab subgroup is:https://gitlab.cs.ui.ac.id/AdvProg/KKI-2021/1906000001
. The subgroup will be used to store your individual works in this course for the whole semester. To access the GitLab subgroup, make sure you have registered at GitLab CS and informed your username to the teaching team. -
Create a new project repository to store your practical works in your own GitLab subgroup at Advanced Programming KKI 2021 GitLab group. Give your project a descriptive name such as "AdvProg Practice 2021" or "Advanced Programming Practicals 2021". The project repository will be used to store all practical exercises starting from
practice-1
next week. -
Open the project repository page and copy the clone URL into the clipboard. You may use the HTTPS (simpler; not recommended if using 2FA) or SSH (more secure; recommended) clone URL.
-
Clone the repository into your local machine. For example, if you are using HTTPS clone URL, then the Git command would be (assuming your project name is
advprog-practice-2021
):git clone https://gitlab.cs.ui.ac.id/AdvProg/KKI-2021/<Your NPM subgroup>/advprog-practice-2021.git
Similarly, if you are using SSH clone url:
git clone git@gitlab.cs.ui.ac.id:AdvProg/KKI-2021/<Your NPM subgroup>/advprog-practice-2021.git
-
Go to the directory where the cloned repository is located in your local machine.
-
Add new remote called upstream that points to this (problem set) repository. Use Git command:
git remote add upstream https://gitlab.cs.ui.ac.id/AdvProg/KKI-2021/practical.git
-
Pull initial problem sets from
upstream
to your local'smaster
:git pull upstream master
-
Push initial commits in your local's
master
to your online GitLab repository:git push -u origin master
Note: If your Git produced an error about 'unrelated histories', try adding
--allow-unrelated-histories
option ingit pull
invocation
If there are updates from the upstream:
git pull upstream master
- Fix any merge conflict(s) that might arise (hopefully none)
- Always prefer the latest commit(s) from upstream when fixing merge conflict(s)
- Do not forget to commit your merged master branch and push it
to your own master branch at your GitLab project's repository
- Use Git command: git push origin master.
Working on a practice problem set:
- Pull any updates from
upstream
-
cd practice-n
where n is week number folder ID. E.g. practice-2 git checkout -b practice-n master
- Do the exercises as instructed in the corresponding
README.md
file. - Commit your work frequently.
- Write good commit message(s).
- If your work is ready for grading:
git push -u origin practice-n
- Make Merge Request (MR) to merge your work branch to
master
branch at your own project repository (i.e., the online Git repository whereorigin
remote is located) and assign your TA as the assignee.
If you want to know the detailed explanation about each instruction above, please read the following sections.
Doing the Practice
- Suppose that you want to work on week 1 problem set. Go to the
directory that containing week 1 problem, i.e.
practice-1
. - To ensure your work regarding week 1 problem is isolated from
your other attempts at other problems, create a new branch
specifically for working on week 1 problem. Use Git command:
git checkout -b practice-1 master
- Explanation: Create a new branch named
practice-1
based on latest commit inmaster
branch.
- Explanation: Create a new branch named
- Read the README file in
practice-1
directory. It contains set of mandatory and optional tasks that you can work on. - Do the practice.
- Use
git add
orgit rm
to stage/unstage files that you want to save into Git later. - Once you want to save your progress, commit your work to Git. Use
Git command:
git commit
A text editor will apear where you should write a commit message. Please try to follow the guidelines written in this guide on how to write a good commit message. - Repeat steps 4 - 6 until you finished the practice.
- Once you are ready to submit your work or you want to save it to
your repository on GitLab, do a Git push. The Git command:
git push -u origin practice-1
- If you are ready to be graded by TA, make a Merge Request (MR) via
Merge Request menu on GitLab. Set your practice branch as source and
master
as the target branch for merging. After that, assign your TA as the assignee of the MR.
Pulling Updates From Upstream
If there are any updates from upstream, you can get the latest commits
and integrate it into your fork by using the following Git command:
git pull upstream master
Merge conflicts may arise since the repository is updated weekly and
may have overlapping changes with the master
branch in your own
forked repository. If merge conflict happens, please always use latest
commit from upstream
. Your works are safe as long you put in in its
own separate branches, e.g. practice-1
, practice-2
, and so forth.
Once you have resolved any merge conflicts and all commits from
upstream are merged succesfully to your own master
branch, do not
forget to push it back to your own GitLab repository. Use Git command:
git push origin master
All students required to demonstrate their work to teaching assistant by
using code review. Code review shall be conducted by using Merge
Request on GitLab and offline discussion. Offline discussions only take place during the practice session.
Students are expected to follow-up questions and feedback given by TA.
TA will give grade based on student's participation during code review and
offline discussion. practice work that achieved grade A - C will be accepted
by TA and merged into student's master
branch.
Warning: students are not allowed to merge their own practice branches to master without TA's supervision and approval. Only members of teaching team (TAs & lecturers) that allowed to approve/reject a MR made by student.
License
Copyright (c) 2021, Faculty of Computer Science Universitas Indonesia
Permission to copy, modify, and share the works in this project are governed under two licenses: BSD 3-Clause and Creative Commons Attribution-ShareAlike 4.0 (CC BY-SA 4.0) Unless noted otherwise, BSD 3-Clause applies to the source code artifact (e.g. Java, configuration files), while CC BY-SA 4.0 applies to text documents in this project.