Overview
This project portfolio details my key contributions to the team software engineering project, EYLAH. The team consists of five Year 2 Computer Science undergraduates in the National University of Singapore (NUS), including myself.
We were given six weeks to either morph or enhance an existing Java project, Address Book. We chose to morph the project into EYLAH, a desktop application specifically programmed for students staying in Temasek Hall at the National University of Singapore. It aims to ease their lives at halls by providing them with an application that split bills easily and help them track their diet. The user interacts with it using a CLI and it is programmed using JAVA 11.
My role was to build the Expense Splitter portion of EYLAH and ensure that our project is on schedule for completion.
Summary of contributions
-
Major enhancement:
-
Adding of Item, ItemPrice, ItemName for the Expense Splitter portion of EYLAH (Pull request #127)
-
What it does:
Allows the user to perform theadditem
command successfully hence adding an Entry which consists of an Item into the current Receipt. -
Justification:
These classes are crucial for Expense Splitter to work because this allows the User to input an Item to split among his friends, the crux of Expense Splitter. -
Highlights:
Implementing the ItemPrice was a little tricky because Double should not be used to hold Currency as it will lead to rounding errors. Upon further research on Stack Overflow, I have decided that BigDecimal will be a better type to hold currency. -
Credits:
Online links where I researched on: "https://stackoverflow.com/questions/1359817/using-bigdecimal-to-work-with-currencies"
-
-
Added the ability to deduct Amount owed by a Person when they have paid through
paid
command (Pull request #176)-
What it does:
Allows the user to reduce the amount owed by a Person. -
Justification:
This feature allows a Person to clear his/her debt. In EYLAH after a Person has cleared his/her debt, their name will be deleted to prevent cluttering of names which may confuse the user. Thus it is important to have a feature which reduces the amount of money owed by a Person. -
Highlights:
This enhancement helped our team discover a rather major bug with Expense Splitter workflow. In the event where the user accidentally delete an item in the receipt after his/her peers has paid the user, EYLAH will not work as intended. Fortunately, we resolved it by not allowing users to use thepaid
command until after a receipt has been finalised.
-
-
Added the expense splitter storage component that allowed the user to automatically save a Person and their amount owed after each command (Pull request #148)
-
What it does:
Allows EYLAH to save a Person and the amount they owe after each command. -
Justification:
This feature allows the user to automatically save the amount of money each person owes him after every command. This is important so the user do not have to manually input every entry again in the unlikely event where EYLAH crash. -
Highlights:
Ability to save a Person name and their amount owed automatically.
-
-
-
Minor enhancement:
-
Modified the
paid
command to allow a Person to pay his debt fully
(Pull request #209)-
What it does:
Expanded thepaid
command to accept empty amount field, which meant that the Person paid his debt fully.
Previously:paid 1 3
meant that person at INDEX 1 paid $3.
Now:paid 1
meant that person at INDEX 1 paid the full amount he owes. -
Justification:
This allows the user to conveniently clear a Person debt fully.
-
-
Performed defensive coding for
additem
command andpaid
command
(Pull request #352)-
What it does:
additem
andpaid
commands are commands in expense splitter which includes numerical digits and multiple parameters. As a result, these commands may be exploited when discovering bugs in EYLAH. Common issues includes passing a huge numerical number which causes Integer Overflow or passing a negative index which causes ArrayOutOfBounds Exceptions. Thus I handled these rouge commands by including try-catch statement to catch these exceptions. -
Justification:
This reduces the chances of EYLAH crashing.
-
-
-
Code contributed:[Functional code and Test Code]
-
Other contributions:
-
Project management:
-
In charge of team progress and planning intermediate deadlines to achieve milestones.
-
Ensure that project deliverables are completed on time.
-
-
Enhancements to existing features:
-
Adapted the given Address Book code into EYLAH’s.
-
-
Documentation:
-
Updated Developer Guide to include Paid Command (Pull request #352)
-
Updated Developer Guide to include List Amount Command (Pull request #355)
-
Updated Developer Guide to include List Receipt Command (Pull request #355)
-
Updated Developer Guide to include Expense Splitter main activity diagram (Pull request #252)
-
Updated User Guide to include Paid, List Amount Command (Pull request #349)
-
-
Community:
-
Contributions to the User Guide
Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users. |
Listing the current receipt: listreceipt
In this section, you will learn more about the listreceipt
command, how to use it
and the expected outcome after using the
listreceipt
command.
Summary of List Receipt Command:
listreceipt
shows you all the entries in your current receipt.
How to use the List Receipt Command:
Format:
listreceipt
Valid Example:
listreceipt
Expected outcome:
Additional notes and tips
Each entry in the receipt has the item’s name, price and person(s) who is splitting that item with you thus you do not have to remember who you split this item with! |
Use listreceipt command to find the index of the item in the receipt. The index is useful for commands
such as deleteitem where you have to pass in the index of item to be deleted.
|
Listing amounts owed by each person: listamount
In this section, you will learn more about the listamount
command, how to use it
and the expected outcome after using the
listamount
command.
Summary of List Amount Command: listamount
shows you how much each Person owes you.
How to use the List Amount Command:
Format:
listamount
Valid example:
listamount
Expected outcome:
Additional notes and tips
|
Use listamount command to find the index of the person who paid you. The index is useful for commands
such as paid .
|
Paying money: paid
In this section, you will learn more about the paid
command, how to use it and the
expected outcome after using the
paid
command.
Summary of Paid Command: paid
subtracts the amount of money a Person owes you.
How to use the Paid Command:
Format:
paid INDEX [AMOUNT]
|
Valid examples:
paid 2
- This commmand means that the Person at index 2 has paid you the full amount they owe you.
paid 3 3.90
- This command means that the Perosn at index 3 has paid you $3.90.
Expected outcome:
Additional notes and tips
|
Use listamount command to find the index of the person who paid you.
|
For Expense Splitter
Command | Format | Example |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Contributions to the Developer Guide
Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project. |
Below is the activity diagram of the entire Expense Splitter.
Activity Diagram of Expense Splitter:
SimplifiedAddItemActivityDiagram is not the actual AddItem Activity Diagram. It has been simplified to provide just enough information for the user to know about the rough workflow of Expense Splitter. A more detailed diagram of Add Item can be found in AddItemCommand. |
List Receipt Command
In this section, we will learn more about how the listreceipt
command is implemented.
What is the List Receipt Command
The listreceipt
command allows user to find out the current Items in the receipt.
The listreceipt
command was implemented as a ListReceiptCommand
in the expensesplitter/logic/commands
package.
The listreceipt
has the following input format:
listreceipt
|
The following activity diagram illustrates what happens when a user executes listreceipt
command:
Structure of List Receipt Command
In this section, you will learn more about the relationships between objects related to the ListReceiptCommand
.
The above class diagram shows the structure of the ListReceiptCommand
and its associated classes and
interfaces. Some methods and fields are left out because they are not of concern in ListReceiptCommand
Implementation of List Receipt Command
The following is a detailed explanation of the operations ListReceiptCommand
performs.
-
The
ListReceiptCommand#execute(SplitterModel splitterModel)
method is executed. -
The method
SplitterModel#listReceipt()
will then be called to return the list of entries currently in that Receipt. -
The method
Receipt#toString()
will use StringBuilder to build the string of the Items(s) currently in Receipt by callingEntry.toString()
for entry. After all entries are done,Receipt#toString()
would have finish building the string and will return to SplitterModelManager. -
4. SplitterModelManager will then pass the String into CommandResult where it will be printed under the UI component.
Sequence Diagram for List Receipt Command
The following sequence diagram summarizes what happens during the execution of listreceipt
command.
List Amount Command
In this section, we will learn more about how the listamount
command is implemented.
What is the List Amount Command
The listamount
command allows users to find out how much each Person owes them.
The listamount
command was implemented as a ListAmountCommand
in the expensesplitter/logic/commands
package.
The listamount
command has the following input format:
listamount
|
The following activity diagram illustrates what happens when a user executes listamount
command.
Structure of List Amount Command
In this section, you will learn more about the relationships between objects related to the ListAmountCommand
.
The above class diagram shows the structure of the ListAmountCommand
and its associated classes and
interfaces. Some methods and fields are left out because they are not of concern in ListAmountCommand
Implementation of List Amount Command
The following is a detailed explanation of the operations ListAmountCommand performs.
-
The
ListAmountCommand#execute(SplitterModel splitterModel)
method is executed. -
The method
SplitterModel#listAmount()
will then be called to return the list of Person(s) with their amount. -
PersonAmountBook#toString()
will convert list of person in the list to the expected format and return it to SplitterModelManager. -
SplitterModelManager will then pass the String into CommandResult where it will be printed under the UI component.
Sequence Diagram for List Amount Command
The following sequence diagram summarizes what happens during the execution of listamount
command.
Paid Command
In this section, we will learn more about how the paid
command is implemented.
What is the Paid Command
The paid
command allows user to reduce the amount of money owed by a Person after they
have paid.
The paid
command was implemented as a PaidCommand
in the expensesplitter/logic
package.
The paid
command has the following input format:
paid
INDEX
[AMOUNT]
|
The following activity diagram illustrates what happens when a user executes paid
command:
Structure of Paid Command
In this section, you will learn more about the relationships between objects related to the PaidCommand
.
The above class diagram shows the structure of the PaidCommand
and its associated classes and
interfaces. Some methods and fields are left out because they are not of concern in PaidCommand
Implementation of Paid Command
The following is a detailed explanation of the operations PaidCommand performs.
-
The
PaidCommand#execute(SplitterModel splitterModel)
method is executed. -
The
SplitterModel#paidPerson(Person person, String amountPaid)
will be called. String amountPaid will be converted into an Amount by instantiating a new instance of Amount. -
The
PersonAmountBook#removeAmount(Person person, Amount amount)
is then called to remove Amount from Person. -
This in turns calls
UniquePersonList#removeAmount(Person person, Amount amount)
. -
Lastly,
Person#removeAmount(Amount amount)
is called to subtract the amount from the person.
Sequence Diagram for Paid Command
The following sequence diagram summarizes what happens during the execution of paid
command.
Use case: UC10 - Listing Receipt
Actor: User
Guarantees: All Items in the current Receipt will be listed out.
MSS
-
User requests to list receipt containing Item(s) in the current Receipt.
-
EYLAH displays the list of Item(s) in the current Receipt, its ItemPrice and Person(s) involved in splitting that Item.
Use case ends.
Extensions
-
1a. EYLAH detects an empty Receipt.
-
1a1. EYLAH displays an error message, saying that the Receipt has 0 Item.
Use case ends.
-
Use case: UC11 - Listing Person(s) and the Amount they owe
Actor: User
Guarantees: All Person(s) and the amount they owe will be listed.
MSS
-
User requests to list all the Person(s) and the Amount they owe the user.
-
EYLAH displays the list of Person(s) and the associated Amount they owe they user.
Use case ends.
Extensions
-
1a. EYLAH detects an empty Person list.
-
1a1. EYLAH displays an error message, informing user that there are no Person in the list.
Use case ends.
-
Use case: UC12 - Paying money
Actor: User
Guarantees: Reduces the Amount a Person owes and if they owe $0 the Person
is automatically deleted.
MSS
-
User requests to reduce the Person’s Amount when he/she has paid the user.
-
EYLAH searches for the Person and reduces the Amount they owe the user, if after paying the Person does not owe anything, they are deleted.
-
EYLAH then displays the new Amount owed by the Person.
Use case ends.
Extensions
-
1a. EYLAH detects that the Person has paid more than what he owes.
-
1a1. EYLAH displays an error message, informing the user to key in an Amount lesser or equal to the amount the Person owes.
Use case ends.
-
-
2a. EYLAH detects an empty PersonList.
-
2a1. EYLAH displays an error message, saying that there is no Person in the list.
Use case ends.
-
-
2b. EYLAH detects invalid IndexOfPersonPaid.
-
2b1. EYLAH displays an error message and informs User to key in the correct Index of the person who paid. EYLAH will prompt the user to use
listamount
to find the Index of Person who paid.Use case ends.
-
-
2c. EYLAH detects that the Person does not exist in the list.
-
2c1. EYLAH displays an error message, informing the user to key in the correct index of the Person. EYLAH will prompt the user to use
listamount
to find the Index of Person who paid.Use case ends.
-
List Receipt in Expense Splitter
-
Listing the items contained in the current receipt. The order of items listed depends on the order of items added by the user.
-
ListReceipt Command format:
listreceipt
-
Prerequisites: NIL.
-
Test case:
listreceipt
Expected: If there are items in the receipt: List all items in the current receipt, its price and amount associated with each person involved in splitting that item -
Test case:
listreceipt
Expected: If there are no items in the receipt: EYLAH will inform user that there is no items currently in the receipt.
-
List Amount In Expense Splitter
-
List all the Person(s) and the amount they owe.
-
List Receipt command format:
listamount
-
Test case:
listamount
Expected: If there are Person in the list: List all Person that currently owe the User money. There should not be anyone with $0 as those who do not owe any money will be deleted from the PersonList. -
Test case:
listamount
Expected: If there are no Person in the list: EYLAH will inform user that there no one owes money.
-
Paid Command In Expense Splitter
-
Reduces the amount of money a Person owes.
-
Paid command format:
paid
INDEX
[AMOUNT]
-
Test case:
paid 1 1.10
Expected: Reduces the amount of money the Person at Index 1 owes by $1.10. -
Test case:
paid 1
Expected: Reduces the entire amount of money the Person at Index 1 owes. -
Test case:
paid -1
Expected: EYLAH will inform the user that INDEX is incorrect.
-