Developer Guide
- Acknowledgements
- Design
- Implementation
- Documentation, logging, testing, configuration, dev-ops
- Appendix: Requirements
- Appendix: Instructions for manual testing
Acknowledgements
Design
.puml
files used to create diagrams in this document can be found in the diagrams folder. Refer to the PlantUML Tutorial at se-edu/guides to learn how to create and edit diagrams.
Architecture
The Architecture Diagram given above explains the high-level design of the App.
Given below is a quick overview of main components and how they interact with each other.
Main components of the architecture
Main
has two classes called Main
and 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 methods where necessary.
Commons
represents a collection of classes used by multiple other components.
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.
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 delete-c 1
.
Each of the four main components (also shown in the diagram above),
- defines its API in an
interface
with the same name as the Component. - implements its functionality using a concrete
{Component Name}Manager
class which follows the corresponding APIinterface
mentioned in the previous point.
For example, the Logic
component defines its API in the Logic.java
interface and implements its functionality using the LogicManager.java
class which follows the Logic
interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component’s being coupled to the implementation of a component), as illustrated in the (partial) class diagram below.
The sections below give more details of each component.
UI component
The API of this component is specified in Ui.java
The UI consists of a MainWindow
that is made up of parts e.g.CommandBox
, ResultDisplay
, HomeTab
,
StatTab
etc. All these, including the MainWindow
, inherit from the abstract UiPart
class which captures the
commonalities between classes that represent parts of the visible GUI.
There are 2 main tab panes contained in MainWindow
:
-
HomeTab
: Displays all the orders, client bookmarks and recipe bookmarks. -
StatTab
: Displays all the ingredients and also business statistics such as revenue for each month, top 10 most frequent clients and top 10 most popular recipes
The UI
component uses the 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.
Logic component
API : Logic.java
Here’s a (partial) class diagram of the Logic
component:
How the Logic
component works:
- When
Logic
is called upon to execute a command, it uses theAddressBookParser
class to parse the user command. - This results in a
Command
object (more precisely, an object of one of its subclasses e.g.,DeleteClientCommand
) which is executed by theLogicManager
. - The command can communicate with the
Model
when it is executed (e.g. to delete a client). - The result of the command execution is encapsulated as a
CommandResult
object which is returned back fromLogic
. - Lastly the
LogicManager
communicates withStorage
to save the changes.
The Sequence Diagram below illustrates the interactions within the Logic
component for the execute("delete-c 1")
API call.
Here are the other classes in Logic
(omitted from the class diagram above) that are used for parsing a user command:
How the parsing works:
- When called upon to parse a user command, the
AddressBookParser
class creates anXYZCommandParser
(XYZ
is a placeholder for the specific command name e.g.,AddOrderCommandParser
) which uses the other classes shown above to parse the user command and create aXYZCommand
object (e.g.,AddOrderCommand
) which theAddressBookParser
returns back as aCommand
object. - All
XYZCommandParser
classes (e.g.,AddOrderCommandParser
,DeleteOrderCommandParser
, …) inherit from theParser
interface so that they can be treated similarly where possible e.g, during testing.
Model component
API : Model.java
The Model
component,
- stores a
UserPref
object that represents the user’s preferences. This is exposed to the outside as aReadOnlyUserPref
objects. - stores the application data in the following components:
- a
UniqueClientList
containingClient
objects. - a
UniqueIngredientList
containingIngredient
objects. - a
UniqueOrderList
containingOrder
objects. - a
UniqueRecipeList
containingRecipe
objects.
- a
- exposes an unmodifiable
ObservableList<Client>
,ObservableList<Ingredient>
,ObservableList<Order>
andObservableList<Recipe>
which can be observed by the UI. This allows the UI to automatically update the displayed list when the data in the list is modified. - does not depend on any of the other three components (
Ui
,Logic
,Storage
).
Storage component
API : Storage.java
The Storage
component,
- can save both application data and user preference data in json format, and read them back into corresponding objects.
- inherits from both
AddressBookStorage
andUserPrefStorage
, which means it can be treated as either one (if only the functionality of only one is needed). - depends on some classes in the
Model
component (because theStorage
component’s job is to save/retrieve objects that belong to theModel
)
Common classes
Classes used by multiple components are in the ay2122s1_cs2103t_w16_2.btbb.commons
package.
Implementation
This section describes some noteworthy details on how certain features are implemented.
Add feature
Overview
Add operations can be executed for the following entities: clients, orders, ingredients and recipes.
Mechanism
This is how the add mechanism works in general:
- User enters an add command.
- A relevant
AddXCommandParser
, whereX
is one of the entities, parses the command to generate aAddXCommand
. - The
AddXCommandParser
generates a relevantXDescriptor
that contains the details of the entityX
to be created. - The
AddXCommand
is executed. During execution, theXDescriptor
is converted to its respectiveX
entity. -
Model
adds the entity. -
Storage
saves the changes. - Feedback about the status of the add is shown to the user.
The following sequence diagram shows how the add order operation works. The sequence diagram for other entities (client, ingredient and recipe) in the model is similar. However, for add order, there is an additional optional step of subtracting the ingredient quantities for each matching ingredient in the inventory.
Usage scenarios
The following activity diagram summarizes what happens when a user executes an add order command:
Example of a successful addition using the add order command:
- The user wishes to add an order.
- The user executes an appropriate add order command to add an order. The
commandText
is received byMainWindow#executeCommand()
and the above mechanism occurs. - The app adds the order and the order is shown in the list.
Copy bookmark details to order feature
Overview
Copy operations can be executed for the following entities: clients and recipes. Instead of keying in all the details of a client when adding an order, the user can specify the index of the client displayed in the client list to copy over the details of the client to the order. This can also be done for recipes.
Example:
- With both client and recipe index
add-o c/1 r/3 od/12-12-2021 1800 oq/2
Mechanism
This is how the copy mechanism works in general:
- User enters an add order command using
X
index whereX
is one of the entities. - A relevant
AddOrderCommandParser
parses the command to generate aAddOrderCommand
. - The
AddOrderCommand
is executed. -
Model
getsX
fromX
list using the specified index. - Details of
X
is copied into the order. -
Model
adds the order. -
Storage
saves the changes. - Feedback about the status of the addition is shown to the user.
The sequence diagram is similar to the add feature.
Usage scenarios
The following activity diagram summarizes what happens when a user executes an add order command using a client index. The activity diagram for adding an order using a recipe index is similar.
Example of a successful addition using the add order command using a client index:
- The user wishes to add an order for the first client in the displayed client list.
- The user executes
add-o c/1 rn/Chicken Rice od/12-12-2021 1800 op/4.00 oq/2
ThecommandText
is received byMainWindow#executeCommand()
and the above mechanism occurs. - The app adds an order containing the details of the first client and the order is shown in the list.
Delete feature
Overview
Delete operations can be executed for the following entities: clients, orders, ingredients and recipes.
Mechanism
This is how the delete mechanism works in general:
- User enters a delete command.
- A relevant
DeleteXCommandParser
, whereX
is one of the entities, parses the command to generate aDeleteXCommand
. - The
DeleteXCommand
is executed. -
Model
deletes the entity. -
Storage
saves the changes. - Feedback about the status of the delete is shown to the user.
The following sequence diagram shows how the delete order operation works. The sequence diagram for other entities (client, ingredient and recipe) in the model is similar. However, for delete order, there is an additional optional step of adding ingredient quantities back to matching ingredients in the inventory.
Usage scenarios
The following activity diagram summarizes what happens when a user executes a delete order command:
Example of a successful deletion using the delete order command:
- The user wishes to delete the first order in the list.
- The user executes
delete-o 1
command to delete the first order. ThecommandText
is received byMainWindow#executeCommand()
and the above mechanism occurs. - The app deletes the order and the order is no longer shown in the list.
Edit feature
Overview
Edit operations can be executed for the following entities: clients, orders, ingredients and recipes.
Mechanism
This is how the edit mechanism works in general:
- User enters an edit command.
- A relevant
EditXCommandParser
, whereX
is one of the entities, parses the command to generate aEditXCommand
. - The
EditXCommandParser
generates a relevantXDescriptor
that contains the details of the entityX
to be edited. - The
EditXCommand
is executed. During execution, theXDescriptor
is converted to its respectiveX
entity. -
Model
updates the entity. -
Storage
saves the changes. - Feedback about the status of the edit is shown to the user.
The following sequence diagram shows how the edit order operation works. The sequence diagram for other entities (client, ingredient and recipe) in the model is similar. However, for edit order, there is an additional optional step of adding/subtracting the ingredient quantities for each matching ingredient in the inventory when there is a change in order quantity.
Usage scenarios
The following activity diagram summarizes what happens when a user executes an edit order command:
Example of a successful edit using the edit order command:
- The user wishes to edit an order.
- The user executes an appropriate edit order command to edit an order. The
commandText
is received byMainWindow#executeCommand()
and the above mechanism occurs. - The app edits the order and the order is shown in the list.
Edit ingredients in order/ recipe feature
Overview
Each order and recipe can contain a list of ingredients. The list is edited through add and delete operations.
Mechanism - Add order/ recipe ingredient
This is how the mechanism works in general:
- User enters an add ingredient command.
- A relevant
AddXIngredientCommandParser
, whereX
is eitherOrder
orRecipe
, parses the command to generate aAddXIngredientCommand
. - The
AddXIngredientCommand
is executed. - The new ingredient is added to a copy of the ingredients list of the specified order or recipe, forming a new ingredients list.
-
Model
updates the order or recipe with the new ingredients list. -
Storage
saves the changes. - Feedback about the status of the addition is shown to the user.
The sequence diagram is similar to the edit feature.
Mechanism - Delete order/ recipe ingredient
This is how the mechanism works in general:
- User enters a delete ingredient command.
- A relevant
DeleteXIngredientCommandParser
, whereX
is eitherOrder
orRecipe
, parses the command to generate aDeleteXIngredientCommand
. - The
DeleteXIngredientCommand
is executed. - A copy of the ingredients list of the specified order or recipe is made and the specified ingredient is removed.
-
Model
updates the order or recipe with the new ingredients list. -
Storage
saves the changes. - Feedback about the status of the deletion is shown to the user.
The sequence diagram is similar to the edit feature.
Usage Scenario - Add order/ recipe ingredient
Example of a successful addition of ingredient using the add recipe ingredient command:
- The user wishes to add an ingredient to a recipe in the list.
- The user executes
add-ri 1 in/Rice iq/400 iu/g
command to add 400 grams of Rice to the first recipe. ThecommandText
is received byMainWindow#executeCommand()
and the above mechanism occurs. - The app adds the ingredient to the recipe and the edited recipe is displayed.
Usage Scenario - Delete order/ recipe ingredient
Example of a successful deletion of ingredient using the delete recipe ingredient command:
- The user wishes to delete an ingredient from a recipe in the list.
- The user executes
delete-ri 1 i/2
command to delete the second ingredient from the first recipe. ThecommandText
is received byMainWindow#executeCommand()
and the above mechanism occurs. - The app deletes the ingredient from the recipe and the edited recipe is displayed.
Find feature
Overview
Find operations can be executed for all entity types in the model, ie. clients, orders, ingredients and recipes.
Mechanism
The find mechanism is facilitated by 4 generic classes that implement the
Java Predicate
interface. The 4 classes are PredicateCollection
,
StringContainsKeywordsPredicate
, ValueInListPredicate
and
ValueWithinRangePredicate
. All of these classes are generic so that their
functionality can be reused for all entity types. The purposes of these classes
are as follows:
-
StringContainsKeywordsPredicate
- Tests if a field in an object matches any of the keywords provided by the user. This class can perform partial and case-insensitive matches. -
ValueInListPredicate
- Tests if a value of a field in an object exists in the list of values provided by the user. -
ValueWithinRangePredicate
- Tests if a value of a field in an object is within a range of values provided by the user. -
PredicateCollection
- Tests if an object satisfies all the predicates contained in this class. This class enables finding entities based on multiple search criteria.
Usage Scenario
-
The user executes the
find-i in/avo gin iqf/1 iqt/10
command to find ingredients whose name matches the keywords ‘avo’ or ‘gin’ and whose quantities are from the range 1-10. -
The
FindIngredientCommandParser
parses the command intoFindIngredientCommand
. AStringContainsKeywordsPredicate
is created with the keywords ‘avo’ and ‘gin’. AValueWithinRangePredicate
is created with the start value set to ‘1’ and end value set to ‘10’. Both of these predicates are added to aPredicateCollection
. AFindCommand
is created with thePredicateCollection
. -
The
ModelManager#updateFilteredIngredientList
method gets called with thePredicateCollection
which causes theFilteredIngredientList
inModelManager
to only contain ingredients that match all the find criteria. -
The
FilteredIngredientList
is a JavaFXObservableList
that is observed by theIngredientListPanel
. The change inFilteredIngredientList
will cause theIngredientListPanel
to re-render, showing only the ingredients that match the find criteria.
The following sequence diagram shows how the find operation for the above scenario works:
List feature
Overview
List operation can be executed for the following entities: clients, orders, ingredients and recipes.
Mechanism
This section explains the List Mechanism:
The list mechanism is facilitated by updating the filtered list in ModelManager
with the predicate that shows all objects in the specified entity list.
The Filtered List is a JavaFX ObservableList
that is observed by the respective entity Ui Panel.
Changes made to this list will cause the Ui panel to re-render, showing all objects of the specified entity.
Usage Scenario
The following sequence diagram shows how the list order operation works:
Example of a successful outcome using the List command:
- The user wishes to list all orders in the order list.
- The user executes
list-o
command to display everything stored in the specified order list. ThecommandText
is received byMainWindow#executeCommand()
. - The
ListOrderCommandParser
parses the command into aListOrderCommand
, which is passed back to theLogic
to be executed. - The
Logic
Component then executes the command. - The Model’s
filteredOrderList
will be updated to show all orders. - The
CommandResult
created would then be passed to the Ui components, to display the updated order list and result message to the user. - The app shows all orders in the order list.
Statistics feature
Overview
Statistics will always be displayed to the user. The following order operations can be executed to update the statistics:
- add-o
- delete-o
- edit-o (with changes made to recipe price and/or client phone number and client name)
Mechanism
This is how the statistics mechanism works in general:
- User enters any order command that updates statistics.
- A relevant
XOrderCommandParser
, whereX
is one of the operations, parses the command to generate aXOrderCommand
. - The
XOrderCommand
is executed. -
Model
updates theUniqueOrderList
andStorage
saves the changes. - Feedback about the status of the operation is shown to the user.
- The relevant data is retrieved from
Model
viaLogic
and passed into a newStatTabContent
object. -
StatTab
which contains the statistic charts, is updated with the contents of theStatTabContent
.
The following sequence diagram shows how the statistics work:
Usage scenarios
The following activity diagram summarizes what happens when statistics are updated through an order command:
Example of a successful update to statistics, by adding an order:
- The user wishes to add an order.
- The user executes an appropriate add order command to add an order. The
commandText
is received byMainWindow#executeCommand()
and the above mechanism occurs. - The app adds the order and the order is shown in the list.
- Since the command will update the statistic charts, the new chart data is retrieved from Model.
- All charts are updated with the new chart data.
Tab feature
Overview
Tabs are switched programmatically in 2 ways:
- Tab command
- Executing a command that affects the view of contents in a tab
Mechanism
The tab switch mechanism is facilitated by CommandResult
.
This is because any programmatic tab switch will only occur after the execution of a command
and information about the switch has to be passed to Ui
components.
After executing a command, if a tab switch should occur,
the tab to switch to is stored in a CommandResult
.
This CommandResult
is created in a Ui
object through MainWindow#executeCommand()
.
Hence, data about whether there is a tab switch and which tab to switch to
can be passed to Ui
components and rendered accordingly.
The following sequence diagram shows how the tab operation works:
Usage Scenarios
The following activity diagram summarizes what happens when a user executes a command:
Example of a successful switch using the Tab command:
- The user wishes to switch to the Home tab.
- The user executes
tab 1
command to switch to the Home tab. ThecommandText
is received byMainWindow#executeCommand()
and the above mechanism occurs. - The app shows the Home tab.
Documentation, logging, testing, configuration, dev-ops
Appendix: Requirements
Product scope
Target user profile:
- Home chef
- Prepares meal orders at home
- Sells meals to clients through delivery
- Individual business owner
- Tracks orders, inventory and revenue
- Types quickly
- Prefers typing to mouse interactions
- Comfortable with CLI applications
Value proposition: The application allows home chefs who are individual business owners to track orders and revenue. They can easily and quickly create new orders by copying bookmarked client and recipe details. They can also use the app to track the status of their inventory. Some business statistics are available to help home chefs make business plans.
User stories
Priorities: High - (must have), Medium - (nice to have), Low - (unlikely to have)
As a home chef |
||
---|---|---|
Priority |
I can... |
So that... |
HIGH | Add an ingredient and quantity to the inventory | I can keep track of my inventory |
HIGH | Delete ingredients from the inventory | My inventory is always up to date |
HIGH | Edit ingredients in the inventory | I can update my inventory with ingredients that I recently bought or used. |
HIGH | Find ingredients by keywords | I know the quantity of a specific ingredient |
HIGH | View all ingredients in my inventory | I can see the remaining quantity of all my ingredients |
HIGH | Detect duplicate ingredients | I do not clutter the application with duplicate ingredients |
HIGH | Add a client | I can copy details from a client to easily fill up the details of an order |
HIGH | Delete clients | I can remove former clients |
HIGH | Edit clients | I can update their contact information |
HIGH | Find clients by keywords | I can find client information to fill up the details of an order |
HIGH | View all clients | I can view all my current clients |
HIGH | Detect duplicate clients | I do not clutter the application with duplicate clients |
HIGH | Add an order | I can keep track of my orders |
HIGH | Add a quantity to an order | I can create multiple orders for the same client |
HIGH | Add a price to an order | I can keep track of my revenue |
HIGH | Delete orders | I can delete cancelled orders |
HIGH | Edit orders | I can update the details of my orders |
HIGH | Find orders by keywords | I can find a specific order |
HIGH | View all orders | I can view all my current orders |
HIGH | Detect duplicate orders | I do not clutter the application with duplicate orders |
HIGH | Mark an order as done | I can set the status of an order |
HIGH | Mark an order as undone | I can reverse the changes made to the status of an order |
HIGH | Add a recipe | I can copy details from a recipe to easily fill up the details of an order |
HIGH | Delete recipes | I can delete unused recipes |
HIGH | Edit recipes | I can update recipe details, like changing the ingredients used or recipe name |
HIGH | Find recipes by keywords | I can reference certain recipes when creating an order |
HIGH | View all recipes | I can see all the current recipes used |
HIGH | Detect duplicate recipes | I do not clutter the application with duplicate recipes |
HIGH | View my most popular recipes | I can focus on growing my business with the popular recipes |
HIGH | View my monthly revenue | I can tell if my business is growing |
HIGH | View my most frequent clients | I can reinforce business relationships with my most frequent clients |
Use cases
(For all use cases below, the System is the BobTheBistroBoss (BTBB)
and the Actor is the Home Chef
, unless specified otherwise)
Use case: UC01 Add client
MSS
- Home Chef chooses to add a client.
- Home Chef enters details in required format.
-
BTBB displays the new client.
Use case ends.
Extensions
- 2a. Client entered already exists in the system.
-
2a1. BTBB informs Home Chef that client already exists.
Use case ends.
-
- 2b. BTBB detects an error in the entered data.
-
2b1. BTBB informs Home Chef why addition of client failed.
Use case ends.
-
Use case: UC02 Find client
MSS
- Home Chef chooses to find a client by a field.
- Home Chef enters search terms in required format.
-
BTBB displays all client(s) that match the terms.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why finding a client failed.
Use case ends.
-
Use case: UC03 Delete client
MSS
- Home Chef chooses to delete a client.
- Home Chef enters details to delete a client.
-
BTBB informs Home Chef that client has been deleted.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why deletion of client failed.
Use case ends.
-
Use case: UC04 View all clients
MSS
- Home Chef chooses to view all clients.
- Home Chef enters command to see all clients.
-
BTBB displays all clients.
Use case ends.
Use case: UC05 Edit client
MSS
- Home Chef chooses to edit a client’s details.
- Home Chef enters details in required format.
-
BTBB displays the edited client.
Use case ends.
Extensions
- 2a. Client entered already exists in the system.
-
2a1. BTBB informs Home Chef that client already exists.
Use case ends.
-
- 2b. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why editing of client failed.
Use case ends.
-
Use case: UC06 Add ingredient
MSS
- Home Chef chooses to add an ingredient.
- Home Chef enters details in required format.
-
BTBB displays the new ingredient.
Use case ends.
Extensions
- 2a. Ingredient entered already exists in the system.
-
2a1. BTBB informs Home Chef that ingredient already exists.
Use case ends.
-
- 2b. BTBB detects an error in the entered data.
-
2b1. BTBB informs Home Chef why addition of ingredient failed.
Use case ends.
-
Use case: UC07 Find Ingredient
MSS
- Home Chef chooses to find an ingredient by a field.
- Home Chef enters search terms in required format.
-
BTBB displays all ingredient(s) that match the terms.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
- 2a1. BTBB informs Home Chef why finding an ingredient failed.
Use case ends.
Use case: UC08 Delete Ingredient
MSS
- Home Chef chooses to delete an ingredient.
- Home Chef enters details to delete an ingredient.
-
BTBB informs Home Chef that ingredient has been deleted.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why deletion of ingredient failed.
Use case ends.
-
Use case: UC09 View all ingredients
MSS
- Home Chef chooses to view all ingredients.
- Home Chef enters command to see all ingredients.
-
BTBB displays all ingredients.
Use case ends.
Use case: UC10 Edit Ingredient
MSS
- Home Chef chooses to edit an ingredient.
- Home Chef enters details in required format.
-
BTBB displays the edited ingredient.
Use case ends.
Extensions
- 2a. Ingredient entered already exists in the system.
-
2a1. BTBB informs Home Chef that ingredient already exists.
Use case ends.
-
- 2b. BTBB detects an error in the entered data.
-
2b1. BTBB informs Home Chef why editing of ingredient failed.
Use case ends.
-
Use case: UC11 Add Order
MSS
- Home Chef chooses to add an order.
- Home Chef enters details in required format.
-
BTBB displays the new order.
Use case ends.
Extensions
- 2a. Order entered already exists in the system.
-
2a1. BTBB informs Home Chef that order already exists.
Use case ends.
-
- 2b. BTBB detects an error in the entered data.
- 2b1. BTBB informs Home Chef why addition of order failed.
Use case ends.
Use case: UC12 Find order
MSS
- Home Chef chooses to find an order by a field.
- Home Chef enters search terms in required format.
-
BTBB displays all order(s) that match the terms.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why finding an order failed.
Use case ends.
-
Use case: UC13 Delete Order
MSS
- Home Chef chooses to delete an order.
- Home Chef enters details in required format.
-
BTBB informs Home Chef that order has been deleted.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why deletion of order failed.
Use case ends.
-
Use case: UC14 View all orders
MSS
- Home Chef chooses to view all orders.
- Home Chef enters command to see all orders.
-
BTBB displays all orders.
Use case ends.
Use case: UC15 Edit order
MSS
- Home Chef chooses to edit an order.
- Home Chef enters details in required format.
-
BTBB displays the edited order.
Use case ends.
Extensions
- 2a. Order entered already exists in the system.
-
2a1. BTBB informs Home Chef that order already exists.
Use case ends.
-
- 2b. BTBB detects an error in the entered data.
-
2b1. BTBB informs Home Chef why editing of order failed.
Use case ends.
-
Use case: UC16 Mark order as done
MSS
- Home Chef chooses to mark an order as done.
-
BTBB displays order as done.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why marking an order as done failed.
Use case ends.
-
Use case: UC17 Mark order as undone
MSS
- Home Chef chooses to mark an order as undone.
-
BTBB displays order as undone.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why marking an order as undone failed.
Use case ends.
-
Use case: UC18 Add recipe
MSS
- Home Chef chooses to add a recipe.
- Home Chef enters details in required format.
-
BTBB displays the new recipe.
Use case ends.
Extensions
- 2a. Recipe entered already exists in the system.
-
2a1. BTBB informs Home Chef that recipe already exists.
Use Case ends.
-
- 2b. BTBB detects an error in the entered data.
-
2b1. BTBB informs Home Chef why addition of recipe failed.
Use case ends.
-
Use case: UC19 Find recipe
MSS
- Home Chef chooses to find a recipe by a field.
- Home Chef enters search terms in required format.
-
BTBB displays all recipe(s) that match the terms.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why finding a recipe failed.
Use Case ends.
-
Use case: UC20 Delete recipe
MSS
- Home Chef chooses to delete a recipe.
- Home Chef enters details in required format.
-
BTBB informs Home Chef that recipe has been deleted.
Use case ends.
Extensions
- 2a. BTBB detects an error in the entered data.
-
2a1. BTBB informs Home Chef why deletion of recipe failed.
Use Case ends.
-
Use case: UC21 View all recipes
MSS
- Home Chef chooses to view all recipes.
- Home Chef enters command to see all recipes.
-
BTBB displays all recipes.
Use case ends.
Use case: UC22 Edit recipe
MSS
- Home Chef chooses to edit a recipe.
- Home Chef enters details in required format.
-
BTBB displays the edited recipe.
Use case ends.
Extensions
- 2a. Recipe entered already exists in the system.
-
2a1. BTBB informs Home Chef that recipe already exists.
Use case ends.
-
- 2b. BTBB detects an error in the entered data.
-
2b1. BTBB informs Home Chef why editing of recipe failed.
Use case ends.
-
Use case: UC23 View revenue for each month for past 12 months
MSS
- Home Chef wants to view revenue earned each month for past 12 months.
- Home Chef switches to statistics tab.
-
BTBB displays revenue earned each month for the past 12 months in a bar chart.
Use case ends.
Use case: UC24 View top 10 most frequent clients
MSS
- Home Chef chooses to view top 10 most frequent clients.
- Home Chef switches to statistics tab.
-
BTBB displays top 10 most frequent clients in a pie chart.
Use case ends.
Use case: UC25 View top 10 most popular recipes
MSS
- Home Chef chooses to view top 10 most popular recipes.
- Home Chef switches to statistics tab.
-
BTBB displays top 10 most popular recipes in a pie chart.
Use case ends.
Non-Functional Requirements
- Usability Requirements:
- Should work on systems with Java 11 and above.
- Should work on Windows, Linux and macOS.
- Should function fully offline without access to the internet.
- Cannot be used on mobile devices.
- Should function smoothly in English, there are no guarantees for other languages.
- Data Requirements:
- Data of clients, orders and ingredients should persist after the app closes.
- Should be able to handle up to 20000 orders.
- Data should be transferable from 1 computer to another.
Glossary
- Mainstream OS: Windows, Linux and macOS.
- BTBB: BobTheBistroBoss.
- Client: Client information that can be copied to orders.
- Ingredient: Ingredient information that is stored in inventory, orders and recipes.
- Inventory: Keeps track of ingredients and their quantities.
- Order: Meal order sold to a client.
- Recipe: Recipe information that can be copied to orders.
Prefix Glossary
Prefix | Parameter | Associated with |
---|---|---|
c/ | CLIENT_INDEX | Client |
ca/ | CLIENT_ADDRESS | Client |
ce/ | CLIENT_EMAIL | Client |
cn/ | CLIENT_NAME | Client |
cp/ | CLIENT_PHONE | Client |
i/ | INGREDIENT_INDEX | Ingredient |
in/ | INGREDIENT_NAME | Ingredient |
iq/ | INGREDIENT_QUANTITY | Ingredient |
iqf/ | INGREDIENT_QUANTITY_FROM | Ingredient |
iqt/ | INGREDIENT_QUANTITY_TO | Ingredient |
iu/ | INGREDIENT_UNIT | Ingredient |
od/ | ORDER_DEADLINE | Order |
of/ | ORDER_FINISHED | Order |
op/ | ORDER_PRICE | Order |
oq/ | ORDER_QUANTITY | Order |
r/ | RECIPE_INDEX | Recipe |
ri/ | RECIPE_INGREDIENT | Recipe |
rn/ | RECIPE_NAME | Recipe |
rp/ | RECIPE_PRICE | Recipe |
Appendix: Instructions for manual testing
Given below are instructions to test the app manually.
Viewing help and Switching tabs
- Viewing help
- Test case:
help
Expected: A pop up window is displayed with a link to BTBB’s user guide. - Test case:
help 123
Expected: A pop up window is displayed with a link to BTBB’s user guide.
- Test case:
- Switching tabs
- Test case:
tab 1
Expected: UI switches to the Home tab. - Test case:
tab 2
Expected: UI switches to the Inventory & Statistics tab. - Test case:
tab -1
Expected: UI does not switch tabs. Error details shown in the result display box. - Test case:
tab abc
Expected: UI does not switch tabs. Error details shown in the result display box. - Test case:
tab 5
Expected: UI does not switch tabs. Error details shown in the result display box.
- Test case:
Client
- Adding a client
- Prerequisite: Client bookmarks list does not contain a client with
99887766
as his/her phone number. - Test case:
add-c cn/Richard Roe cp/99887766 ce/richardr@example.com ca/311, Clementi Ave 2, #02-25
Expected: A new client is added to client bookmarks list with the given details. Details of the added client are shown in the result display box. - Test case:
add-c cn/John Doe cp/98765432 ce/johnd@example.com
Expected: No client is added. Error details shown in the result display box. - Test case:
add-c cn/John Doe cp/98765432 ca/311, Clementi Ave 2, #02-25
Expected: No client is added. Error details shown in the result display box. - Test case:
add-c cn/John Doe ce/johnd@example.com ca/311, Clementi Ave 2, #02-25
Expected: No client is added. Error details shown in the result display box. - Test case:
add-c cp/98765432 ce/johnd@example.com ca/311, Clementi Ave 2, #02-25
Expected: No client is added. Error details shown in the result display box. - Test case:
add-c cn/John Doe cp/98765432 ce/johndexample.com ca/311, Clementi Ave 2, #02-25
Expected: No client is added. Error details shown in the result display box. - Test case:
add-c cn/John Doe cp/98765432 ce/+johnd@example.com ca/311, Clementi Ave 2, #02-25
Expected: No client is added. Error details shown in the result display box. - Test case:
add-c cn/John Doe cp/987654321098765432100 ce/johnd@example.com ca/311, Clementi Ave 2, #02-25
Expected: No client is added. Error details shown in the result display box. - Test case:
add-c 1 cn/John Doe cp/987654321098762100 ce/johnd@example.com ca/311, Clementi Ave 2, #02-25
Expected: No client is added. Error details shown in the result display box. - Test case:
add-c
Expected: No client is added. Error details shown in the result display box.
- Prerequisite: Client bookmarks list does not contain a client with
- Deleting a client
- Prerequisites: Client bookmarks list shows at least 1 client and at most 3 clients.
- Test case:
delete-c 1
Expected: First client is deleted from the client bookmarks list. Details of the deleted client are shown in the result display box. - Test case:
delete-c -1
Expected: No client is deleted. Error details shown in the result display box. - Test case:
delete-c 4
Expected: No client is deleted. Error details shown in the result display box. - Test case:
delete-c abc
Expected: No client is deleted. Error details shown in the result display box. - Test case:
delete-c
Expected: No client is deleted. Error details shown in the result display box.
- Editing a client
- Prerequisites: Client bookmarks list shows at least 1 client and at most 3 clients.
- Test case:
edit-c 1 cn/Marcus Goh ce/marcusg@gmail.com
Expected: First client in the client bookmarks list is edited to have the name ‘Marcus Goh’ and email ‘marcusg@gmail.com’. Its position in the client bookmarks list may change. Details of the edited client are shown in the result display box. - Test case:
edit-c 1 ca/333, Serangoon North Ave 1
Expected: First client in the client bookmarks list is edited to have the address ‘333, Serangoon North Ave 1’. - Test case:
edit-c cn/Ryan Lim
Expected: No client is edited. Error details shown in the result display box. - Test case:
edit-c abc cn/Ryan Lim
Expected: No client is edited. Error details shown in the result display box. - Test case:
edit-c
Expected: No client is edited. Error details shown in the result display box. - Test case:
edit-c 1
Expected: No client is edited. Error details shown in the result display box. - Test case:
edit-c -1 cn/Ryan Lim
Expected: No client is edited. Error details shown in the result display box. - Test case:
edit-c 5 cn/Ryan Lim
Expected: No client is edited. Error details shown in the result display box. - Test case:
edit-c 1 cp/98
Expected: No client is edited. Error details shown in the result display box.
- Finding clients by keywords
- Prerequisites: There are exactly 2 clients in the client bookmarks list. The client details are as follows:
- Name: John Doe, Phone: 98765432, Address: 311, Clementi Ave 2, #02-25, Email: johnd@gmail.com
- Name: Gary Lim, Phone: 99887766, Address: 333, Buona Vista Ave 2, #03-37, Email: garyl@gmail.com
- Test case:
find-c cn/john
Expected: Client bookmarks list only shows the client with the name ‘John Doe’. - Test case:
find-c cn/gary
Expected: Client bookmarks list only shows the client with the name ‘Gary Lim’. - Test case:
find-c ca/311
Expected: Client bookmarks list only shows the client with the address ‘311, Clementi Ave 2, #02-25’. - Test case:
find-c ca/333
Expected: Client bookmarks list only shows the client with the address ‘333, Buona Vista Ave 2, #03-37’. - Test case:
find-c cp/9876
Expected: Client bookmarks list only shows the client with the phone ‘98765432’. - Test case:
find-c cp/9988
Expected: Client bookmarks list only shows the client with the phone ‘99887766’. - Test case:
find-c ce/john
Expected: Client bookmarks list only shows the client with the email ‘johnd@gmail.com’. - Test case:
find-c ce/gary
Expected: Client bookmarks list only shows the client with the email ‘garyl@gmail.com’. - Test case:
find-c cn/
Expected: No change in the client bookmarks list display. Error details shown in the result display box. - Test case:
find-c
Expected: No change in the client bookmarks list display. Error details shown in the result display box. - Test case:
find-c 1 cn/john
Expected: No change in the client bookmarks list display. Error details shown in the result display box.
- Prerequisites: There are exactly 2 clients in the client bookmarks list. The client details are as follows:
- Listing all clients
- Prerequisite: Client bookmark list has at least 1 client.
- Test case:
list-c
Expected: Client bookmarks list displays all clients. - Test case:
list-c 123
Expected: Client bookmarks list displays all clients.
Ingredient
- Adding an ingredient
- Prerequisites: Inventory has no ingredients.
- Test case:
add-i in/Chocolate Syrup iq/3 iu/bottles
Expected: A new ingredient is added to inventory with the given details. Details of added ingredient will be shown in the result display box. - Test case:
add-i in/Chocolate iq/4
Expected: No ingredient is added. Error details shown in the result display box. - Test case:
add-i iq/4 iu/bars
Expected: No ingredient is added. Error details shown in the result display box. - Test case:
add-i in/Chocolate iu/bars
Expected: No ingredient is added. Error details shown in the result display box. - Test case:
add-i in/Chocolate iq/0 iu/bars
Expected: No ingredient is added. Error details shown in the result display box. - Test case:
add-i 2 in/Chocolate iq/3 iu/bars
Expected: No ingredient is added. Error details shown in the result display box. - Test case:
add-i
Expected: No ingredient is added. Error details shown in the result display box.
- Deleting an ingredient
- Prerequisites: Inventory has at least 1 ingredient and at most 3 ingredients.
- Test case:
delete-i 1
Expected: First ingredient in inventory is deleted. Details of deleted ingredient will be shown in the result display box. - Test case:
delete-i 0
Expected: No ingredient is deleted. Error details shown in the result display box. - Test case:
delete-i -2
Expected: No ingredient is deleted. Error details shown in the result display box. - Test case:
delete-i abc
Expected: No ingredient is deleted. Error details shown in the result display box. - Test case:
delete-i
Expected: No ingredient is deleted. Error details shown in the result display box.
- Editing an ingredient
- Prerequisites: Inventory only has these 3 ingredients:
- name: Apple, unit: whole
- name: Banana, unit: whole
- name: Carrot, unit: pack
- Test case:
edit-i 1 in/Rice iq/4 iu/bags
Expected: First ingredient in the inventory is edited to have ingredient name ‘Rice’, quantity ‘4’ and unit ‘bags’. Its position in the inventory may change. Details of the edited ingredient are shown in the result display box. - Test case:
edit-i 3 in/Apricot
Expected: Third ingredient in the inventory is edited to have ingredient name ‘Apricot’. Its position in the inventory may change. Details of the edited ingredient are shown in the result display box. - Test case:
edit-i 0 in/Apple
Expected: No ingredient is edited. Error details shown in the result display box. - Test case:
edit-i -2 in/Apple
Expected: No ingredient is edited. Error details shown in the result display box. - Test case:
edit-i in/Apple
Expected: No ingredient is edited. Error details shown in the result display box. - Test case:
edit-i 1
Expected: No ingredient is edited. Error details shown in the result display box.
- Prerequisites: Inventory only has these 3 ingredients:
- Finding ingredients by keywords
- Prerequisites: There are exactly 3 ingredients in the inventory.
- name: Green Apple, quantity: 10, unit: whole
- name: Banana, quantity: 13, unit: whole
- name: Carrot, quantity: 20, unit: pack
- Test case:
find-i in/apple iq/10
Expected: Inventory only shows the ingredient with the ingredient name ‘Green Apple’. - Test case:
find-i in/apple iq/11
Expected: Inventory shows 0 ingredients. - Test case:
find-i iq/13
Expected: Inventory only shows the ingredient with the ingredient name ‘Banana’. - Test case:
find-i iqf/13
Expected: Inventory shows 2 ingredients: ‘Banana’ and ‘Carrot’. - Test case:
find-i iqf/10 iqt/13
Expected: Inventory shows 2 ingredients: ‘Green Apple’ and ‘Banana’. - Test case:
find-i iq/10 13
Expected: Inventory shows 2 ingredients: ‘Green Apple’ and ‘Banana’. - Test case:
find-i iq/13 iqf/10 iqt/20
Expected: Inventory only shows the ingredient with the ingredient name ‘Banana’. - Test case:
find-i in/
Expected: No change in the inventory. Error details shown in the result display box. - Test case:
find-i iqf/20 iqt/10
Expected: No change in the inventory. Error details shown in the result display box. - Test case:
find-i 2 iq/13
Expected: No change in the inventory. Error details shown in the result display box. - Test case:
find-i
Expected: No change in the inventory. Error details shown in the result display box.
- Prerequisites: There are exactly 3 ingredients in the inventory.
- Listing all ingredients
- Prerequisite: Inventory has at least 1 ingredient.
- Test case:
list-i
Expected: Inventory displays all ingredients. - Test case:
list-i abc
Expected: Inventory displays all ingredients.
Order
- Adding an Order
- Prerequisites (should be satisfied for each individual test case):
- Order list does not contain an order with the following details:
- Client Name: Alex Yeoh
- Client Phone: 87438807
- Client Address: Blk 30 Geylang Street 29. #06-40
- Recipe Name: Chicken Rice
- Recipe Ingredients: Rice x 200 g, Chicken x 1 whole
- Order Price: $4.00
- Order Deadline: 12 December 2021 at 12 pm
- Order Quantity: 1
- Completion status: Uncompleted
- Client bookmark list contains at least one client and the first client in the list has the following details:
- Client Name: Alex Yeoh
- Client Phone: 87438807
- Client Address: Blk 30 Geylang Street 29. #06-40
- Client Email: alexyeoh@gmail.com
- Recipe bookmark list contains at least one recipe and the first recipe in the list has the following details:
- Recipe Name: Chicken Rice
- Recipe Ingredients: Rice x 200 g, Chicken x 1 whole
- Recipe Price: 4
- Order list does not contain an order with the following details:
- Test case (all client and recipe details specified):
add-o cn/Alex Yeoh cp/87438807 ca/Blk 30 Geylang Street 29. #06-40 rn/Chicken Rice ri/Rice-200-g, Chicken-1-whole op/4 od/12-12-2021 1200 oq/1
Expected: A new order is added to order list with the given details. Details of the added order are shown in the result display box. - Test case (only client index used):
add-o c/1 rn/Chicken Rice ri/Rice-200-g, Chicken-1-whole op/4 od/12-12-2021 1200 oq/1
Expected: A new order is added to order list with the given details (client details are copied from the first client). Details of the added order are shown in the result display box. - Test case (only recipe index used):
add-o cn/Alex Yeoh cp/87438807 ca/Blk 30 Geylang Street 29. #06-40 r/1 op/4 od/12-12-2021 1200 oq/1
Expected: A new order is added to order list with the given details (recipe details are copied from the first recipe). Details of the added order are shown in the result display box. - Test case (both client and recipe index used):
add-o c/1 r/1 op/4 od/12-12-2021 1200 oq/1
Expected: A new order is added to order list with the given details (client and recipe details are copied from the first client and recipe respectively). Details of the added order are shown in the result display box. - Test case:
add-o cn/Alex Yeoh cp/87438807 ca/Blk 30 Geylang Street 29. #06-40 rn/Chicken Rice ri/Rice-200-g, Chicken-1-whole op/4 od/12-12-2021 1200
Expected: A new order is added to order list with the given details. Details of the added order are shown in the result display box. - Test case:
add-o cn/Alex Yeoh cp/87438807 ca/Blk 30 Geylang Street 29. #06-40 rn/Milo op/1.40 od/12-12-2021 1200
Expected: A new order is added to order list with the given details. Details of the added order are shown in the result display box. - Test case:
add-o cn/Alex Yeoh cp/87438807 ca/Blk 30 Geylang Street 29. #06-40 rn/Nasi Lemak op/1.40
Expected: No order is added. Error details shown in the result display box. - Test case (all client and recipe details specified):
add-o cn/Alex Yeoh cp/847521698521145366247893451125 ca/Blk 30 Geylang Street 29. #06-40 rn/Chicken Rice ri/Rice-200-g, Chicken-1-whole op/4 od/12-12-2021 1200 oq/1
Expected: No order is added. Error details shown in the result display box. - Test case:
add-o c/0 r/1 op/4 od/12-12-2021 1200 oq/1
Expected: No order is added. Error details shown in the result display box. - Test case:
add-o op/4 od/12-12-2021 1200 oq/1
Expected: No order is added. Error details shown in the result display box. - Test case:
add-o
Expected: No order is added. Error details shown in the result display box.
- Prerequisites (should be satisfied for each individual test case):
- Adding an order ingredient
- Prerequisites: Order list shows at least 1 order and at most 3 orders. The first order in the list does not have rice (in grams) as one of its ingredients.
- Test case:
add-oi 1 in/Rice iq/400 iu/g
Expected: The new ingredient is added to the first order. Details of the new ingredient and the edited order are shown in the result display box. - Test case:
add-oi 4 in/Rice iq/400 iu/g
Expected: No order is edited. Error details shown in the result display box. - Test case:
add-oi 1 in/Chicken iq/0 iu/whole
Expected: No order is edited. Error details shown in the result display box. - Test case:
add-oi 1 in/Chicken iq/500000 iu/whole
Expected: No order is edited. Error details shown in the result display box. - Test case:
add-oi 1 in/Chi$ken iq/4 iu/whole
Expected: No order is edited. Error details shown in the result display box. - Test case:
add-oi 1 in/Chicken iq/4 iu/who%le
Expected: No order is edited. Error details shown in the result display box. - Test case:
add-oi 1 in/Rice iu/g
Expected: No order is edited. Error details shown in the result display box. - Test case:
add-oi in/Rice iq/400 iu/g
Expected: No order is edited. Error details shown in the result display box. - Test case:
add-oi
Expected: No order is edited. Error details shown in the result display box.
- Deleting an order
- Prerequisites: Order list shows at least 1 order and at most 3 orders.
- Test case:
delete-o 1
Expected: First order is deleted from the order list. Details of the deleted order are shown in the result display box. - Test case:
delete-o -1
Expected: No order is deleted. Error details shown in the result display box. - Test case:
delete-o 4
Expected: No order is deleted. Error details shown in the result display box. - Test case:
delete-o abc
Expected: No order is deleted. Error details shown in the result display box. - Test case:
delete-o
Expected: No order is deleted. Error details shown in the result display box.
- Deleting an order ingredient
- Prerequisites: Order at index 1 has at least 1 ingredient and at most 3 ingredients.
- Test case:
delete-oi 1 i/1
Expected: First ingredient is deleted from the ingredient list in the first order of the order list. Details of the deleted ingredient and edited order are shown in the result display box. - Test case:
delete-oi 1 i/10
Expected: No order is edited. Error details shown in the result display box. - Test case:
delete-oi abc i/1
Expected: No order is edited. Error details shown in the result display box. - Test case:
delete-oi 1 i/abc
Expected: No order is edited. Error details shown in the result display box. - Test case:
delete-oi 1
Expected: No order is edited. Error details shown in the result display box. - Test case:
delete-oi i/1
Expected: No order is edited. Error details shown in the result display box. - Test case:
delete-oi
Expected: No order is edited. Error details shown in the result display box.
- Editing an order
- Prerequisites (should be satisfied for each individual test case):
- Order list contains at least one order and the first order in the list has the following details:
- Client Name: Alex Yeoh
- Client Phone: 87438807
- Client Address: Blk 30 Geylang Street 29. #06-40
- Recipe Name: Chicken Rice
- Recipe Ingredients: Rice x 200 g, Chicken x 1 whole
- Order Price: $4.00
- Order Deadline: 12 December 2021 at 12 pm
- Order Quantity: 1
- Completion status: Uncompleted
- Client bookmark list contains at least one client and the first client in the list has the following details:
- Client Name: Richard Yeoh
- Client Phone: 96847225
- Client Address: Blk 2 Bedok Street 12. #06-41
- Client Email: richard@gmail.com
- Recipe bookmark list contains at least one recipe and the first recipe in the list has the following details:
- Recipe Name: Nasi Lemak
- Recipe Ingredients: Rice x 200 g, Fish x 1 whole
- Recipe Price: 3
- Order list contains at least one order and the first order in the list has the following details:
- Test case:
edit-o 1 cn/Alexa White cp/91542652
Expected: The client name and phone in the first order is edited to ‘Alexa White’ and ‘91542652’ respectively. Details of the edited order are shown in the result display box. - Test case:
edit-o 1 c/1
Expected: The details of the first client in the client bookmarks list is copied to the first order in the order list. Details of the edited order are shown in the result display box. - Test case:
edit-o 1 r/1
Expected: The details of the first recipe in the recipe bookmarks list is copied to the first order in the order list. Details of the edited order are shown in the result display box. - Test case:
edit-o 1 op/1 od/12-12-2021 1900 oq/2
Expected: First order in the order list is edited to have order price of ‘1’, order deadline at ‘12 December 2021 7pm’ and order quantity of ‘2’. Its position in the order list may change. Details of the edited order are shown in the result display box. - Test case:
edit-o rn/Chocolate Cupcake op/20
Expected: No order is edited. Error details shown in the result display box. - Test case:
edit-o
Expected: No order is edited. Error details shown in the result display box. - Test case:
edit-o 1
Expected: No order is edited. Error details shown in the result display box. - Test case:
edit-o abc
Expected: No order is edited. Error details shown in the result display box. - Test case:
edit-o 1 op/-2
Expected: No order is edited. Error details shown in the result display box.
- Prerequisites (should be satisfied for each individual test case):
- Finding orders by keywords
- Prerequisites: There are exactly 2 orders in the order list.
- First order has the following details:
- Client Name: Bernice Yu
- Client Phone: 98762159
- Client Address: Blk 12 Holland Village Street 1. #01-40
- Recipe Name: Nasi Lemak
- Recipe Ingredients: Rice x 200 g, Fish x 1 whole
- Order Price: $3.00
- Order Deadline: 15 December 2021 at 1 pm
- Order Quantity: 2
- Completion status: Uncompleted
- Second order has the following details:
- Client Name: Alex Yeoh
- Client Phone: 87438807
- Client Address: Blk 30 Geylang Street 29. #06-40
- Recipe Name: Chicken Rice
- Recipe Ingredients: Rice x 200 g, Chicken x 1 whole
- Order Price: $4.00
- Order Deadline: 12 October 2021 at 12 pm
- Order Quantity: 1
- Completion status: Completed
- First order has the following details:
- Test case:
find-o cn/alex
Expected: Order list only shows the second order. - Test case:
find-o of/yes
Expected: Order list only shows the second order. - Test case:
find-o of/no
Expected: Order list only shows the first order. - Test case:
find-o rn/Nasi Lemak
Expected: Order list only shows the first order. - Test case:
find-o rn/Chicken Rice
Expected: Order list only shows the second order. - Test case:
find-o cn/charlie
Expected: Order list shows 0 orders. - Test case:
find-o cn/
Expected: No change in the order list display. Error details shown in the result display box. - Test case:
find-o
Expected: No change in the order list display. Error details shown in the result display box.
- Prerequisites: There are exactly 2 orders in the order list.
- Listing all orders
- Prerequisite: Order list has at least one order.
- Test case:
list-o
Expected: Order list displays all orders. - Test case:
list-o abc
Expected: Order list displays all orders.
- Marking an order as done
- Prerequisites: There are exactly 2 orders in the order list.
- First order has the following details:
- Client Name: Bernice Yu
- Client Phone: 98762159
- Client Address: Blk 12 Holland Village Street 1. #01-40
- Recipe Name: Nasi Lemak
- Recipe Ingredients: Rice x 200 g, Fish x 1 whole
- Order Price: $3.00
- Order Deadline: 15 December 2021 at 1 pm
- Order Quantity: 2
- Completion status: Uncompleted
- Second order has the following details:
- Client Name: Alex Yeoh
- Client Phone: 87438807
- Client Address: Blk 30 Geylang Street 29. #06-40
- Recipe Name: Chicken Rice
- Recipe Ingredients: Rice x 200 g, Chicken x 1 whole
- Order Price: $4.00
- Order Deadline: 12 October 2021 at 12 pm
- Order Quantity: 1
- Completion status: Completed
- First order has the following details:
- Test case:
done-o 1
Expected: The first order is marked as completed. It’s position in the Order list may change. Details of marked order are shown in the result display. - Test case:
done-o 2
Expected: The second order is still marked as completed. Details of marked order are shown in the result display. - Test case:
done-o 3
Expected: No change in the order list display. Error details shown in the result display box. - Test case:
done-o -1
Expected: No change in the order list display. Error details shown in the result display box.
- Prerequisites: There are exactly 2 orders in the order list.
- Marking an order as undone
- Prerequisites: There are exactly 2 orders in the order list.
- First order has the following details:
- Client Name: Bernice Yu
- Client Phone: 98762159
- Client Address: Blk 12 Holland Village Street 1. #01-40
- Recipe Name: Nasi Lemak
- Recipe Ingredients: Rice x 200 g, Fish x 1 whole
- Order Price: $3.00
- Order Deadline: 15 December 2021 at 1 pm
- Order Quantity: 2
- Completion status: Uncompleted
- Second order has the following details:
- Client Name: Alex Yeoh
- Client Phone: 87438807
- Client Address: Blk 30 Geylang Street 29. #06-40
- Recipe Name: Chicken Rice
- Recipe Ingredients: Rice x 200 g, Chicken x 1 whole
- Order Price: $4.00
- Order Deadline: 12 October 2021 at 12 pm
- Order Quantity: 1
- Completion status: Completed
- First order has the following details:
- Test case:
undone-o 2
The second order is marked as uncompleted. It’s position in the Order list may change. Details of marked order are shown in the result display. - Test case:
undone-o 1
Expected: The first order is still marked as uncompleted. Details of marked order are shown in the result display. - Test case:
undone-o 3
Expected: No change in the order list display. Error details shown in the result display box. - Test case:
undone-o -1
Expected: No change in the order list display. Error details shown in the result display box.
- Prerequisites: There are exactly 2 orders in the order list.
Recipe
- Adding a Recipe
- Prerequisites (should be satisfied for each individual test case):
- Recipe list does not contain a recipe with the following details:
- Recipe Name: Chicken Rice
- Recipe Ingredients: Rice x 200 g, Chicken x 1 whole
- Recipe Price: $4.00
- Recipe list does not contain a recipe with the following details:
- Test case:
add-r rn/Chicken Rice ri/Rice-200-g, Chicken-1-whole rp/4
Expected: A new recipe is added to the recipe list with the given details. Details of the added recipe are shown in the result display box. - Test case:
add-r rn/Chicken Rice ri/Rice-200-g, Chicken-1-whole
Expected: No recipe is added. Error details shown in the result display box. - Test case:
add-r ri/Rice-200-g, Chicken-1-whole rp/4
Expected: No recipe is added. Error details shown in the result display box. - Test case:
add-r rn/Chicken Rice$$ ri/Rice-200-g, Chicken-1-whole rp/4
Expected: No recipe is added. Error details shown in the result display box. - Test case:
add-r rn/Chicken Rice ri/Rice, Chicken-1-whole rp/4
Expected: No recipe is added. Error details shown in the result display box. - Test case:
add-r rn/Chicken Rice ri/Rice-200-g, Chicken-1-whole rp/$4
Expected: No recipe is added. Error details shown in the result display box.
- Prerequisites (should be satisfied for each individual test case):
- Adding a recipe ingredient
- Prerequisites: Recipe list shows at least 1 recipe and at most 3 recipes. The first recipe in the list does not have rice (in grams) as one of its ingredients.
- Test case:
add-ri 1 in/Rice iq/400 iu/g
Expected: The new ingredient is added to the first recipe. Details of the new ingredient and the edited recipe are shown in the result display box. - Test case:
add-ri 4 in/Rice iq/400 iu/g
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
add-ri 1 in/Chicken iq/0 iu/whole
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
add-ri 1 in/Chicken iq/500000 iu/whole
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
add-ri 1 in/Chi$ken iq/4 iu/whole
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
add-ri 1 in/Chicken iq/4 iu/who%le
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
add-ri 1 in/Rice iu/g
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
add-ri in/Rice iq/400 iu/g
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
add-ri
Expected: No recipe is edited. Error details shown in the result display box.
- Deleting a recipe
- Prerequisites: Recipe list shows at least 1 recipe and at most 3 recipes.
- Test case:
delete-r 1
Expected: First recipe is deleted from the recipe list. Details of the deleted recipe are shown in the result display box. - Test case:
delete-r -1
Expected: No recipe is deleted. Error details shown in the result display box. - Test case:
delete-r 4
Expected: No recipe is deleted. Error details shown in the result display box. - Test case:
delete-r abc
Expected: No recipe is deleted. Error details shown in the result display box. - Test case:
delete-r
Expected: No recipe is deleted. Error details shown in the result display box.
- Deleting a recipe ingredient
- Prerequisites: Recipe at index 1 has at least 1 ingredient and at most 3 ingredients.
- Test case:
delete-ri 1 i/1
Expected: First ingredient is deleted from the ingredient list in the first recipe of the recipe bookmarks list. Details of the deleted ingredient and edited recipe are shown in the result display box. - Test case:
delete-ri 1 i/10
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
delete-ri abc i/1
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
delete-ri 1 i/abc
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
delete-ri 1
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
delete-ri i/1
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
delete-ri
Expected: No recipe is edited. Error details shown in the result display box.
- Editing a recipe
- Prerequisites: Recipe bookmarks list only has these 3 recipes:
- name: Banana split, price: $10
- name: Orange cake, price: $12
- name: Pecan pie, price: $10
- Test case:
edit-r 1 rn/Truffle fries rp/8.00
Expected: First recipe in the recipe bookmarks list is edited to have recipe name ‘Truffle fries’ and recipe price of ‘$8.00’. Its position in the recipe bookmarks list may change. Details of the edited recipe are shown in the result display box. - Test case:
edit-r 1 rn/Apple pie
Expected: First recipe in the recipe bookmarks list is edited to have recipe name ‘Apple pie’. Its position in the recipe bookmarks list may change. Details of the edited recipe are shown in the result display box. - Test case:
edit-r rn/Apple pie
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
edit-r
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
edit-r 1
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
edit-r abc
Expected: No recipe is edited. Error details shown in the result display box. - Test case:
edit-r 1 rp/-2
Expected: No recipe is edited. Error details shown in the result display box.
- Prerequisites: Recipe bookmarks list only has these 3 recipes:
- Finding recipes by keywords
- Prerequisites: There are exactly 2 recipes in the recipe bookmarks list. One has the recipe name ‘Apple Pie’, the other has the recipe name ‘Banana split’.
- Test case:
find-r rn/apple
Expected: Recipe bookmarks list only shows the recipe with the recipe name ‘Apple Pie’. - Test case:
find-r rn/chocolate
Expected: Recipe bookmarks list shows 0 recipes. - Test case:
find-r rn/
Expected: No change in the recipe bookmarks list display. Error details shown in the result display box. - Test case:
find-r
Expected: No change in the recipe bookmarks list display. Error details shown in the result display box.
- Listing all recipes
- Prerequisites: Recipe bookmarks list has at least 1 recipe.
- Test case:
list-r
Expected: Recipe bookmarks list displays all recipes. - Test case:
list-r abc
Expected: Recipe bookmarks list displays all recipes.
Exiting the program
- Exit the application
- Prerequisite: Application is running.
- Test case:
exit
Expected: Application window closes. Data is saved to the json file.
Saving data and Editing the data file
- Dealing with missing data files
- Move your copy of
btbb.jar
to an empty directory. - If that directory has a directory named
data
, delete thedata
directory. - Double-click
btbb.jar
to launch the application. If that does not work, use your terminal to navigate to the directory containingbtbb.jar
and executejava -jar btbb.jar
.
Expected: The application GUI shows sample data.
- Move your copy of
- Dealing with corrupted data files
- Replace all of the content in
data/btbb.json
withCorrupted file
. - Double-click
btbb.jar
to launch the application. If that does not work, use your terminal to navigate to the directory containingbtbb.jar
and executejava -jar btbb.jar
.
Expected: The application GUI does not show any data.
- Replace all of the content in