View on GitHub

tp

Developer Guide for FinanceIt

Design

Overview of Architecture

Architecture Diagram

There are 5 distinct features that exists within the FinanceIt application, all of which are accessed via the main menu interface facilitated in FinanceIt.java.

The design of the software can be split into 5 distinct components:

Logic Manager Component

Description

The Logic Manager component serves as the bridge between user interface and program operations.
It includes 5 classes:

API

Design decisions

Logic Component

Description

The Logic Component executes logic operations passed via a CommandPacket, by handling individual params contained in the CommandPacket.

API

Design decisions

Input Manager Component

Description

The Input Manager consists of the UiManager class, and the Parser sub-component.

API

Model Component

Description

Represents data and data list in the program, whereby program operations specified by user input can be performed upon.

API

Storage Component

Description

Storage component performs storage of data from Goal Tracker, Manual Tracker and Recurring Tracker. It loads the data upon entry into the program and performs auto save upon exiting the program. Save Manager also added a feature that allow multiple copies of backup data to be saved and loaded.

API

Logging

Description

Some classes facilitate critical operations which need to be logged for debugging purposes. The LoggerCentre class includes all logger instances for such classes throughout the program.

API

Implementation

Module-level Implementation

 

Input Manager

Input Conventions

CommandPacket class

InputParser class

ParamsParser class

 

Logic Managers

Execution

  1. Logic Managers are implemented with a common method: execute(), which utilizes a while loop to maintain a cycle of 2 processes: User input processing and Command handling.

User Input Processing

  1. Logic Managers depend on InputManager module to read user input, parse user input and produce a meaningful CommandPacket instance.
  2. The CommandPacket instance can then be used by the next step of the cycle.

Command Handling

  1. Each Logic Manager will have several methods that are dedicated to handle a single operation. They can typically be identified by a specific naming convention: "handle.....()".
  2. These methods use CommandHandler classes to perform param dependent operations, which involves evaluation of paramMap in the provided CommandPacket instance to decide the operation to perform, be it on Data or DataList.

Error Reporting

  1. While error handling from param parsing is handled by ParamChecker singleton class, there is a need to identify from the execution methods at Logic Managers, whether an exception has been thrown.
  2. This is handled by a try-catch block within the "handle.....()" methods, whereby an exception caught will result in an error message printed. The error message will not be specific to the exact error; rather it generally indicates whether an operation has failed.

Example

    public static void execute() {
        endTracker = false;
        UiManager.printWithStatusIcon(Common.PrintType.SYS_MSG, "Welcome to Manual Tracker!");
        while (!endTracker) {
            endTracker = false;
            handleMainMenu();
        }
    }
    static void handleDeleteLedger() {
        //Retrieves ledger and deletes it
    }

 

Logic

ParamChecker

  1. Contains a set of public static methods which verifies the validity of the raw input provided
  2. If there is nothing wrong with the param, the method will typically return the param supplied without modification.
  3. If the param fails to pass the tests administered within the method, the following procedures will execute:
    1. Log to log file a corresponding error message with WARNING level
    2. Print to console, any applicable error messages.
    3. Throw a common exception: ParseFailParamException
      1. The implication is that the range of exceptions that would have been caught in other parts of the software with regards to param handling, is now consolidated within a single class in the program. The class that uses ParamChecker is only concerned with whether the param is valid or not.

ParamHandler

  1. CommandPacket created from user-input needs to be handled by a particular ParamHandler subclass, depending on what kind of command it is. E.g. CreateEntryHandler handles creating a new Entry.

CommandHandler

  1. Extends ParamHandler class. Individual implementation of handleSingleParams()
    • E.g. CreateEntryHandler handles /desc param, whereas RetrieveEntryHandler does not.
  2. Used within Logic Managers to handle processing of CommandPacket.

Handling of params by XYZCommandHandler:

  1. Initialize the state of the handler
    • XYZCommandHandler#setRequiredParams() sets required Params that need to be parsed successfully to constitute a valid input.
      • E.g. to create a new RecurringEntry, /desc and /day are two of the required params, whereas editing has no required params (provided that at least one param is present).
    • Pass CommandPacket to ParamChecker by calling ParamChecker#setPacket(packet).
  2. Call ParamHandler#handleParams()
    • For everyparamType in the CommandPacket instance, execute XYZCommandHandler#handleSingleParam(packet)
    • If the param parses successfully, it will be added to paramsSuccessfullyParsed, else an Exception will be thrown
  3. Check if the CommandPacket is valid. The below conditions must be satisfied:
    • All params set earlier via setRequiredParams() are parsed with no exceptions thrown. That is, all params in requiredParams is also in paramsSuccessfullyParsed.
  4. If all successful, the entry created is returned. Else, throw InsufficientParamsException().

Feature-level Implementation

 

Manual Tracker & Entry Tracker

Overview

Ledgers and Entries

In this feature, we represent the transactions incurred by the users as Entry instances. Instances of Entry class are categorised by the date of origin, which is represented by Ledger instances.

Entry instances are characterized by the following:

Ledger instances are characterized by the following:

Manual Tracker

The Manual Tracker is a feature that allows users to manage Ledgers with create, delete and open operations. Ledgers is a class that maintains a list of transactions that are recorded for a given date.

The Entry Tracker is fundamentally similar to the Manual Tracker, except it manages Entry instances instead of Ledger. Entry Tracker is initialized when a Ledger instance is “opened”, whereby the Entry Tracker facilitate the manipulation of the collection of Entry instances that are associated with that particular Ledger instance.

For the sake of brevity, this section will focus on the discussion of the Manual Tracker. The edit operation of the Entry Tracker will be discussed at the end of this section; it is sufficiently unique to Manual Tracker operations to merit detailed discussion.

The Manual Tracker is capable of executing the following states of operation:

States Operations
MAIN_MENU Go to main menu for users to choose the available operations
CREATE_LEDGER Create a ledger specified by date, and append it to ledgerList.
DELETE_LEDGER Delete an existing ledger, referenced by date or index.
OPEN_LEDGER Go to subroutine “Entry Tracker” for the entries recorded under the specified ledger.

Architecture in Context

Logic Manager and Parser

Class Function
InputParser Breaks input string by user into commandString and a sequence of paramTypes-param pairs.

The latter subsequence of the string is passed into ParamParser for further processing.

Information obtained from input parsing will be used to populate an instantiated CommandPacket instance, which will then be passed to the entity that called the parsing function.
ParamParser Process the sequence of paramTypes-param pairs and populate the paramMap in the instantiated CommandPacket instance.
ManualTracker Refer to section.
EntryTracker Omitted for brevity.

Logic Manager and Data

Class Function
ManualTracker Refer to section.
EntryTracker Omitted for brevity.
EntryList Omitted for brevity.
Entry Omitted for brevity.
LedgerList Extends ItemList. Refer to Ledgers and Entries section for class behavior.
Ledger Extends DateTimeItem. Refer to Ledgers and Entries section for class behavior.
ItemList Class with defined list behavior specified with helper methods such as retrieval, checking of Duplicates and deletion.
DateTimeItem Abstract class that extends Item class; instances will have LocalDate or LocalTime attributes and corresponding helper methods.
Item Abstract class to define behavior of entities that need are stored in ItemList instances.

Handler and Logic

Class Function
RetrieveLedgerHandler Process paramTypes-param pairs from the CommandPacket instance to identify specified Ledger instance, then retrieves the instance from the existing LedgerList.
CreateLedgerHandler Process paramTypes-param pairs from the CommandPacket instance to identify specified Ledger instance to be created, then creates the instance and append to existing LedgerList.
retrieveEntryHandler Omitted for brevity.
CreateEntryHandler Omitted for brevity.
EditEntryHandler Omitted for brevity.
ParamChecker Class contains a collection of methods that verify the correctness of the param supplied.

For instance, ParamChecker.checkAndReturnIndex checks if the index provided is out of bounds relative to the specified list, and throws the relevant exception if the input index is invalid.
ParamHandler Abstract class that outlines the general param handling behavior of commands instances and other classes that need to handle params in its operation.

Logic Manager and Handler

Class Function
RetrieveLedgerHandler Refer to section.
CreateLedgerHandler Refer to section.
retrieveEntryHandler Omitted for brevity.
CreateEntryHandler Omitted for brevity.
EditEntryHandler Omitted for brevity.
ManualTracker Implements Manual Tracker. Contains handler methods that implements a particular operation capable by the Manual Tracker.

These methods use the above command instances for param handling operations from user input.
EntryTracker Omitted for brevity.

Functions with Sequence Diagrams

Creation of Ledger(Sequence Diagram)

  1. At ManualTracker.handleMainMenu(), the user’s input is registered via java.util.Scanner instance.
  2. Input is parsed by InputParser.parseInput(), and ManualTracker.packet is set to the returned CommandPacket instance.
  3. The commandString of the CommandPacket instance is evaluated, and the corresponding handle method() is executed.
    In this case, handleCreateLedger() will be called.
  4. At handleCreateLedger(), the following processes will be executed:
    1. A new instance of CreateLedgerHandler is created. The input String array will be passed into CreateLedgerHandler.setRequiredParams() to set required params for a successful parse.
    2. A new instance of Ledger will be instantiated and set to CreateLedgerHandler.currLedger.
    3. CreateLedgerHandler.handlePacket(packet) is called to handle params in the packet.
      1. Refer to the section on Param Handling for more details pertaining to general param handling.
      2. For CreateLedgerHandler, the handleSingleParam abstract method will be implemented as shown in the following table.
  5. From ManualTracker, the configured Ledger instance will be retrieved from the CreateLedgerHandler instance and added into the LedgerList instance at ManualTracker.ledgerList.

Param Handling Behavior

ParamType ParamType String Expected Param Operation Verification method
PARAM.DATE “/date” Various format of date in string, eg. “2020-03-02” Call currLedger.setDate() to set date for the Ledger instance. ParamChecker.checkAndReturnDate(packet)

Sequence Diagram

Deletion of Ledger (Sequence Diagram)
The deletion of a specified ledger is performed in two phases: Ledger Retrieval and Ledger Delete.

  1. Phase 0: Instruction retrieval
    1. At ManualTracker.handleMainMenu(), the user’s input is registered via java.util.Scanner instance.
    2. Input is parsed by InputParser.parseInput(), and ManualTracker.packet is set to the returned CommandPacket instance.
    3. The commandString of the CommandPacket instance is evaluated, and the corresponding handle method() is executed.
      In this case, handleDeleteLedger() will be called.
  2. Phase 1: Ledger retrieval
    1. At handleDeleteLedger(), the following processes will be executed:
      1. A new instance of RetrieveLedgerHandler is created. The input String array will be passed into CreateLedgerHandler.setRequiredParams() to set required params for a successful parse.
      2. RetrieveledgerHandler.handlePacket(packet) is called to handle params in the packet.
        1. Refer to the section on Param Handling for more details pertaining to general param handling.
        2. For CreateLedgerHandler, the handleSingleParam abstract method will be implemented as shown in the following table:
          • Note that only one of the two params need to be invoked from the input.
  3. Phase 2: Ledger Deletion
    1. From ManualTracker, call ledgerList.RemoveItemAtCurrIndex() to remove the ledger specified by the index set to modify earlier.

Param Handling Behavior

ParamType ParamType String Expected Param Operation Verification method
PARAM.DATE “/date” Various format of date in string, eg. “2020-03-02” Call ledgerList.setIndexToModify() to set index of retrieved item. ParamChecker.checkAndReturnDate(packet)
PARAM.INDEX “/index” Valid index on the list from 1 onwards. Call ledgerList.setIndexToModify() to set index of retrieved item. ParamChecker.checkAndReturnIndex(packet)

Sequence Diagram

Entry Tracker: Edit of entries
The editing of details within the entry is performed in two phases: Entry Retrieval and Entry Edit.

  1. Phase 0: Instruction retrieval
    1. At EntryTracker.handleMainMenu(), the user’s input is registered via java.util.Scanner instance.
    2. Input is parsed by InputParser.parseInput(), and EntryTracker.packet is set to the returned CommandPacket instance.
    3. The commandString of the CommandPacket instance is evaluated, and the corresponding handle method() is executed.
      In this case, handleEditEntry() will be called.
  2. Phase 1: Entry retrieval(Sequence Diagram)
    1. At handleEditEntry(), the following processes will be executed:
      1. A singleton instance of RetrieveEntryHandler is retrieved. The input String array will be passed into retrieveEntryHandler.setRequiredParams() to set required params for a successful parse.
      2. retrieveEntryHandler.handlePacket(packet) is called to handle params in the packet.
        1. Refer to the section on Param Handling for more details pertaining to general param handling.
        2. For retrieveEntryHandler, the handleSingleParam abstract method will be implemented as shown in the following table.
        3. From EntryTracker, call entryList.popItemAtCurrIndex to retrieve the entry specified by the index set to modify earlier.

Param Handling Behavior

ParamType ParamType String Expected Param Operation Verification method
PARAM.INDEX “/index” Valid index on the list
from 1 onwards.
Call entryList.setIndexToModify()
to set index of retrieved item.
ParamChecker.checkAndReturnIndex(packet)

Sequence Diagram

  1. Phase 2: Entry edit (Sequence Diagram)
    1. Following Phase 1, the following processes will be executed:
      1. The singleton instance of EditEntryHandler is retrieved. There is no need to call EditEntryHandler.setRequiredParams() ; this command does not require params to modify. Instead, it acceps any params supplied and performs the edit accordingly.
      2. editeEntryHandler.setPacket(packet) is called to set packet.
    2. EditEntryHandler.handlePacket() is called to handle params in the packet.
      1. Refer to the section on Param Handling for more details pertaining to general param handling.
      2. For EditEntryHandler, the handleSingleParam abstract method will be implemented as shown in the following table.
    3. The edited entry is added back into the list.

Param Handling Behavior

ParamType ParamType String Expected Param Operation Verification method
PARAM.AMOUNT “/amt” Positive Double in 2 decimal places Call entryList.setAmount() to set amount ParamChecker.checkAndReturnDoubleSigned(packet)
PARAM.TIME “/time” Various format of time in string, eg. “15:00” Call entryList.setTime() to set index of retrieved item. ParamChecker.checkAndReturnTime(packet)
PARAM.INC “-i” Income entry type flag Call entryList.setEntryType(EntryType.INC) to set index of retrieved item. nil
PARAM.EXP “-e” Expense entry type flag Call entryList.setEntryType(EntryType.EXP) to set index of retrieved item. nil
PARAM.DESCRIPTION “/desc” Description in string, ‘;’ character is illegal. Call entryList.setDescription() to set index of retrieved item. ParamChecker.checkAndReturnDescription(packet)
PARAM.CATEGORY “/cat” A set of strings that corresponds with entry type Call entryList.setCategory() to set index of retrieved item. ParamChecker.checkAndReturnCategories(packet)

Sequence Diagram

 

Recurring Tracker

Overview
Recurring Tracker handles the creation, deletion and editing of recurring entries.

Entries use the class RecurringEntry, and are stored in the RecurringEntryList class.

RecurringEntry has the following attributes:

RecurringEntryList extends ItemList, and supports the following methods on top of inherited methods

Logic Manager and Handler

RecurringTracker, like EntryTracker, utilizes 3 handlers - CreateEntryHandler, EditEntryHandler and RetrieveEntryHandler.

handleCreateEntry()

Below are the compulsory params; an Exception will be thrown by CreateEntryHandler if not all are present.

Optional params are

The following sequence diagram illustrates the process:

handleDeleteEntry()

The only compulsory param is /id, the 1-based index of the item to delete.

handleEditEntry()

Compulsory params are “/id” and at least one other param to edit

Reminders
Upon launching the program, the system date and time is recorded in RunHistory.

The program then checks if there are any entries upcoming within 5 days from the current date, and prints the entries out as reminders.

  1. Main code calls MenuPrinter#printReminders(), which in turn calls ReminderListGenerator#generateListOfRemindersAsStrings().
  2. ReminderListGenerator checks the current date, and calculates the day of month which is 5 days from current date. This is stored in dayToRemindUntil.
  3. ReminderListGenerator then checks if dayToRemindUntil is after the last day of the current month. If it is, then the reminder timeframe will overflow to the next month.

    For example:

    • Current date is 29th October. There are 31 days in October. 5 days after today is 34th, which is beyond last day of October.
    • Reminder timeframe will overflow to next month, until 3rd of November
  4. If it has overflown, set isOverflowToNextMonth to true. Subtract the last day of month from dayToRemindUntil. The new value of dayToRemindUntil is the day of next month that the reminder timeframe extends to.

    For example:

    • Continuing from example earlier, dayToRemindUntil = 34.
    • dayToRemindUntil -= NUM_DAYS_IN_OCT, i.e. 34 - 31
    • dayToRemindUntil = 3, representing that the reminder timeframe extends to 3rd of November
  5. ReminderListGenerator then grabs the entries within the reminder timeframe from the list of all recurring entries.
    • If isOverflowToNextMonth == true, it will grab all entries from currentDay to lastDayOfMonth and all entries from 1 (1st day of next month) to dayToRemindUntil
    • Else, it will simply grab all entries from currentDay to dayToRemindUntil
  6. Lastly, the list of entries will be converted to a formatted String to be displayed as reminders, and passed back to MenuPrinter, who will pass it to UiManager to print.

The sequence diagram below shows how it works:

 

FinanceTools

Overview
FinanceTools consists of the following features

  1. Simple Interest Calculator
  2. Yearly/Monthly Compound Interest Calculator
  3. Cashback Calculator
  4. Miles Credit Calculator
  5. Account Storage
  6. Command and Calculation History

Simple Interest Calculator
Simple Interest Calculator is facilitated by SimpleInterest class. It allows user to calculate interest earned. When user inputs simple as a command, handleSimpleInterest from Handler class will handle user inputted parameters. The calculation is done by SimpleInterest class. The result is outputted in FinanceTools.main().

Parameters

The following class diagram shows how the Simple Interest Calculator feature works:
ClassDiagram

The following sequence diagram shows how the params are handled before the implementation is carried out:
For more information on parameters handling, refer here. SequenceDiagram1

The following sequence diagram shows how the Simple Interest Calculator feature works:
SequenceDiagram2

Yearly/Monthly Compound Interest Calculator
Yearly/Monthly Compound Interest Calculator is facilitated by YearlyCompoundInterest / MonthlyCompoundInterest class. It allows user to calculate interest earned. When user inputs cyearly / cmonthly as a command, handleYearlyCompoundInterest / handleMonthlyCompoundInterest from Handler class will handle user inputted parameters. The calculation is done by YearlyCompoundInterest / MonthlyCompoundInterest class. The result is outputted in FinanceTools.main().

Parameters

The following class diagram shows how the Yearly/Monthly Compound Interest Calculator feature works:
ClassDiagram1 ClassDiagram2
The following sequence diagram shows how the params are handled before the implementation is carried out:
For more information on parameters handling, refer here. SequenceDiagram1

SequenceDiagram1

The following sequence diagram shows how the Yearly/Monthly Compound Interest Calculator feature works:
SequenceDiagram1

SequenceDiagram1

Cashback Calculator
Cashback Calculator is facilitated by Cashback class. It allows user to calculate cashback earned. When user inputs cashb as a command, handleCashback from Handler class will handle user inputted parameters. The calculation is done by Cashback class. The result is outputted in FinanceTools.main().

Parameters

The following class diagram shows how the Cashback Calculator feature works:
ClassDiagram

The following sequence diagram shows how the params are handled before the implementation is carried out:
For more information on parameters handling, refer here. SequenceDiagram1

The following sequence diagram shows how the Cashback Calculator feature works:
SequenceDiagram2

Miles Credit Calculator
Miles Credit Calculator is facilitated by MilesCredit class. It allows user to calculate miles credit earned. When user inputs miles as a command, handleMilesCredit from Handler class will handle user inputted parameters. The calculation is done by MilesCredit class. The result is outputted in FinanceTools.main().

Parameters

The following class diagram shows how the Miles Credit Calculator feature works:
ClassDiagram

The following sequence diagram shows how the params are handled before the implementation is carried out:
For more information on parameters handling, refer here. SequenceDiagram1

The following sequence diagram shows how the Miles Creidt Calculator feature works:
SequenceDiagram2

Account Storage
Account Storage feature is facilitated by AccountStorage class. It allows user to store account information such as name of account, interest rate, cashback rate, etc. When user inputs store as command, handleAccountStorage from Handler class will handle user inputted parameters and store information accordingly. The implementation is done by handleInfoStorage from AccountStorage class. Afterwards, this information is stored into a txt file which is done by updateFile from AccountSaver class.

Additionally, it implements the following operations:

Parameters

Details
handleInfoStorage stores the user inputted information into an ArrayList which is then passed into updateFile to update the txt file. The purpose of using txt file is so that when the user exits and enters the program again, the information is retained, and the user does not have to re-enter the account information(s) again.

When user first enters FinanceTools in the program, readFileContents reads 5 lines in the txt file consecutively in a while loop because these 5 lines consists of information that belong to a particular account. These categories include: Name, Interest Rate, Cashback Rate, Cashback Cap and Notes”. Doing so helps to facilitate the delete option where instead of deleting single lines, we can delete the entire account information which correspond to a particular account because the information is stored in one index of the ArrayList.

The following class diagram shows how the Account Storage feature works:
ClassDiagram

The following sequence diagram shows how the params are handled before the implementation is carried out:
For more information on parameters handling, refer here. SequenceDiagram1

The following sequence diagram shows how the Account Storage feature works:

SequenceDiagram2

SequenceDiagram3

Command and Calculation History
To store the commands inputted by user and results from calculations in FinanceTools, an ArrayList is used. The commands are stored in the ArrayList before the params are handled and implementation is executed. The results from calculation is stored in the ArrayList when the implementation has finished executed.

 

Goal Tracker

Set Expense Goal Feature
The set expense goal feature is being implemented by GoalTracker. It allows the user to set an expense goal for the respective month to ensure that the user does not overspent his budget. When user enter expense 2000 for 08, the command will be sent to InputParser and parse it into String[]. With the String[], it will be sent to a class called Goal, and it will store the individual information. Afterwards, it will be added to a ArrayList in a class called TotalGoalList.

Not only that, GoalTracker also implemented a feature called set income goal that works almost the same as set expense goal feature with just slight command difference.

Format:

Details
Firstly, user will input the command based on the Format. Secondly, the input command will be sent to InputParser to parse. Thirdly, the parsed information will be sent to class Goal to store the individual information Next, it will be added to a ArrayList in class TotalGoalList. Lastly, the goal status will be displayed to the user.

This class diagram will show how the setting of expense goal works:

ExpenseClassDiagram

This sequence diagram will show the flow of setting of expense goal:

ExpenseSequenceDiagram

 

Storage Utility

What it does
Storage utility is a tool designed for backup and storage of all data associated with Goal tracker, Manual tracker and recurring tracker. It performs auto loading and saving of data upon entry and exit of the program as well as allowing multiple saves to be created and loaded at will.

Overview
Storage utility contains 5 classes. SaveHandler class contains some commonly used functions such as buildFile that is inherited to the 3 saver child classes. goalTrackerSaver produce text file to save goalTracker states, autoTrackerSaver saves recurringTracker states and manualTrackerSaver saves manualTracker states.

Save Manager Class Diagram

SaveManagerClassDiagram
Saver classes alone can handle autosave of data during entry and when exiting the program. This is done by calling load and save functions in the Financit main. saveManager class adds additional features that performs adding and loading of backup saves. addSave function is done by calling save function in each respective saver class with 2 parameters attached. Since save function is implemented as variable argument function, it is designed to accept no argument or two arguments. For the case with no argument the function will save to the default location given during initilization of the program and used for loading during startup and saving upon exit. For the case with two argument, new directory location is specified that is used for saving of backup data.

saveManager loadSave function was implemented by calling first the clear function in each respective saver classes, then the load functions. FileChannel is also used to copy contents of the backup save file into the default initilzation save file in case program was unexpectedly terminated.

Save Manager Sequence Diagram

SaveManagerSequenceDiagram

 

Product scope

Target user profile

Value proposition

ManualTracker and EntryTracker

GoalTracker

RecurringTracker

Finance Tools

 

User Stories

Version As a … I want to … So that I can …
v1.0 financially prudent user Keep record of my spendings of the day I can keep track of my spending habits on a daily basis.
v1.0 student who mistypes easily Edit my transaction details using one line commands I can correct my mis-types in a easy and intuitive way.
v1.0 university student who may have difficulty keeping track of his finances Monitor my spending habits and income according to various categories of expenditure I can identify which particular category of spending forms the majority of my daily expenditures.
v1.0 person who spends a lot of time in front of a computer Record my expenses and income using one-line commands I can monitor my spending habits conveniently and hassle-free.
v1.0 person who owns a bank account calculate interest over a principal amount know how much interest I can earn
v1.0 user planning for my future finances calculate interest earned over a period time know how much interest I can earn at the end of a period
v1.0 user who owns a cashback credit card calculate cashback earned know how much cashback I can earn
v1.0 user who owns a miles credit card calculate miles credit earned know how much miles credit I can earn
v1.0 user who is interested about my expenses set expense goal for 1 year manage my expenditure according to the budget I set aside
v1.0 user wants to save money set income goal for 1 year know how much I have saved and did I reach my saving target
v1.0 user that wishes to manage my income know my goal status everytime I made an entry saved the hassle to go to goal tracker just to check the progress
v1.0 user that has recurring bills from subscription services add a recurring entry Keep track of monthly transactions like income or bills
v1.0 user that has recurring bills from subscription services edit a recurring entry update details of existing entries without having to re-enter everything
v1.0 user that has multiple recurring subscription services bill delete a recurring entry remove recurring entries that are no longer valid e.g. cancelled subscription
v1.0 user who wants to know my expenditure create a save after I exit the program and load that save when I return shutdown my PC and save electrical bills without losing progress
v2.0 user who is planning for long-term finances calculate interest over a principal amount with yearly or monthly deposit know how much interest I can earn with regular deposits
v2.0 user who has multiple bank accounts and credit cards store account or card information refer to account features such as interest rate any time
v2.0 user who is new to credit cards or bank accounts compare my calculations with different interest rate decide which account is better
v2.0 user whose expenditure is large for particular months set expense goal for specific month manage my expenditure monthly instead of yearly
v2.0 user who wants flexibility for finance-related goals set income goal for specific month know exactly which month I manage to saved up to my target goal
v2.0 user who has different income goals for different month edit expense/income goal for specific month adjust my expenditure/saving target according to the situation
v2.0 user that is interested in my finances for a particular month display expense/income goal for specific month keep track of my progress
v2.0 busy user with many bills to pay see all my upcoming recurring entries keep track of bill payment dates and prevent overdue fees
v2.0 user that has a lot of financial-related information be assured my saved progress is not lost if program unexpectedly terminates work long hours without manually saving the program
v2.0 user who manages finance for other people keep multiple copies of different saves load a different save if my friend wishes to use the program on my computer
v2.0 user who is particular about sensitive information reset my program easily remove all saved progress without having to delete them one at a time

 

Non-Functional Requirements

 

Glossary

 

Future implementations

  1. Integrate Goal Tracker with Recurring Tracker
    In the next version, the Goal tracker will be used to keep track not only the manual tracker but also the recurring tracker. With this feature being implemented, those fixed monthly income and expenditure will also be included into the goal tracker progress to better aid the user in managing their finances.

  2. Entry Categories used for analysis
    In the next version, entry categories can be recorded and used in meaningful calculations to represent the user’s spending habits in a more detailed and categorised manner. Perhaps a tabulated summary of entries by each category would be helpful in assisting the users in meaningfully monitoring their spending habits.

 

Instructions for Manual Testing

  1. Download the executable from our latest release
  2. Save the executable file in your preferred folder
  3. Run the program via the command line. The command is: java -jar financeit.jar
  4. You should see the following output:

Testing Main Menu

  1. Accessing a feature (Using ManualTracker as example):
    1. Enter manual into the console. You should see the following:

  1. Exiting the main menu and quit the program:
    1. Enter exit into the console. You should see the following:

Testing ManualTracker

Show Command List

  1. Enter commands into the console. You should see the following:

Create Ledger
Positive Test

  1. Enter new /date 200505 into the console. You should see the following:

Negative test: Duplicate inputs

  1. Again, enter new /date 200505 into the console. You should see the following:

Testing Show Ledger List
Positive Test

  1. Enter list into the console. You should see the following:

Observe that there is currently one ledger in the list, of date 2020-05-05.

  1. Refer to the above section on creating ledgers to create another ledger of date 2020-06-06 using the command: new /date 200606.
  2. Enter list into the console. Observe that there are now two ledgers in the list. You should see the following:

Testing Delete Ledger
Positive Test

  1. Enter delete /id 1 into the console.
    • This will delete the first ledger on index, which is of date 2020-05-05
  2. Enter list into the consolde. You should see the following:

Observe there is now one ledger on the list.

Open Ledger

  1. Enter open /date 200707 into the console. You should see the following:

Note that the ledger of date 2020-07-07 was not created beforehand. However, the ledger will be automatically created by the operation, and will resume as per normal.

Testing EntryTracker

  1. The following testing guide assumes that the test for Manual Tracker has been completed.

Show Command List

  1. Enter commands into the console. You should see the following:

Show Category List

  1. Enter cat into the console. You should see the following:

Create Entry
Positive Test

  1. Enter new /time 1500 /cat tpt /amt $16.30 /desc Riding the bus back home -e into the console. You should see the following:

  1. Enter new /time 1500 /cat slr /amt $16.30 /desc Riding the bus back home -i into the console. You should see the following:

Negative Test

  1. Enter new /time 1500 /cat tpt /amt $16.30 /desc Riding the bus back home -i into the console. You should see the following:

Note that the error is thrown because category tpt is not considered an income, -i. Instead, it is considered an expenditure, and -e should have been used instead.

Testing Show Entry List

  1. Enter list into the console. You should see the following:

Note that the number of entries is now 2.

Testing Edit Entry

  1. Enter edit /id 1 /amt $0.50 into the console.
  2. Enter list into the console. You should see the following:

Observe that the entry of entry number 1 is not $0.50 under the Amount column.

Testing Delete Entry

  1. Enter delete /id 2 into the console.
  2. Enter list into the console. You should see the following:

Observe the entry that is the latter to be added, entry with Entry Type = Income, is now removed from the list.

Testing RecurringTracker

  1. Enter recur in the Main Menu. You should see the following:

Show Command List

  1. Enter commands. Output:

Testing Add Entry

Positive Test 1: Normal Entry

  1. Enter new -e /desc Netflix /amt 36.20 /day 27 /notes Cancel when finished watching Black Mirror. Output:

Entry with special day of month

  1. Enter new -e /desc Drinks /amt 58.45 /day 31. Output:

Negative Test

  1. Enter new /desc OIH()(&%* /amt 343243. Output:

Testing List Entries

Testing Edit Entry

Negative Test: No Params to Edit

  1. Enter edit /id 1. Output:


Negative Test: No Such Index

  1. Enter edit /id 4 /desc Hello Bubble. Output:

Testing Delete Entry

  1. Enter delete /id 1. Output:

  1. Enter list. Output:

Testing Reminders

  1. Enter add -e -auto /desc Spotify subscription /amt 9.99 /day {CURRENT_DAY + 2}
    • E.g. if today is 15th, input will be /day 17
  2. Enter add -i /desc Collect cash from Sonia /amt 500 /day {CURRENT_DAY + 7}
    • E.g. if today is 15th, input will be /day 22
    • E.g. if today is 28th, input will be /day 5 OR day 4 depending on whether the current month has 30 or 31 days respectively.
  3. Enter exit to quit to main menu. Reminders are printed above the Main Menu prompt. Note: Screenshot was taken on 6th, hence entries entered above are on the 6th, 8th and 13th respective. Output:

  1. Enter exit to quit the program. Run the .jar file again. Reminders are printed below the logo and above the Main Menu prompt.

Testing GoalTracker

Set Goal for Expense
Positive Test
Enter expense 4000 for 01 into the console. You should see the following: SetExpenseGoal

Negative Test
Again, enter expense 2000 for 01 into the console. You should see the following: NegativeSet

Testing Set Goal for Income
Positive Test
Enter income 2000 for 02 into the console. You should see the following: SetIncomeGoal

Negative Test
Again, enter income 7000 for 02 into the console. You should see the following: NegativeSetIncome

Edit Goal for Expense
Positive Test
Enter edit expense 2000 for 01 into the console. You should see the following: EditExpenseGoal

Negative Test
Enter edit expense 4000 for 05 into the console. You should see the following: NegativeEditExpense

Edit Goal for Income
Positive Test
Enter edit income 5000 for 02 into the console. You should see the following: EditIncomeGoal

Negative Test
Enter edit income 1000 for 09 into the console. You should see the following: NegativeEditIncome

Display Expense goal
Positive Test
Enter display expense for 01 into the console. You should see the following: DisplayExpenseGoal

Display Income Goal
Positive Test
Enter display income for 02 into the console. You should see the following: DisplayIncomeGoal

Goal Status Update
When a user make a new entry, the goal status will update and display as output as shown: GoalStatusUpdate

Testing SaveManager

Add Save
Positive Test
Enter add /name save123 into the console.
You should see the following:

capture

capture2

Negative Test
Enter add /name into the console.
You should see the following:

capture1

Load Save
Positive Test
Enter load /name save123 into the console.
You should see the following:

capture3

Negative Test
Enter load /name wrongName into the console.
You should see the following:

capture4

Delete Save
Positive Test
Enter delete /name save123 into the console.
You should see the following:

capture5

capture7

Negative Test
Enter delete /name wrongName into the console.
You should see the following:

capture6

Testing FinanceTools

Simple Interest Calculator
Enter simple /a 1000 /r 5 into the console.
You should see the following: Example

Yearly Compound Interest Calculator
Enter cyearly /a 1000 /r 3 /p 2 into the console.
You should see the following: Example

Monthly Compound Interest Calculator
Enter cmonthly /a 1000 /r 3 /p 2 into the console.
You should see the following: Example

Cashback Calculator
Enter cashb /a 1000 /r 5 /c 1000 into the console.
You should see the following: Example

Miles Credit Calculator
Enter miles /a 1000 /r 5 into the console.
You should see the following: Example

Account Storage
Enter store /n myaccount /ir 2 /r 2 /c 100 /o main account followed by info into the console.
You should see the following: Example

Example