This project is based on the AddressBook-Level3 project created by the SE-EDU initiative.
Refer to the guide Setting up and getting started.
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.
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.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),
interface with the same name as the Component.{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.
The API of this component is specified in Ui.java
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,
Logic component.Model data so that the UI can be updated with the modified data.Logic component, because the UI relies on the Logic to execute commands.Model component, as it displays Person object residing in the Model.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.
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:
Logic is called upon to execute a command, it is passed to an MentorstackParser object which in turn creates a parser that matches the command (e.g., DeleteCommandParser) and uses it to parse the command.Command object (more precisely, an object of one of its subclasses e.g., DeleteCommand) which is executed by the LogicManager.Model when it is executed (e.g. to delete a person).Model) to achieve.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:
MentorstackParser 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 MentorstackParser returns back as a Command object.XYZCommandParser classes (e.g., MentorstackParser, DeleteCommandParser, ...) inherit from the Parser interface so that they can be treated similarly where possible e.g, during testing.API : Model.java
The Model component,
Person objects (which are contained in a UniquePersonList object).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.UserPref object that represents the user’s preferences. This is exposed to the outside as a ReadOnlyUserPref objects.Model represents data entities of the domain, they should make sense on their own without depending on other components)
API : Storage.java
The Storage component,
MentorstackStorage and UserPrefStorage, which means it can be treated as either one (if only the functionality of only one is needed).Model component (because the Storage component's job is to save/retrieve objects that belong to the Model)Classes used by multiple components are in the seedu.mentorstack.commons package.
This section describes some noteworthy details on how certain features are implemented.
The key operation to store the states of the data is in the Model interface as Model#remember().
Given below is an example usage scenario and how the undo mechanism behaves at each step.
Step 1. The user launches the application for the first time. The Mentorstack will be initialized with the initial mentorstack state, and the empty list of state history is initialized.
Step 2. The user executes delete 5 command to delete the 5th person in the mentorstack. The delete command calls Model#remember(), causing the original state before the delete 5 command executes to be saved in the history.
Step 3. The user executes add n/David … to add a new person. The add command also calls Model#remember(), causing another mentorstack state to be saved into the history.
Note: If a command fails its execution, it will not call Model#remember(), so the mentorstack state will not be saved into the history.
Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the undo command. The undo command will call Model#undo(), which, after verified by Model#canUndo(), will make history to pop once to give last state, and restores the mentorstack to that state.
Note: If the history has no previous mentorstack states to restore. The undo command uses Model#canUndo() to check if this is the case. If so, it will return an error to the user rather
than attempting to perform the undo.
The following sequence diagram shows how an undo operation goes through the Logic component:
Note: The lifeline for UndoCommand should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram.
Similarly, how an undo operation goes through the Model component is shown below:
Step 5. The user then decides to execute the command list. Commands that do not modify the mentorstack, such as list, will usually not call Model#remember(). Thus, the history remains unchanged.
The following activity diagram summarizes what happens when a user executes a new command:
Aspect: How undo executes:
Alternative 1 (current choice): Saves the entire mentorstack.
Alternative 2: Individual command knows how to undo by itself.
delete, just save the person being deleted).{more aspects and alternatives to be added}
The StatsCommand provides statistical insights into the persons stored in MentorStack. It can either display overall statistics or filter by a specified subject.
The following sequence diagram shows how a stats operation goes through the Logic component:
The ArchiveCommand archives students and transfers their data to an archive list stored on Mentorstack.
It is similar to the active list but student entries cannot be edited.
Given below is a sequence diagram for a sample ArchiveCommand
A similar sequence diagram can be drawn for the UnarchiveCommand, which moves the student back to the active list.
Target user profile:
Computer science tutors who need an efficient system to organize student information and track student progress
Value proposition:
Mentorstack helps CS tutors efficiently manage and track student contacts, attendance, participation, progress, and streamlines communication. It simplifies student management across different levels and courses while catering to tech-savvy users who may prefer a command-line interface.
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
* * * | tutor | add a student’s details (name, email, course, year) | keep track of their information |
* * * | tutor | remove a student’s details | remove a student whose details no longer need to track |
* * * | tutor | edit a student’s details | update their information |
* * * | tutor | search for a student by name or ID | quickly find their details |
* * * | tutor | view all students’ information | get in touch with the student whenever I want |
* * | tutor | undo an unintended operation | quickly correct any mistakes |
* * | tutor | View the gender distribution of my students | adjust my teaching style |
* * | tutor | archive a student | focus on current student while not deleting past students |
* * | tutor | unarchive a student | add mistakenly archived students back |
* * | tutor | clear all student's details | reset the Mentorstack to an empty |
* * | tutor | list all student's details | see all active students in Mentorstack |
* * | tutor | mark students | quickly identify students |
* * | tutor | unmark students | unmark mistakenly marked students |
* * | tutor | mark a student's subject as completed | check if a student has completed a course |
* * | tutor | mark a student's subject as uncompleted | unmark mistakenly marked subjects |
* * | tutor | show all archived students | check which students are archived |
* * | tutor | view help window or hinter command | quickly get help to using Mentorstack |
(For all use cases below, the System is Mentorstack and the Actor is the tutor, unless specified otherwise)
Use case: UC01 - Add student details
MSS
Tutor requests to add a new student.
System displays the required input format to add student information.
Tutor enters student's information.
System creates a new student profile.
Use case ends.
Extensions
4a. Required information is missing.
4b. Information input format is invalid.
4c. A student’s information already exists.
Use case: UC02 - Delete a student
MSS
Tutor requests to list students.
System shows a list of students.
Tutor requests to delete a specific student in the list.
System deletes the person.
Use case ends.
Use case: UC03 - Edit student details
MSS
User inputs the student ID and the updated information of the corresponding student.
Mentorstack shows a message of successful updating.
Use case ends.
Extensions
2a. The given student ID is invalid.
2a1. Mentorstack shows an error message.
Use case ends.
Use case: UC04 - Find students by name
MSS
User inputs a string.
Mentorstack shows a list of students that contains the string in the name.
Use case ends.
Extensions
2a. There is no matching student.
2a1. Mentorstack shows an error message.
Use case ends.
Use case: UC05 - View all students’ information by filter
MSS
Tutor enters the view_students command with an optional filter type and value.
Mentorstack retrieves a list of students matching the filter criteria.
Mentorstack displays a table of students retrieved.
Use case ends.
Extensions
1a. The filter or value is invalid.
Use case ends.
2a. The list is empty.
Use case ends.
Use case: UC06 - View student distribution by stats
MSS
Tutor enters the stats command with an optional subject name.
Mentorstack calculates numbers by the filter criteria.
Mentorstack displays the number of distributions retrieved.
Use case ends.
Extensions
1a. The filter or value is invalid.
Use case ends.
1b. No subject input.
2a. The list is empty.
Use case ends.
Use case: UC07 - Archive students
MSS
Use case ends.
Extensions
2a. Students are not in the list.
Use case ends.
2b. A student is already archived.
Use case ends.
Use case: UC08 - Unarchive students
Preconditions: User is accessing the archive list and there are archived students. MSS
Use case ends.
Extensions
2a. Students are not in the list.
Use case ends.
2b. A student is already unarchived.
Use case ends.
Use case: UC09 - Show all archived students
MSS
Use case ends.
Use case: UC10 - Mark student
MSS
Use case ends.
Extensions
2a. Student is not in the list.
Use case ends.
2b. Student is archived.
Use case ends.
Use case: UC11 - Unmark student
MSS
Use case ends.
Extensions
2a. Student is not in the list.
Use case ends.
2b. Student is archived.
Use case ends.
Use case: UC12 - Finish subject
MSS
Use case ends.
Extensions
2a. Student is not in the list.
Use case ends.
2b. Student is archived.
Use case ends.
2c. Student is not enrolled in the subject
Use case ends.
Use case: UC13 - Unfinish subject
MSS
Use case ends.
Extensions
2a. Student is not in the list.
Use case ends.
2b. Student is archived.
Use case ends.
2c. Student is not enrolled in the subject.
Use case ends.
Use case: UC14 - Undo an unintended operation
Precondition
MSS
Tutor enters the undo command.
Mentorstack reverts the last operation that modified the data storage.
Mentorstack displays a success message.
Mentorstack displays a description for the operation that is undone.
Use case ends.
Extensions
1a. There is no operation to undo - undo is not valid.
Use case ends.
17 or above installed.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.
Initial launch
Download the jar file and copy into an empty folder
Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
If this still fails, refer to the instructions in the Quick Start section in the User Guide for launch instructions.
Saving window preferences
Resize the window to an optimum size. Move the window to a different location. Close the window.
Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
Adding a person
Test case: add n/John Doe g/M p/98765432 e/johnd@example.com s/CS2103
Expected: Student is added to the end of the list with the above details. Details of the added student shown in the status message.
Test case: add n/John Doe
Expected: No person is added. Error details shown in the status message. Can try with other missing fields.
Deleting a person while all persons are being shown
Prerequisites: List all persons using the list command. Multiple persons in the list.
Test case: delete 1
Expected: First student is deleted from the list. Details of the deleted student shown in the status message.
Test case: delete 0
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
Other incorrect delete commands to try: delete, delete x, ... (where x is larger than the list size)
Expected: Similar to previous.
Editing a person while all persons are being shown
Prerequisites: List all persons using the list command. Multiple persons in the list.
Test case: edit 1 s/CS2103
Expected: First student is edited with the above details. Details of the edited student shown in the status message.
Test case: edit 1
Expected: No person is edited. Error details shown in the status message. At least one field must be edited.
Other incorrect edit commands to try: edit, edit x, ... (where x is larger than the list size)
Expected: Similar to previous.
Finds persons with matching name in Mentorstack.
Prerequisites: Student with name alex in Mentorstack.
Test case: find alex
Expected: Students with name containing alex is listed.
Finds persons with matching values in Mentorstack.
Test case: view f/s v/CS
Expected: Students taking CS subjects are listed.
Test case: view
Expected: All students listed.
Test case: view f/s v/CS f/n v/alex
Expected: Students taking CS subjects and name containing alex are listed.
Test case: view f/n
Expected: Filter/value not specified. No error. All students are listed.
Archives students in Mentorstack.
Prerequisites: Students in the active list in Mentorstack.
Test case: archive 1
Expected: First student is moved to the archive list. Verify with showarchive. Verify that student can no longer be edited.
Unarchives students in Mentorstack.
Prerequisites: Students in the archive list in Mentorstack. Access this list first using showarchive
Test case: unarchive 1
Expected: First student in the archive list is moved back to the active list. Verify with list. Verify that student can now be edited.
Marks students in Mentorstack.
Prerequisites: List all students using the list command. Multiple persons in the list.
Test case: mark 1
Expected: First student is marked. Verify that mark 1 again keeps first student as marked.
Test case: mark 0
Expected: No student is marked. Error details shown in the status message.
Other incorrect mark commands to try: mark, mark x, ... (where x is larger than the list size)
Expected: Similar to previous.
Unmarks students in Mentorstack.
Prerequisites: List all students using the list command. Multiple persons in the list.
Test case: unmark 1
Expected: First student is unmarked. Verify that unmark 1 again keeps first student as unmarked.
Test case: unmark 0
Expected: No student is unmarked. Error details shown in the status message.
Other incorrect unmark commands to try: unmark, unmark x, ... (where x is larger than the list size)
Expected: Similar to previous.
Marks a student's subject as finished in Mentorstack.
Prerequisites: First student in the list must be enrolled in CS2103 and not enrolled in CS2104.
Test case: finish 1 s/CS2103
Expected: Subject marked as finished. Verify that running the command again simply keeps the subject as finished.
Test case: finish 1 s/CS2104
Expected: Error details shown in the status message.
Marks a student's subject as unfinished in Mentorstack.
Prerequisites: First student in the list must have finished CS2103 and not enrolled in CS2104.
Test case: unfinish 1 s/CS2103
Expected: Subject marked as unfinished. Verify that running the command again simply keeps the subject as unfinished.
Test case: unfinish 1 s/CS2104
Expected: Error details shown in the status message.
Undoes the previous state-changing command in Mentorstack successfully.
Prerequisites: Valid commands have been run that have changed the state of Mentorstack in the current session.
undoFails to undo the commands in Mentorstack.
Prerequisites: New Mentorstack session.
undoTeam size: 5
., /).view command: The view command simply lists all students if invalid arguments are given. This could be reworked to always throw an error message whenever filter-value pairs are incorrectly specified to help users use the format.stats command work for archived students: The stats command currently only displays statistics for students currently enrolled in subjects in the active list. This could be extended to work for the archive list and completed subjects.+, -) to account for country codes.CS2103 is different from cs2103). This could be extended to consider these subjects as the same by making them case-insensitive.find and view currently matches partial words. It could be more effective if another search function was added that searches by full matching words.