From 93c4314d8ad6020abb667cbe4ec8520e2077432b Mon Sep 17 00:00:00 2001 From: solomonng2001 Date: Sun, 14 Apr 2024 23:09:52 +0800 Subject: [PATCH 1/3] Add sort test cases and effort in developer guide --- docs/DeveloperGuide.md | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 25bb90c6f27..c766fe4f5e1 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -929,6 +929,54 @@ testers are expected to do more *exploratory* testing. ### Sorting clients +1. Sorting clients by priority + + 1. Prerequisites: Multiple clients in the client list. + + 2. Test case (valid descending): `sort priority o/desc`
+ Expected: Clients are sorted by priority in descending order. Success message shown in the status message. + + 3. Test case (valid ascending): `sort priority o/asc`
+ Expected: Clients are sorted by priority in ascending order. Success message shown in the status message. + + 4. Test case (invalid order): `sort priority o/invalid`
+ Expected: Clients are not sorted. Error message shown in the status message. + + 5. Test case (invalid criteria): `sort invalid o/asc`
+ Expected: Similar to previous. + +2. Sorting clients by name + + 1. Prerequisites: Multiple clients in the client list. + + 2. Test case (valid ascending): `sort name o/asc`
+ Expected: Clients are sorted by name in ascending order. Success message shown in the status message. + + 3. Test case (valid descending): `sort name o/desc`
+ Expected: Clients are sorted by name in descending order. Success message shown in the status message. + + 4. Test case (invalid order): `sort name o/invalid`
+ Expected: Clients are not sorted. Error message shown in the status message. + + 5. Test case (invalid criteria): `sort invalid o/asc`
+ Expected: Similar to previous. + +3. Sorting clients by birthday + + 1. Prerequisites: Multiple clients in the client list. + + 2. Test case (valid ascending): `sort birthday o/asc`
+ Expected: Clients are sorted by birthday in ascending order. Success message shown in the status message. + + 3. Test case (valid descending): `sort birthday o/desc`
+ Expected: Clients are sorted by birthday in descending order. Success message shown in the status message. + + 4. Test case (invalid order): `sort birthday o/invalid`
+ Expected: Clients are not sorted. Error message shown in the status message. + + 5. Test case (invalid criteria): `sort invalid o/asc`
+ Expected: Similar to previous. + ### Updating last met Command Format: `met index d/YYYY-MM-DD`
Assumptions: Today is 13 April 2024, date chosen must not be in the future.
@@ -1090,6 +1138,12 @@ invalid values if the txt file is edited wrongly. 2. Policies Features 3. Additional Client Traits and Features +Difficulty Level: 3/5
+Effort Required: 3/5
+Challenges faced: When implementing sorting of clients, the challenge was understanding the design principles behind how `ModelManager#filteredPersons` was implemented in AB3. Since this is an iterative project, we had to ensure that the principles were consistent. +For instance, we recognised that `ModelManager#filteredPersons` was an immutable list, and thus our initial implementation of removing the `final` keyword from the `filteredPersons` field was incorrect and broke the design principles. We had to revert this change and design an alternative solution that adhered to the design principles. +This took some time to understand and implement correctly. `Birthday` and `Priority` are extensions of the `Person` model and required classes of their own. `DateUtil` and `DateTimeUtil` classes were additionally created to handle dates and times, which was used widely, and thus had to be well-designed to ensure utility and prevent bugs. +Testing for most features were very extensive, with multiple edge cases and invalid inputs. Quality of design was ensured and priorities over shortcut alternatives. For instance, data structures like `HashMap` was utilised to map string inputs to `PriorityValue` enums. All these quality design required time and effort. 4. GUI From c9a24c841c0074839a68695e646ebc168584f6f6 Mon Sep 17 00:00:00 2001 From: solomonng2001 Date: Sun, 14 Apr 2024 23:29:08 +0800 Subject: [PATCH 2/3] Add sort use case --- docs/DeveloperGuide.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 8e420ac52a8..481d7de1de5 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -606,6 +606,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli Steps 1a1-1a3 are repeated until the data entered are correct.
Use case resumes at step 2. + **Use case: UC05 - View client details and policies** **MSS** @@ -626,7 +627,6 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli Use case ends. - **Use case: UC06 - Find a client by name** **MSS** @@ -647,6 +647,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 1b1. ClientCare lets user know that the list is empty.
Use case ends. + **Use case: UC07 - Adding notes to a client** **MSS** @@ -688,12 +689,19 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli Steps 1a1-1a3 are repeated until the data entered are correct.
Use case resumes at step 2. + **Use case: UC09 - Sort clients** **MSS** -1. PLACEHOLDER +1. User requests to sort clients by `CRITERIA` and `ORDER`. +2. ClientCare sorts the clients by the specified criteria and order. +3. ClientCare shows a success message to the user.
+ Use case ends. **Extensions** +* 1a. ClientCare detects that the given command is invalid. + * 1a1. ClientCare shows an error message. + Use case ends. **Use case: UC10 - Update client as met** @@ -717,6 +725,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 1c1. ClientCare shows an error message.
Use case ends. + **Use case: UC11 - Update last met overdue duration** **MSS** @@ -735,7 +744,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 1b. ClientCare detects that the given input entered is not a non-negative integer. * 1b1. ClientCare shows an error message.
Use case ends. - + + **Use case: UC12 - Schedule an appointment with client** **MSS** @@ -781,6 +791,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 1c1. ClientCare shows an error message.
Use case ends. + **Use case: UC14 - Add policies to client** **MSS** @@ -803,6 +814,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 1c1. ClientCare shows an error message.
Use case ends. + **Use case: UC15 - Delete policies from client** **MSS** @@ -825,6 +837,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 1c1. ClientCare shows an error message.
Use case ends. + ### Non-Functional Requirements 1. Should work on any _mainstream OS_ as long as it has Java `11` or above installed. From c5dab034ba70de75ab366b6fad32a51add5d9c57 Mon Sep 17 00:00:00 2001 From: solomonng2001 Date: Sun, 14 Apr 2024 23:32:44 +0800 Subject: [PATCH 3/3] Add extensions to sort use case --- docs/DeveloperGuide.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 481d7de1de5..9cc08a3dee6 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -702,6 +702,12 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli * 1a. ClientCare detects that the given command is invalid. * 1a1. ClientCare shows an error message. Use case ends. +* 1b. ClientCare detects that the given `CRITERIA` is invalid. + * 1b1. ClientCare shows an error message. + Use case ends. +* 1c. ClientCare detects that the given `ORDER` is invalid. + * 1c1. ClientCare shows an error message. + Use case ends. **Use case: UC10 - Update client as met**