AB-3 Developer Guide


Acknowledgements

CollabSync is built upon AddressBook-Level3, a project developed by the SE-EDU initiative.

We also acknowledge the use of the following third-party libraries: JavaFX, JUnit5


Setting up, getting started

Refer to the guide Setting up and getting started.


Design

Architecture

The Architecture Diagram given above explains the high-level design of the App.

Given below is a quick overview of main components and how they interact with each other.

Main components of the architecture

Main (consisting of classes Main and MainApp) is in charge of the app launch and shut down.

  • At app launch, it initializes the other components in the correct sequence, and connects them up with each other.
  • At shut down, it shuts down the other components and invokes cleanup methods where necessary.

The bulk of the app's work is done by the following four components:

  • UI: The UI of the App.
  • Logic: The command executor.
  • Model: Holds the data of the App in memory.
  • Storage: Reads data from, and writes data to, the hard disk.
  • Setup: Responsible for the initial configuration and launching of the AddressBook application

Commons represents a collection of classes used by multiple other components.

How the architecture components interact with each other

The Sequence Diagram below shows how the components interact with each other for the scenario where the user issues the command delete 1.

Each of the four main components (also shown in the diagram above),

  • defines its API in an interface with the same name as the Component.
  • implements its functionality using a concrete {Component Name}Manager class (which follows the corresponding API interface mentioned in the previous point.

For example, the Logic component defines its API in the Logic.java interface and implements its functionality using the LogicManager.java class which follows the Logic interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.

The sections below give more details of each component.

UI component

The API of this component is specified in Ui.java

Structure of the UI Component

The UI consists of a MainWindow that is made up of parts e.g.CommandBox, ResultDisplay, PersonListPanel, StatusBarFooter etc. All these, including the MainWindow, inherit from the abstract UiPart class which captures the commonalities between classes that represent parts of the visible GUI.

The UI component uses the JavaFx UI framework. The layout of these UI parts are defined in matching .fxml files that are in the src/main/resources/view folder. For example, the layout of the MainWindow is specified in MainWindow.fxml

The UI component,

  • executes user commands using the Logic component.
  • listens for changes to Model data so that the UI can be updated with the modified data.
  • keeps a reference to the Logic component, because the UI relies on the Logic to execute commands.
  • depends on some classes in the Model component, as it displays Person object residing in the Model.

Logic component

API : Logic.java

Here's a (partial) class diagram of the Logic component:

The sequence diagram below illustrates the interactions within the Logic component, taking execute("delete 1") API call as an example.

Interactions Inside the Logic Component for the `delete 1` Command

Note: The lifeline for DeleteCommandParser should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.

How the Logic component works:

  1. When Logic is called upon to execute a command, it is passed to an AddressBookParser object which in turn creates a parser that matches the command (e.g., DeleteCommandParser) and uses it to parse the command.
  2. This results in a Command object (more precisely, an object of one of its subclasses e.g., DeleteCommand) which is executed by the LogicManager.
  3. The command can communicate with the Model when it is executed (e.g. to delete a student).
    Note that although this is shown as a single step in the diagram above (for simplicity), in the code it can take several interactions (between the command object and the Model) to achieve.
  4. The result of the command execution is encapsulated as a CommandResult object which is returned back from Logic.

Here are the other classes in Logic (omitted from the class diagram above) that are used for parsing a user command:

How the parsing works:

  • When called upon to parse a user command, the AddressBookParser class creates an XYZCommandParser (XYZ is a placeholder for the specific command name e.g., AddCommandParser) which uses the other classes shown above to parse the user command and create a XYZCommand object (e.g., AddCommand) which the AddressBookParser returns back as a Command object.
  • All XYZCommandParser classes (e.g., AddCommandParser, DeleteCommandParser, ...) inherit from the Parser interface so that they can be treated similarly where possible e.g, during testing.

Model component

API : Model.java

The Model component,

  • stores the address book data i.e., all Person objects (which are contained in a UniquePersonList object).
  • stores the currently 'selected' Person objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Person> that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.
  • stores a UserPref object that represents the user’s preferences. This is exposed to the outside as a ReadOnlyUserPref objects.
  • does not depend on any of the other three components (as the Model represents data entities of the domain, they should make sense on their own without depending on other components)

Note: An alternative (arguably, a more OOP) model is given below. It has a Tag list in the AddressBook, which Person references. This allows AddressBook to only require one Tag object per unique tag, instead of each Person needing their own Tag objects.

Storage component

API : Storage.java

The Storage component,

  • can save both address book data and user preference data in JSON format, and read them back into corresponding objects.
  • inherits from both AddressBookStorage and UserPrefStorage, which means it can be treated as either one (if only the functionality of only one is needed).
  • depends on some classes in the Model component (because the Storage component's job is to save/retrieve objects that belong to the Model)

Setup component

The Setup component,

  • based on the original implementations of Main.java , MainApp.java & AppParameters.java in AB3.
  • now these 3 classes are in a package called setup for better coding standards.

Common classes

Classes used by multiple components are in the seedu.address.commons package.


Implementation

This section describes some noteworthy details on how certain features are implemented.

Backup on corrupt workflow

Implementation

The sequence diagram below illustrates the interactions between different components when corrupted data is detected and backupAndDeleteFile(filePath) is called.

Backup On Corrupt Sequence Diagram

Here's the workflow:

  1. During MainApp's initialization, MainApp will set the Logic component to contain information about whether there is an initial error.
  2. When MainApp.start() is called, it will invoke UI.start() and pass the Logic component to it.
  3. The UI will then check with Logic whether an initial error exists.
  4. If there is an initial error, the UI will display a prompt to the user and wait for user interaction.
  5. Simultaneously, the UI will call the backupAndDeleteFile() method from FileUtil.
  6. backupAndDeleteFile() will gather and prepare all necessary information for the backup and delete.
  7. It will then call the copy() method from Files to complete the backup process.
  8. Finally, the corrupted data file will be deleted after the backup process is done.

Note: The prompt and the backup process are invoked concurrently.

AddCommand workflow

Implementation

The AddCommand is part of the AddressBookParser layer in the application and handles the action of adding the contact.

Add Command Sequence Diagram

Here's the workflow:

  1. The AddCommand is invoked when the user types the command add. This is handled in the execute(Model model) method of the AddCommand class. The Model object, which represents the application's data layer, is passed into the method.
  2. The AddCommand will query Model object with hasPerson() to ensure no duplicate student before adding.
  3. If hasPerson() return false, AddCommand will call addPerson() of Model object to add the new student.

EditCommand workflow

Implementation

The EditCommand is part of the AddressBookParser layer in the application and handles the action of adding the contact.

Edit Command Sequence Diagram

Here's the workflow:

  1. The EditCommand is invoked when the user types the command edit. This is handled in the execute(Model model) method of the EditCommand class. The Model object, which represents the application's data layer, is passed into the method.
  2. The EditCommand requests the Model to retrieve the filtered list of Person objects via the method call model.getFilteredPersonList(). This call is made to fetch all the students that the user has in the current view (filtered according to certain criteria).
  3. If the INDEX paramter is valid, EditCommand will call createEditedPerson() to create a new student with updated details.
  4. The EditCommand then invoke setPerson() and updateFilteredPersonList() methods of Model object to update the student.

DeleteCommand workflow

Implementation

The DeleteCommand is part of the AddressBookParser layer in the application and handles the action of deleting the contact(s).

Delete Command Sequence Diagram

Here's the workflow:

  1. The DeleteCommand is invoked when the user types the command delete. This is handled in the execute(Model model) method of the DeleteCommand class. The Model object, which represents the application's data layer, is passed into the method.
  2. The DeleteCommand requests the Model to retrieve the filtered list of Person objects via the method call model.getFilteredPersonList(). This call is made to fetch all the students that the user has in the current view (filtered according to certain criteria).
  3. Before DeleteCommand continues it's execution, DeleteCommand will first check the format of the parameters to determine user wants to delete with tags or index.
  4. Next, DeleteCommand will prompt user for confirmation before proceed with deletion.
  5. If the command format matches delete INDEX, the system invokes deleteWithIndex(). This method retrieves the target Person object based on the provided index, then calls deletePerson() from the Model object to remove the student.
  6. If the command format matches delete t/TAG [ ,t/TAGS], the system invokes deleteWithTag(). This method filters the List<Person> to find entries matching any of the specified tags (using hasTags()). Deletes all matched students by calling deletePerson() from the Model object.

HideCommand workflow

Implementation

The HideCommand is part of the AddressBookParser layer in the application and handles the action of hiding the details of a contact.
This operation is executed when the user triggers the hide command in the system.

Hide Command Sequence Diagram

Here's the workflow:

  1. The HideCommand is invoked when the user types the command hide. This is handled in the execute(Model model) method of the HideCommand class. The Model object, which represents the application's data layer, is passed into the method.
  2. The HideCommand requests the Model to retrieve the filtered list of Person objects via the method call model.getFilteredPersonList(). This call is made to fetch all the students that the user has in the current view (filtered according to certain criteria).
  3. Once the filteredPersonList is retrieved, the HideCommand iterates over each Person object in the list and calls the method person.hideDetails(). This hides the details of each student in the list. The hideDetails() method, which is part of the Person class, modifies the internal state of the Person object, essentially "hiding" the contact's details from the user interface.
  4. After the details are hidden, the HideCommand returns a CommandResult indicating the success of the operation. The message "Contact details hidden." is passed to the CommandResult constructor, along with additional flags that help the UI decide how to update (whether to show a success message or not).
  5. The UI layer will use the CommandResult object to display feedback to the user. If successful, the system will notify the user that the contact's details have been hidden.

Note: UnhideCommand also follows a similar workflow, but instead of calling hideDetails(), the method invoked is showDetails()

UI Update Behavior

Below is the frontend update process:

  1. Model State Update:
    After hideDetails() is called on each Person, the internal areDetailsVisible property is set to false.

  2. Automatic UI Refresh via Data Binding:
    In the PersonCard component, the UI elements (such as phone, email, address, and major) are bound to the person's detailsVisibleProperty(). For example:

    phone.visibleProperty().bind(person.detailsVisibleProperty());
    phone.managedProperty().bind(person.detailsVisibleProperty());
    
    address.visibleProperty().bind(person.detailsVisibleProperty());
    address.managedProperty().bind(person.detailsVisibleProperty());
    
    email.visibleProperty().bind(person.detailsVisibleProperty());
    email.managedProperty().bind(person.detailsVisibleProperty());
    
    major.visibleProperty().bind(person.detailsVisibleProperty());
    major.managedProperty().bind(person.detailsVisibleProperty());
    

    With these bindings in place, when areDetailsVisible is set to false, these labels automatically become invisible and are excluded from layout calculations.

  3. UI Outcome: As a result, once the HideCommand is executed:

    • The UI refreshes automatically.

    • The student’s detailed information (phone, email, address, major) is hidden.

    • Only the basic details (such as the name and tags) remain visible.

    If the user issues an unhide command, the showDetails() method is invoked, setting areDetailsVisible back to true and causing the UI to re-render the full details.

FindCommand workflow

Implementation

The FindCommand is part of the AddressBookParser layer and handles searching for students based on keywords.
This operation is executed when the user triggers the find command in the system.

Find Command Sequence Diagram

Here's the workflow:

  1. The user types the command find KEYWORD.... This is handled in the execute(Model model) method of the FindCommand class.
  2. The FindCommand creates a PersonContainsKeywordsPredicate object with the specified keywords.
  3. The FindCommand calls model.updateFilteredPersonList(Predicate<Person>) to update the filtered list of Person objects. This filters out any students whose names do not match the given keywords.
  4. The FindCommand calls model.getFilteredPersonList() to get the size of the list displayed.
  5. A CommandResult is returned, containing a success message that indicates how many students were found (e.g., "X persons listed!").
  6. The UI layer reads the CommandResult and refreshes the display to show only those students who match the keywords.

Note:

  1. The search is case-insensitive, meaning a keyword "alice" will match both "Alice" and "alice" in the student's name.
  2. ListCommand works similar to the above, but the Predicate<Person> is always set to true, which makes it display all the contacts by default.

SortCommand Workflow

Implementation

The SortCommand is part of the AddressBookParser layer and handles searching for students based on keywords.
This operation is executed when the user triggers the sort command in the system.
If identical names are in the contact, the contacts will be sorted using their phone numbers.

Sort Command Sequence Diagram

Here's the workflow:

  1. The user enters the command sort asc or sort desc.
  2. In the execute(Model model) method of SortCommand, the following steps occur:
    • The model is checked to ensure it is not null.
    • The filtered student list is retrieved via model.getFilteredPersonList().
    • Empty List Check:
      If the list is empty, the command immediately returns a CommandResult with the message "No contacts to sort."
    • Sorting Comparator:
      A comparator is defined that first compares students by name, and in cases where names are equal, by phone number:
      Comparator<Person> comparator = Comparator.comparing(Person::getName)
              .thenComparing(Person::getPhone);
      
    • Order Adjustment:
      If the command is to sort in descending order (isAscending is false), the comparator is reversed.
    • Sorting the List:
      The comparator is then passed to the model via model.sortFilteredPersonList(comparator), which reorders the filtered list.
    • Result Generation:
      Finally, a new CommandResult is created with a message indicating the sort order, e.g., "Contacts sorted in ascending order." or "Contacts sorted in descending order."

Note: The sort operation does not modify the underlying data permanently; it only reorders the displayed filtered list in the UI.


Documentation, logging, testing, configuration, dev-ops


Appendix: Requirements

Product scope

Target user profile:

  • is a National University of Singapore student
  • need to manage project team contacts
  • track relationships between classmates across multiple courses
  • prefer desktop apps over other types
  • can type fast
  • prefers typing to mouse interactions
  • is reasonably comfortable using CLI apps

Value proposition: manage contacts for NUS students faster than a typical mouse/GUI driven app

User stories

Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *

Priority As a …​ I want to …​ So that I can…​
* * * user add a new student store and retrieve essential information easily
* * * user delete a student remove outdated or irrelevant entries
* * * user find a student by name quickly locate specific student
* * user data save automatically so that I never lose my contacts even if the app crashes
* * user find students by course quickly locate students with a specific course
* * user clear all contacts at once reset the app for a new semester
* * user delete students by course remove related entries after a course ended
* * user edit student details keep their details up-to-date
* * user sort student details keep their details in an orderly manner
* * user list all students see all my saved contacts at once
* * new user view a help menu quickly learn how to use the application
* user remember my last search don't need to type it again
* privacy-conscious user hide students' information hide sensitive details when others view my screen
* privacy-conscious user unhide students' information access full contact details when needed
* user with many students in the address book search for contacts fuzzily find a student even if I do not correctly know their names
* user with many students in the address book the application to load quickly access my information without delay

Use cases

(For all use cases below, the System is the CollabSync and the Actor is the user, unless specified otherwise)


Use case: Add a student

MSS

  1. User requests to add a new student by specifying Name, Phone, Email, Address, Major and Tags(if any) (e.g., using add n/NAME p/PHONE e/EMAIL a/ADDRESS m/MAJOR t/[TAGS]).

  2. CollabSync validates the details (e.g., checks phone format, email format, etc.).

  3. CollabSync saves the new student to the address book.

    Use case ends.

Extensions

  • 2a. User provides incomplete or invalid details. (e.g., phone number format is invalid)

    • 2a1. CollabSync shows an error message.

      Use case ends.

  • 2b. User tries to add a contact that already exists (e.g., same Name and Phone).

    • 2b1. CollabSync rejects the duplicate entry and shows an error message.

      Use case ends.


Use case: Delete a student based on index

MSS

  1. User requests to list students (e.g., using the list command).

  2. CollabSync shows a list of students with their Name, Phone, Email, Address, Major and Tags(if any) in an indexed format.

  3. User requests to delete a specific student in the list by index (e.g., delete 3).

  4. CollabSync prompts a popup box to request user to confirm their deletion.

  5. User enters the confirm button.

  6. CollabSync deletes the student with the given index.

    Use case ends.

Extensions

  • 2a. The list is empty.

    • 2a1. CollabSync informs the user that there are no contacts to delete.

      Use case ends.

  • 3a. The given index is invalid.

    • 3a1. CollabSync shows an error message.

      Use case resumes at step 2.

  • 4a. Cancel button or x was pressed.

    • 4a1. Contact is not deleted. Deletion canceled.

      Use case resumes at step 2.


Use case: Delete student(s) based on tags

MSS

  1. User requests to list students (e.g., using the list command).

  2. CollabSync shows a list of students with their Name, Phone, Email, Address, Major and Tags(if any) in an indexed format.

  3. User requests to delete a specific student in the list by the tags (e.g., delete t/HSA1000).

  4. CollabSync prompts a popup box to request user to confirm their deletion.

  5. User enters the confirm button.

  6. CollabSync deletes the student with the given index.

    Use case ends.

Extensions

  • 2a. The list is empty.

    • 2a1. CollabSync informs the user that there are no contacts to delete.

      Use case ends.

  • 3a. The given index is invalid.

    • 3a1. CollabSync shows an error message.

      Use case resumes at step 2.

  • 4a. Cancel button or x was pressed.

    • 4a1. Contact is not deleted. Deletion canceled.

      Use case resumes at step 2.


Use case: Edit a student

MSS

  1. User requests to list students (e.g., using the list command).

  2. CollabSync shows a list of students.

  3. User requests to edit a specific student.

  4. CollabSync updates the details of the student.

    Use case ends.

Extensions

  • 2a. The list is empty. Use case ends.

  • 3a. The given index is invalid.

    • 3a1. CollabSync shows an error message. Use case resumes at step 2.
  • 3b. The new tags entered by user are of invalid format.

    • 3b1. CollabSync shows an error message. Use case resumes at step 3.

Use case: List all students

MSS

  1. User enters the list command.

  2. CollabSync displays a list of all students with their Name, Phone, Email, Address, Major, and Tags (if any) in an indexed format.

    Use case ends.

Extensions

  • 2a. No students in the address book:
    • 2a1. CollabSync informs the user that the list is empty.

      Use case ends.


Use case: Sort contacts

MSS

  1. User enters a sort command with a specified order (e.g., using 'sort asc' or 'sort desc').

  2. Sorts the contact list in the specified order based on Name, followed by Phone Number if names are identical.

  3. CollabSync displays the sorted contact list.

    Use case ends.

Extensions

  • 2a. No contacts found in the list.

    • 2a1. CollabSync informs the user that there are no contacts to sort.

      Use case ends.

  • 2b. User enters an invalid sorting order.

    • 2b1. CollabSync informs the user of the invalid input and provides the correct format.

      Use case ends.


Use case: Hide Information

MSS

  1. User enters the hide command.

  2. CollabSync automatically hides the contact details of all students currently shown in the application, except for Name and Tags (if they were displayed previously).

    Use case ends.

Extensions

  • 2a. Information is already hidden:
    • 2a1. The information of the contacts in the current window currently will remain hidden.

      Use case ends.


Use case: Unhide Information

MSS

  1. User enters the unhide command.

  2. CollabSync automatically reveals all the hidden information of the students currently in the application.

    Use case ends.

Extensions

  • 1a. No information was hidden:
    • 1a1. The information of the contacts in the current window will remain revealed.

      Use case ends.


Use case: Find a student

MSS

  1. User enters a search term. (e.g., using find KEYWORD).

  2. CollabSync searches for any matching students based on the search term in their Name, Phone, Email, Major and Tags.

    Use case ends.

Extensions

  • 2a. No matching students found
    • 2a1. CollabSync informs the user that no results match the search.

      Use case ends.


Use case: Save Data

MSS

  1. User performs an action that modifies the data (e.g., adding, editing, or deleting a contact).

  2. CollabSync automatically saves the updated data to a local file (e.g., data/addressbook.json).

    Use case ends.

Extensions

  • 2a. Saving data fails (e.g., permission issues or disk is full).

    • 2a1. CollabSync shows an error message indicating that the save failed.

      Use case ends.

  • 2b. Data file is corrupted or unreadable.

    • 2b1. CollabSync shows an error message about the corrupted file.

      Use case ends.


Use case: Clear All Contacts

MSS

  1. User enters the clear command.

  2. CollabSync clears all entries from the address book.

    Use case ends.

Extensions

  • 2a. User clears an empty contact list:
    • 2a1. CollabSync still clears the contact.

      Use case ends.


Non-Functional Requirements

  1. Should work on any mainstream OS as long as it has Java 17 or above installed.
  2. Should be able to hold up to 1000 students without a noticeable sluggishness in performance for typical usage.
  3. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse.
  4. The product should be for a single user.
  5. Response to any use action should become visible within 5 seconds.
  6. The system should be useable by non-technical users.
  7. Command error messages should be clear and informative enough that even non-technical users can understand the issues.
  8. The data should be stored locally and should be in a human editable text file.
  9. The software should not depend on your own remote server.

Glossary

  • Mainstream OS: Windows, Linux, Unix, MacOS
  • CLI (Command-Line Interface): A text-based interface for interacting with the application through typed commands.
  • GUI (Graphical User Interface): The visual interface of the application, including windows, buttons, and forms.
  • Contact: An entry in the address book containing details such as name, phone number, email, and address.
  • Students: NUS Students

Appendix: Instructions for manual testing

Given below are instructions to test the app manually.

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

    1. Download the jar file and copy into an empty folder

    2. Double-click the jar file
      Expected: Shows the GUI with a set of sample contacts (the window size may not be optimum).

  2. Saving window preferences

    1. Resize the window to an optimum size

    2. Move the window to a different location

    3. Close the window

    4. Re-launch the app by double-clicking the jar file
      Expected: The most recent window size and location is retained.

Displaying help window

  1. Displaying help window

    1. Test case: help
      Expected: A help window popped out. List of commands and their format in the help window.

    2. Test case: help aaaaaaa
      Expected: A help window popped out. List of commands and their format in the help window.

Adding a student

  1. Adding a student

    1. Test case: add n/Li Shi Rei p/98765432 e/shireiHG@u.nes.edu a/21 Lower Kent Ridge Road m/Prompt Engineering t/genius:trivial
      Expected: Student is successfully added to the list. All details are displayed correctly. The contact list updates to show the new student.

    2. Test case: add n/Saitama p/23456789 e/atama@u.nos.edu a/21 Lower Kent Ridge Road m/Sport Science t/friends:trivial t/HDM1000:module (different tags)
      Expected: Student is successfully added to the list. All details are displayed correctly. The contact list updates to show the new student.

    3. Test case: add n/Saitama p/23456789 e/atama@u.nos.edu a/21 Lower Kent Ridge Road m/Sport Science t/friends:trivial t/HDM1000:module (same as previous test case)
      Expected: Student not added to the list. UI displays "This student already exists in the address book".

    4. Test case: add John Doe
      Expected: Student not added to the list. Error details shown in the status message.

    5. Test case: add n/ t/ p/
      Expected: Student not added to the list. Error details shown in the status message.

Listing all students

  1. Listing all students

    1. Test case: list
      Expected: All students are display correctly.

    2. Test case: list abcdefg
      Expected: All students are display correctly.

Hiding and Unhiding information

  1. Hiding information

    1. Test case: hide
      Expected: All students' details is hidden, with only their names and tags shown.

    2. Test case: hide (same as previous test case)
      Expected: All students' details remain hidden, with only their names and tags shown.

  2. Unhiding information

    1. Test case: unhide
      Expected: All students' hidden details are displayed.

    2. Test case: unhide (same as previous test case)
      Expected: All students' details remain displayed.

Sorting students

  1. Sorting students in ascending order (A → Z)

    1. Test case: sort asc
      Expected: Students are sorted by their name in ascending order. Ties in names are broken by phone numbers.
  2. Sorting students in descending order (Z → A)

    1. Test case: sort desc
      Expected: Students are sorted by their name in descending order. Ties in names are broken by phone numbers.
  3. Sorting students in other order

    1. Test case: sort xyz
      Expected: The student list remains the same. Error details shown in the status message.

Editing a Student

  1. Editing a student while all students are being shown

    1. Prerequisites:

      • List all students using the list command.
      • Ensure there are multiple students in the list.
    2. Test case: edit 1 n/John Doe p/91234567 e/johndoe@example.com a/123 Main Street m/Computer Science t/friend
      Expected:

      • The student at index 1 is updated with the following details:
        • Name: John Doe
        • Phone: 91234567
        • Email: johndoe@example.com
        • Address: 123 Main Street
        • Major: Computer Science
        • Tag: friend
      • A success message is shown, and the UI reflects the updated information.
    3. Test case: edit 2 p/98765432 a/456 New Road
      Expected:

      • The student at index 2 is updated with the new phone number and address only.
      • All other fields (name, email, major, tags) remain unchanged.
      • A confirmation message is displayed.
    4. Test case: edit 1 n/ p/
      Expected:

      • The command fails because required fields (e.g., name) are empty or missing.
      • An error message is displayed in the status message.
    5. Test case: edit 100 n/Jane Doe
      Expected:

      • If there is no student at index 100, the command fails.
      • An error message is displayed in the status message.
    6. Test case: edit 1 e/invalidEmailFormat p/abcde
      Expected:

      • The command fails due to invalid email and phone number formats.
      • An error message is displayed in the status message.

Deleting a student

  1. Deleting a student while all students are being shown
    1. Prerequisites:

      • List all students using the list command.
      • Ensure there are multiple students in the list.
    2. Test case: delete 1
      Expected: First student entry is deleted from the list. Details of the deleted students shown in the status message.

    3. Test case: delete t/friends:trivial
      Expected: Students with same tag and priority are deleted. Details of the deleted students shown in the status message.

    4. Test case: delete 0
      Expected: No student is deleted. Error details shown in the status message. Status bar remains the same.

    5. Other incorrect delete commands to try: delete, delete x, ... (where x is larger than the list size)
      Expected: Similar to previous.

Saving data

  1. Dealing with missing data files

    1. Close the app

    2. Delete addressbook.json in the data folder

    3. Re-launch the app
      Expected: Shows the GUI with a set of sample contacts.

  2. Dealing with corrupted data files

    1. Close the app

    2. Modify addressbook.json in the data folder by inserting random data at either the start or end of the file

    3. Re-launch the app
      Expected: A pop-up appears showing a warning message. The corrupted addressbook.json is backed up to addressbook_old.json. The app will continue with an empty list after pressing the 'OK' button.

Appendix: Effort

Difficulty Level for the Project

CollabSync was significantly more difficult than the AB3 application. We incorporated new commands and functionalities to suit better our target audience, which were university students. Incorporating newer, but more relevant features such as the refinement of tags with their various levels of priorities, as well as including a new field: "Major" made our project much harder as we had to modify all the other relevant classes, as well as test classes to support these critical features.

Challenges Faced for the Project

  • Challenge 1 : Revamping the UI to make our application look more appealing to users through various coloured words and tags.
  • Challenge 2 : Addition of the newer features such as the introduction of corrupt data handling for corrupted files.
  • Challenge 3 : Intense workload due to a 4-person team.

Effort Required for the Project

  • Various, new commands are added while existing commands are refined to better cater to university students more closely for CollabSync.
  • Refactoring of code to ensure our code follows certain principles taught in the CS2103T module: No deep nesting, KISS, SLAP and so on.

Achievements of the Project

The AB3 application is now refined through the addition of new features, as well as refinement of existing features. University students are more able to effectively and efficiently manage their contacts using CollabSync.

Appendix: Planned Enhancements

  • Refine the warning message for edit : For edit command, when one enters a large index value, such as edit 100000000000000 , the warning message does not show At least one field to edit must be provided. due to buffer overflow errors. Instead, it shows Invalid command format! [More error message ....]. It would be good to fix this in future.
  • Enhanced parameter validation : Unnecessary parameters provided with commands, such as entering help 12345, will trigger a clear warning message that indicates the correct usage. This enhancement ensures that users receive immediate feedback, guiding them to use commands as intended and reducing potential confusion.
  • Help Window refinement : As a future enhancement, we plan to implement dedicated help commands for each command entered. For example, help add allows users to seek help on the add command specifically. This refinement offers users a more detailed, feature-specific guidance on the respective commands. This will make it easier for users to understand and effectively utilize each command, thereby enhancing overall usability and user experience.