We follow the project design and documentation structure of AB3.
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 deleteStu 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, StudentListPanel, 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 Student 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("deleteStu 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 AddressBookParser 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 student).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:
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.XYZCommandParser classes (e.g., AddCommandParser, 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,
Student objects (which are contained in a UniqueStudentList object).Student objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Student> 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)Note: An alternative (arguably, a more OOP) model is given below. This model introduces a more streamlined structure where AddressBook holds a TutorialList and an AssignmentList, linking directly to Tutorial and Assignment entities. Each Student is associated with a TutorialId, and Tutorial entities maintain a list of Student objects, making it easier to manage relationships and reducing redundancy. This design allows AddressBook to manage tutorials and assignments without requiring each student to hold separate Tutorial or Assignment objects, simplifying interactions and data management.
API : Storage.java
The Storage component,
AddressBookStorage, UserPrefStorage, TutorialStorage and AssignmentStorage, which means it can be treated as one of these (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.address.commons package.
This section describes some noteworthy details on how certain features are implemented.
Please note that certain aspects, such as UML classes, may have been simplified to fit within the diagram's constraints and maintain readability.
Users can seamlessly add tutorials, students and assignments into the TrackMate application. On top of that, users can also add student's tutorial attendance to maintain student's accurate attendance record.
Centralized Parsing with AddCommandParser:
The parsing logic is centralized in AddCommandParser to ensure that input arguments are consistently handled across commands. This prevents each command from having redundant logic and promotes modularity by isolating parsing responsibilities.
Avoiding Duplicates with Tutorial and Student Validation:
We ensure that duplicate students or non-existent tutorials are caught early in ModelManager. This provides immediate feedback and prevents inconsistent states in the data model.
TutorialList and Student) to ensure consistency without impacting performance.To ensure data integrity and completeness, the system necessitates the inclusion of parameters such as Name and Student ID. The activity diagram below shows the sequence of action users will have to take to add a new Student Profile into the TrackMate Application.
Besides, a class diagram of add student command is given below to demonstrate the interactions among classes.
Similar to adding student, the system requires parameters such as Tutorial Name and Tutorial ID. The sequence diagram below demonstrates the interaction among various classes to add a new Tutorial into the TrackMate Application.
The AttendCommand is responsible for marking the attendance of a student for a specific tutorial session in the TrackMate Application. This command interacts with the model to update the attendance record of a given student for a particular tutorial. The sequence diagram below shows how the command interact with other classes.
Users can also add assignments to the TrackMate Application that are shared among all the students in every tutorial class. The activity diagram below will demonstrate what the users need to do to add assignment for students.
Alternative 1 (Current Implementation):
Description: The current implementation uses a dedicated ParserUtil class to handle input parsing and data validation. This ensures that common validation logic (e.g., parsing names, student IDs, tutorial IDs or dates) is reusable across different components.
Pros:
Cons:
Alternative 2: Inline Validation in Domain Classes
Description: An alternative design is to incorporate validation logic directly within each relevant class (e.g., Student, TutorialId, Name) to enforce constraints close to where the data is used.
Pros:
Cons:
We chose Alternative 1 due to the modularity, maintainability, and consistency it provides. By centralizing the validation logic in ParserUtil, we ensure it aligns with the modular nature of our design, where commands and models interact through a well-defined interface. It also simplifies the commands by offloading validation and parsing responsibilities, promoting cleaner, more maintainable code.
The TrackMate application empowers users to update the details of existing students easily. With the Edit feature, users can modify a student's name, student ID, or assigned tutorial ID. This functionality ensures that student records remain accurate and up-to-date within the application, reflecting any changes in student information or tutorial assignments.
Use of EditStudentDescriptor: The EditStudentDescriptor is a static inner class within EditCommand that stores the details of the fields to edit. It allows for optional fields, meaning users can choose to update any combination of the student's attributes without affecting others.
Benefit: This descriptor pattern provides a clean and flexible way to handle optional edits. It encapsulates changes, making it straightforward to create a new Student object with updated values. It also promotes code reuse and maintainability by isolating the edit details from the command execution logic.
Challenge: Managing optional values and ensuring that the descriptor accurately represents the intended changes without introducing errors requires careful implementation. Ensuring that at least one field is edited and providing appropriate error messages when none are requires precise checks.
Validation Checks in EditCommand: Before applying edits, several validation checks are performed such that we can ensure that the edited student does not duplicate an existing student in the address book unless it's the same student. Besides, it also validates that the new student ID, if changed, does not already exist in the system.
Benefit: These checks maintain data integrity, preventing inconsistent states and ensuring the uniqueness of critical identifiers like student IDs.
Challenge: These validations must be efficient to avoid performance degradation. They also need to be comprehensive to prevent any edge cases where data integrity could be compromised.
To maintain accurate and up-to-date student records, the Edit feature allows users to modify existing student information. The sequence diagram below shows how it involves specifying the student's index in the displayed list and providing any new values for the student's attributes.
Alternative 1 (Current Implementation):
Description:
The current implementation employs an EditStudentDescriptor to encapsulate the fields to be edited. The EditCommandParser handles the parsing of user input, populating this descriptor with provided values. The EditCommand then uses this descriptor to create a new Student object with the updated values, replacing the old one in the model.
Pros:
Cons:
Alternative 2: Inline Editing with Mutable Student Objects
Description:
An alternative design could involve making the Student class mutable, allowing direct modification of its fields. The EditCommand would modify the fields of the existing Student object directly without creating a new instance.
Pros:
Cons:
Decision:
We chose Alternative 1 due to its alignment with the application's overall design philosophy of using immutable data objects. This approach promotes safer code by avoiding side effects, making it easier to maintain and less error-prone. Although it introduces additional classes, the benefits of modularity, maintainability, and data integrity outweigh the added complexity. It also adheres to the Single Responsibility Principle, keeping parsing, data encapsulation, and execution concerns separate.
The TrackMate application allows users to remove students, tutorials, assignments, and attendance records efficiently. The Delete feature ensures that outdated or incorrect records can be cleaned up, maintaining the integrity and relevance of the data within the application.
Students: Deleting a student removes them from the address book, unassigns them from tutorials, and updates assignments and attendance records.
Tutorials: Deleting a tutorial removes it from the tutorial list and unassigns all associated students.
Assignments: Deleting an assignment removes it from the assignment list.
Attendance Records: Deleting attendance marks the student as absent for that date and tutorial.
To remove a student from the application, the user specifies the student's index in the displayed student list. The system ensures that the index is valid and then proceeds to delete the student, updating all related records. Below is the sequence diagram regarding deleting student.
To delete a tutorial, the user provides the tutorial ID. The system verifies the existence of the tutorial and then removes it, updating any students assigned to it. The sequence diagram of deleting tuorial is similar to deleting student.
To delete an assignment, the user specifies the assignment title. The system ensures that the assignment exists before deleting it from the model. The activity diagram below illustrates what the series of actions the user should do to delete assignment.
To delete a student's attendance record for a specific date and tutorial, the user provides the student ID, tutorial ID, and date. The diagram is also similar to adding attendance, thus is not given.
Alternative 1 (Current Implementation):
Description:
The current implementation utilizes specific delete commands for different entities (DeleteCommand for students, DeleteTutorialCommand for tutorials, etc.). Each command class handles the deletion logic pertinent to its entity type. Parsing and validation are handled in dedicated parser classes, and the model updates are performed through methods in ModelManager.
Pros:
Cons:
Alternative 2: Unified Delete Command with Type Specification
Description:
An alternative design is to implement a single DeleteCommand that can handle deletion of different entity types based on additional arguments specifying the type (e.g., student, tutorial, assignment).
Pros:
Cons:
Decision:
We chose Alternative 1 because it promotes modularity, clarity, and maintainability. By having separate commands and parsers for each entity type, we can encapsulate the specific logic and validation required for each. This separation makes the codebase more organized and easier to extend or modify. Although there is some code duplication, the benefits of clarity and reduced complexity outweigh the drawbacks.
Team size: 5 people
In the current implementation of the attendance marking feature, the system does not validate the dates entered by users. This allows users to mark attendance for tutorial dates that have not yet occurred. In future updates, the system will include a date validity check to ensure attendance can only be marked for past or current dates.
If you try to enter a name that contains / the application will show error message about invalid format for NAME but someone can have / in their legal name e.g Prabhat S/O Radhe, this limitation arises due to usage of / character for Internal use within the application. We plan to implement a stronger parser function in the future version to tackle with this legal name restriction on the character of /.
In the current UI implementation, when some fields get too long where they exceed the width of the panel/window, some expected behaviors occur. For example, Name: is replaced by ... and the text is not wrapped properly. We plan to solve this issue by adding a sliding window in the future.
For some commands, duplicated tags are not handled properly. For example, deleteTut and assignment-related commands have unexpected behavior when multiple tags are specified.
Example command:
addAsg n/Assignment 1 d/2024-01-01 2359 d/2024-02-04 1200 ignores the first deadline tag and creates an assignment with deadline 2024-02-04 1200 only instead of alerting the user that multiple prefixes are provided. This behavior applies to other tags and some other commands as stated above.
We are planning to solve all of these unexpected behaviors in future versions by adding a layer of checking of prefixes.
After editing student details in the student panel card on the right, the student card on the left will not display instantly. Users will need to re-click the student panel card to refresh the student card. In future implementations, we plan to make the student card instantly responsive to enhance user experience.
Assignment title, student ID and tutorial ID are currently case-sensitive as we have the format for the user to follow. Assignment title, student ID and tutorial ID will be implemented as case-insensitive in the future version to enhance the flexibility of the application command.
Currently, examples of tutorial names given in our application are misleading as we use different module codes even though it is only catered to one module. We plan to use clearer examples for tutorial names in the future by fixing it to the context of one module (e.g. CS2103T).
The error output of certain commands when a compulsory field missing in current implementation is not specific enough. For example, the error output for addStu s/A1234567X will be better to be ‘name field is missing’. However, the current UI implementation will display the error message: “Invalid command format”, which may not be specific enough. This example applies to other commands that require a compulsory field or fields.
Currently, the UI does not show the list of tutorials and assignments permanently. This causes some inconvenience to the users, as they have to constantly list assignments and tutorials. Hence, we plan to add the tutorial and assignment list display in future versions for the ease of usage.
In the current implementation, certain commands could be enhanced to provide more specific feedback for empty lists and invalid inputs. For instance, when executing list commands for students, assignments, or tutorials (list, listAsg, listTut), a generic success message appears even if the respective list is empty, which could be more informative. Displaying a message such as "No students/assignments/tutorials in the list" would provide clearer feedback for users. Additionally, mark attendance and delete attendance commands currently give a general error message ("Date should be valid and in correct format (yyyy-MM-dd)!") when an invalid date is entered (e.g., "2024-02-32"). Enhancing this feedback to distinguish between invalid formats and dates would improve user experience by clearly indicating whether the error is due to format issues or an invalid date.
Target user profile:
Value proposition: manage students' tasks and attendance faster than a typical mouse/GUI driven app
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
* * * | tutor | add student data | add student information efficiently |
* * * | tutor | delete student data | delete student information efficiently |
* * * | tutor | record student attendance daily through a CLI command | track student participation |
* * * | tutor | create assignments for students | assign tasks to students |
* * | tutor | edit student data | manage student information efficiently |
* * | tutor | list all students | see all students enrolled in the course |
* * | tutor | add tutorials | organize students into specific sessions or groups |
* * | tutor | list all tutorials | review all tutorial sessions currently available |
* * | tutor | delete a tutorial | manage tutorials efficiently by removing sessions that are no longer needed |
* * | tutor | add assignments | add assignment information efficiently |
* * | tutor | delete assignments | manage assignments efficiently by removing tasks that are no longer relevant |
* * | tutor | list all assignments | see all assignments I have created for the students |
* * | tutor | mark assignments as completed or pending | track the progress of each student |
* * | tutor | unmark assignments as completed | correct any mistakes in assignment status updates |
* * | tutor | check assignment status for a student | monitor individual student progress on given assignments |
* * | tutor | mark student attendance | keep track of each student's participation in the tutorials |
* * | tutor | unmark student attendance | correct mistakes in attendance marking |
* * | cross-platform user | run the application on any platform (Windows, Linux, OS X) without any OS-specific dependencies | use it anywhere |
* * | convenience-seeking educator | use the application without an installer | use it directly from the downloaded JAR file |
* | self-learning user | use interactive help commands | understand how to use the application without referring to external documentation |
(For all use cases below, the System is the TrackMate and the Actor is the National University of Singapore teaching assistants, unless specified otherwise)
Use case ends.
2a. User enters incomplete or invalid student details:
Use case resumes at Step 3.
2b. Duplicate student id found:
Use case resumes at Step 3.
Use case ends.
2a. Invalid tutorial id or name format entered:
Use case resumes at Step 3.
2b. Duplicate tutorial id found:
Use case resumes at Step 3.
Use case ends.
2a. User enters an invalid attendance date (correct date format: yyyy-MM-dd)
Use case resumes at Step 3.
2b. User enters the student information wrongly.
Use case resumes at Step 3.
Use case ends.
2a. User enters an invalid due date (incorrect date format: yyyy-MM-dd)
Use case resumes at Step 3.
2b. Duplicate assignment name found:
Use case resumes at Step 3.
Use case ends.
2a. Invalid student index is entered
Use case resumes at step 3.
2b. detect error in any updated information entered (invalid format)
Use case resumes at step 3.
2c. updated information is the same as current information
Use case ends.
Use case ends.
2a. Invalid student index is entered
Use case resumes at step 3.
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
Prerequisite: Download the jar file and copy into an empty folder
Test case: Double-click the jar file
Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
Saving window preferences
Prerequisite: Resize the window to an optimum size. Move the window to a different location. Close the window.
Test case: Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained.
Tip: Replace "INVALID_ID" with "A12345678X" and "INVALID_TUT" with "T12345" for testing purpose here
Sample error message indicating that invalid command format: Invalid command format!
Sample error message indicating that the student ID format is invalid: Student ID should be in the format: 'A' followed by seven digits and an uppercase character.
Sample error message indicating that the tutorial ID format is invalid: Tutorial class should be in the format of Txxxx where xxxx are four digits.
Prerequisite: Ensure that the tutorial T1001 exists in the system.
Adding a student with all required details
addStu n/John Doe s/A1234567X c/T1001Adding a student with missing compulsory fields
Test case: addStu n/John Doe c/T1001
Expected: Error message indicating that invalid command format will output.
Test case: addStu s/A1234567X c/T1001
Expected: Error message indicating that invalid command format will output.
Adding a student with invalid data
Test case: addStu n/John Doe s/INVALID_ID c/T1001
Expected: Error message indicating that the student ID format is invalid.
Test case: addStu n/John Doe s/A1234567X c/INVALID_TUT
Expected: Error message indicating that the tutorial ID format is invalid.
Test case: addStu n/John Doe s/INVALID_ID c/INVALID_TUT
Expected: Error message indicating that the student ID format is invalid. Invalid student ID format will be prioritised over invalid tutorial ID in this case.
Prerequisite 1: At least one student exists in the list. For example, a student at index 1.
Prerequisite 2: Ensure that the tutorial T2001 exists in the system.
Prerequisite 3: Ensure that no student with student ID "A7654321X" exists in the system.
Editing a student's details
edit 1 n/Jane Smith s/A7654321X c/T2001Editing a student with some fields missing
edit 1 n/Jane SmithEditing a student with invalid command format
edit 0 n/Jane SmithPrerequisite: List all students using the
listcommand. Multiple students in the list.
Deleting a student while all students are being shown
Test case: deleteStu 1
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated.
Test case: deleteStu 0
Expected: No student is deleted. Error details shown in the status message. Status bar remains the same.
Other incorrect delete commands to try: deleteStu, deleteStu x, ... (where x is larger than the list size)
Expected: Similar to previous.
Test case: deleteStu 1
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated.
Test case: deleteStu 0
Expected: No student is deleted. Error details shown in the status message. Status bar remains the same.
Other incorrect delete commands to try: deleteStu, deleteStu x, ... (where x is larger than the list size)
Expected: Similar to previous.
Prerequisite: Student with ID "A1234567X" exists and is assigned to tutorial "T1001".
Marking a student's attendance for a tutorial session
markAtt s/A1234567X c/T1001 d/2023-10-21Marking attendance for a student not in the tutorial
markAtt s/A1234567X c/T2001 d/2023-10-21Marking attendance with invalid date format
markAtt s/A1234567X c/T1001 d/21-10-2023Note: Users are expected to use the command listAsg to find out the assignment names before marking or unmarking. This is explained under tip for User Guide Section 4.3.3.
Marking/Unmarking a student's assignment status for a specific assignment.
Prerequisites: Student at specified index exists and assignment with specified name exists (case-sensitive).
Test case: markAsg 1 n/Assignment 1 where the student's assignment status is not marked before.
Expected: Assignment marked successfully!
Test case: markAsg 1 n/Assignment 1 where the student's assignment status is marked before.
Expected: Assignment marked successfully!
Test case: unmarkAsg 1 n/Assignment 1 where the student's assignment status is previously marked as completed.
Expected: Assignment unmarked successfully!
Test case: unmarkAsg 1 n/Assignment 1 where the student's assignment status is previously incomplete.
Expected: Assignment unmarked successfully!
Note: Repeated marking or unmarking actions on the same assignment (e.g., marking an already marked assignment) yield the same success message. This is because write after write operation does not affect the usage. Same message is displayed to avoid users' confusion.
Marking/Unmarking a student's assignment status with invalid/missing index.
markAsg 0 n/Assignment 1unmarkAsg 1000 n/Assignment 1 where student at index 1000 does not exist.markAsg n/Assignment 1Marking/Unmarking a student's assignment status with invalid/missing assignment name.
markAsg 1 n/lorem ipsum where assignment with name "lorem ipsum" does not exist.unmarkAsg 1 n/ where assignment has empty name.Dealing with missing data files
Dealing with corrupted data files