By: CS2103-AY1819S2-W15-2      Since: Feb 2019

1. Setting up

1.1. Prerequisites

  1. JDK 9 or later

    JDK 10 on Windows will fail to run tests in headless mode due to a JavaFX bug. Windows developers are highly recommended to use JDK 9.
  2. IntelliJ IDE

    IntelliJ by default has Gradle and JavaFx plugins installed.
    Do not disable them. If you have disabled them, go to File > Settings > Plugins to re-enable them.

1.2. Setting up the project in your computer

  1. Fork this repo, and clone the fork to your computer

  2. Open IntelliJ (if you are not in the welcome screen, click File > Close Project to close the existing project dialog first)

  3. Set up the correct JDK version for Gradle

    1. Click Configure > Project Defaults > Project Structure

    2. Click New…​ and find the directory of the JDK

  4. Click Import Project

  5. Locate the build.gradle file and select it. Click OK

  6. Click Open as Project

  7. Click OK to accept the default settings

  8. Open a console and run the command gradlew processResources (Mac/Linux: ./gradlew processResources). It should finish with the BUILD SUCCESSFUL message.
    This will generate all resources required by the application and tests.

  9. Open MainWindow.java and check for any code errors

    1. Due to an ongoing issue with some of the newer versions of IntelliJ, code errors may be detected even if the project can be built and run successfully

    2. To resolve this, place your cursor over any of the code section highlighted in red. Press ALT+ENTER, and select Add '--add-modules=…​' to module compiler options for each error

  10. Repeat this for the test folder as well (e.g. check HelpWindowTest.java for code errors, and if so, resolve it the same way)

1.3. Verifying the setup

  1. Run the seedu.address.MainApp and try a few commands

  2. Run the tests to ensure they all pass.

1.4. Configurations to do before writing code

1.4.1. Configuring the coding style

This project follows oss-generic coding standards. IntelliJ’s default style is mostly compliant with ours but it uses a different import order from ours. To rectify,

  1. Go to File > Settings…​ (Windows/Linux), or IntelliJ IDEA > Preferences…​ (macOS)

  2. Select Editor > Code Style > Java

  3. Click on the Imports tab to set the order

    • For Class count to use import with '*' and Names count to use static import with '*': Set to 999 to prevent IntelliJ from contracting the import statements

    • For Import Layout: The order is import static all other imports, import java.*, import javax.*, import org.*, import com.*, import all other imports. Add a <blank line> between each import

Optionally, you can follow the UsingCheckstyle.adoc document to configure Intellij to check style-compliance as you write code.

1.4.2. Updating documentation to match your fork

After forking the repo, the documentation will still refer to the CS2103-AY1819S2-W15-2/main repo.

If you plan to develop this fork as a separate product (i.e. instead of contributing to CS2103-AY1819S2-W15-2/main), you should do the following:

  1. Configure the site-wide documentation settings in build.gradle, such as the site-name, to suit your own project.

  2. Replace the URL in the attribute repoURL in DeveloperGuide.adoc and UserGuide.adoc with the URL of your fork.

1.4.3. Setting up CI

Set up Travis to perform Continuous Integration (CI) for your fork. See UsingTravis.adoc to learn how to set it up.

After setting up Travis, you can optionally set up coverage reporting for your team fork (see UsingCoveralls.adoc).

Coverage reporting could be useful for a team repository that hosts the final version but it is not that useful for your personal fork.

Optionally, you can set up AppVeyor as a second CI (see UsingAppVeyor.adoc).

Having both Travis and AppVeyor ensures your App works on both Unix-based platforms and Windows-based platforms (Travis is Unix-based and AppVeyor is Windows-based)

1.4.4. Getting started with coding

When you are ready to start coding,

  1. Get some sense of the overall design by reading Section 2.1, “Architecture”.

  2. Take a look at Appendix A, Suggested Programming Tasks to Get Started.

2. Design

2.1. Architecture

Architecture
Figure 1. Architecture Diagram

The Architecture Diagram given above explains the high-level design of the App. Given below is a quick overview of each component.

The .pptx files used to create diagrams in this document can be found in the diagrams folder. To update a diagram, modify the diagram in the pptx file, select the objects of the diagram, and choose Save as picture.

Main has only one class called MainApp. It is responsible for,

  • At app launch: Initializes the components in the correct sequence, and connects them up with each other.

  • At shut down: Shuts down the components and invokes cleanup method where necessary.

Commons represents a collection of classes used by multiple other components. The following class plays an important role at the architecture level:

  • LogsCenter : Used by many classes to write log messages to the App’s log file.

The rest of the App consists of 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.

Each of the four components

  • Defines its API in an interface with the same name as the Component.

  • Exposes its functionality using a {Component Name}Manager class.

For example, the Logic component (see the class diagram given below) defines it’s API in the Logic.java interface and exposes its functionality using the LogicManager.java class.

LogicClassDiagram
Figure 2. Class Diagram of the Logic Component

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 deleteexpense 1.

SDforDeleteExpense
Figure 3. Component interactions for deleteexpense 1 command

The sections below give more details of each component.

2.2. UI component

UiComponentClassDiagram
Figure 4. Structure of the UI Component

API : Ui.java

The UI consists of a MainWindow that is made up of parts e.g.CommandBox, ResultDisplay, ExpenseListPanel, BudgetListPanel, DebtListPanel, RecurringExpenseListPanel, StatusBarFooter, BrowserPanel etc. All these, including the MainWindow, inherit from the abstract UiPart class. Each individual ListPanel consists of their respective Card.

The UI component uses 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,

  • Executes user commands using the Logic component.

  • Listens for changes to Model data so that the UI can be updated with the modified data.

2.3. Logic component

LogicClassDiagram
Figure 5. 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 expense).

  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.

Given below is the Sequence Diagram for interactions within the Logic component for the execute("deleteexpense 1") API call.

DeleteExpenseSdForLogic
Figure 6. Interactions Inside the Logic Component for the deleteexpense 1 Command

2.4. Model component

ModelClassDiagram
Figure 7. Structure of the Model Component

API : Model.java

The Model,

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

  • stores the Finance Tracker data.

  • exposes unmodifiable ObservableList<Expense>, ObservableList<Recurring>, ObservableList<Debt>, ObservableList<Budget> 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.

2.5. Storage component

StorageClassDiagram1
Figure 8. Structure of the Storage Component

API : Storage.java

The Storage component,

  • can save UserPref objects in json format and read it back.

  • can save the Finance Tracker data in json format and read it back.

2.6. Common classes

Classes used by multiple components are in the seedu.address.commons package.

3. Implementation

This section describes some noteworthy details on how certain features are implemented.

3.1. Undo/Redo feature

3.1.1. Current Implementation

The undo/redo mechanism is facilitated by VersionedFinanceTracker. It extends FinanceTracker with an undo/redo history, stored internally as a financeTrackerStateList and currentStatePointer. Additionally, it implements the following operations:

  • VersionedFinanceTracker#commit() — Saves the current finance tracker state in its history.

  • VersionedFinanceTracker#undo() — Restores the previous finance tracker state from its history.

  • VersionedFinanceTracker#redo() — Restores a previously undone finance tracker state from its history.

These operations are exposed in the Model interface as Model#commitFinanceTracker(), Model#undoFinanceTracker() and Model#redoFinanceTracker() respectively.

Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.

Step 1. The user launches the application for the first time. The VersionedFinanceTracker will be initialized with the initial finance tracker state, and the currentStatePointer pointing to that single finance tracker state.

UndoRedoStartingStateListDiagram

Step 2. The user executes deleteexpense 5 command to delete the 5th expense in the finance tracker. The deletexpense command calls Model#commitFinanceTracker(), causing the modified state of the finance tracker after the deleteexpense 5 command executes to be saved in the financeTrackerStateList, and the currentStatePointer is shifted to the newly inserted finance tracker state.

UndoRedoNewCommand1StateListDiagram

Step 3. The user executes addexpense n/BKT …​ to add a new expense. The addexpense command also calls Model#commitFinanceTracker(), causing another modified finance tracker state to be saved into the financeTrackerStateList.

UndoRedoNewCommand2StateListDiagram
If a command fails its execution, it will not call Model#commitFinanaceTracker(), so the finance tracker state will not be saved into the financeTrackerStateList.

Step 4. The user now decides that adding the expense was a mistake, and decides to undo that action by executing the undo command. The undo command will call Model#undoFinanceTracker(), which will shift the currentStatePointer once to the left, pointing it to the previous finance tracker state, and restores the finance tracker to that state.

UndoRedoExecuteUndoStateListDiagram
If the currentStatePointer is at index 0, pointing to the initial finance tracker state, then there are no previous finance tracker states to restore. The undo command uses Model#canUndoFinanceTracker() to check if this is the case. If so, it will return an error to the user rather than attempting to perform the undo.

The following sequence diagram shows how the undo operation works:

UndoRedoSequenceDiagram

The redo command does the opposite — it calls Model#redoFinanceTracker(), which shifts the currentStatePointer once to the right, pointing to the previously undone state, and restores the finance tracker to that state.

If the currentStatePointer is at index financeTrackerStateList.size() - 1, pointing to the latest finance tracker state, then there are no undone finance tracker states to restore. The redo command uses Model#canRedoFinanceTracker() to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.

Step 5. The user then decides to execute the command listexpense v/all. Commands that do not modify the finance tracker, such as listexpense, will usually not call Model#commitFinanceTracker(), Model#undoFInanceTracker() or Model#redoFinanceTracker(). Thus, the financeTrackerStateList remains unchanged.

UndoRedoNewCommand3StateListDiagram

Step 6. The user executes clearexpense, which calls Model#commitFinanceTracker(). Since the currentStatePointer is not pointing at the end of the financeTrackerStateList, all finance tracker states after the currentStatePointer will be purged. We designed it this way because it no longer makes sense to redo the addexpense n/BKT …​ command. This is the behavior that most modern desktop applications follow.

UndoRedoNewCommand4StateListDiagram

The following activity diagram summarizes what happens when a user executes a new command:

UndoRedoActivityDiagram

3.1.2. Design Considerations

Aspect: How undo & redo executes
  • Alternative 1 (current choice): Saves the entire finance tracker.

    • Pros: Easy to implement.

    • Cons: May have performance issues in terms of memory usage.

  • Alternative 2: Individual command knows how to undo/redo by itself.

    • Pros: Will use less memory (e.g. for deleteexpense, just save the expense being deleted).

    • Cons: We must ensure that the implementation of each individual command is correct.

Aspect: Data structure to support the undo/redo commands
  • Alternative 1 (current choice): Use a list to store the history of finance tracker states.

    • Pros: Easy for new Computer Science student undergraduates to understand, who are likely to be the new incoming developers of our project.

    • Cons: Logic is duplicated twice. For example, when a new command is executed, we must remember to update both HistoryManager and VersionedFinanceTracker.

  • Alternative 2: Use HistoryManager for undo/redo

    • Pros: We do not need to maintain a separate list, and just reuse what is already in the codebase.

    • Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as HistoryManager now needs to do two different things.

3.2. Logging

We are using java.util.logging package for logging. The LogsCenter class is used to manage the logging levels and logging destinations.

  • The logging level can be controlled using the logLevel setting in the configuration file (See Section 3.3, “Configuration”)

  • The Logger for a class can be obtained using LogsCenter.getLogger(Class) which will log messages according to the specified logging level

  • Currently log messages are output through: Console and to a .log file.

Logging Levels

  • SEVERE : Critical problem detected which may possibly cause the termination of the application

  • WARNING : Can continue, but with caution

  • INFO : Information showing the noteworthy actions by the App

  • FINE : Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size

3.3. Configuration

Certain properties of the application can be controlled (e.g user prefs file location, logging level) through the configuration file (default: config.json).

3.4. Listing Feature

This feature allows users to filter out specific items based on the view specified. Only expenses that are under those views will be shown on the respective list panels.

Listing feature consists of commands such as listexpense, listrecurring and listdebt.

This implementation is under Logic and Model components.

3.4.1. Current implementation

Below is the UML sequence diagram and a step-by-step explanation of an example usage scenario for listexpense. The other list commands have similar implementations.

ListExpenseSequenceDiagram
  1. User enters command listexpense v/food. The command is received by FinanceTrackerParser, which then creates a ListExpenseCommandParser object. The created object then calls ListExpenseCommandParser#parse("v/food") method.

  2. ListExpenseCommandParser#parse("v/food") method calls the ArgumentTokenizer#tokenize() to tokenize the input v/food and stores it in an ArgumentMultiMap object.

  3. ListExpenseCommandParse#parse("v/food") method then calls ParserUtil#parseView(argMultiMap#getValue(PREFIX_VIEW)#get()) and gets a View object in return.

  4. After that, a ListExpenseCommand object is created with the View object as parameter and return to LogicManager.

  5. LogicManager then calls ListExpenseCommand#execute(), which calls Model#updateFilteredExpense(predicate), where predicate is obtained from calling the ListExpenseCommand#getPredicate(view). It then updates the filter of the filtered expense list and it now contains the new set of expenses that are filtered by the predicate.

  6. Finally, the expense list panel will show the new set of expenses. A CommandResult is then created and returned to LogicManager.

3.4.2. Design Consideration

This feature can be implemented in different ways in terms of how the specified expenses are filtered out. The alternative ways of implementation are shown below.

  • Alternative 1 (current choice): Go through all expenses in the FinanceTracker and filter out those that are under the specified view.

    • Pros: Easy to implement. The original architecture is preserved.

    • Cons: Time-consuming. Large number of expenses in FinanceTracker will take longer time to filter.

  • Alternative 2: Store expenses in separate files based on different views. Only check files under the specified view when filtering.

    • Pros: More efficient. Will not go through every single expense.

    • Cons: Will need to alter the original architecture. More storage space will be needed.

3.5. Recurring Feature

The Recurring feature consists of addrecurring, editrecurring, listrecurring, deleterecurring clearrecurring, and convertrecurring.

Recurring expenses are expenses that are periodic and have a fixed frequency and a defined number of occurrences. Examples of these recurring expenses are bills or subscription fees.

This feature allows users to add recurring expenses to the finance tracker and be able to constantly keep track of them. This is done by calling Logic#execute which creates an AddRecurringCommand. This command then calls Model#addRecurring, adding the specified recurring into the recurring list.

This feature also simplifies the deletion and editing of these recurring expenses, and they work in a similar manner.

3.5.1. Convert Recurring To Expense Feature

The purpose of this feature is to provide the convenience for users by adding outstanding expenses from all their recurring expenses into the expense list. After adding recurring expenses into the Finance Tracker, the user can call convertrecurring to make the conversion.

Current Implementation

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

ConvertRecurringSequenceDiagram
  1. User enters the command convertrecurring, to add outstanding expenses from all their recurring expenses into the expense list. This command is executed by LogicManager, which calls FinanceTrackerParser#parseCommand("convertrecurring"). This creates a ConvertRecurringToExpenseCommand object and returned to the LogicManager.

  2. The LogicManager calls ConvertRecurringToExpenseCommand#execute, which will call Model#getFilteredRecurringList() to retrieve the list of recurrings in the financetracker.

  3. The programme then iterates through the recurring list, and for each recurring, checks the recurring’s lastConvertedDate, which is the last time the recurring has gone through a convertrecurring check.

  4. If the recurring’s lastConvertedDate is before the current date, this recurring will have to be checked again for outstanding expenses that can potentially be added.

  5. The programme then calls Recurring#getRecurringListofExpenses to retrieve the list of expenses that are supposed to be added by this recurring, and iterates through this expense list.

  6. If the expense’s date is before or equals to the current date, and after the lastConvertedDate, this recurring expense will have to be converted into an expense and added into the FinanceTracker. This is done by calling Model#addExpense(recurringListOfExpenses.get(j)).

  7. This is done for every expense that is supposed to be added by this recurring to determine which has to be added into the expense list. After the iteration, the recurring’s lastConvertedDate is set to the current date.

  8. This is done for each recurring in the list.

3.5.2. Advanced Delete and Edit Recurring (coming in v2.0)

This is still a work in progress.

Currently, deleterecurring does not delete expenses already added by the deleted recurring, and editrecurring does not edit expenses already added by the edited recurring.

The purpose of this feature is to make deleterecurring and editrecurring more advanced such that the expenses already added by the recurring to be deleted or edited will also reflect the new changes.

3.6. Debt Feature

The Debt feature consists of adddebt, editdebt, listdebt, deletedebt, selectdebt, cleardebt and paydebt.

This feature allows users to add debts to the finance tracker and be able to constantly keep track of them. This is done by calling Logic#execute which creates an AddDebtCommand. This command then calls Model#addDebt, adding the specified debt into the debt list.

Editing, deleting, selecting and clearing of debts work in a similar manner.

3.6.1. Pay Debt Feature

The purpose of this feature is to provide the convenience for users to indicate that they have paid off a particular debt and seamlessly convert that into an expense.

Current Implementation

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

PayDebtSequenceDiagram
  1. User enters the command paydebt 1, to convert the first listed debt on the user interface into an expense. This command is executed by LogicManager, which calls FinanceTrackerParser#parseCommand("paydebt 1"). This creates a new PayDebtCommandParser object which will help parse the input by the user.

  2. The newly created object calls parse("1") which in turns calls ArgumentTokenizer#tokenize("1", "d/") to split the arguments into its preamble(the index) and the date(if inputted by the user). This returns an argMultiMap containing the split input.

  3. The PayDebtCommandParser object then calls ParserUtil#parseIndex(argMultiMap.getPreamble()) and ParserUtil#parseDate(argMultiMap.getValue("d/").get()) to parse the arguments into the index and date into its correct form respectively. If the user does not input a date, the program will use the local date on the system’s clock. A PayDebtCommand object containing the index and date is then created and returned to the LogicManager.

  4. The LogicManager calls PayDebtCommand#execute(), which will call Model#getFilteredDebtList() to retrieve the list of debts stored in the finance tracker. The method get(index) is then called to retrieve the debt the user was intending to convert.

  5. An expense is then created by retrieving out the following relevant information from the debt entry:

    • Person Owed

    • Amount

    • Category

    • Remarks

  6. The programme then take this information and creates a new Expense convertedExpense with the following fields:

    • Name : Paid Debt to Person Owed

    • Amount : Same amount will be used

    • Category : Same category will be used

    • Date : Based on user’s input on when the debt is paid, else the program will use the local date in the system’s clock

    • Remarks : Same remarks will be used

  7. Model#deleteDebt(debt) and Model#addExpense(convertedExpense) are then called to delete the targeted debt from the debt list and add the convertedExpense into the expense list accordingly.

  8. The command result is then returned to the LogicManager which then returns it to the UI where the changes are then reflected on the user interface.

3.6.2. Design Consideration

This feature can be implemented in different ways in terms of the architecture of the Model component. The alternative ways of implementation are shown below.

  • Alternative 1 (current choice): Debt and Expense classes do not inherit from a common Interface. Container objects such as expense list and debt list, will be initialized to hold objects of their own individual classes.

    • Pros: Lower level of coupling between Expense and Debt classes.

    • Cons: Slower and less flexibility. Conversion between classes, e.g. from Debt to Expense, requires extracting information from debt, creating a new expense, then deleting the old debt.

  • Alternative 2: Debt and Expense classes inherit from a common Interface. Container objects such as expense list and debt list, will be initialized to hold objects of this common Interface.

    • Pros: Greater flexibility. Polymorphism allows for easy conversion between different types of entries, such as from debt to expense, simply by moving them across different lists. This will be useful considering that our Finance Tracker will need significant amounts of conversion between different objects.

    • Cons: Higher level of coupling between Expense and Debt classes.

Ultimately, the first option was chosen because a lower level of coupling will allow for easier maintenance, integration and testing. Also, it is not significantly slower thus the Finance Tracker will still be able to complete debt-related commands within 2 seconds, which is one of our non-functional requirements.

3.6.3. Debt Notifications (Coming in v2.0)

This is still a work in progress.

The purpose of this feature is to alert users when the deadline for their debts is approaching. These alerts come in the form of either a pop-up notification or an email alert.

It is up to the user on when they would like to receive this notification. Currently, there are plans to implement the following options:

  • 1 month before debt deadline

  • 1 week before debt deadline

  • 3 days before debt deadline

  • 1 day before debt deadline

Future Implementation

Once the duration option is set, each time the main application loads, the programme will go through every debt in Model#getFilteredDebtList(), deduct duration from each Debt#getDeadline() to get its notificationDate and add them to a new list notificationDates.

Each notificationDate is then checked against LocalDate#now(). If notificationDate is before or equals to LocalDate#now, they are then added to a new list notificationsToBeAlerted.

Every item in notificationsToBeAlerted is then printed on an alert box, reminding the user of the upcoming deadlines for their debts.

3.7. Statistics Feature

This feature allows users to calculate various statistics for the entries in their Financial Tracker. The feature will read the expenses, debts and budgets and generate various metrics to display.

The Statistic feature consists of stats, statstrend and statscompare

This implementation is under Logic and Model components.

3.7.1. stats

Current implementation

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

StatCommandSequenceDiagram
  1. User enters command stats sd/01-01-2019. The command is received by FinanceTrackerParser, which then creates a StatsCommandParser object. The created object then calls StatsCommandParser.parse("stats sd/01-01-2019") method. A StatsCommand object is then created with StatsCommand(01-01-2019, 01-02-2019) and returned to the LogicManager

  2. Logic Manager will call the execute method of the StatsCommand object which calls the calculateStatistics("stats', 01-01-2019, 01-02-2019, null) method in Model. The Model Manager will handle this command and duplicate the Expense list held in the Financial Tracker, creating a snapshot. The Model Manager will instantiate a Statistics object and call the calculateStatistics("stats', 01-01-2019, 01-02-2019, null) method.

  3. The calculateStatistics method in Statistics is a wrapper that will call the appropriate method basicStats(01-01-2019, 01-02-2019) after reading the String "stats" that was passed in.

  4. basicStats calls the method extractRelevantExpense(01-01-2019, 01-02-2019) which takes only the Expenses that lie within the time range and adds them to a new Expense list data. These relevant Expenses are then processed by the generateSummary(data) method. This method will return a table of relevant statistics.

  5. The methods trimTable(table), convertDataToString(trimmedtable) are called to process this table. htmlTableBuilder(header, table) is called to generate the HTML code required to show the Statistics in the BrowserPanel.

  6. Model Manager calls setStatistics(statistics) which sets the observable Statistics in ModelManager.

  7. The listener in BrowserPanel will detect the change and display the HTML page showing the statistics

Future Implementation

Users will be given the option to choose a Visual Representation method. This will determine the output format of the statistics. Currently, statistics can only be displayed in table format. However, in the future a feature will be implemented to show the statistics in graphical or pictorial formats. These could include pie charts, bar charts, line graphs, etc.

3.8. Budget Feature

This feature allows users to set budgets for different categories so they can limit the amount spent for each category.

It stores all budgets added by the user and keeps track of the expenses added within the user-specified time frame.

This feature includes addbudget, editbudget, deletebudget, selectbudget and clearbudget.

The implementation of the budget feature is under the Logic and Model components.

3.8.1. Current implementation

Adding a budget:

User enters the command word addbudget, followed by the category for which they want to set the budget for, the amount they want to limit themselves to for that category and specifies the start and end date for that budget.

Editing an existing budget:

User enters the command word editbudget, followed by the category for which they want to edit the budget of and the relevant parameters of which they wish to edit the values of.

Deleting an existing budget:

User enters the command word deletebudget, followed by the category for which they wish to delete the budget for.

Selecting an existing budget:

User enters the command word selectbudget, followed by the category for which they wish to select the budget for viewing.

For all four actions, the user command gets parsed by the respective parsers: AddBudgetCommandParser, EditBudgetCommandParser, DeleteBudgetCommandParser and SelectBudgetCommandParser, which handle the execution of the commands.

Below is the UML sequence diagram of a scenario for the addbudget command. Editing, deleting and selecting budgets work similarly to adding budgets.

AddBudgetSequenceDiagram
  1. User enters the command addbudget c/food $/1000 ed/30-06-2019, to add a new budget for the FOOD category. This command is executed by LogicManager, which calls FinanceTrackerParser#parseCommand("addbudget c/food $/1000 ed/30-06-2019"). This creates a new AddBudgetCommandParser object which will help parse the input by the user.

  2. The newly created object calls parse("c/food $/1000 ed/30-06-2019") which in turn calls ArgumentTokenizer#tokenize("c/food $/1000 ed/30-06-2019", "/c", "$/", "sd/", "ed/", "r/") to split the arguments into the different parameters of a budget. This returns an argMultiMap containing the split input.

  3. The AddBudgetCommandParser object then calls ParserUtil#parseCategory(argMultiMap.getValue("c/").get()) ParserUtil#parseAmount(argMultiMap.getValue("$/").get()) and ParserUtil#parseDate(argMultiMap.getValue("ed/").get()) to parse the arguments provided by the user into the correct formats of the relevant parameters. As the user does not specify a start date in this case, the programme will use the local date on the system’s clock. An AddBudgetCommand object containing the parameter values provided and today’s date as the start date is then created and returned to the LogicManager.

  4. The LogicManager calls AddBudgetCommand#execute(), which will call Model#updateFilteredBudgetList(Predicate<Budget>) to update the list of budgets stored in the finance tracker.

  5. Model#addBudget(budget) is then called to add the budget into the budget list.

  6. The command result is then returned to the LogicManager which then returns it to the UI where the changes are then reflected on the user interface.

Updating of budgets:
  • When a new budget is added, the model checks the expense list for any expenses of that category which fall within the time frame of the added budget and sets the totalSpent and percentage variables of the Budget object accordingly.

  • When an existing budget is edited, the model updates the percentage variable of the Budget object.

  • For every expense the user enters, the model will check if there exists a budget for the category of the added expense and if the date of the expense is within the time frame of the budget. If the added expense is during the time of the budget, the totalSpent variable in the Budget object with that specific category will be updated.

  • The total amount spent for each budget category, along with the percentage of the total budgeted amount, will be displayed to the user so that the user can know how much has been spent so far and can better plan their future expenses so as not to exceed their budget.

3.8.2. Future Enhancements

The Budget class has a boolean method overlaps(Budget other) which returns true if two budgets of the same category have overlapping time frames. This method was included with the idea of allowing the user to add multiple budgets for the same category but for different time frames.

Another future enhancement would be to notify the user when a certain budget is about to exceed. For example, if the percentage spent within the time frame reaches say 90% of the budget amount, the user will receive an e-mail or notification of some sort to alert the user. Another notification can also be sent when the budget is actually exceeded.

Yet another possible enhancement would be to allow the user to set a recurring budget. For example, if a user wants to limit their daily spending to $20, maybe an addrecurringbudget c/food $/20 f/d command, similar to the recurring expense command, could be implemented so that the user does not have to add a budget everyday.

4. Documentation

We use asciidoc for writing documentation.

We chose asciidoc over Markdown because asciidoc, although a bit more complex than Markdown, provides more flexibility in formatting.

4.1. Editing Documentation

See UsingGradle.adoc to learn how to render .adoc files locally to preview the end result of your edits. Alternatively, you can download the AsciiDoc plugin for IntelliJ, which allows you to preview the changes you have made to your .adoc files in real-time.

4.2. Publishing Documentation

See UsingTravis.adoc to learn how to deploy GitHub Pages using Travis.

4.3. Converting Documentation to PDF format

We use Google Chrome for converting documentation to PDF format, as Chrome’s PDF engine preserves hyperlinks used in webpages.

Here are the steps to convert the project documentation files to PDF format.

  1. Follow the instructions in UsingGradle.adoc to convert the AsciiDoc files in the docs/ directory to HTML format.

  2. Go to your generated HTML files in the build/docs folder, right click on them and select Open withGoogle Chrome.

  3. Within Chrome, click on the Print option in Chrome’s menu.

  4. Set the destination to Save as PDF, then click Save to save a copy of the file in PDF format. For best results, use the settings indicated in the screenshot below.

chrome save as pdf
Figure 9. Saving documentation as PDF files in Chrome

4.4. Site-wide Documentation Settings

The build.gradle file specifies some project-specific asciidoc attributes which affects how all documentation files within this project are rendered.

Attributes left unset in the build.gradle file will use their default value, if any.
Table 1. List of site-wide attributes
Attribute name Description Default value

site-name

The name of the website. If set, the name will be displayed near the top of the page.

not set

site-githuburl

URL to the site’s repository on GitHub. Setting this will add a "View on GitHub" link in the navigation bar.

not set

site-seedu

Define this attribute if the project is an official SE-EDU project. This will render the SE-EDU navigation bar at the top of the page, and add some SE-EDU-specific navigation items.

not set

4.5. Per-file Documentation Settings

Each .adoc file may also specify some file-specific asciidoc attributes which affects how the file is rendered.

Asciidoctor’s built-in attributes may be specified and used as well.

Attributes left unset in .adoc files will use their default value, if any.
Table 2. List of per-file attributes, excluding Asciidoctor’s built-in attributes
Attribute name Description Default value

site-section

Site section that the document belongs to. This will cause the associated item in the navigation bar to be highlighted. One of: UserGuide, DeveloperGuide, LearningOutcomes*, AboutUs, ContactUs

* Official SE-EDU projects only

not set

no-site-header

Set this attribute to remove the site navigation bar.

not set

4.6. Site Template

The files in docs/stylesheets are the CSS stylesheets of the site. You can modify them to change some properties of the site’s design.

The files in docs/templates controls the rendering of .adoc files into HTML5. These template files are written in a mixture of Ruby and Slim.

Modifying the template files in docs/templates requires some knowledge and experience with Ruby and Asciidoctor’s API. You should only modify them if you need greater control over the site’s layout than what stylesheets can provide. The SE-EDU team does not provide support for modified template files.

5. Testing

5.1. Running Tests

There are three ways to run tests.

The most reliable way to run tests is the 3rd one. The first two methods might fail some GUI tests due to platform/resolution-specific idiosyncrasies.

Method 1: Using IntelliJ JUnit test runner

  • To run all tests, right-click on the src/test/java folder and choose Run 'All Tests'

  • To run a subset of tests, you can right-click on a test package, test class, or a test and choose Run 'ABC'

Method 2: Using Gradle

  • Open a console and run the command gradlew clean allTests (Mac/Linux: ./gradlew clean allTests)

See UsingGradle.adoc for more info on how to run tests using Gradle.

Method 3: Using Gradle (headless)

Thanks to the TestFX library we use, our GUI tests can be run in the headless mode. In the headless mode, GUI tests do not show up on the screen. That means the developer can do other things on the Computer while the tests are running.

To run tests in headless mode, open a console and run the command gradlew clean headless allTests (Mac/Linux: ./gradlew clean headless allTests)

5.2. Types of tests

We have two types of tests:

  1. GUI Tests - These are tests involving the GUI. They include,

    1. System Tests that test the entire App by simulating user actions on the GUI. These are in the systemtests package.

    2. Unit tests that test the individual components. These are in seedu.address.ui package.

  2. Non-GUI Tests - These are tests not involving the GUI. They include,

    1. Unit tests targeting the lowest level methods/classes.
      e.g. seedu.address.commons.StringUtilTest

    2. Integration tests that are checking the integration of multiple code units (those code units are assumed to be working).
      e.g. seedu.address.storage.StorageManagerTest

    3. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
      e.g. seedu.address.logic.LogicManagerTest

5.3. Troubleshooting Testing

Problem: HelpWindowTest fails with a NullPointerException.

  • Reason: One of its dependencies, HelpWindow.html in src/main/resources/docs is missing.

  • Solution: Execute Gradle task processResources.

6. Dev Ops

6.1. Build Automation

See UsingGradle.adoc to learn how to use Gradle for build automation.

6.2. Continuous Integration

We use Travis CI and AppVeyor to perform Continuous Integration on our projects. See UsingTravis.adoc and UsingAppVeyor.adoc for more details.

6.3. Coverage Reporting

We use Coveralls to track the code coverage of our projects. See UsingCoveralls.adoc for more details.

6.4. Documentation Previews

When a pull request has changes to asciidoc files, you can use Netlify to see a preview of how the HTML version of those asciidoc files will look like when the pull request is merged. See UsingNetlify.adoc for more details.

6.5. Making a Release

Here are the steps to create a new release.

  1. Update the version number in MainApp.java.

  2. Generate a JAR file using Gradle.

  3. Tag the repo with the version number. e.g. v0.1

  4. Create a new release using GitHub and upload the JAR file you created.

6.6. Managing Dependencies

A project often depends on third-party libraries. For example, Finance Tracker depends on the Jackson library for JSON parsing. Managing these dependencies can be automated using Gradle. For example, Gradle can download the dependencies automatically, which is better than these alternatives:

  1. Include those libraries in the repo (this bloats the repo size)

  2. Require developers to download those libraries manually (this creates extra work for developers)

Appendix A: Suggested Programming Tasks to Get Started

Suggested path for new programmers:

  1. First, add small local-impact (i.e. the impact of the change does not go beyond the component) enhancements to one component at a time.

  2. Next, add a feature that touches multiple components to learn how to implement an end-to-end feature across all components.

Appendix B: Product Scope

Target user profile:

  • has a need to manage a significant number of expenses, debts and bills/subscriptions

  • wants to keep track of how much is being spent

  • prefer desktop apps over other types

  • can type fast

  • prefers typing over mouse input

  • is reasonably comfortable using CLI apps

Value proposition: manage finances faster than a typical mouse/GUI driven app

Appendix C: User Stories

Priorities: High (must have) - * * *, Medium (nice to have) - * *, Low (unlikely to have) - *

Priority As a/an …​ I want to …​ So that I can…​

* * *

new user

see usage instructions

refer to instructions when I forget how to use the App

* *

user

view a list of my expenses in certain time periods

have a better overview of my expenses

* * *

user

add expenses into the finance tracker

record all my expenses

* * *

user

see the total amount of money I have

see how much money I have left overall and better plan my finances

* * *

user

make changes to expenses I previously added

correct any mistakes

* * *

organised user

categorise my expenses

know my spending for each category

* * *

user

delete an expense

remove entries that I no longer need to keep track of

* * *

thrifty user

set a budget

manage my expenses and see how much more I can spend for the remaining part of the day/week/month/year

* *

user

split my budget into different categories

enhance my finance planning further and not spend excessively on a single category, e.g. food

* * *

user

edit my budget

change the amount of budget available or the duration

* * *

user

cancel my budget

* *

user

view a list of my debts and see when they are due

remind myself to pay the people I owe by their due dates

* * *

forgetful user

add my debts

can see who I owe money to

* * *

user

edit my debts

change the amount I owe if any changes occur

* * *

user

delete my debts

* * *

user

clear my paid debts

know I have settled them

* * *

user

add my recurring expenses

keep track of my subscriptions and bills

* * *

user

edit my recurring expenses

change the details of my bills if any changes occur

* * *

user

delete my recurring expenses

* * *

analytical user

see a breakdown of my expenses

know what I spend the most on

* *

visual user

have charts and graphs to represent my expenditure

have a better picture on the different categories of my expenses

* *

efficient user

be able to view my command history

easily input a repeated command when needed

* * *

user

undo and redo my actions

* * *

user

clear all entries

start with an empty finance tracker again when needed

* *

non-tech-savvy user

type simple commands step by step

use the programme more easily without having to keep referring to the help menu

*

user

receive reminders regarding my expenditure

know if my spending is about to exceed my budget or when my debts are about to be due

Appendix D: Use Cases

(For all use cases below, the System is the Personal Finance Tracker (PFT) and the Actor is the user, unless specified otherwise)

Use case 1: List expenses

MSS

  1. User chooses to list all expenses and specifies if user wants to view by specific duration or category

  2. PFT displays all expenses according to specified duration or category

    Use case ends.

Extensions:

  • 1a. PFT detects invalid value for view

    • 1a1. PFT informs user that input is invalid

    • Use case ends.

Use case 2: Add expense

MSS

  1. User chooses to add an expense

  2. PFT prompts user for name of expense

  3. User enters name

  4. PFT prompts user for amount for expense

  5. User enters amount

  6. PFT prompts user for date of expense

  7. User enters date

  8. PFT prompts user for remark of expense

  9. User enters remark

  10. PFT creates expense and displays confirmation

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 10.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9)a. PFT detects wrong format or incorrect data

    • 3(5,7,9)a1. PFT requests for correct format

    • 3(5,7,9)a2. User enters correct data

    • Use case resumes from step 4(6,8,10)

Use case 3: Edit expense

MSS

  1. User chooses to edit an existing expense by specifying its index

  2. PFT prompts user for new name of expense

  3. User enters new name

  4. PFT prompts user for new amount of expense

  5. User enters new amount

  6. PFT prompts user for new category of expense

  7. User enters new category

  8. PFT prompts user for new date of expense

  9. User enters new date

  10. PFT prompts user for new remark for expense

  11. User enters new remark

  12. PFT updates the existing values to the values entered by user

    Use case ends

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 12.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9,11)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11)a1. PFT requests for correct format

    • 3(5,7,9,11)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12)

Use case 4: Delete expense

MSS

  1. User chooses to delete an existing expense and specifies its index

  2. PFT deletes the expense at the specified index

    Use case ends.

Extensions:

  • 1a. PFT detects that index is invalid.

    • 1a1. PFT informs user that index is invalid.

    • Use case ends.

Use case 5: Add budget

MSS

  1. User chooses to add a budget

  2. PFT prompts user for category of budget

  3. User enters category

  4. PFT prompts user for amount for budget

  5. User enters amount

  6. PFT prompts user for start date of budget

  7. User enters start date

  8. PFT prompts user for end date of budget

  9. User enters end date

  10. PFT creates budget for specified time frame

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 10.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user that command is invalid

    • Use case ends.

  • 3(5,7,9)a. PFT detects wrong format or incorrect data

    • 3(5,7,9)a1. PFT requests for correct format

    • 3(5,7,9)a2. User enters correct data

    • Use case resumes from step 4(6,8,10).

Use case 6: Edit budget

MSS

  1. User chooses to edit an existing budget

  2. PFT prompts user for category to edit budget for

  3. User enters category

  4. PFT prompts user for new amount for budget

  5. User enters new amount

  6. PFT prompts user for new start date of budget

  7. User enters new start date

  8. PFT prompts user for new end date of budget

  9. User enters new end date

  10. PFT updates the existing values to the values entered by user

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 10.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9)a. PFT detects wrong format or incorrect data

    • 3(5,7,9)a1. PFT requests for correct format

    • 3(5,7,9)a2. User enters correct data

    • Use case resumes from step 4(6,8,10).

Use case 7: Delete budget

MSS

  1. User chooses to delete an existing budget and specifies its category

  2. PFT deletes the budget for the specified category

    Use case ends.

Extensions:

  • 1a. PFT detects invalid category

    • 1a1. PFT informs user that category is invalid

    • Use case ends.

Use case 8: List debt

MSS

  1. User chooses to list debts

  2. PFT lists debts

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 2

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

Use case 9: Add debt

MSS

  1. User chooses to add a debt

  2. PFT prompts user for expense owed for debt

  3. User enters name

  4. PFT prompts user for amount owed of debt

  5. User enters amount

  6. PFT prompts user for category of debt

  7. User enters category

  8. PFT prompts user for deadline of debt

  9. User enters deadline

  10. PFT prompts user for remark of debt

  11. User enters remark

  12. PFT creates budget for specified time frame

    Use case ends

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 12.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9,11)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11)a1. PFT requests for correct format

    • 3(5,7,9,11)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12).

Use case 10: Edit budget

MSS

  1. User chooses to edit an existing debt

  2. PFT prompts user for new expense owed for debt

  3. User enters new name

  4. PFT prompts user for new amount for debt

  5. User enters new amount

  6. PFT prompts user for new category for debt

  7. User enters new category

  8. PFT prompts user for new end deadline for debt

  9. User enters new deadline

  10. PFT prompts user for new remark of debt

  11. User enters new remark

  12. PFT updates the existing values to the values entered by user

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 12.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

  • 3(5,7,9,11)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11)a1. PFT requests for correct format

    • 3(5,7,9,11)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12).

Use case 11: Delete debt

MSS

  1. User chooses to delete an existing debt and specifies its index

  2. PFT deletes the debt at the specified index

    Use case ends.

Extensions:

  • 1a. PFT detects invalid index

    • 1a1. PFT informs user that index is invalid

    • Use case ends.

Use case 12: Pay debt

MSS

  1. User chooses to pay off an existing debt and specifies its index

  2. PFT converts the debt into an expense entry

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 2.

  • 1b. User enters complex command with missing parameters

    • 1b1. PFT informs user of invalid command

    • Use case ends.

Use case 13: Add recurring expense

MSS

  1. User chooses to add recurring expense

  2. PFT prompts user for name of recurring expense

  3. User enters name

  4. PFT prompts user for amount of recurring expense

  5. User enters amount

  6. PFT prompts user for category of recurring expense

  7. User enters category

  8. PFT prompts user for frequency of recurring expense

  9. User enters frequency

  10. PFT prompts user for number of occurrences of recurring expense

  11. User enters number of occurrences

  12. PFT prompts user for start date of recurring expence

  13. User enters start date

  14. PFT prompts user for remark of recurring expense

  15. User enters remark

  16. PFT creates recurring expense and displays confirmation

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 16.

  • 1b. User enters complex command with missing parameters

    • Use case ends.

  • 3(5,7,9,11,13,15)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11,13,15)a1. PFT requests for correct format

    • 3(5,7,9,11,13,15)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12,14,16).

Use case 14: Edit recurring expense

MSS

  1. User chooses to edit existing recurring expense

  2. PFT prompts user for new name of recurring expense

  3. User enters new name

  4. PFT prompts user for new amount of recurring expense

  5. User enters new amount

  6. PFT prompts user for new category of recurring expense

  7. User enters new category

  8. PFT prompts user for new frequency of recurring expense

  9. User enters new frequency

  10. PFT prompts user for new number of occurrences of recurring expense

  11. User enters new number of occurrences

  12. PFT prompts user for new start date of recurring expense

  13. User enters new start date

  14. PFT prompts user for new remark of recurring expense

  15. User enters new remark

  16. PFT updates parameters with new values

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 16.

  • 1b. User enters complex command with missing parameters

    • Use case ends.

  • 3(5,7,9,11,13,15)a. PFT detects wrong format or incorrect data

    • 3(5,7,9,11,13,15)a1. PFT requests for correct format

    • 3(5,7,9,11,13,15)a2. User enters correct data

    • Use case resumes from step 4(6,8,10,12,14,16).

Use case 15: Delete recurring expense

MSS

  1. User chooses to delete existing recurring expense and specifies both its index and whether to delete all old expenses already added by this recurring expense

  2. PFT deletes the recurring expense at the specified index

    Use case ends.

Extensions:

  • 1a. PFT detects invalid index.

    • 1a1. PFT informs user that index is invalid

    • Use case ends.

  • 1b. User enters command with missing or invalid parameters

    • 1b1. PFT informs user of invalid input.

    • Use case ends.

Use case 16: View statistics summary

MSS

  1. User chooses to view statistics

  2. PFT prompts user for start date

  3. User enters start date

  4. PFT prompts user for end date

  5. User enters end date

  6. PFT prompts user for visual representation method

  7. User enters visual representation method

  8. PFT displays the statistics requested

    Use case ends

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 8

  • 1b. User enters complex command with missing parameters

    • 1b1. Use case ends

  • 3(5)a. PFT detects wrong format or incorrect data

    • 3(5)a1. PFT requests for correct format

    • 3(5)a2. User enters correct data

    • Use case resumes from step 4(6)

Use case 17: View statistics trend

MSS

  1. User chooses to view statistics trend

  2. PFT prompts user for start date

  3. User enters start date

  4. PFT prompts user for end date

  5. User enters end date

  6. PFT prompts user for period

  7. User enters period

  8. PFT displays the statistics requested

    Use case ends

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 8.

  • 1b. User enters complex command with missing parameters

    • Use case ends.

  • 3(5,7)a. PFT detects wrong format or incorrect data

    • 3(5,7)a1. PFT requests for correct format

    • 3(5,7)a2. User enters correct data

    • Use case resumes from step 4(6,8).

Use case 18: Compare 2 statistic summaries

MSS

  1. User chooses to compare statistics

  2. PFT prompts user for date 1

  3. User enters date

  4. PFT prompts user for date 2

  5. User enters date

  6. PFT prompts user for period

  7. User enters period

  8. PFT displays the statistics requested

    Use case ends.

Extensions:

  • 1a. User enters complex command

    • Use case resumes from step 8.

  • 1b. User enters complex command with missing parameters

    • Use case ends.

  • 3(5,7)a. PFT detects wrong format or incorrect data

    • 3(5,7)a1. PFT requests for correct format

    • 3(5,7)a2. User enters correct data

    • Use case resumes from step 4(6,8)

Use case 19: View command history

MSS

  1. User chooses to view command history

  2. PFT lists all valid commands entered in reverse chronological order

    Use case ends.

Use case 20: Auto-fill previous command

MSS

  1. User keys in “Up” arrow

  2. PFT auto-fills previous command stored in history in the command line

    Steps 1-2 can be repeated as many times as required until the command wanted is reached

  3. User presses enter

  4. PFT executes autofilled command

    Use case ends.

Extensions:

  • 2a. User realises user has accidentally pressed "Up" arrow too many times

    • 2a1. User presses "Down" arrow

    • 2a2. PFT auto-fills next command stored in history in the command line

    • Steps 2a1-2a2 can be repeated as many times as required until the command wanted is reached

    • Use case resumes from step 3.

Use case 21: Undo previous command

MSS

  1. User chooses to undo previous command

  2. PFT restores itself to the state before the previous undoable command

Extensions:

  • 1a. PFT does not find any undoable command

    • 1a1. PFT informs user that there are no undoable commands executed previously

      Use case ends.

Use case 22: Clear all entries

MSS

  1. User chooses to clear all entries stored

  2. PFT requests for confirmation

  3. User enters confirmation

  4. PFT deletes all entries

    Use case ends.

Use case 23: Exit programme

MSS

  1. User chooses to exit

  2. PFT closes itself and exits

    Use case ends.

Appendix E: Non Functional Requirements

  1. Should work on any mainstream OS as long as it has Java 9 or higher installed.

  2. Should respond to most commands within 2 seconds.

  3. Should work on 32-bit and 64-bit environments.

  4. Should be backwards compatible with data produced by the earlier versions of the system.

  5. Should be able to hold up to 1000 entries without a noticeable sluggishness in performance for typical usage.

  6. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse.

  7. A user with below average to average typing speed for regular English text should be able to accomplish most of the tasks using commands as easily as using the mouse.

  8. Size of program should be less than 15MBs.

  9. User interface should be intuitive enough for users who are not IT-savvy.

  10. User interface should be responsive based on different screen sizes.

Appendix F: Glossary

Mainstream OS

Windows, Linux, Unix, OS-X

Complex command

A command in which both the command as well as the compulsory parameters are entered in the same command line

Appendix G: Instructions for Manual Testing

Given below are instructions to test the app manually.

These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing.

G.1. Launch and Shutdown

  1. Initial launch

    1. Download the jar file and copy into an empty folder

    2. Double-click the jar file
      Expected: Shows the GUI with an empty finance tracker. The window size may not be optimum.

  2. Saving window preferences

    1. Resize the window to an optimum size. Move the window to a different location. Close the window.

    2. Re-launch the app by double-clicking the jar file.
      Expected: The most recent window size and location is retained.

G.2. Deleting an expense

  1. Deleting an expense while all expenses are listed

    1. Prerequisites: List all expenses using the listexpense v/all command. Multiple expenses in the list.

    2. Test case: deleteexpense 1
      Expected: First expense is deleted from the list. Details of the deleted expense shown in the status message. Timestamp in the status bar is updated.

    3. Test case: deleteexpense 0
      Expected: No expense is deleted. Error details shown in the status message. Status bar remains the same.

    4. Other incorrect delete commands to try: deleteexpense, deleteexpense x (where x is an integer larger than the list size), deleteexpense n/bkt
      Expected: Similar to previous.

G.3. Adding a budget

  1. Adding a budget for a specific category

    1. Prerequisite: Add a budget for food category using the addbudget c/food $/100 ed/31-12-2020 command (if you are doing this in year 2021 or later, make sure the ed/ date is later than today’s date). Now a food budget exists in budget list.

    2. Test case: adding a budget for a category which already has a budget
      Command: addbudget c/food $/200 ed/31-12-2020
      Expected: No budget is created. Error message that budget already exists for that category shown in status message.

    3. Test case: adding a budget for a new category without specifying the amount allocated for that budget
      Command: addbudget c/travel ed/31-12-2020 Expected: No budget is created. Error message that command format is invalid shown in status message.

    4. Test case: adding a budget with end date before start date
      Command: addbudget c/food $/250 sd/01-01-2020 ed/30-06-2019
      Expected: No budget is created. Error message for invalid end date is shown in status message.

  2. Saving added budgets

After adding a budget, close the window then re-launch the app.
Expected: the budget list panel shows the budget(s) you had previously added before closing the window.

G.4. Editing a debt

  1. Editing a debt while all debts are listed

    1. Prerequisites: List all debts using the listdebt v/all command. Multiple debts in the list.

    2. Test case: editdebt 2 $/17
      Expected: Amount for second debt in the list is changed to $17. Success message shown in status message.

    3. Test case: editdebt 1
      Expected: First debt is not edited. Message prompting user for at least one field to be edited shown in status message.

    4. Also try editdebt 0 due/31-12-2020
      Expected: No debt edited. Error message for invalid command format shown in status message.

G.5. Adding a recurring expense

  1. Adding a recurring expense to an empty list

    1. Test case: addrecurring n/daily thing $/2 c/entertainment f/d o/14 Expected: Recurring expense with specified name daily thing, amount $2, category ENTERTAINMENT, frequency daily and occurrence 14 times added to recurring list with starting date set as today’s date. Success message shown in status message.

    2. Test case: addrecurring n/daily sustenance $/10 c/food or addrecurring n/annual trip $/1500 f/y o/10
      Expected: No recurring expense created. Error message for invalid command format shown in status message.

    3. Test case: addrecurring n/monthly donation $/100 c/others f/m o/12 d/01-01-2019
      Expected: No recurring expense created. Error message for invalid date shown in status message.