Developer Guide
- Acknowledgements
- Setting up, getting started
- Design
- Implementation
- Documentation, logging, testing
- Appendix: Requirements
- Use Cases
Acknowledgements
- Thanks to Prof Damith C.Rajapakse and Boyd Anderson provide consulation for our tem.
- Thanks to the project team AY2122S1-TIC4001-F18-2.
Setting up, getting started
Refer to the guide Setting up and getting started.
Design
- Architecture
- UI component (CLI, Input/ Output)
- Logic component (Execution, Command, Parser)
- Model component (Item, Expense, Income)
-
Storage component API: Storage.java
The Storage component,
a. can save expenses.txt file to/filefolder and load the expenses.txt file back/filefolder with corresponding format.
b. auto save when user execute edit, delete and add expense/ income command
File formatshowing as below,Here are the items in your list: 1.[E] [Meal] lunch ($40.0) (2021-Dec-01) 2.[I] [OctSalary] salary ($4000.0) (2021-Dec-01) - Common classes (ItemList)
Class diagram (refer to the image below)

Object diagram

Implementation (Sequence Diagram)
- Find Command
The user executefind KEYWORDcommand to search items containKEYWORDin the item list.
The working flow of the findCommand is shown in the sequence diagram below.

- Exit Command
The user executeexitcommand to quit the program.
The working flow of the exitCommand is shown in the sequence diagram below.

- List Command
The user executelistcommand to show all the items in the list.
UI scannedlistcommand from user,Executioncreate a newListCommandandrun()to get the items from Arraylist, itemList return the items to UI and show to user.
- Delete Command
The user executedelete 5command to delete the 5th item in the item list.
TheExecutiontype variable will be generated after user input scanned and in execution variable, theDeletecommand will be created andrun()method inDeleteclass will be executed to remove the 5th item. After the item be removed, the delete information will be printed to show user which the deleted item’s details and remaining item quantity in the item list.

- Summary Command
The user executesummarycommand to print the summary of usage.
UI scannedsummarycommand from user input,Executioncreate a newSummaryCommandandrun()to print summary informtion.

- Add Command
The user executeexpense lunch /food /12 /12-10-2021command to add expense item to item list.
The user executeincome Company A /salary /2000 /01-10-2021command to add income item to item list.
UI scannedexpenseorincomecommand from user,Executioncreate a newAddExpenseCommandor newAddIncomeCommand.
Executerun()andaddExpenseoraddIncomeitems to item list and store the item list.
After file store successfully to file storage, return the items to UI and show to user.

Documentation, logging, testing
-
Testing Guide
There are two ways to run tests:- Using IntelliJ JUnit test runner. Run all tests, right-click on the
src/test/javafolder </br> a. chooseRun‘All Tests’ </br> b. Run a subset of tests, you can right-click on a test package, test class and selectRun‘ParserTest’ </br> - Using Gradle Open a console and run the command gradlew clean test (Mac/Linux: ./gradlew clean test)
- Using IntelliJ JUnit test runner. Run all tests, right-click on the
-
Logging Guide
- We are using java.util.logging package for logging.
- The Logger class is used to manage the logging levels and logging destinations.
- The Logger for a class can be obtained using Logger.getLogger(Class) which will log messages according to the specified logging level.
- Log messages are output to a
/log/*.logfile by settinglogger.setUseParentHandlers = falseto disable showing on console output. The logger collectDeleteCommand,ListCommandclass and etc. - The output logging level by
Level.INFO
Appendix: Requirements
Product scope
Target user profile
- has a need to manage and track incomes and expenses
- prefers desktop apps over other types
- prefers typing to mouse interactions
- is reasonably comfortable using CLI apps
Value proposition
- keep record of income and expense items
- track income and expense items easily
- analyse daily / monthly expense
User Stories
| Version | As a … | I want to … | So that I can … |
|---|---|---|---|
| v1.0 | user | add expense item with description and amount | know how much I spent on the item |
| v1.0 | user | view all the expense items | know number of expense items |
| v1.0 | user | delete the expense item | remove the expense item with wrong information |
| v1.0 | user | have exit command | quit the system without using mouse |
| v2.0 | user | add income item with description and amount | know how much I earned on the item |
| v2.0 | user | sort the list in descending order of the amount | view the highest expenses quickly |
| v2.0 | user | record the date of items | know when the items incurred |
| v2.0 | user | classify items into categories | the distribution of my expenditure |
| v2.0 | user | search items with keyword | view the specific item quickly |
| v3.0 | user | sort the list in descending order of the date | know the most recent expenses quickly |
| v3.0 | user | edit the item without deleting it | rectify the item with wrong information quickly |
| v3.0 | user | get summary report of my existing item | know my total income and expense |
| v3.0 | user | save item list as file | print record into hard copy |
| v3.0 | user | read previous items from the file | continue to add items from the previous record |
Use Cases
(For all use cases below, the System is EXPENSES MANAGEMENT SYSTEM (EMS) and the Actor is the user, unless specified otherwise)
Use case: Add Expense
- User keys in expense details
- EMS records the expense
- EMS shows the expense added successfully
- Data files updated automatically
Use case: Add Income
- User keys in income details
- EMS records the income
- EMS shows the income added successfully
- Data files updated automatically
Use case: List Items
- User requests to view items
- EMS shows the list of items
Use case: Delete Item
- User requests to delete a specific item
- EMS deletes the item from the list
- EMS shows the item deleted successfully
- Data files updated automatically
Use case: Find Items
- User keys in the keyword to search
- EMS performs searching
- EMS displays the result
Use case: Edit Item
- User request to edit a specific item with new item details
- EMS updated the item in the list
- EMS shows the item updated successfully
- Data files updated automatically
Use case: Sort Item List
- User request to sort the item list with the specific order
- EMS sorts the list accordingly
- EMS shows the sorted list
Use case: Summarize Items
- User request for summary of the item list
- EMS summarizes the list
- EMS shows the summary report of the list
Use case: Exit
- User requests to exit the program
- EMS terminates safely
Non-Functional Requirements
- Should work on any mainstream OS as long as it has Java 11 or above installed.
- Should be able to hold up to 1000 persons without a noticeable sluggishness in performance.
- The command should be simple enough so that users are able to accomplish most of the tasks faster using typing than using the mouse.
- Should be easy for new users to get used to usage fast.
Glossary
Mainstream OS: Windows, Linux, Unix, OS-X