eugeneyl

This page aims to showcase my contribution to the project In-Credit-Ble done in tandem with the software engineering module (CS2103T). I will first give an introduction to In-Credit-Ble, followed by highlighting the key contributions that i have made in the application. Lastly, I will be including the relevant sections of the User Guide(UG) and Development Guide(DG) that I documented.


PROJECT: In-Credit-Ble

Overview

In-Credit-Ble is a Finance Tracker created in order to assist fellow university students who have difficulty keeping track of their daily expenses due to the multitude of micro-transactions that they encounter in their daily life. By creating a finance tracker with an intuitive and easy-to-use User Interface (UI), we hope to help these students by providing them with a hassle-free platform to manage their expenses.

In-Credit-Ble was developed by a team of five students from the National University of Singapore as part of a Software Engineering module (CS2103T). In a short span of 3 months, we understood the basic structure of a software and adapted the source code of an address book into our finance tracker application. I will be documenting my contributions to this project through the major and minor features implemented for In-Credit-Ble.

Summary of Contributions

This section will provide a summary of my contributions to In-Credit-Ble.

Features Enhancements

Major Enhancement: Implementation of the search feature

I added the ability to find records based on name, category or dates.

What it does: The search command allows the user to search for entries based on keyword that correspond to the entries' name, category or date depending on the user’s choice. The total sum of money spent on all the filtered entries of the search is also displayed to allow user to know how much money he/ she has spent on a particular type of transaction.

Justification: In the midst of numerous entries that the user has recorded in the application, this function will allow the user to filter out certain transactions record that he/ she is interested in or wants to review. Having the total sum of money spent on these records will allow the user to have a better understanding of his/ her spending for a particular category, date or item.

Highlights: This enhancement can be triggered using the 'search' command. This feature is also expandable in filtering out different kind of records by adding additional predicates in which the user can search with (eg. Searching based on amount).

Minor Enhancement:

  1. Introduced the function to add, edit or delete the description parameter of the entries using the already implemented edit command.

    • What it does: Allows user to make changes to the description of the any of the entries that he/ she has inputted into In-Credit-Ble.

    • Justification: This functionality allow the user to make any changes to the description easily, without having the need to create a new entry. Furthermore, being able to delete the description will allow the user to remove unnecessary information shown on the record card in In-Credit-Ble so that he/ she can view his/ her transaction easier.

    • Highlights: This enhancement can be triggered using the edit command. In order to make changes to the description, the user can add the necessary changes after the description prefix(r/). If the user wants to remove the description, he/ she can input the description prefix with nothing after it.

  2. Improved the Spend command to take in current date by default.

    • What it does: If the user does not key in the date field when using the spend command, the current date will automatically be taken as the date instead.

    • Justification: Since a transaction will usually be inputted into In-Credit_Ble on the day of the transaction, having this function allow the user to key in one less parameter when recording his/ her numerous transactions, making it easier and enticing to record his/ her transactions.

    • Highlights: This enhancement can be triggered using the spend command. Having this functionality will make addition of entries easier and more accurate.

Other Notable Contributions:

  • Enhancements to existing features:

    • Updated the restrictions for amount, date to prevent the user from inputted an unwanted value for the 2 fields by accident. (Pull request: #68, #191)

    • Changed all instances of person to record when adapting the address book application to the finance tracker application. (Pull request #58)

    • Wrote the automated tests for the set command and added additional tests for allocate command. (Pull Request: #194)

  • Documentation:

    • Edited the user guide to ensure consistency between the application and the documentations. (Pull Request: #146)

    • Updated the application description in the ReadMe document so that users know what In-Credit-Ble is for. (Pull Request: #9)

  • Issue Managements:

    • Resolved issues surfaced by peers after testing the codes.

  • Community:

    • PR Reviews: To view the pull requests reviewed by me, click here.

Code Contribution

Please click on this link to see the code that I contributed to In-Credit-Ble → Code Contributions.

Contributions to the User Guide

This next section will include my contribution to the User Guide. This showcases my ability in documenting a reader-friendly User Guide that is designed for new users of In-Credit-Ble to understand the different functionality available in our application.

I documented the edit and search command in the user guide. These portions highlight the functions, usage and other relevant information about the 2 commands and is explained in ways that a new user will be able to grasps.

1) Description of Search Command

Searching an entry based on name/category/date: search

You can easily search for entries in the records using a name, category or date as keywords. The total sum of money spent on all the results of the search will also be shown.

Make use of the list command to show the full list of entries again after filtering the entries using the search command.

Alias: find

Format: search FLAG KEYWORD [MORE_KEYWORDS]

Examples:

  • search -cat Accessories

  • search -name cake bread

  • search -date 10/10/2001

SearchByCategoryExample
Figure 1. Example of searching the a long list of records by the category "Accessories".

The total amount of money spent on the searched entries will also be shown in the result display.

TotalSpentInResultDisplay
Figure 2. Total spent on searched records shown in result display.
  • FLAG here refers to either -name, -cat or -date.

  • Only one flag should be provided.

  • If you do not input parameters after the flag, the search result will return with empty list.

2) Description of Edit Command

Editing an entry: edit

You can easily edit any part of an existing entries in In-Credit-Ble.
Index refers to the index number shown in the list.

Alias: e

Format: edit INDEX [n/NAME] [$/AMOUNT] [d/DATE] [c/CATEGORY] [r/DESCRIPTION]

Examples:

  • edit 2 $/10.10

  • edit 1 n/burger c/Food

  • edit 1 r/Best meal I have ever eaten

You can remove the description of any entries by inputting an empty parameter for description.

Example of removing description:

  • edit 1 r/

RemoveDescriptionExample
Figure 3. Example of removing the description from entries
  • INDEX here refers to the index number shown in the displayed records.

  • INDEX must be a positive integer 1, 2, 3, …​

  • INDEX must be within the total number of records that are displayed.

  • At least one of the optional fields must be provided.

  • Name, category and description inputs are limited to 40 characters each.

  • Amount entered cannot be larger than 100,000,000.

  • Date inputted cannot be a date later than the present date.

  • Order of parameters inputted does not matter.

  • Existing values will be updated to the input values.

Contributions to the Developer Guide

This last section will include my contribution to the Developer Guide. It showcases my ability in writing technical documentation and also demonstrates the technical depth of my code contribution.

Application Design

I constructed the class diagrams for the different components of the In-Credit-Ble and explained the interaction within these components. This will allow developers who wish to contribute to our project to easily understand how our application is designed. Due to page constraints, I will only be showing the edits that I made to the Logic and the Model component. To see the contributions I made in documenting the other components of the application, please visit the links below.

1) UI
2) Storage

Logic component


LogicClassDiagram
Figure 4. Structure of the Logic Component


API : Logic.java

  1. Logic uses the FinanceTrackerParser class to parse the user command.

  2. This results in a Command object which is executed by the LogicManager.

  3. The command execution can affect the Model (e.g. adding a record).

  4. The result of the command execution is encapsulated as a CommandResult object which is passed back to the Ui.

  5. In addition, the CommandResult object can also instruct the Ui to perform certain actions, such as displaying help to the user.

Model component


ModelClassDiagram
Figure 5. Structure of the Model Component


API : Model.java

The Model component,

  • stores a UserPref object that represents the user’s preferences.

  • stores the Finance Tracker data.

  • exposes an unmodifiable ObservableList<Record> 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.

  • does not depend on any of the other three components.

Implementation of Search Command

I also documented the design of Search command to give the readers a better understanding of how the search command is implemented and the interactions between the various components of the application in order for the search command to be executed. I also listed the design considerations of the search command in order to explain why the current implementation is chosen instead of the alternative.

Search feature

This feature allows the user to filter out specific expenses based on keywords that correspond to the name, category or date.

This implementation is under Logic and Model Component.


Current Implementation

The search command uses predicates that implement the java.util.Predicate interface. These predicates are used to filter the records that are inputted into the finance tracker. Each of these predicates contain a List<String> of keywords and a test() command that is used to test if a record satisfy the conditions set in the predicate. These predicates are found in the Model component.

Table 1. Predicates implemented in Model component

Types of predicate

Functions

CategoryContainsKeywordsPredicate

Filters out records by a given category

DateContainsKeywordsPredicate

Filters out records by a given date

NameContainsKeywordPredicate

Filters out records with names that matches a keyword

Below is the UML sequence diagram and a step-by-step explanation of an example usage scenario.

SearchCommandSequenceDiagram
Figure 6. Sequence Diagram of Search Command
  1. User enters a search command (eg. search -cat food). The command is received by the UI components and the method LogicManger#execute() is called.

  2. The command is received by FinanceTrackerParser, which then creates a SearchCommandParser Object and calls SearchCommandParser#parse() method.

  3. Depending on the -FLAG that is entered by the user, SearchCommandParser will create different predicates objects that correspond to the -FLAG.

    • If -cat is inputted, CategoryContainsKeywordsPredicate will be created.

    • If -date is inputted, DateContainsKeywordPredicate will be created.

    • If -name is inputted, NameContainsKeywordPredicate will be created.

  4. A SearchCommand Object with the correct predicate Object as parameter is created and returned to the FinanceTrackerParser and then to the LogicManager.

  5. LogicManager then calls SearchCommand#execute(), which calls Model#updateFilteredExpenseList() method to update the predicate of FilterList<Record>. FilterList<Record> now contains a new set of records which is filtered by the new predicate.

  6. SearchCommand then calls getFilteredRecordList method to access the filtered records in an ObservableList<Record> in order to calculate the sum of the money that is spent in all the filtered records.

  7. Then the record list panel will show a set of records according to the keywords. A CommandResult is then created and returned to Logic Manager.


Design Consideration

This feature can be implemented in different ways in terms of how the records are found.

  • Alternative 1 : Check through all records and select those with the matched keywords based on the flag.

    • Pros: Easy to implement without changing original architecture.

    • Cons: Slow. Tends to take a long time to search through large number of records.

  • Alternative 2 : Each time a new category/date is called when making a record, create a new list. Each of these lists will hold all the records that correspond to these category or dates.

    • Pros: Very efficient, each time the command is called, just need to retrieve the list of the wanted field.

    • Cons: Need to change the original architecture of storage to introduce storing of different list corresponding to each tag. Will take up more space if there is many different tags.

We have implemented Alternative 1 as we want the search function to be more dynamic and more generic to accept different kind of search in the future implementation. If we were to choose Alternative 2, the search conditions will only be restricted to category and date where it is likely for different records to have the same value (eg. same date or same category). However, it is not feasible to create a different list for every single name that is inputted into the finance tracker.