From 20dc87212cdbaecb5451ffe08c36fa6edae43d1a Mon Sep 17 00:00:00 2001 From: shuckycheese Date: Fri, 8 Nov 2024 01:27:48 +0800 Subject: [PATCH 1/3] Add manual testing guide --- docs/DeveloperGuide.md | 359 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 330 insertions(+), 29 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 6162023b36d..a465caeb16a 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -99,17 +99,25 @@ The sequence diagram below illustrates the interactions within the `Logic` compo **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. -Here is another example of interactions within the `Logic` component, taking `execute("del_appt 1")` API call as an example. +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 person).
+ 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 is another example of interactions within the `Logic` component, taking `execute("delappt 1")` API call as an example. -How the `Logic` component works: +Using this -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. -1. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `DeleteCommand`) which is executed by the `LogicManager`. -1. The command can communicate with the `Model` when it is executed (e.g. to delete a person).
- 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. -1. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`. +1. When `Logic` is called upon to execute the `delappt 1` command, it is passed to an `AddressBookParser` object which in turn creates a `DeleteCommandParser` and uses it to parse the command. +2. This results in a `DeleteAppointmentCommand` object which is executed by the `LogicManager`. +3. The command can communicate with the `Model` when it is executed (e.g. to delete aa appointment from a person).
+ 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: @@ -490,6 +498,22 @@ testers are expected to do more *exploratory* testing. +### Patient Management commands + +1. Lets start by adding in your first new patient using the `add` command. Type in the command `add n/John Doe i/P00001 w/A1 d/Type 1 Diabetes m/Metformin`. Scroll down the patients window to see your newly added patient +2. Add in a few more patients using the add command and changing the parameter values. You may use the following `add` commands + 1. `add n/Kathy Prince i/P00002 w/B1 d/Gastrisitis m/Antacids` + 2. `add n/John Doe i/P00001 w/A1 d/Influenza m/Zyrtec` +3. Let's try editing a patient using the `edit` command. type in the command `edit 1 n/Jack Mack w/A2` +4. Now that you've edited your first patient, lets view that patient to check if their information was edited correctly. Use the `view` command to do so. Type in `view 1` and the patient information should be displayed on the command result box. +5. You can also delete patients by using the `delete` command. Type in `delete 1` to delete the first patient in the list. +6. Next, let's try searching for specific patients using the `find` command. Assuming you've been using the above commands, type in `find n/kathy` and it should only show the patient "Kathy Prince" in the patients list +7. To show all patients again, use the `list` command + +### Notes commands + +1. To add patient notes to a patient, use the `addnotes` command. + ### Launch and shutdown 1. Initial launch @@ -507,27 +531,304 @@ testers are expected to do more *exploratory* testing. 1. _{ more test cases …​ }_ -### Deleting a person +### Adding a patient + +**Command:** `add`
+ +1. Adding a patient with all fields + * * **Prerequisites:** + * No persons in the list. +

+ * **Test Case:** `add n/John Doe i/P00001 w/A1 d/Type 1 Diabetes m/Metformin`
+ * **Expected** A patient with the following fields is added to the list: + * Name: `John Doe` + * ID: `P00001` + * Ward: `A1` + * Diagnosis: `Type 1 Diabetes` + * Medication: `Metformin` + * Notes: `-` + * Appointment: `-` +

+2. Adding a patient without optional fields (DIAGNOSIS and MEDICATION) + * * **Prerequisites:** + * No persons in the list. +

+ * **Test Case:** `add n/Kathy Prince i/P00002/D1 d/Gastrisitis`
+ * **Expected** A patient with the following fields is added to the list: + * Name: `John Doe` + * ID: `P00001` + * Ward: `A1` + * Diagnosis: `Type 1 Diabetes` + * Medication: `-` + * Notes: `-` + * Appointment: `-` +

+ * **Test Case:** `add n/Joshua Lim i/P00003 w/C3 m/Paracetemol`
+ * **Expected** A patient with the following fields is added to the list: + * Name: `Joshua Lim` + * ID: `P00003` + * Ward: `C3` + * Diagnosis: `-` + * Medication: `Paracetemol` + * Notes: `-` + * Appointment: `-` +

+3. Adding a patient without optional fields (DIAGNOSIS and MEDICATION) + * * **Prerequisites:** + * No persons in the list. +

+ * **Test Case:** `add n/Emily Tan i/P00004 w/B2` + * **Expected:** A patient with the following fields is added to the list: + * Name: `Emily Tan` + * ID: `P00004` + * Ward: `B2` + * Diagnosis: `-` + * Medication: `-` + * Notes: `-` + * Appointment: `-` +

+### Editing a patient + +**Command:** `edit`
+ +1. Editing a patient with all fields + * **Prerequisites:** + * Non-empty patient list + * First patient in the list does have fields that match the edited fields +

+ * **Test Case:** `edit 1 n/Jeff Bean i/P10000 w/G5 d/influenza m/paracetomol` + * **Expected:** The first patient in the list is updated with the following fields: + * Name: `Jeff Bean` + * ID: `P10000` + * Ward: `G5` + * Diagnosis: `influenza` + * Medication: `paracetomol` + * Notes: remains unchanged + * Appointment: remains unchanged +

+2. Editing a patient with a few fields + * **Prerequisites:** + * Non-empty patient list + * First patient in the list does have fields that match the edited fields +

+ * **Test Case 1:** `edit 1 n/Samuel Lee` + * **Expected:** The first patient in the list is updated with the following fields: + * Name: `Samuel Lee` + * ID: remains unchanged + * Ward: remains unchanged + * Diagnosis: remains unchanged + * Medication: remains unchanged + * Notes: remains unchanged + * Appointment: remains unchanged +

+ * **Test Case 2:** `edit 1 i/P20001 w/C1` + * **Expected:** The first patient in the list is updated with the following fields: + * Name: remains unchanged + * ID: `P20001` + * Ward: `C1` + * Diagnosis: remains unchanged + * Medication: remains unchanged + * Notes: remains unchanged + * Appointment: remains unchanged +

+ * **Test Case 3:** `edit 1 d/Bronchitis m/Amoxicillin w/D2` + * **Expected:** The first patient in the list is updated with the following fields: + * Name: remains unchanged + * ID: remains unchanged + * Ward: `D2` + * Diagnosis: `Bronchitis` + * Medication: `Amoxicillin` + * Notes: remains unchanged + * Appointment: remains unchanged +

+### Deleting a patient + +**Command:** `delete`
1. Deleting a person while all persons are being shown - - 1. Prerequisites: List all persons using the `list` command. Multiple persons in the list. - - 1. Test case: `delete 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. - - 1. Test case: `delete 0`
- Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. - - 1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)
- Expected: Similar to previous. - -1. _{ more test cases …​ }_ - -### Saving data - -1. Dealing with missing/corrupted data files - - 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_ - -1. _{ more test cases …​ }_ + * **Prerequisites:** + * Non-empty patient list + * List all persons using the `list` command +

+ * **Test Case 1:** `delete 1` + * **Expected:** First patient is deleted from the list. Details of the deleted contact shown in the status message. +

+ * **Test Case 2:** `delete 0` + * **Expected:** No person is deleted. Error details shown in the status message. +

+ * **Test Case 3:** Other incorrect delete commands to try: `delete`, `delete x` (where x is larger than the list size) + * **Expected:** No person is deleted. Error details shown in the status message. +

+### Searching for a patient + +**Command:** `find`
+ +1. Finding patients by their information. + * **Prerequisites:** + * Non-empty patient list +

+ * **Test Case 1:** `find n/Emily Tan` + * **Expected:** Displays all patients with **Name** `Emily Tan`. +

+ * **Test Case 2:** `find i/P00001` + * **Expected:** Displays all patients with **ID** `P00001`. +

+ * **Test Case 3:** `find w/A1` + * **Expected:** Displays all patients with **Ward** `A1`. +

+ * **Test Case 4:** `find d/Diabetes` + * **Expected:** Displays all patients with **Diagnosis** `Diabetes`. +

+ * **Test Case 5:** `find m/Metformin` + * **Expected:** Displays all patients with **Medication** `Metformin`. +

+### Viewing a patient + +**Command:** `view`
+ +1. Viewing a patient's information. + * **Prerequisites:** + * Non-empty patient list +

+ * **Test Case 1:** `view 1` + * **Expected:** Displays the first patients information in the command result box. +

+### Adding notes to a patient + +**Command:** `addnotes`
+ +1. Adding notes to a patient + * **Prerequisites:** + * Non-empty patient list +

+ * **Test Case:** `addnotes 1 pn/patient prone to falling ` + * **Expected:** The first patient in the list is updated with the following fields: + * Name: remains unchanged + * ID: remains unchanged + * Ward: remains unchanged + * Diagnosis: remains unchanged + * Medication: remains unchanged + * Notes: `patient prone to falling` + * Appointment: remains unchanged +

+2. Adding empty patient notes + * **Prerequisites:** + * Non-empty patient list +

+ * **Test Case:** `addnotes 1 pn/` + * **Expected:** WardWatch throws an error informing the user that they are unable to add an empty note to a patient. +

+### Deleting notes from a patient + +**Command:** `delnotes`
+ +1. Deleting notes from a patient that has notes + * **Prerequisites:** + * Non-empty patient list + * First person in the list must have notes +

+ * **Test Case:** `delnotes 1` + * **Expected:** The first patient in the list is updated with the following fields: + * Name: remains unchanged + * ID: remains unchanged + * Ward: remains unchanged + * Diagnosis: remains unchanged + * Medication: remains unchanged + * Notes: `-` + * Appointment: remains unchanged +

+2. Deleting notes from a patient who does not have notes + * **Prerequisites:** + * Non-empty patient list + * First person in the list must not have any notes +

+ * **Test Case:** `delnotes 1` + * **Expected:** WardWatch throws an error informing the user that the patient does not have any notes to delete. +

+### Making an appointment + +**Command:** `makeappt`
+ +1. Adding an appointment to a patient + * **Prerequisites:** + * Non-empty patient list + * The appointment the user adds must not overlap with any existing appointment +

+ * **Test Case:** `makeappt 1 a/ Surgery s/ 01-01-2024-20-00 e/ 01-01-2024-23-00` + * **Expected:** The first patient in the list is updated with the following fields: + * Name: remains unchanged + * ID: remains unchanged + * Ward: remains unchanged + * Diagnosis: remains unchanged + * Medication: remains unchanged + * Notes: remains unchanged + * Appointment: `Surgery FROM 01 January 2024, 08:00 pm TO 01 January 2024, 11:00 pm` +

+2. Adding an appointment that overlaps with other appointments + * **Prerequisites:** + * Non-empty patient list + * The appointment the user adds must overlap with an existing appointment +

+ * **Test Case:** `makeappt 1 a/ Checkup s/ 02-01-2024-20-00 e/ 02-01-2024-23-00` + * **Expected:** Ward watch throws the error message `Appointment overlaps with another pre-existing appointment! Please check your schedule and try again` +

+### Deleting an appointment + +**Command:** `delappt`
+ +1. Deleting an appointment from a patient who has an appointment + * **Prerequisites:** + * Non-empty patient list + * First patient has an appointment +

+ * **Test Case:** `delappt 1` + * **Expected:** The first patient in the list is updated with the following fields: + * Name: remains unchanged + * ID: remains unchanged + * Ward: remains unchanged + * Diagnosis: remains unchanged + * Medication: remains unchanged + * Notes: remains unchanged + * Appointment: `-` +

+2. Deleting an appointment from a patient who has no appointment + * **Prerequisites:** + * Non-empty patient list + * First patient in the list has no appointment +

+ * **Test Case:** `delappt 1` + * **Expected:** Ward watch throws the error message `The Patient indicated does not have an appointment` +

+### Showing appointments on a particular date + +**Command:** `scheduledate`
+ +1. Show schedule on a particular date which has appointments + * **Prerequisites:** + * Non-empty patient list + * At least one patient has an appointment + * The date that you pass into the command as input has at least one appointment +

+ * **Test Case:** `scheduledate 01-01-2024` + * **Expected:** WardWatch will give a message stating the number of appointments listed on that date and the appointment list will show all of those appointments. +

+2. Show schedule on a particular date which has no appointments + * **Prerequisites:** + * Non-empty patient list + * The date that you pass into the command as input has 0 appointments +

+ * **Test Case:** `scheduledate 02-01-2024` + * **Expected:** WardWatch shows the message `0 appointments on 02 January 2024 listed` and the appointments list shows no appointments. +

+### Showing all appointments + +**Command:** `scheduleall`
+ +1. Show all appointments + * **Prerequisites:** + * Non-empty patient list + * At least one patient has an appointment +

+ * **Test Case:** `scheduleall` + * **Expected:** WardWatch shows the message `Displayed all appointments` and the appointment list will show all appointments. +

From 4fb6981d320ffdc0a7850a0ba9c31d4caa375c93 Mon Sep 17 00:00:00 2001 From: shuckycheese Date: Fri, 8 Nov 2024 01:43:00 +0800 Subject: [PATCH 2/3] Remove extra repeated info --- docs/DeveloperGuide.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index d5c578bc39c..af9e62a7a32 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -644,22 +644,6 @@ testers are expected to do more *exploratory* testing. -### Patient Management commands - -1. Lets start by adding in your first new patient using the `add` command. Type in the command `add n/John Doe i/P00001 w/A1 d/Type 1 Diabetes m/Metformin`. Scroll down the patients window to see your newly added patient -2. Add in a few more patients using the add command and changing the parameter values. You may use the following `add` commands - 1. `add n/Kathy Prince i/P00002 w/B1 d/Gastrisitis m/Antacids` - 2. `add n/John Doe i/P00001 w/A1 d/Influenza m/Zyrtec` -3. Let's try editing a patient using the `edit` command. type in the command `edit 1 n/Jack Mack w/A2` -4. Now that you've edited your first patient, lets view that patient to check if their information was edited correctly. Use the `view` command to do so. Type in `view 1` and the patient information should be displayed on the command result box. -5. You can also delete patients by using the `delete` command. Type in `delete 1` to delete the first patient in the list. -6. Next, let's try searching for specific patients using the `find` command. Assuming you've been using the above commands, type in `find n/kathy` and it should only show the patient "Kathy Prince" in the patients list -7. To show all patients again, use the `list` command - -### Notes commands - -1. To add patient notes to a patient, use the `addnotes` command. - ### Launch and shutdown 1. Initial launch @@ -675,7 +659,6 @@ testers are expected to do more *exploratory* testing. 1. Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained. -1. _{ more test cases …​ }_ ### Adding a patient From 69c82361fdc120f323bfbee05cae1d603acd674c Mon Sep 17 00:00:00 2001 From: shuckycheese Date: Fri, 8 Nov 2024 14:00:42 +0800 Subject: [PATCH 3/3] Fix formatting --- docs/DeveloperGuide.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index af9e62a7a32..547fd5c4ff1 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -665,8 +665,8 @@ testers are expected to do more *exploratory* testing. **Command:** `add`
1. Adding a patient with all fields - * * **Prerequisites:** - * No persons in the list. + * **Prerequisites:** + * No patients in the list

* **Test Case:** `add n/John Doe i/P00001 w/A1 d/Type 1 Diabetes m/Metformin`
* **Expected** A patient with the following fields is added to the list: @@ -679,9 +679,9 @@ testers are expected to do more *exploratory* testing. * Appointment: `-`

2. Adding a patient without optional fields (DIAGNOSIS and MEDICATION) - * * **Prerequisites:** - * No persons in the list. -

+ * **Prerequisites:** + * No patients in the list +

* **Test Case:** `add n/Kathy Prince i/P00002/D1 d/Gastrisitis`
* **Expected** A patient with the following fields is added to the list: * Name: `John Doe` @@ -703,8 +703,8 @@ testers are expected to do more *exploratory* testing. * Appointment: `-`

3. Adding a patient without optional fields (DIAGNOSIS and MEDICATION) - * * **Prerequisites:** - * No persons in the list. + * **Prerequisites:** + * No patients in the list

* **Test Case:** `add n/Emily Tan i/P00004 w/B2` * **Expected:** A patient with the following fields is added to the list: @@ -774,19 +774,19 @@ testers are expected to do more *exploratory* testing. **Command:** `delete`
-1. Deleting a person while all persons are being shown +1. Deleting a patient while all patients are being shown * **Prerequisites:** * Non-empty patient list - * List all persons using the `list` command + * List all patients using the `list` command

* **Test Case 1:** `delete 1` * **Expected:** First patient is deleted from the list. Details of the deleted contact shown in the status message.

* **Test Case 2:** `delete 0` - * **Expected:** No person is deleted. Error details shown in the status message. + * **Expected:** No patient is deleted. Error details shown in the status message.

* **Test Case 3:** Other incorrect delete commands to try: `delete`, `delete x` (where x is larger than the list size) - * **Expected:** No person is deleted. Error details shown in the status message. + * **Expected:** No patient is deleted. Error details shown in the status message.

### Searching for a patient @@ -854,7 +854,7 @@ testers are expected to do more *exploratory* testing. 1. Deleting notes from a patient that has notes * **Prerequisites:** * Non-empty patient list - * First person in the list must have notes + * First patient in the list must have notes

* **Test Case:** `delnotes 1` * **Expected:** The first patient in the list is updated with the following fields: @@ -869,7 +869,7 @@ testers are expected to do more *exploratory* testing. 2. Deleting notes from a patient who does not have notes * **Prerequisites:** * Non-empty patient list - * First person in the list must not have any notes + * First patient in the list must not have any notes

* **Test Case:** `delnotes 1` * **Expected:** WardWatch throws an error informing the user that the patient does not have any notes to delete.