Labi Trisha Angelica Vergara - Project Portfolio

PROJECT: SHOCO

Overview

SHOCO is a desktop application used for managing and planning of shopping lists and budgets. Users interact with it through the use of a command-line interface (CLI), the program is written in Java and has bout 5 kLoC.

Summary of Contributions

Contributions to the User Guide

Given below are sections that I have contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Table of Contents

Editing an item: EDIT

Edits the specified item in the shopping list.

Format: EDIT INDEX [i/DESCRIPTION] [p/PRICE] [q/QUANTITY]

Examples of usage:

  1. EDIT 3 i/potato p/5.00 q/3
    • Edits the description, price and quantity of the 3rd item in the shopping list
  2. EDIT 3 i/potato chips p/5.00 OR EDIT 3 i/potato chips q/2 OR EDIT 3 p/5.00 q/2
    • Edits the description and price / description and quantity / price and quantity of the 3rd item in the shopping list
  3. EDIT 3 i/potato chips OR EDIT 3 p/5.00 OR EDIT 3 q/2
    • Edits only description / only price / only quantity of the 3rd item in the shopping list

Viewing help: HELP

Shows the available commands, their purpose and how they are to be used.

Format: HELP

Command Summary


Contributions to the Developer Guide

Given below are sections that I have contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Table of Contents

3.2 Edit feature

3.2.1 Current implementation

The edit feature is implemented using an EditCommand class. This class extends from the main Command class. The Item object to be edited is identified by the index number provided in the user input. In addition to the index number, the user input must also contain at least one of these parameters: description, price, quantity.

The process is as follows:

  1. Duke class receives user input from the Ui class.
  2. A Parser object is created.
  3. Duke calls Parser#parseCommand() method to instantiate an EditCommand object based on the user input.
  4. Duke class calls the EditCommand#execute() method.
  5. In the EditCommand#execute() method, the Item object is retrieved through ShoppingList#getItem(). The original description / price / quantity of the item is overwritten with the new values from the user input through the use of the Item class setter methods.
  6. The Item object with its new values is stored back to the ShoppingList object.

The following sequence diagram below shows how the edit feature works. The details of updating the values of an item have been omitted from the diagram. Those details are shown in a separate sequence diagram.

Edit Feature

The separate sequence diagram below shows how an item is updated with new values.

Edit Feature SD

3.2.2 Design considerations
Aspect: Data structure to support the edit feature

Reason for choosing alternative 1: By allowing users to update any values they want, it provides them with greater convenience and freedom as they do not need to follow strict command “rules/order”. Furthermore, having greater freedom on input values makes it a hassle-free process for the users.

 

3.10 View help feature

3.10.1 Current implementation

The help feature is implemented using a HelpCommand class which extends the main Command class. The HelpCommand class shows the program usage instructions to the user.

The process is as follows:

  1. Duke receives user input from Ui.
  2. Duke calls Parser#parseCommand(). If the user input fails to match any of the correct command keywords (ADD, EDIT, DEL etc.), or if the input matches the HELP command keyword, a HelpCommand object will be instantiated.
  3. Duke calls HelpCommand#execute().
  4. HelpCommand#execute() lists all the accepted command format SHOCO recognizes, their purpose and 1 or more examples of usage.

The following sequence diagram below shows how the help feature works. Note, the Ui class is omitted in the sequence diagram to emphasise on the other classes:

Help Feature

3.10.2 Design considerations
Aspect: Data structure to support the help feature

Reason for choosing alternative 1: By abstracting out different command types as separate classes, we could work better in parallel and also be able to spot bugs more easily as each class deals with a different functionality

 

Appendix D: Instructions for Manual Testing

:information_source: Note: These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing.

Launch and Shutdown

  1. Initial launch

    i. Download the latest version of SHOCO, named CS2113T-T13-1.Shoco.jar under version 2.1.

    ii. Copy it into an empty folder on your desktop.

    iii. While inside the empty folder, open a command prompt window by typing CMD in the address bar of the folder.

    iv. Run the following command in the command prompt window: java -jar CS2113T-T13-1.Shoco.jar

    v. If the font size of the command window is too big, you can decrease it by CTRL + scroll down on your mouse.

     Expected: Shows a welcome message from SHOCO.
    

     

  2. Shutdown

    i. Enter the command BYE to exit the SHOCO application.

     Expected: The program is terminated.
    

     

Set and Reset a budget

  1. Set a budget

    i. Test case: SET b/500.00

    Expected: Budget is set to $500.00
    

     

    ii. Test case: SET b/10000

     Expected: Budget is set to $5000.00, which is the maximum budget SHOCO allows.
    

     

    iii. Test case: SET b/-100

     Expected: Budget is reset to $0.00, which is the minimum budget SHOCO allows.
    

     

    iv. Other incorrect set budget commands to try: SET b/xxx (where xxx is not a number).

     Expected: An error message and the correct usage of the SET command is shown.
    

     

  2. Reset the budget

    i. Test case: RES

     Expected: Budget has been reset to $0.00
    

     

    ii. Other incorrect reset budget commands to try: RES xxx (where xxx is not a number).

     Expected: An error message and the correct usage of the RES command is shown.
    

     

Add and Edit an item

  1. Add an item

    :bulb: Tip: Before adding an item, you can run the DISPLAY command to prevent entering a duplicate description

    i. Test case: ADD i/apple p/3.00 q/2

    Expected: An item with the description - "apple", price - "$3.00" and quantity - "2"  is added.
    

    :bulb: Tip: You can run the DISPLAY command to check the newly added item.

     

    ii. Test case: ADD p/3.00

     Expected: No item is added. Error message and a correct usage of the ADD command is shown.
    

     

    iii. Other incorrect ADD commands to try: ADD, ADD p/xxx, ADD q/xxx (where xxx is not a number).

     Expected: Similar to previous. 
    

     

  2. Edit an item

    :bulb: Tip: You can run the DISPLAY command to check if the item has been correctly updated.

    Assumption: Valid index and description is provided. (No duplicate description allowed)

    i. Test case: EDIT 1 i/banana

     Expected: The description of the first item is updated to "banana". 
    

     

    ii. Test case: EDIT 1 p/5.60

     Expected: The price of the first item is updated to "$5.60". 
    

     

    iii. Test case: EDIT 1 q/3

     Expected: The quantity of the first item is updated to "3". 
    

     

    iv. Other incorrect edit commands to try: EDIT p/xxx , EDIT q/xxx. (where xxx is not a number).

     Expected: An error message and the correct usage of the EDIT command is shown.
    

     

Find and Delete an item

  1. Find an item based on keyword

    i. Test case: FIND apple

    Expected: A list of items that contains "apple" in their description is displayed.
    

     

    ii. Test case: FIND xxx (where xxx is a keyword that is unmatched)

     Expected: An error message and the correct usage of the FIND command is shown.
    

     

  2. Delete an item

    :bulb: Tip: You can run the DISPLAY command to check the index of an item.

    i. Test case: DEL 1

    Expected: The first item (if it exists), is deleted.
    

     

    ii. Test case: DEL xxx (where xxx is a not a number / the item does not exist yet)

     Expected: An error message and the correct usage of the DEL command is shown.
    

     

Display and Clear the shopping list

  1. List all items in the shopping list

    i. Test case: DISPLAY

     Expected: A list of all the items and the current budget amount is displayed.
    

     

  2. Clear all items in the shopping list

    i. Test case: CLEAR

     Expected: The shopping list is cleared.