This site is from a past semester! The current version will be here when the new semester starts.
CS2113/T 2021 Jan-May
  • Full Timeline
  • Week 1 [Mon, Jan 11th]
  • Week 2 [Mon, Jun 21st]
  • Week 3 [Mon, Jun 28th]
  • Week 4 [Mon, Jul 5th]
  • Week 5 [Mon, Jul 12th]
  • Week 6 [Mon, Jul 19th]
  • Week 7 [Mon, Jul 26th]
  • Week 8 [Mon, Aug 9th]
  • Week 9 [Mon, Aug 16th]
  • Week 10 [Mon, Aug 23rd]
  • Week 11 [Mon, Aug 30th]
  • Week 12 [Mon, Sep 6th]
  • Week 13 [Mon, Sep 13th]
  • Textbook
  • Admin Info
  • Dashboards
  •  Individual Project (iP):
  • Individual Project Info
  • iP Upstream Repo
  • iP Code Dashboard
  • iP Progress Dashboard

  •  Team Project (tP):
  • Team Project Info
  • Reference AB3
  • Team List
  • tP Code Dashboard
  • tP Progress Dashboard
  • Java exercises
  • Report Bugs
  • Forum
  • Gitter (Chat)
  • Instructors
  • Announcements
  • Files (handouts, submissions etc.)
  • Tutorial Schedule
  • Java Coding Standard
  • Git Conventions
  • Forum Activities Dashboard
  • Participation Dashboard
  • Week 6 [Mon, Jul 19th] - Tutorial

    1 Demo debugging in an IDE

    Suggested pre-tutorial preparations:

    • Clone the https://github.com/nus-cs2113-AY2021S2/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.