This site is from a past semester! The current version will be here when the new semester starts.
CS2113/T 2020 Aug-Dec
  • Full Timeline
  • Week 1 [Mon, Aug 10th]
  • Week 2 [Fri, Aug 14th]
  • Week 3 [Fri, Aug 21st]
  • Week 4 [Fri, Aug 28th]
  • Week 5 [Fri, Sep 4th]
  • Week 6 [Fri, Sep 11th]
  • Week 7 [Fri, Sep 18th]
  • Week 8 [Fri, Oct 2nd]
  • Week 9 [Fri, Oct 9th]
  • Week 10 [Fri, Oct 16th]
  • Week 11 [Fri, Oct 23rd]
  • Week 12 [Fri, Oct 30th]
  • Week 13 [Fri, Nov 6th]
  • Textbook
  • Admin Info
  • Report Bugs
  • Forum
  • Gitter (Chat)
  • Instructors
  • Announcements
  • Files
  • Tutorial Schedule
  • repl.it link
  • repl.it link (duplicated)
  • Java Coding Standard
  • Git Conventions
  • Forum Activities Dashboard
  • Participation Dashboard

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

  •  Team Project (tP):
  • Reference AB3
  • Team Project Info
  • Team List
  • tP Code Dashboard
  • tP Progress Dashboard
  • Week 6 [Fri, Sep 11th] - Tutorial

    1 Demo debugging in an IDE

    Suggested pre-tutorial preparations:

    • Clone the https://github.com/nus-cs2113-AY2021S1/personbook repo to your Computer (no need to fork first).
    • Set it up in your IDE.
    • Use the IDE debugging to step through the code to understand how the code works. For example, you can try to find answers to these questions:
      • How to add a new find command to locate persons by name?
      • What's the purpose of the variable PersonBook#lastShownList? Is it really needed?

    During the tutorial, demo your ability to do debugging using an IDE by performing the following tasks:

    1. Set a breakpoint in the following method of the Main class.
      /** Reads the user command and executes it, until the user issues the exit command.  */
      private void runCommandLoopUntilExitCommand() {
      Command command;
      do {
      String userCommandText = ui.getUserCommand();
      command = new Parser().parseCommand(userCommandText);
      CommandResult result = executeCommand(command);
      personBook.setLastShownList(result.getRelevantPersons());
      ui.showResultToUser(result);

      } while (!ExitCommand.isExit(command));
      }
    2. Use the debugger to step through the code while explaining how the code works. Start from the main method.
    3. Suppose the code behaves incorrectly when using the list command after adding two persons. Show how to set a conditional breakpoint so that execution pauses when the user types in the command list but doesn't pause for other commands.
      You need to set what is known as a conditional breakpoint.

    2 Demo iP using the jar file

    • Copy your iP jar file to an empty folder.
    • Launch the jar file using the command prompt and type a command.
    • Take a screenshot and paste in the tutorial workspace document.

    3 Receive feedback on the tP UG draft

    • The tutor will give feedback based on the UG draft that you uploaded to LumiNUS.
    • The feedback will be limited to the scope of v1.0 i.e., caution you if you seem to overambitious in you v1.0 plan.