ChatGPT was heavily used to help create test case templates, although the ideas behind the test cases were mostly thought by the developers.
We would also like to acknowledge group CS2103T-W14-1 as we followed a similar format for the command explanations in the user guide based on their user guide,
and group CS2103-F10-2 as we followed their test cases for saving data based on their developer guide.
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, ClientListPanel, 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 Client 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("inputString") API call as an example.
inputString refers to any valid addClaimCommandInput that can be passed in.
Note: The lifeline for AddClaimCommandParser 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., AddClaimCommandParser) and uses it to parse the command.Command object (more precisely, an object of one of its subclasses e.g., AddClaimCommand) which is executed by the LogicManager.Model when it is executed (e.g. to add a claim to a client).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,
Client objects (which are contained in a UniqueClientList object).Client objects (e.g., results of a search query) as a separate filtered list which is exposed to outsiders as an unmodifiable ObservableList<Client> 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,
AddressBookStorage 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.address.commons package.
Target user profile: Insurance Agents
Value proposition: Our app helps insurance agents effortlessly manage new and existing clients, offering features for tracking insurance plans and claims, all while staying organised and efficient."
Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *
| Priority | As a … | I want to … | So that I can… |
|---|---|---|---|
* * * | new user | view the help page | refer to instructions when I forget how to use the app |
* * * | basic user | add a client | keep track of client's contact details |
* * * | basic user | delete a client | remove client's contact details that I no longer need |
* * | intermediate user | edit a client | update client's contact when necessary |
* * * | basic user | list all clients | view all clients in the app |
* * * | efficient user | find a client by name | quickly retrieve client's contact without looking through all my contacts |
* * * | basic user | add an insurance plan to a client | keep track of the insurance plan the client has purchased |
* * * | basic user | delete an insurance plan from a client | remove an insurance plan that was previously purchased by the client |
* * | intermediate user | add a claim to an insurance plan purchased by a client | keep track of a claim filed against an insurance plan |
* * | intermediate user | delete a claim from an insurance plan purchased by a client | remove a wrongly-added claim from an insurance plan |
* * | intermediate user | close a claim filed against an insurance plan purchased by a client | mark the claim as closed |
* * | intermediate user | list all claims of a client | view all claims filed for the various insurance plans purchased by the client |
* | frequent user | customise the theme of the app | change the theme according to my mood and liking |
* * | basic user | clear all contacts from the app | quickly reset my app to an empty state |
* * * | basic user | exit the app | close the app when I am done using it |
(For all use cases below, the System is the InSUREance and the Actor is the user, unless specified otherwise)
Use case 01: Add a client
MSS
Use case ends.
Extensions
1a. Client details are invalid.
Steps 1a1-1a2 are repeated until the data entered is correct
Use case resumes from step 3.
1b. Client name is identical to another client that already exists inside the system.
Use case resumes from step 2.
MSS
Use case ends.
Extensions
1a. Client index is invalid.
Steps 1a1-1a2 are repeated until the index is valid.
Use case resumes from step 2.
Use case 03: Delete a client
MSS
Use case ends.
Extensions
Use case 04: Select an insurance plan
MSS
Use case ends.
Extensions
1a. The insurance plan id is invalid.
Use case ends.
1b. The client does not support the specified insurance plan.
Use case ends.
Use case 05: Add an insurance plan to a client
MSS
Use case ends.
Extensions
3a. The client already has the given insurance plan.
Use case ends.
Use case 06: Remove an insurance plan from a client
MSS
Use case ends.
Use case 07: View all claims of a client
MSS
Use case ends.
Extensions
2a. There are no claims for the client.
Use case ends.
Use case 08: Select a claim of a client
MSS
Use case ends.
Extensions
1a. Claim ID is invalid.
Use case ends.
Use case 09: Add a claim to a client
MSS
Use case ends.
Extensions
1a. The claim already exists for the client.
Use case ends.
Use case 09: Close a claim for a client
MSS
Use case ends.
Extensions
1a. The claim has already been closed for the client.
Use case ends.
17 or above installed.Basic Insurance Plan : 0 and Travel Insurance Plan : 1.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
InSUREance.jar and copy it into an empty folder.java -jar InSUREance.jar to launch the app.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 using the command java -jar InSUREance.jar
Expected: The most recent window size and location is retained.
Deleting a client while all clients are being shown
Prerequisites: List all clients using the list command. Multiple clients in the list.
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.
Test case: delete 0
Expected: No client 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 number of clients displayed)
Expected: Similar to previous.
Dealing with missing data files
Delete config.json and re-launch the app. Expected: New config.json created. Existing data is not affected.
Delete preferences.json and re-launch the app. Expected: New preferences.json created. Existing data is not affected.
Edit the line "addressBookFilePath" : "data/addressbook.json" to "addressBookFilePath" : "data/data.json" and re-launch the app. Expected: App starts on clean slate (i.e. with sample data only).
Delete data/ or data/addressbook.json. Expected: New data/addressbook.json created. App starts on clean slate (i.e. with sample data only).
Dealing with corrupted data files
"newField" : "newField" to a client. Expected: All data is lost. The app starts on a clean slate."insurancePlans" field from a client. Expected: All data is lost. The app starts on a clean slate.Do note we have 4 members in our group.
A single claim ID can be added to multiple users. i.e. B1100 can be added to both client A and client B with no error.
This will be fixed in a future version such that claim ID is unique across all clients.
Claim amount can currently exceed 1 million. In the future, a restriction will be placed on the claim amount such that if the claim amount is over 1 million, it will be rejected with an appropriate error message. This is in line with our restriction on claim amount (claim amount cannot exceed 1 million).
Currently, the way the system checks if a person is a duplicate is simply by checking if the person has the same name or not. However, in future versions, we are planning to check if all details are the same before flagging it as a duplicate. This is because 2 people can share numbers, address and emails (eg a parent and child) or 2 clients can have the same full name with different contact details, but it will be unreasonably rare for clients to have the same name, number, email and addresses simultaneously.
Currently, our app does not allow some common names with some special characters to be entered. An example is "s/o" or "d/o". This will be fixed in a future version because we will change the way we parse the add and edit commands.
Currently, if the name, tags or other details are very long, they are cut off in the UI. This will be fixed in a future version by enabling wrapping for texts in the UI such that they are more easily viewable.
This may not be ideal when you want to find clients by what insurance plans they have. This will be supported in a future version when we enhance the find function to search by finding insurance plans.
Command keywords are currently case-sensitive i.e. add is a valid command but Add is not. For user convenience, we
will make command keywords case-insensitive in a future update by parsing the prefixes differently.
Most of the difficulty in our project stems from the challenge of trying to integrate mutable objects into an established immutable project. While we knew the project was developed based on the principles of immutability, we felt in our case, it was better to use mutable objects for insurance plans and claims as the lists and claims were objects that were changed frequently unlike details that were currently found in addressbook level-3 such as names, emails and phone numbers. This would allow future developers to also work more easily with the given code base as adding and removing plans, introducing new insurance related features would be much more easily implemented with less code. We also wanted to challenge ourselves to see if this was possible at all.
The biggest hurdle to overcome with this project was modifying the testing methods. The test methods were mostly designed for immutable objects and there were strict tests like JsonSerializableAddressBookTest which were the most difficult to pass. This is because the test compares the hardcoded file of clients to a generated file of clients. However, at first since we were making the objects mutable, the generated file becomes different in comparison to the hardcoded file ONLY during the full testing sequence. When the test was done individually, the test passes. We scratched our heads over this for a very long time and eventually managed to solve this problem by changing the equals method for Client object and also the InsurancePlansManager object.
However, this fix initially caused other tests break. This includes tests like addClaimCommandTest.java as the assertCommandSuccess method in TestUtil.java did not compare actual and expected models correctly. This meant that even if there were some changes in the insurance plan manager, sometimes the two models are evaluated as equal to each other. We then had to create new assert methods for commands (like assertInsuranceCommandSuccess) for all the insurance plan related objects.
Our implementations were at least as difficult compared to half of AB-3 effort. While we did not have to create many huge structures from scratch like the ModelManager, Logic and Storage components, we had to work with moving parts compared to AB-3. AB-3 does not support any form in automatic sorting. However, since we wanted a quick and easy way for insurance managers to view their most critical claims, we implemented an automatic sorting of claims for each client to show their respective open claims first.
Lastly, as our project involved money, a sensitive value that has to be precise and accurate, we decided to store all values in cents. This was to avoid having to use float (and having issues with floating point accuracy). However, this led to greater care required to parse and convert values to cents and ended up being a very time-consuming method to unit test. This method was still not completely fixed (the constraint of a maximum claim amount of $1 Million was yet to be implemented).