Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Adrika Novrialdi's avatar
Adrika Novrialdi authored
Release Practice 7

See merge request adrika-novrialdi/advprog-practicals!6
9ca5f89e
History

Practice Problem Sets

CSCM602023 Advanced Programming @ Faculty of Computer Science Universitas Indonesia, Term 2 2020/2021

Table of Contents

  1. Practice 1: Unit Testing and Input Space Partitioning
  2. Practice 2: Refactoring and Clean Code
  3. Practice 3: Concurrency
  4. Practice 4: Profiling
  5. Practice 5: Asynchronous Programming
  6. Practice 6: 12 Factors App
  7. Practice 7: Docker Container and Orchestration

TL;DR

Initial setup:

  1. 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.

  2. 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.

  3. 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.

  4. 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
  5. Go to the directory where the cloned repository is located in your local machine.

  6. 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

  7. Pull initial problem sets from upstream to your local's master: git pull upstream master

  8. 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 in git pull invocation

If there are updates from the upstream:

  1. git pull upstream master
  2. Fix any merge conflict(s) that might arise (hopefully none)
    • Always prefer the latest commit(s) from upstream when fixing merge conflict(s)
  3. 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:

  1. Pull any updates from upstream
  2. cd practice-n where n is week number folder ID. E.g. practice-2
  3. git checkout -b practice-n master
  4. Do the exercises as instructed in the corresponding README.md file.
  5. Commit your work frequently.
  6. Write good commit message(s).
  7. If your work is ready for grading: git push -u origin practice-n
  8. Make Merge Request (MR) to merge your work branch to master branch at your own project repository (i.e., the online Git repository where origin 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

  1. Suppose that you want to work on week 1 problem set. Go to the directory that containing week 1 problem, i.e. practice-1.
  2. 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 in master branch.
  3. Read the README file in practice-1 directory. It contains set of mandatory and optional tasks that you can work on.
  4. Do the practice.
  5. Use git add or git rm to stage/unstage files that you want to save into Git later.
  6. 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.
  7. Repeat steps 4 - 6 until you finished the practice.
  8. 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
  9. 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.