This site is from a past semester! The current version will be here when the new semester starts.
CS2113/T 2020 Jan-Apr
  • Full Timeline
  • Week 1 [from Mon Jan 13]
  • Week 2 [from Wed Jan 15 noon]
  • Week 3 [from Wed Jan 22 noon]
  • Week 4 [from Wed Jan 29 noon]
  • Week 5 [from Wed Feb 5 noon]
  • Week 6 [from Wed Feb 12 noon]
  • Week 7 [from Wed Feb 19 noon]
  • Week 8 [from Wed Mar 4 noon]
  • Week 9 [from Wed Mar 11 noon]
  • Week 10 [from Wed Mar 18 noon]
  • Week 11 [from Wed Mar 25 noon]
  • Week 12 [from Wed Apr 1 noon]
  • Week 13 [from Wed Apr 8 noon]
  • Textbook
  • Admin Info
  • Report Bugs
  • Forum
  • Instructors
  • Announcements
  • File Submissions
  • Tutorial Schedule
  • repl.it link
  • Java Coding Standard
  • Forum Activities Dashboard
  • Participation Dashboard

  •  Individual Project (iP):
  • Individual Project Info
  • Duke Upstream Repo
  • iP Code Dashboard
  • iP Progress Dashboard

  •  Team Project (tP):
  • Team Project Info
  • Team List
  • tP Code Dashboard
  • tP Progress Dashboard
  • Week 7 [from Wed Feb 19 noon] - Project

    iP:

    1. Add Increment: A-MoreOOP
    2. Add Increments as PRs: Level-8, Level-9, A-JavaDoc
    3. Add a brief user guide
    4. Release the product by Monday (March 2) 1200

    tP:

    1. Set up the project repo during the tutorial
    2. Plan v1.0

    iP

    1 Add Increment: A-MoreOOP

    • As in the previous week, commit, tag, and push, as you do the following increments in the master branch (no need to use separate branches).
    A-MoreOOP: Use More OOP

    A-MoreOOP

         Make the code more OOP

    Refactor the code to extract out closely related code as classes.

    • Minimal: Extract the following classes:
      • Ui: deals with interactions with the user
      • Storage: deals with loading tasks from the file and saving tasks in the file
      • Parser: deals with making sense of the user command
      • TaskList: contains the task list e.g., it has operations to add/delete tasks in the list

    For example, the code of the main class could look like this:

    public class Duke {

    private Storage storage;
    private TaskList tasks;
    private Ui ui;

    public Duke(String filePath) {
    ui = new Ui();
    storage = new Storage(filePath);
    try {
    tasks = new TaskList(storage.load());
    } catch (DukeException e) {
    ui.showLoadingError();
    tasks = new TaskList();
    }
    }

    public void run() {
    //...
    }

    public static void main(String[] args) {
    new Duke("data/tasks.txt").run();
    }
    }
    • Stretch Goal: Consider extracting more classes. e.g., *Command classes (i.e., AddCommand, DeleteCommand, ExitCommand etc.) that inherits from an abstract Command class, so that you can write the main logic of the App as follows:
      public void run() {
      ui.showWelcome();
      boolean isExit = false;
      while (!isExit) {
      try {
      String fullCommand = ui.readCommand();
      ui.showLine(); // show the divider line ("_______")
      Command c = Parser.parse(fullCommand);
      c.execute(tasks, ui, storage);
      isExit = c.isExit();
      } catch (DukeException e) {
      ui.showError(e.getMessage());
      } finally {
      ui.showLine();
      }
      }
      }
      You can get some inspiration from how the code of the addressbook-level2 is organized.

    2 Add Increments as PRs: Level-8, Level-9, A-JavaDoc

    • Practice using parallel git branches and PRs, as explained below:
      1. First, do each increment as a parallel branch (i.e., branch-Level-8, branch-Level-9, branch-A-JavaDoc), but do not merge any.
      2. Then, push each branch to your fork, and create a PR within your fork (i.e., from the increment branch to the master branch).
      3. Now, let's merge one of the PRs and update the remaining PRs accordingly, as given below:
        1. Merge one of the PRs on GitHub e.g., Level-8. Remember to choose the Create merge commit option when merging.
        2. Pull the updated master branch from your fork to your Computer.
        3. Note how the remaining un-merged branches are no longer in sync with the latest master. To rectify, merge the master branch to each of them. Resolve merge conflicts, if any.
        4. Push the updated branches to your fork. The PRs will update automatically to reflect the updated branch.
        5. As before, tag the merge commit in the master branch and push the tag to your fork.
      4. Merge the remaining PRs using a procedure similar to the above.
    Level-8: Dates and Times optional

    Level 8. Dates and Times

    Teach Duke to understand dates and times. For example, if the command is deadline return book /by 2/12/2019 1800, Duke understands 2/12/2019 1800 as 2nd of December 2019, 6pm, instead of storing it simply as a String.

    • Minimal: Store deadline dates as a java.time.LocalDate in your task objects. Accept dates in a format such as yyyy-mm-dd format (e.g., 2019-10-15) and print in a different format such as MMM dd yyyy e.g., (Oct 15 2019).
    • Stretch goal: Use dates and times in more meaningful ways. e.g., add a command to print deadlines/events occurring on a specific date.

    A code snippet using the LocalDate class:

    import java.time.LocalDate;
    import java.time.format.DateTimeFormatter;
    import java.time.temporal.ChronoUnit;

    public class Main {
    public static void main(String[] args) {
    //create dates from strings
    LocalDate d1 = LocalDate.parse("2019-12-01");
    LocalDate d2 = LocalDate.parse("2019-12-02");
    LocalDate d3 = LocalDate.parse("2019-12-02");

    //compare dates
    System.out.println(d1.isBefore(d2)); // -> true
    System.out.println(d1.isAfter(d2)); // -> false
    System.out.println(d2.equals(d3)); // -> true

    //work with dates
    System.out.println(d1.getDayOfWeek()); // -> SUNDAY
    System.out.println(d1.getMonth()); // -> DECEMBER
    System.out.println(d1.plus(1, ChronoUnit.YEARS)); // -> 2020-12-01

    // get today's date and print it in a specific format
    LocalDate d4 = LocalDate.now();
    System.out.println(d4); // -> 2019-10-15
    System.out.println(d4.format(DateTimeFormatter.ofPattern("MMM d yyyy"))); // -> Oct 15 2019
    }
    }
    Level-9: Find

    Level 9. Find

    Give users a way to find a task by searching for a keyword.

    Example:

    find book
    ____________________________________________________________
    Here are the matching tasks in your list:
    1.[T][✓] read book
    2.[D][✓] return book (by: June 6th)
    ____________________________________________________________
    A-JavaDoc: JavaDoc

    A-JavaDoc

         Add JavaDoc comments

    Add JavaDoc comments to the code.

    • Minimal: Add header comments to at least half of the non-private classes/methods.
    • Stretch goal: Add header comments to all non-private classes/methods, and non-trivial private methods.

    3 Add a brief user guide

    A-UserGuide: User Guide

    A-UserGuide

         Add a User Guide

    Add a User Guide to the project. Here is one simple way to do it.

    • Update the given docs\README.md. See this guide to GitHub flavored Markdown (GFMD).
    • Go to the settings page of your Duke fork and enable GitHub pages to publish from the docs folder (you can select a theme too).
    • Go to http://{your username}.github.io/duke/ to view the user guide of your product. Note: it could take 5-10 minutes for GitHub to update the page.

    4 Release the product by Monday (March 2) 1200

    • Create a new jar file. The jar file should be cross-platform and should work in a computer that has Java 11.
    • Do the following smoke tests to ensure the jar file works (reason: it will be used to grade your iP).
      1. Copy the jar file to an empty folder and test it from there. This should surface issues with hard-coded file paths.
      2. Pass the jar file to team members and ask them to do a test drive. Assuming some of your team members' OS differ from yours, this should verify if the app is cross-platform.
    • Create a new release on GitHub (e.g., v0.2) and upload the jar file.
    A-Release: Release

    A-Release

         Release the product

    Release the product to be used by potential users. e.g., you can make it available on GitHub



    tP: Plan v1.0

    1 Set up the project repo during the tutorial

    • Set up the team org and the team repo as explained below:

    Organization Setup

    Please follow the organization/repo name format precisely because we use scripts to download your code or else our scripts will not be able to detect your work.

    After receiving your team ID, one team member should do the following steps:

    • Create a GitHub organization with the following details:
      • Organization name (all UPPER CASE) : AY1920S2-TEAM_ID. e.g.  AY1920S2-CS2113T-W12-1, AY1920S2-CS2113-F09-3
      • Plan:  Open Source ($0/month)
      • This organization belongs to: My personal account
    • Add members to the organization:
      • Create a team called developers to your organization.
      • Add your team members to the developers team.

    Repo Setup

    The tP project template given to you is a variation of the Duke repo you used for the iP, but with some important differences. Please follow instructions carefully, rather than follow what you remember from the iP.

    Only one team member:

    1. Fork the tP project template nus-cs2113-AY1920S2/tP repo to your team org.
      This repo (let's call it the team repo) is to be used as the repo for your project.
      Please do not rename the fork Reason: it will make it difficult for our bots to find your fork if you rename it.
    2. Enable the issue tracker of the team repo Reason: our bots will be posting your weekly progress reports on the issue tracker of your team repo.
    3. Enable GitHub actions: Go to the Actions tab and enable workflows by clicking the button. That will enable the GitHub Actions that come with the project template.
    4. Enable GitHub Pages: Go to the Settings tab and enable GitHub Pages for the master branch /docs folder (similar to how you did it in the iP).
      Remember to choose a theme too by clicking the button (that will create a commit in your repo that is needed in a later step.
      After a few minutes, confirm your tP website is available in the corresponding github.io URL.
    5. Give access to team members: Ensure your team members have the desired level of access to your team repo.
    6. Create a team PR for us to track your project progress: i.e., create a PR from your team repo master branch to [nus-cs2113-AY1920S2/tP] master branch. PR name: [Team ID] Product Name e.g., [CS2113T-T09-2] Contact List Pro. As you merge code to your team repo's master branch, this PR will auto-update to reflect how much your team's product has progressed. In the PR description use @githubUserName@mention the other team members so that they get notified when the tutor adds comments to the PR.

    All team members:

    1. Watch the tP repo (created above) i.e., go to the repo and click on the button to subscribe to activities of the repo
    2. Fork the tP repo to your personal GitHub account.
      Please do not rename the fork Reason: it will make it difficult for our bots to find your fork if you rename it.
    3. Clone the fork to your computer.
    4. Set up the developer environment in your computer.
      Recommended: Set it up as an Intellij project (follow the instructions in the README carefully as the steps are different from the iP).

    Note that some of our bot scripts depend on the following folder paths. Please do not alter those paths in your project.

    • /src/main/java
    • /src/test/java
    • /docs

    2 Plan v1.0

    • Decide which part of v1.0 each member will implement. Break those into smaller tasks (i.e., small enough for one person to complete within a week).

    • Reflect the above plan in the issue tracker by creating issues to represent those tasks and assigning the corresponding issues (create new issues if necessary) to yourself and to the corresponding milestone.