Developer Guide
Table of Contents
- 1.0 Introduction
- 2.0 Setting up
- 3.0 Design
- 4.0 Implementation
- Appendix A: Product Scope
- Appendix B: User Stories
- Appendix C: Non-Functional Requirements
- Appendix D: Glossary
- Appendix E: Instructions for manual testing
- Launch and Shutdown
- Testing for Book Management
- Testing for Quote Management
- Adding a quote
- Listing all quotes
- Listing quotes by a specific author
- Listing quotes from a specific reference
- Listing quotes from a specific author and reference
- Editing a quote
- Deleting a quote
- Finding a quote
- Adding reflection to quote
- Listing reflection of a quote
- Editing reflection of a quote
- Deleting reflection of a quote
- Testing for Progress Tracker
- Testing for Category Management
- Testing for Rating System for books
1.0 Introduction
Welcome to Quotesify!
Quotesify is a free desktop application to help you in your reading activities. With Quotesify, you can add books and its related quotes that you wish to remember. You can categorize your books and quotes by an author, customize categories, and even rate your books. Quotesify also comes with a progress tracker which improves your reading experience.
This guide will provide information on the design and implementation of Quotesify. It will help you to get started on your journey of being a contributor to Quotesify. This guide will also explain the steps to test out the program, so that you will have a better understanding of the current status of Quotesify.
2.0 Setting up
- Fork the Quotesify repo from here, and clone the fork to your computer.
- Open up your IDE (IntelliJ is highly recommended). If you are not at the welcome screen,
click
File
>Close Project
to close any existing project. - Set up the correct JDK version for Gradle:
- Click
Configure
>Project Defaults
>Project Structure
. - Click
New…
and find the directory where you saved your JDK.
- Click
- Click
Import Project
. - Locate the build.gradle file and select it.
- Click
OK
. - Click
Open as Project
. - Click
OK
to accept all default settings. - To verify the set up, locate the
Quotesify.java
file, right-click it and selectRun Quotesify.main()
. If the setup is correct, you should see something like this as shown below:
________ __ .__ _____
\_____ \ __ __ _____/ |_ ____ _____|__|/ ____\__.__.
/ / \ \| | \/ _ \ __\/ __ \ / ___/ \ __< | |
/ \_/. \ | ( <_> ) | \ ___/ \___ \| || | \___ |
\_____\ \_/____/ \____/|__| \___ >____ >__||__| / ____|
\__> \/ \/ \/
Welcome to Quotesify v2.1!
Before you continue, here's something:
Better days are coming, they are called Saturday and Sunday.
----------------------------------------------------------------
What would you like to do with Quotesify?
Note: If you have added a quote before, the quote printed will be randomized.
3.0 Design
Note: All UML diagrams in this guide are stored in the docs/images directory.
3.1 Architecture
The architecture diagram displayed above describes the high-level design of Quotesify. Below details a brief description of each component shown.
Main class: Quotesify.java
- On program launch, the Main is responsible for initialising the required components in the correct sequence as well as to connect these components to start Quotesify.
- On shutdown, the Main gracefully terminates the application and its running components.
The other components that make up Quotesify include:
- UI: Text-based User Interface (UI) of the application.
- Logic: Handles the execution of user input commands.
- Model: Stores Quotesify’s data objects in application memory.
- Storage: Stores and accesses program data in the hard disk.
The Sequence Diagram below shows an example of how the components work together upon receiving the command
add -b Harry Potter /by JK Rowling
.
- The user command
add -b Harry Potter /by JK Rowling
will be converted into a String object nameduserCommandText
, which is then passed into the Logic component for parsing and execution of the command.
3.2 UI Component
The class diagram below shows the associations between classes that make up the UI component.
The UI component is made up of mainly 2 classes:
TextUi
: Responsible for the majority of the display of Quotesify’s messages.UiMessage
: Holds all messages required for TextUI to print to the program console.
In essence, the UI is responsible for the majority of the display of all successful command executions, error messages , as well as user interactions by prompting for the next command.
3.3 Logic Component
The class diagram below shows the associations between classes that make up the Logic component.
Note: Model and Storage in this diagram represent components, not classes.
The Logic component is made up of 2 sub-components, namely the Parser
and Command
. Below describes the sequence
flow from the time a user input is read till command execution ends.
- UI fetches the User input, which is passed into the Parser for parsing.
- Parser returns a Command object, which is then executed.
- The command execution outcome may affect Quotesify’s model objects. (e.g. adding a book)
- Command instructs the UI component to print out relevant output messages depending on command type. Also, Command may invoke saving of data via Storage at a given point in time.
- Finally, Command will then inspect the exit status after command execution to verify if the program should exit.
- Control is handed back over to the UI, either for processing of program exit, or the next user input command.
X
represents the execution type consisting ofAdd
,Delete
,Edit
,Find
,List
,Done
.Y
represents the model type consisting ofBook
,Quote
,Category
,Bookmark
,ToDo
,Rating
.
Therefore,
XCommand
class represents the command type such asAddCommand
,FindCommand
,DeleteCommand
, etc.XYCommand
class represents the command to execute from a specific model type. Such asAddBookCommand
,FindBookCommand
,DeleteQuoteCommand
, etc.
3.4 Model Component
The class diagram below shows the associations between classes that make up the Model component.
The model component consists of several classes that make up the main features of Quotesify. Each object holds in-application data unique to each feature and is stored in a list of their own.
3.5 Storage Component
The storage component consists of a single Storage
class. It is responsible for saving user data as instructed
by the command component as well as to detect and load data on program launch.
On program launch:
Storage
is initialised and checks for the existence of save data.- If save data exists,
Storage
will read the save data in JSON format and parses them back into their model objects (e.g. Book). - If save data does not exist,
Storage
will create an empty save file in the specified directory.
On Command execution:
Storage
parses all model objects in JSON format and writes into the save file.
4.0 Implementation
Note: All UML diagrams in this guide are stored in the docs/images directory.
4.1 Feature: Book Management
Given below is the class diagram for classes related to Book Management in Quotesify:
- The
XBookCommand
class representsAddBookCommand
,ListBookCommand
,EditBookCommand
,DeleteBookCommand
,FindBookCommand
andDoneBookCommand
.4.1.1 Add Books
The sequence diagram below demonstrates the command execution process when adding a book to the booklist.
- To reduce complexity and increase readability, the sequence diagram excludes error handling.
- The Parser and AddCommand classes parses the user input, which is also not shown in the diagram.
- We did not include the
checkMissingInformation()
method in the sequence diagram as it merely checks for possible missing information given in the user input and throws exceptions. - Upon ensuring there are no mistakes in the user input,
createNewBook()
will be called, which essentially creates a new book after ensuring there are no identical books already in the BookList. sort()
method is called after adding the book to the BookList in order to sort the books in alphabetical order.
Design Considerations
- Title and author must be specified as <title,author> is used as the primary key.
- Pros: Allows users to specify different books with the same title but different author.
- Cons: Need to check for both title and author to prevent duplicates.
- BookList is always sorted in alphabetical order
- Alternative 1 (current choice): Sort after adding the book
- Pros: Only need to sort after every addition, listing is as per normal
- Cons: Adding books may take longer if size of BookList is too large
- Alternative 2: Sort before listing the books
- Pros: Adding books will not take as long
- Cons: Since there are multiple listing methods, may not be the best method to keep sorting before listing.
- Alternative 1 (current choice): Sort after adding the book
4.1.2 Find Book by Keyword
The sequence diagram below demonstrates the command execution process when finding books by a keyword.
- Opt-frames ensure that the user input is correct and that the keyword results in a non-empty list of books.
- Parsing of user input is done in the Parser and FindCommand classes, which is not shown in the diagram.
findByKeyword()
method filters books regardless of case.
Design Considerations
- Allows user to find books if either title or author contains the keyword.
- Pros: Users can find books not just based on book title alone. The search range is increased to author name as well.
- Cons: Need to check for both title and author for the list of results.
- Case insensitive
- Pros: Users do not have to bother about the exact letter case when typing the keyword.
- Cons: Need to ensure all titles or authors are converted to the same case before searching.
- Keyword or phrase
- Alternative 1: Let users find by multiple space-separated keywords
- Pros: Users can find books if they can only remember part of the book title.
- Cons: Search list may not be narrowed as much.
- Alternative 2 (current choice): Let users find by exact phrase
- Pros: Users can narrow down the search using an exact phrase instead of just one word.
- Cons: The exact phrase must be typed out for the correct result to show.
- Alternative 1: Let users find by multiple space-separated keywords
4.2 Feature: Quote Management
Given below is the class diagram for classes related to the Quote Management System in Quotesify:
A Quote
object holds the following attributes:
- A
String
that holds the quote given by the user. - An
Author
object that contains the author name of the quote. - A
String
that holds the reference title from where the quote was from. -
A
String
that holds the user given reflection of the quote. - The Quote management system contains the following commands:
AddQuoteCommand
,ListQuoteCommand
,EditQuoteCommand
,DeleteQuoteCommand
,FindQuoteCommand
,AddQuoteReflectionCommand
,ListQuoteReflectionCommand
,EditQuoteReflectionCommand
,DeleteQuoteReflectionCommand
.
4.2.1 Add quote
The add quote feature allows users to add quotes of multiple formats to Quotesify. Quotes added can be of the following format:
- Quote with author name and reference title
- Quote with author name
- Quote with reference title
- Quote with no author name and reference title
The sequence diagram below reflects the command execution when a user adds a quote to Quotesify.
- Not shown in the sequence diagram is the parsing of user input by Quotesify’s main parser class that creates an
AddCommand
object which subsequently creates theAddQuoteCommand
as seen in the diagram, and then calling it’sexecute()
method. - The
parseParametersIntoQuote()
method fromQuoteParser
will be called to identify the format desired by the user and returns the appropriateQuote
object to be added into theQuoteList
with the user specified information. - Appropriate validation checks will be conducted to identify if the quote field is empty. Similarly, if author and reference flags are used, their respective fields will also be checked. If any missing field is found, the quote will not be added, and an error message will be displayed.
- Additional checks for duplicate flags and other invalid input parameters will also result in an exception being thrown and respective error messages displayed to the user when detected.
- Upon successful addition of a quote, the user will now be able to list, edit, delete, find and add a reflection to it.
Design Considerations
- Aspect: Allowing users to add quotes of different formats, or only accepting one format for quotes.
- Alternative 1 (current choice): Allowing users to add quotes of different formats with a single command.
- Pros: Users will not be restricted to one format or be required to use additional commands to add author and reference.
- Cons: Increased implementation complexity due to parsing different formats and additional error handling.
- Alternative 2: Users can only add quotes of one format.
- Pros: Easier implementation and less steep of a learning curve for new users.
- Cons: Reduced efficiency and usability as not all quotes have author and/or reference titles.
- Alternative 1 (current choice): Allowing users to add quotes of different formats with a single command.
4.2.2 Edit Quote Reflection
The edit quote reflection feature updates current reflection of a quote into a new reflection, keeping the remaining information such as quote, author name and reference the same.
The sequence diagram below reflects the command execution when a user edits the reflection of a quote.
- Not shown in the sequence diagram is the parsing of user input by Quotesify’s main parser class, which creates an
EditCommand
object which subsequently creates theEditQuoteReflectionCommand
as seen in the diagram, and then calling it’sexecute()
method. - Appropriate validation checks will be conducted to determine that the edit tag
/to
is present, and that the quote contains a reflection prior. If the following conditions are not met, the reflection will not be updated, and the respective error messages will be displayed. - Upon successful update of a reflection, the user will now be able to list the updated reflection for viewing.
Design Considerations
- Aspect: Users have to use a
/to
flag before specifying updated reflection, or allowing users to specify the updated reflection without any flags.- Alternative 1 (current choice): Use of
/to
flag- Pros: Clear demarcation before start of the updated reflection results in easier parsing.
- Cons: Users are required to type more.
- Alternative 2: No flags required before specifying updated reflection.
- Pros: Increased efficiency and users do not need to remember the different flags.
- Cons: Increased difficulty in parsing and more prone to unhandled exceptions and errors.
- Alternative 1 (current choice): Use of
- Aspect: Include a
updateReflection
method inQuoteList
or edit the quote object directly from theEditReflectionCommand
.- Alternative 1 (current choice): Use of a
updateReflection
method in theQuoteList
to update the reflection.- Pros: Better encapsulation and data hiding as attributes can be set to private
- Cons: Additional methods and passing of data required
- Alternative 2: Edit the quote object from the
EditReflectionCommand
.- Pros: Reduced number of methods and implementation complexity.
- Cons: Increased coupling and difficulty in tracking down potential bugs if attributes are set to public.
- Alternative 1 (current choice): Use of a
4.3 Feature: Progress Tracker
Progress Tracker consists of two parts: Bookmark Management and Task Management. Given below is the class diagram for classes related to Bookmark Management in Quotesify:
Given below is the class diagram for classes related to Task Management in Quotesify:
4.3.1 Add/Update bookmark
The proposed add or update bookmark feature will rely on an existing Book
object, and then a Bookmark
object will
be created in the process.
- The
Bookmark
object will be made up of theBook
object and a page number, which is stored in a list of bookmarks namedBookmarkList
.
The sequence diagram below demonstrates the command execution process when adding or updating a bookmark to an existing book.
- To reduce complexity and increase readability, the sequence diagram excludes error handling.
- Not shown in the sequence diagram is the parsing of user input by Quotesify’s main parser class which creates an
BookmarkCommand
object as seen in the diagram, and then calling it’sexecute()
method.
Design Considerations
- BookmarkList is always sorted in order of creation time
- Pros: Allow users to easily find the earliest and the latest book that they read.
- Cons: More difficult for users to find the bookmark that they recently updated.
4.3.2 Add task
The add task feature allows users to add tasks with a deadline to Quotesify. Tasks added can be of the following format:
- Tasks without any deadline
- Tasks with an unformatted deadline
-
Tasks with a formatted deadline
- The
ToDo
object (we mentioned as ‘task’ before) will be made up of a name and a deadline, which is stored in a list of tasks namedToDoList
.
The sequence diagram below demonstrates the command execution process when adding a task.
- To reduce complexity and increase readability, the sequence diagram excludes error handling.
- Not shown in the sequence diagram is the parsing of user input by Quotesify’s main parser class, which creates an
AddCommand
object which subsequently creates theAddToDoCommand
as seen in the diagram, and then calling it’sexecute()
method.
Design Considerations
- ToDoList is sorted in two ways:
- Tasks with formatted deadline will be sorted in ascending order of time. (The one with an earlier deadline is displayed ahead of the one with a later deadline)
- Tasks with unformatted deadline and without specified deadline will be arranged in order of creation time.
-
Tasks with formatted deadline will be listed ahead of all other tasks.
- Pros: Users can view the most urgent task easily
- Cons: It is harder for users to find a task with an unformatted deadline even though the text in the deadline represents a high urgency.
4.4 Feature: Category Management
Given below is the class diagram for classes related to Category Management in Quotesify:
A Category
object holds the following attributes:
- A
String
object that holds the category name in lower-case format. - A
BookList
object that stores a list ofBook
objects tagged with the specified category name. - A
QuoteList
object that stores a list ofQuote
objects tagged with the specified category name.
4.4.1 Add Categories
The proposed add categories feature allows users to add multiple categories to an existing book, quote, or both.
The sequence diagram below demonstrates the command execution process when adding a category to an existing book.
- For each category that the user has specified, the process will be executed in a loop until all categories have been processed.
- Additional checks include verifying the existence of the specified book and if the specified category already exists in the book. If either one of these checks fail, an error message will be prompted.
- On success,
- The category name will be added into the categories attribute of the
Book
object. - A new
Category
object will be created and stored into the category list if it does not exist. - The book will be added into the category’s bookList attribute for record keeping.
- The category name will be added into the categories attribute of the
Design Consideration
- Aspect: Allowing users to specify only a single, or multiple categories at once.
- Alternative 1 (current choice): Allowing users to specify multiple categories at once.
- Pros: Increases efficiency for users as they could add multiple categories to a book/quote in a single command.
- Cons: Increased complexity in implementation.
- Alternative 2: Allowing users to specify only a single category at any time.
- Pros: Easier to implement.
- Cons: Inefficient for users who wish to add multiple categories to a book/quote.
- Alternative 1 (current choice): Allowing users to specify multiple categories at once.
- Aspect: Whether to give users an option to specify both books and quotes to be tagged with a category.
- Alternative 1 (current choice): Giving users an option to specify a book, quote, or both to be tagged with a category.
- Pros: Increases efficiency for users as they could add the same category to a book and quote in a single command.
- Cons: Difficult to implement.
- Alternative 2: Users can only specify a book or quote, but not both to be tagged with a category:
- Pros: Easier to implement.
- Cons: Inefficient for users who wish to add a category to a book and quote at the same time.
- Alternative 1 (current choice): Giving users an option to specify a book, quote, or both to be tagged with a category.
With the addition of new categories, users can perform several commands that makes use of them. Such as editing of category name, finding a category, deleting a category, listing all categories, or adding the same category to other books and quotes.
4.5 Feature: Rating system for books
Given below is the class diagram for classes related to the Rating System in Quotesify:
- A
Book
must exists before aRating
can be created. - A
Book
object will have an attribute rating.
4.5.1 Add rating
The add rating feature will rely on an existing book object, and a rating object will then be created in the process.
- The book object will store an attribute named rating, which will be set by this feature.
- The rating object will be made up of the book object and a rating score, which is stored in a list of ratings.
Given below is the sequence diagram for adding rating to a book:
- The sequence diagram shows the process of Add Rating from the
execute()
method inAddRatingCommand
class, which extends theAddCommand
class. The switch statement in theexecute()
method to decide the item that the user is adding is not shown in the diagram. - The list of ratings will be retrieved from the
ListManager
class which stores all the different lists in Quotesify. - In the
addRating()
method, if the user input such as book number or rating score is missing , a message will be printed to inform the user and the method is returned. - There will also be checks implemented by the
RatingParser
to check if the rating score is within range, if the book to be rated exists in Quotesify and if the book has been rated before. This is done by checking the list of books in Quotesify. If all these conditions are met, the book will be rated. - When rating a book, the attribute rating of the book is set to the rating score. A rating object containing the book details and rating score will also be created and stored in the rating list. This list of ratings will be used when listing or finding ratings.
Design Consideration
- Aspect: Saving the ratings in a Rating List as compared to just only using the Book List
- Alternative 1 (current choice): Saving the ratings in a Rating List.
- Pros: Helps in listing and finding ratings as not all books are rated.
- Cons: Increases memory usage.
- Alternative 2: Saving the ratings only in the Book List.
- Pros: Less memory usage.
- Cons: May be slower as not all books are rated and the list is not sorted according to rating score.
- Alternative 1 (current choice): Saving the ratings in a Rating List.
- Aspect: Using both book title and author to identify a rating instead of just book title
- Alternative 1 (current choice): Using both book title and author to identify a rating.
- Pros: Allows books with the same title but different author to be rated.
- Alternative 2: Using only book title to identify a rating.
- Cons: Books with same title but different author will not be rated.
- Alternative 1 (current choice): Using both book title and author to identify a rating.
4.5.2 Find ratings
The find ratings feature will search for books with title that contains the specified keyword and print details about the rating.
Given below is the sequence diagram for finding ratings:
- The sequence diagram shows the process of Find Rating from the
execute()
method inFindRatingCommand
class which extends theFindCommand
class. The switch statement in theexecute()
method to decide the item that the user is finding is not shown in the diagram. - The list of ratings will be retrieved from the
ListManager
class which stores all the different lists in Quotesify. - In the
findRating()
method, if the keyword to search for is missing, a message will be printed to inform the user and the method is returned. - The list of ratings will be looped to see if ratings exists for books with title containing the specified keyword.
- The details of the ratings found will be printed to the user.
Appendix A: Product Scope
Target user profile
The intended user of Quotesify is someone who meets the following criteria:
- reads a lot
- has difficulty remembering content after reading them
- can type fast
- prefers typing over other means of input
- prefers using desktop applications
- comfortable with using Command Line Interface (CLI) applications
Value proposition
- Helps user track books that they have read with their relevant review/rating
- Allows user to capture and log quotes with their reflection
- Timely quote reminders to resurface previously saved quotes
- Personalised categories created to only suit what the user needs
- Find books, quotes and categories with a single command
- Works offline and stores data locally
- Portable
Appendix B: User Stories
Version | As a … | I want to … | So that I … |
---|---|---|---|
v1.0 | reader | enter good quotes and phrases from a book I read | can quickly refer back to it at any time |
v1.0 | user | categorize my listings | can view quotes from a specific category that I want |
v1.0 | long time user | have a page to see a list of books and categories of my notes | can navigate into the relevant book/category without having to remember the titles |
v1.0 | user | give rating for the books I read | can recommend book titles to others when asked |
v1.0 | beginner reader | add deadlines to books I am reading | can keep track of my readling deadlines |
v1.0 | avid reader | be able to keep track of books | can filter out books I have read and those that are on my list of books to read |
v1.0 | forgetful user | add bookmarks to my book | can find the page where I last stopped |
v1.0 | user | categorise my books or quotes | can view items from a specific category whenever I need |
v1.0 | user | save quotes I find meaningful | can view my favourite quotes whenever I want |
v2.0 | forgetful reader | be reminded of quotes I saved | can remember them better in the long run |
v2.0 | student and reader | pen my thoughts to a highlighted quote or text | can expand on certain ideas or express how I feel |
v2.0 | long time user | be able to search for keywords | can find specific quotes I want from the list |
v2.0 | user after some time | find a book rating by its book title | do not have to go through the whole list |
Appendix C: Non-Functional Requirements
- Should work on major Operating Systems (OS) with at least
Java 11
installed. - A user should have no problems using the various commands without referring to the help page after some time.
- Users should prefer typing to GUI.
- Data should be stored locally inside the device’s hard disk.
- Data should be in a human editable text file.
- Program should work without requiring an installer and/or remote server.
Appendix D: Glossary
- GUI - Graphical User Interface
- JAR file - Java ARchive file
- Major OS - Windows, Linux, OS-X
Appendix E: Instructions for Manual Testing
Launch and shutdown
Initial launch
- Ensure
Java 11
and above is installed. - Download the latest Quotesify JAR file from here.
- Save the jar file in a desired file directory.
- Open your command line or terminal and navigate into the file directory where Quotesify is saved.
- Run
java -jar [CS2113T-T09-3][Quotesify].jar
to launch Quotesify.
Subsequent launch
- Open your command line or terminal and navigate into the file directory where Quotesify is saved.
- Run
java -jar [CS2113T-T09-3][Quotesify].jar
to launch Quotesify. - Data will be automatically loaded from the data file upon launch.
Shutdown
- To terminate Quotesify, enter the
bye
command. You should see the following: - Data will be automatically saved into a data file.
---------------------------------------------------------------
Before you continue, here's something:
Better days are coming, they are called Saturday and Sunday.
Alright, have a nice day!
---------------------------------------------------------------
Note: If you have added a quote before, the quote printed will be randomized.
Testing for Book Management
Adding a book
-
Test case:
add -b Harry Potter /by JK Rowling
Expected: Book is added to Quotesify’s booklist. A message will be prompted to indicate that the book has been successfully added.
-
Other incorrect commands to try:
add -b
: Book title left emptyadd -b /by JK Rowling
: Book title left empty with author name specifiedadd -b title
: Author name left emptyadd -b title /by
: Author name left empty with author tag specified
Expected: Book will not be added. An error message will be printed.
List all existing books
-
Test case:
list -b
Expected: All existing books in booklist will be listed.
List book details
-
Test case:
list -b 2
Expected: Book details of book with the book index 2 from list of all books will be printed.
-
Other incorrect commands to try:
list -b Harry Potter /by JK Rowling
: Wrong format.list -b 10000
: Index out of range of booklist.
Expected: Book details will not be printed. An error message will be printed.
List books by author
-
Test case:
list -b /by JK Rowling
Expected: Books with the author JK Rowling will be listed.
-
Other incorrect commands to try:
list -b JK Rowling
: Flag/by
not specified
Expected: Books will not be listed. An error message will be printed.
Find books by keyword
-
Test case:
find -b Harry
Expected: Books with the title or author name containing Harry will be listed.
-
Other incorrect commands to try:
find -b
: Keyword not specified
Expected: Books will not be listed. An error message will be printed.
Delete books
-
Test case:
delete -b 3
Expected: Book with the book index of 3 in booklist will be deleted from list. A successful message will be printed.
-
Other incorrect commands to try:
delete -b Harry Potter
: Wrong formatdelete -b 10000
: Index out of range of booklist.
Expected: Book will not be deleted. An error message will be printed.
Edit book
-
Test case:
edit -b 3 /to Harry Potterrrrr
Expected: Book title of book with the book index of 3 will be changed to Harry Potterrrrr.
-
Other incorrect commands to try:
edit -b Harry Potter /to Harry Potterrrrr
: Wrong formatedit -b 3 Harry Potterrrrr
: Flag/to
not specified.edit -b 3 /to
: New title not specified.
Expected: Book title will not be edited. An error message will be printed.
Testing for Quote Management
Adding a quote
-
Add a quote without author and reference title to Quotesify
-
Test case:
add -q Life is short, smile while you still have teeth
-
Expected: Quote is added to Quotesify. A message will be prompted to indicate that the quote has been successfully added.
-
-
Add a quote with an author to Quotesify
-
Test case:
add -q Luke, I am your father /by Darth Vader
-
Expected: Quote is added to Quotesify. A message will be prompted to indicate that the quote has been successfully added.
-
-
Add a quote with a reference title to Quotesify
-
Test case:
add -q Get schwifty! /from Rick and Morty
-
Expected: Quote is added to Quotesify. A message will be prompted to indicate that the quote has been successfully added.
-
-
Add a quote with an author and reference title to Quotesify
-
Test case:
add -q So everyone’s supposed to sleep every single night now? /by Rick /from Rick and Morty
-
Expected: Quote is added to Quotesify. A message will be prompted to indicate that the quote has been successfully added.
-
-
Other incorrect commands to try:
add -q
: quote field left emptyadd -q
: empty space entered for quote fieldadd -q you can't see me /by
: author tag with missing author nameadd -q my name is inigo montoya /from
: reference tag with missing reference titleadd -q i am your father /by /from
: missing reference title and author name
Expected: Quote will not be added. A message with error details will be shown.
Listing all quotes
-
Test case:
list -q
Expected: The entire list of quotes with reference and author name (if present) in Quotesify will be displayed.
Listing quotes from a specific reference
-
Test case:
list -q /from rick and morty
Expected: The list of quotes with the specified reference title will be displayed.
-
Other incorrect commands to try:
list -q /from
: reference tag with missing reference title
Expected: No quotes will be listed. A message with error details will be shown.
Listing quotes by a specific author
-
Test case:
list -q /by darth vader
Expected: The list of quotes with the specified author name will be displayed.
-
Other incorrect commands to try:
list -q /by
: author tag with missing author name
Expected: No quotes will be listed. A message with error details will be shown.
Listing quotes from a specific author and reference
-
Test case:
list -q /by rick /from rick and morty
Expected: The list of quotes with the specified author name and reference title will be displayed.
-
Other incorrect commands to try:
list -q /by /from rick and morty
: author and reference tag with missing author namelist -q /by rick /from
: author and reference tag with missing reference titlelist -q /by /from
: missing author name and reference title
Expected: No quotes will be listed. A message with error details will be shown.
Editing a quote
-
Test case:
edit -q 2 /to No, I am your mummy /by Darth Vader
Expected: Quote will be updated, a prompt displaying old and updated quote will be displayed.
-
Other incorrect commands to try:
edit -q
: missing quote number and updated quoteedit -q 1 /to
: missing updated quoteedit -q 1 You can't see me
: missing “/to” flagedit -q 9999999 /to You can't see me
: non-existent quote number
Expected: Quote will not be updated. A message with error details will be shown.
Deleting a quote
-
Test case:
delete -q 1
Expected: Quote will be deleted from Quotesify. A message will be prompted to indicate that the quote has been successfully deleted.
-
Other incorrect commands to try:
delete -q
: missing quote number fielddelete -q X
: non integer inputdelete -q 9999999
: non existent quote number
Expected: Quote will not be deleted. A message with error details will be shown.
Finding a quote
-
Test case:
find -q sleep
Expected: Quotes related to the keyword will be shown.
-
Other incorrect commands to try:
find -q
: missing keywordfind -q
: empty space as keyword
Expected: No quotes will be found and listed. A message with error details will be shown.
Adding reflection to a quote
-
Test case:
add -qr 1 /reflect No, that's not true. It's impossible!
Expected: Reflection is added to quote. A message will be prompted to indicate that the reflection has been successfully added.
- Quotes with reflection will have a “[R]” tag attached to differentiate between those that do not.
-
Incorrect commands to try:
add -qr
: missing quote number, reflection tag and reflectionadd -qr 1 /reflect
: reflection field missingadd -qr 9999 /reflect Reflection is here
: non-existent quote
Expected: Reflection will not be added. A message with error details will be shown.
Listing reflection of a quote
-
Test case:
list -qr 1
Expected: The reflection attached to the specified quote will be displayed.
-
Other incorrect commands to try:
list -qr
: missing quote numberlist -qr 9999
: non-existent quote
Expected: Reflection will not be listed. A message with error details will be shown.
Editing reflection of a quote
-
Test case:
edit -qr 1 /to Who is Yoda’s daddy?
Expected: Reflection will be updated, a prompt displaying updated reflection will be shown.
-
Other incorrect commands to try:
edit -qr 1 /to
: missing updated reflectionedit -qr 1 nothing to reflect
: missing/to
flagedit -qr 9999999 /to updated reflection here!
: non-existent quote number
Expected: Reflection will not be updated. A message with error details will be shown.
Deleting reflection of a quote
-
Test case:
delete -qr 1
Expected: Reflection will be deleted from the quote. A message will be prompted to indicate that the reflection has been successfully deleted.
-
Other incorrect commands to try:
delete -qr
: missing quote number fielddelete -qr X
: non integer inputdelete -qr 9999999
: non existent quote number
Expected: Quote reflection will not be deleted. A message with error details will be shown.
Testing for Progress Tracker
Adding a bookmark to book
-
Test case:
bookmark -b 1 /pg 123
Expected: a page number will be marked at the book. A message will be prompted to indicate that the bookmark has been tagged to the book successfully.
-
Other incorrect commands to try:
bookmark -b 1 /pg
: missing page number fieldbookmark -b 0 /pg 123
: incorrect book number input
Expected: Bookmark will not be added to any book. A message will error details will be shown.
List all existing bookmarks
-
Test case:
list -bm
Expected: A list of bookmarks will be displayed. Each row contains an index assigned to the bookmark in the list, its book’s information, and a page number marked by the bookmark.
Deleting an existing bookmark
-
Test case:
delete -bm 1
Expected: Bookmark will be deleted from the book. A message will be prompted to indicate that the bookmark has been removed from the book successfully.
-
Other incorrect commands to try:
delete -bm 999
: bookmark number with given index does not existdelete -bm abc
: invalid bookmark number provided
Expected: Bookmark will not be deleted from the book. A message with error details will be shown.
Edit an existing bookmark
-
Test case:
bookmark -b 1 /pg 123
Expected: The page number will be updated in the bookmark. A message will be prompted to indicate that the bookmark has been updated successfully.
-
Other incorrect commands to try:
bookmark -b 1 /pg
: missing page number fieldbookmark -b 0 /pg 123
: incorrect book number input
Expected: Bookmark will not be updated to any book. A message with error details will be shown.
Adding a task to todo list
- Adding a task without deadline
-
Test case:
add -t return Harry Potter
Expected: A message will be prompted to indicate that the task has been added to the todo list successfully, and the deadline is ‘not specified’.
-
- Adding a task with unformatted deadline
-
Test case:
add -t return Harry Potter /by tmr
Expected: A message will be prompted to indicate that the task has been added to the todo list successfully, and the deadline is the same as stated in the command line.
-
- Adding a task with formatted deadline
-
Test case:
add -t return Harry Potter /by 2020-10-24
Expected: A message will be prompted to indicate that the task has been added to the todo list successfully, and the deadline will be formatted as ‘Oct 24 2020, Saturday’.
-
Listing all existing tasks
-
Test case:
list -t
Expected: A list of tasks will be displayed. The tasks with formatted deadlines will be displayed in the front, and sorted in ascending order of timing, while other tasks will be displayed at the back without any order.
Marking an existing task as done
-
Test case:
done -t 1
Expected: A message will be prompted to indicate that the task has been marked as done in the todo list successfully.
Deleting an existing task
-
Test case:
delete -t 1
Expected: A message will be prompted to indicate that the task has been removed from the todo list successfully.
Testing for Category Management
Adding categories
- Add one or more category to a book
- Prerequisites: A book should exist in Quotesify.
- Assume that the book “Harry Potter” is added into Quotesify assigned to index 1.
-
Test case:
add -c fantasy -b 1
Expected: A message will be prompted to indicate that category has been tagged to the book successfully.
-
Test case:
add -c fantasy romance -b 1
Expected: A message will be prompted to indicate that categories have been tagged to the book successfully.
- Add one or more category to a quote
- Prerequisites: A quote should exist in Quotesify.
- Assume that the quote “Life is great!” is added into Quotesify assigned to index 1.
-
Test case:
add -c inspirational -q 1
Expected: A message will be prompted to indicate that category has been tagged to the quote successfully.
-
Test case:
add -c inspirational happy -q 1
Expected: A message will be prompted to indicate that categories have been tagged to the quote successfully.
- Add one or more category to a book and quote
- Prerequisites: A book and quote should exist in Quotesify.
- Assume that an existing book and quote are both assigned to index 1.
-
Test case:
add -c inspirational -b 1 -q 1
Expected: A message will be prompted to indicate that category has been tagged to both book and quote successfully.
-
Test case:
add -c inspirational action -q 1
Expected: A message will be prompted to indicate that categories have been tagged to both book and quote successfully.
- Other incorrect commands to try
add -c
missing category name, book or quoteadd -c action
missing a book or quoteadd -c action -b 0 -q 0
invalid book and quote indexadd -c -b 1 -q 1
missing category name
Expected: An error message will be prompted. No changes will be made.
Listing all categories
- List all existing categories
-
Test case:
list -c
Expected: A list of categories with the total number of items tagged under each category will be displayed.
-
Listing a specific category
- List all books and quotes tagged by a specific category
-
Test case:
list -c action
Expected: A list of books and quotes tagged under that category will be displayed.
-
- Incorrect commands to try
list -c 123
invalid category name
Expected: An error message will be displayed indicating that no such category exists.
Deleting existing categories
- Remove one or more category from a book
- Prerequisites: Specified book index, quote index and category should exist in Quotesify.
- Assume the book “Harry Potter” is tagged with [action, fantasy] category and assigned with index 1.
-
Test case:
delete -c action -b 1
Expected: A message will be prompted to indicate that category has been removed from book successfully.
-
Test case:
delete -c action fantasy -b 1
Expected: A message will be prompted to indicate that categories have been removed from book successfully.
- Remove one or more category from a quote
- Prerequisites: Specified book index, quote index and category should exist in Quotesify.
- Assume the quote “Life is great!” is tagged with [inspirational, happy] category and assigned with index 1.
-
Test case:
delete -c inspirational -q 1
Expected: A message will be prompted to indicate that category has been removed from quote successfully.
-
Test case:
delete -c inspirational happy -q 1
Expected: A message will be prompted to indicate that categories have been removed from quote successfully.
- Remove one or more category from a book and quote
- Prerequisites: Specified book index, quote index and category should exist in Quotesify.
- Assume that a book and quote are both tagged with [action, happy] categories.
-
Test case:
delete -c action -b 1 -q 1
Expected: A message will be prompted to indicate that category has been removed from both book and quote successfully.
-
Test case:
delete -c action happy -b 1 -q 1
Expected: A message will be prompted to indicate that categories have been removed from both book and quote successfully.
- Remove one or more category from list
- Test case:
delete -c action
Expected: A message will be prompted to indicate that category has been removed from all book and quotes.
- Test case:
delete -c action fantasy
Expected: A message will be prompted to indicate that categories has been removed from all book and quotes.
- Test case:
- Other incorrect commands to try
delete -c
missing category name, book or quotedelete -c action -b 0 -q 0
invalid book and quote indexdelete -c -b 1 -q 1
missing category name
Expected: An error message will be prompted. No changes will be made.
Editing an existing category
- Edit an existing category name
-
Test case:
edit -c love /to romance
Expected: A message will be prompted indicating that category has been changed successfully. All books and quotes tagged under the old category will be changed as well.
-
- Other incorrect commands to try
edit -c
missing existing and new category nameedit -c love
missing new category name
Expected: An error message indicating invalid parameters and a command usage will be prompted. No changes will be made.
Finding an existing category
- Find existing categories related to a keyword.
-
Test case:
find -c man
Expected: Quotesify will list all categories containing the keyword “man”.
-
- Other incorrect commands to try
find -c
missing keywordfind -c 123
invalid category name
Expected: An error message will be prompted. No categories will be listed.
Testing for Rating System for books
Adding a book rating
-
Prerequisite: Book to be rated should exist in Quotesify. Use
list -b
to list all existing books and get book number. -
Test case:
add -r 5 1
, assuming book number 1 exists.Expected: Rating is added to the book. A message will be prompted to indicate rating has been added successfully.
-
Other incorrect commands to try:
add -r
: rating score and/or book number fields left emptyadd -r 6 1
: assuming book number 1 exists, but rating score is out of the rangeadd -r 1 x
: where x is a book number that does not exist
Expected: No rating is added. A message with error details will be prompted.
Listing all existing book ratings
-
Test case:
list -r
Expected: The entire list of books and their ratings will be shown. Rating of books are sorted in descending order, with the highest rating at the top.
Listing books of a specific book rating
-
Test case:
list -r 5
Expected: The list of books with the specified rating will be shown.
-
Other incorrect commands to try:
list -r 6
: rating score is out of the rangelist -r AAA
: invalid rating score
Expected: No rating is listed. A message with error details will be prompted.
Deleting a book rating
-
Prerequisite: Book to be rated should exist in Quotesify. Use
list -b
to list all existing books and get book number. -
Test case:
delete -r 1
, assuming book number 1 exists.Expected: Rating is deleted from book. A message will be prompted to indicate rating has been deleted successfully.
-
Other incorrect commands to try:
delete -r
: book number field left emptydelete -r x
: where x is a book number that does not exist or has not been rated
Expected: No rating is deleted. A message with error details will be prompted.
Editing a book rating
-
Prerequisite: Book to be rated should exist in Quotesify. Use
list -b
to list all existing books and get book number. -
Test case:
edit -r 4 1
, assuming book number 1 exists.Expected: Rating is edited to the new rating. A message will be prompted to indicate rating has been edited successfully.
-
Other incorrect commands to try:
edit -r
: rating score and/or book number fields left emptyedit -r -1 1
: assuming book number 1 exists, but rating score is out of the rangeedit -r 3 x
: where x is a book number that does not exist or has not been rated
Expected: No rating is edited. A message with error details will be prompted.
Finding book ratings
-
Test case:
find -r POT
Expected: Ratings of books with title that contains the keyword (case-insensitive) will be listed.
-
Other incorrect commands to try:
find -r
: keyword field left empty
Expected: No rating is found and listed. A message with error details will be prompted.