Connoisseur Developer Guide
Table of Contents
-
2.1 Prerequisites
-
3.1 Architecture: High Level View
3.2 UI Component
3.3 Logic Component
3.4 Model Component
3.5 Sorter Component
-
4.2 Review Mode
4.2.1 Add a Review Feature
4.2.2 List Reviews Feature
4.2.3 Sort Reviews Feature
4.2.4 View a Review Feature
4.2.5 Edit a Review Feature
4.2.6 Delete a Review Feature
4.3.1 Add a Recommendation Feature
4.3.2 List Recommendation Feature
4.3.3 Edit a Recommendation Feature
4.3.4 Delete a Recommendation Feature
4.4 Storage
4.4.1 Storage Format
4.4.2 Implementation
4.5 Error handling
-
Appendix A: Product Scope
Appendix B: User Stories
Appendix C: Non-Functional Requirements
Appendix D: Instructions for manual testing
Appendix E: Other Guides: Documentation, Testing, Dev-ops
Appendix F: Glossary
1. Preface
Connoisseur is a desktop application for managing and storing a list of personal reviews on experiences, and a list of recommendations to try next.
The Developer Guide for Connoisseur v2.1 is designed for developers intending to improve Connoisseur, by fixing bugs, or perhaps adding entirely new features. It explains how the project is set up, the architecture used, and the code style you should adopt when contributing code to the project.
2. Setting up
The following section describes how to set up the coding environment on your own computer, in order to start writing code to improve Connoisseur.
2.1 Prerequisites
- JDK 11
Download JDK 11 - Recommended integrated development environment for coding : IntelliJ IDEA
Download IntelliJ IDEA
2.2 Setting up Connoisseur in your computer
❗ Follow the steps in the following guide precisely. Things will not work out if you deviate in some steps.
- Fork this repo, and clone the fork into your computer.
- Open IntelliJ (if you are not in the welcome screen, click
File
>Close Project
to close the existing project dialog first). - Set up the correct JDK version for Gradle
a. ClickConfigure
>Project Defaults
>Project Structure
b. ClickNew...
and find the directory of the JDK. - Click
Import Project
. - Locate the
build.gradle
file and select it. ClickOK
. - Click
Open as Project
. - Click
OK
to accept the default settings.
2.3 Verifying the Setup
- Run Connoisseur.main()
- Try a few commands.
- Run the tests to ensure they all pass.
2.4 Configure Coding Style
If using IDEA, follow the guide [se-edu/guides] IDEA: Configuring the code style to set up IDEA’s coding style to match ours.
Optionally, you can follow the guide [se-edu/guides] Using Checkstyle to find how to use the CheckStyle within IDEA e.g., to report problems as you write code.
3. Design
The following section describes the design and implementation of the product. We use UML diagrams and code snippets to explain some aspects of the code. If you are unfamiliar with UML, the diagrams should still be fairly understandable. However, you may wish to consult [CS2113/T] Modeling for a quick introduction to UML.
3.1 Architecture: High Level View
This section illustrates how the architecture components interact with each other
The following Figure 1, provides a rough overview of how Connoisseur is built.
Figure 1. Architecture of Connoisseur
As shown in Figure 1, the user interacts with UI
, which takes in commands and displays output to the user.
The main Connoisseur
class initializes the other components in the application. It passes the input received from the user to the logic component, which consists of Parser
and Commands
.
Parser
will decipher the input and make the corresponding method calls in Commands
. Depending on whether Connoisseur is in review or recommendation mode, the Commands
class will execute the respective commands in the ReviewList
and RecommendationList
classes of the Model
component.
In the case of storing data, Commands
will interact directly with the Storage
class to save the data.
The ReviewList
class has sorting functions which requires Sorter
. All the reviews will be passed to Sorter
to be sorted, which then returns the sorted reviews back to ReviewList
.
RecommendationList
also interacts with ReviewList
for converting Recomendations to Reviews.
3.2 UI Component
The UI component of Connoisseur consists of the classes UI
and Messages
.
It is instantiated in the connoisseur() method and serves two main purposes:
- Read user input from the console.
- Print program output to the console.
The ui.readCommand()
method reads the input which is then passed on to the Logic
component.
The ui.println(output)
method prints output to the console. Default output messages are stored as static string constants in the Messages
class, while commonly used output messages are made methods by themselves. ui.printGreeting()
is one such method and is called to display the welcome message to the user.
3.3 Logic Component
Figure 2. Logic Component of Connoisseur
As show in Figure 2, the Logic component of Connoisseur consists of the classes Parser
and Commands
.
It is instantiated in the connoisseur()
method and serves to translate user input into recognisable commands by the application.
The determineCommand()
method of the Parser
class deciphers the command word of the input, calling the respective command’s method in Commands
.
Each method in Commands
will then check the arguments provided with the commands to make sure that they are valid, before executing the command in Storage
, ReviewList
or RecommendationList
.
3.4 Model Component
Figure 3. Model Component of Connoisseur
As shown in Figure 3, the Model component of Connoisseur consists of the classes ReviewList
and RecommendationList
.
It is instantiated in the connoissuer() method and serves to store data as the program runs.
Both the classes in the Model component contain methods which modify the content of their respective ArrayLists, which consist of either Reviews or Recommendations.
3.5. Sorter Component
Figure 4. Sorter Component of Connoisseur
As shown in Figure 4, the Sorter component is a separate component which serves to sort the reviews based on a few sorting methods.
When the sortReviews()
method is called in the ReviewList
, a sortMethod parameter is passed together with it to the Sorter
, which then determines which of the Sorts to sort the reviews by. If the sortMethod parameter is empty, Sorter
will use the default sortMethod saved. The sorted reviews are then passed back to ReviewList
.
3.6. Storage Component
The Storage component serves to implement the storage functions of Connoisseur. It saves and loads data represented as a JSON file in the ./data
folder so that data can be retained after exiting Connoisseur.
On startup, Connoisseur checks if there is a connoisseur.json
file in the ./data
folder. If they exist, the data will be loaded via the loadConnoisseurData()
method and used to initialize classes in the Model
component. If the file and folder do not exist, they will be created and new instances of the classes in the Model
component will be initialized instead.
Before exiting, Connoissuer will save the data from the Model
component and write them to connoisseur.json
located in the ./data
folder.
4. Implementation
The following section describes the implementation of certain key features in the current version of Connoisseur. It also provides some background into our (the original developers of Connoisseur) thinking and the rationale behind the decisions.
4.1 Mode Switch Feature
The mode switch feature is shown in Figure 5. The two modes in Connoisseur are Review and Recommendation. These two modes have some overlapping commands. However, depending on the mode Connoisseur is currently in, the same command displays different output to the user. Each mode has its own unique features and commands as well. This section explains how the mode switch feature is implemented.
Figure 5. Mode Switching in Connoisseur
The following Figure 6 is the Sequence diagram to Switch Mode.
Figure 6. Sequence Diagram for Mode Switch Feature
A general explanation of how this feature works::
- User inputs commands that trigger mode switch.
review
andreco
are commands which are recognised byParser
class as mode switching commands through thedetermineCommand()
method. - If
review
command is input by user,Commands
class callsreviewMode()
method which setsprivate boolean isReviewMode
attribute to true. - If
reco
command is input by user,Commands
class callsrecommendationMode()
method which setsprivate boolean isReviewMode
attribute to false. - Finally,
reviewMode()
andrecommendationMode()
callsUi
class methodprintln()
to display message “You are in review mode” or “You are in recommendation mode” respectively as shown in Figure 4.
4.2 Review Mode
When User inputs a command, Commands
class checks for the value of the attribute
boolean isReviewMode
before executing the command. As explained in section 4.1, when in review mode, boolean isReviewMode
is equal to true.
Hence, only commands that are recognised by the Review Mode are executed when input by user. Else, an “inavild command” message is displayed to the user.
This mode implements the following features:
add
/new
/add quick
/add full
/new quick
/new full
- Add a Reviewlist [SORT_TYPE(optional parameter)]
- List Review sorted by SORT_TYPE parametersort [SORT_TYPE(Optional parameter)]
- Displays current saved sorting method or changes saved sorting method to that specified by SORT_TYPE parameterview [TITLE_OF_REVIEW]
- View a Reviewedit [TITLE_OF_REVIEW]
- Edit a Reviewdelete [TITLE_OF_REVIEW]
- Delete a Review
4.2.1 Add a Review Feature
The mechanism to add a review is facilitated by the ReviewList
class. The user is able to add in a new review using new
, add
,new quick
,add quick
, new full
or add full
commands.
The following Figure 7 is the Sequence diagram to add a review.
Figure 7. Sequence Diagram for Add a Review Feature
A general explanation of how this feature works:
Ui
will read in user command and callPaser#determineCommand()
to determine the input.Parser
callsCommands#add
if input entered isnew
oradd
.-
Commands
callsReviewList#addQuickReview()
orReviewList#addFullReview()
to prompt and read respective information of the review such astitle
,category
,rating
anddescription
(only prompted byaddFullReview()
method).title
- a string with 20char limit, that will callReviewList#checkAndPrintDuplicateRecommendation
to check for duplicates in ArrayListreviews
.category
- a string with 15char limit, that cannot be whitespace or null.rating
- a positive integer with 0 to 5 recognised as valid input, that cannot be whitespace or null. ❗ The input ‘-0’ would be treated as ‘0’.description
- string with unlimited char limit.
-
The violation of any constraints for each attribute will print an error message from
ui
and be promoted to re-enter a valid input. -
When all fields are valid, fields are added into a
Review
Class. - The new
Review
object is added into an ArrayListreviews
.
4.2.2 List Reviews Feature
This feature prints out Title
, Category
, Rating
and Date
string attributes for each Review
object in the ArrayList reviews
.
The mechanism to list reviews is facilitated by the ReviewList
class. The user is able to list all reviews using list
command.
The mechanism to list reviews sorted alphabetically according to either Title
, Cateogry
or from highest to lowest rating
or from earliest/ latest Date
of entry of the review is facilitated by the Sorter
class.
The following Figure 8 is the Sequence diagram to list a review.
Figure 8. Sequence Diagram for List a Review Feature
A general explanation of how this feature works:
- Assuming additional parameters are not specified,
Commands
callsReviewList#listReviews()
to retrieveReview
objects in the ArrayListreviews
. - If
reviews
array is empty,ReviewList
callsUi#printEmptyReviewListMessage()
which prints message “You have no reviews, type ‘new’ to start!” - If additional parameters specifying sort method in addition to list command is input (e.g
list rating
) ,ReviewList
callsSorter#SortReviews(sortMethod)
. ReviewList
class executesdisplayReviews()
method to display a list of reviews to the user.
4.2.3 Sort Reviews Feature
The mechanism to change the saved sorting method is implemented by Sorter
class
The following Figure 9 is the Sequence diagram to Sort a review.
Figure 9. Sequence Diagram for Sort Reviews Feature
A general explanation of how this feature works:
- User inputs command
sort [sortType]
, where sortType is additional parameters the user can specify such asTITLE
,CATEGORY
,RATING
,EARLIEST
orLATEST
. Parser
callsCommands#sort()
.- Since the command
sort [sortType]
is only recognised in review mode, ifprivate boolean isReviewMode
attribute ofCommands
class is set to false,Commands
callsUi#printCommandDoesNotExistInRecommendationMode()
. - Else if
private boolean isReviewMode
attribute ofCommands
class is set to true, if user did not specifysortType
,ReviewList
callsUi#printCurrentSortMethod()
. - If user did specify
sortType
,ReviewList
callsSorter#changeSortMethod()
which changes and saves to the specified sort method.
4.2.4 View a Review Feature
The mechanism to view a single specified review is implemented by ReviewList
class
The following Figure 10 is the Sequence diagram to View a review.
Figure 10. Sequence Diagram for View a Review Feature
A general explanation of how this feature works:
- User inputs command
view [title]
, where parameter title is the title of review that should be specified by the user. Parser
callsCommands#view()
.- Since the command
view [title]
is only recognised in review mode, ifprivate boolean isReviewMode
attribute ofCommands
class is set to false,Commands
callsUi#printCommandDoesNotExistInRecommendationMode()
. - Else if
private boolean isReviewMode
attribute ofCommands
class is set to true, if user did not specify title of review, or it does not exist in the list ,ReviewList
callsUi#missingTitle
andUi#invalidTitle
respectively . - If title of review exists in ArrayList
reviews
,ReviewList
callsdisplaySingleReview()
method which displays the specified review.
4.2.5 Edit a Review Feature
The mechanism to edit a specified review is implemented by ReviewList
class
The following Figure 11 is the Sequence diagram to Edit a review.
Figure 11. Sequence Diagram for Edit a Review Feature
A general explanation of how this feature works:
- User inputs command
edit [title]
, where the parameter title is the title of review that should be specified by the user. Parser
callsCommands#edit()
.- Since the command
edit [title]
is recognised in both review and recommendation mode,private boolean isReviewMode
attribute ofCommands
class is set to true in this case. ReviewList
class implements edits to the specified review object in ArrayListreviews
and sets details.
4.2.6 Delete a Review Feature
The mechanism to delete a specified review is implemented by ReviewList
class
The following Figure 12 is the Sequence diagram to Delete a review.
Figure 12. Sequence Diagram for Delete a Review Feature
A general explanation of how this feature works:
- User inputs command
delete [title]
, where parameter title is the title of review that should be specified by the user. Parser
callsCommands#delete()
.- Since the command
delete [title]
is recognised in both review and recommendation mode,private boolean isReviewMode
attribute ofCommands
class is set to true in this case. ReviewList
class implements delete to the specified review object in ArrayListreviews
and removes it from the ArrayList.
4.3 Recommendation Mode
This section provides details on the implementation of the various commands that occurs in the recommendation mode.
This mode allows users to keep a list of recommendations that they have not tried/completed. When User inputs a command, Commands
class checks for the value of the attribute
boolean isReviewMode
before executing the command. As explained in section 5.1, when in recommendation mode, boolean isReviewMode
is equal to false.
Hence, only commands that are recognised by the Recommendation Mode are executed when input by user. Else, inavild command message is displayed to the user.
This mode implements the following features:
add
/new
- Add a Recommendationlist
- List Recommendationsedit [TITLE_OF_RECOMMENDATION]
- Edit a Recommendationdelete [TITLE_OF_RECOMMENDATION]
- Delete a Recommendationdone [TITLE_OF_RECOMMENDATION]
- Review a Recommendation
4.3.1 Add a Recommendation Feature
This feature allows user to add a recommendation for any of the activities that they have not completed.
❗ Title of a new recommendation cannot exist in current list of reviews. An error message would be printed out if it does.
The mechanism to add a recommendation is facilitated by the RecommendationList
class. The user is able to add in a new recommendation using new
or add
command.
The following Figure 13 is the Sequence diagram to add a recommendation
.
Figure 13. Sequence Diagram for add recommendations
A general explanation of how add recommendation works:
-
Ui
will read in user command and callParser#determineCommand()
to determine the input. -
Parser
calls forCommands#add
if input entered isnew
oradd
. Commands
calls forRecommendationList#addRecommendation
to prompt and read respective information such astitle
,category
,price range
,recommendedby
andlocation
.title
- string with 20char limit, that will callRecommendationList#checkAndPrintDuplicateRecommendation
to check for duplicates in both ArrayListsreviews
andrecommendations
.category
,recommendedby
andlocation
- string with 15char limit, that cannot be whitespace or null.price range
-a string, that will callRecommendationList#checkPriceValidity
and restrict it to 2 decimal places.
-
The violation of any constraints for each attribute will print an error message from
Ui
and be promoted to re-enter a valid input. -
When all fields are valid, fields are added into a
Recommendation
Class. - The new
Recommendation
is added into an ArrayListrecommendations
.
4.3.2 List Recommendation Feature
This feature prints out title
, category
, price range
,recommendedby
and location
String attributes for each Recommendation
class in the ArrayList recommendations
.
The mechanism to list recommendations is facilitated by the RecommendationList
class. The user is able to list all recommendations using list
command.
The following Figure 14 is the Sequence diagram to list recommendations
.
Figure 14. Sequence Diagram for list recommendations
A general explanation of how this feature works:
Commands
callsRecommendationList#listRecommendations()
to retrieveRecommendation
inrecommendations
RecommendationList
calls itselfdisplayRecommendations
to iterate through and printRecommendation
inrecommendations
.
4.3.3 Edit a Recommendation Feature
This feature allows the user to change the fields in a specific Recommendation
Class in the ArrayList recommendations
.
The mechanism to edit a recommendation is facilitated by the RecommendationList
class. The user is able to edit in an existing recommendation using edit [TITLE]
command.
The following Figure 15 is the Sequence diagram to edit a recommendation
.
Figure 15. Sequence Diagram for edit recommendations
A general explanation of how this feature works:
-
Commands
will callRecommendationList#editRecommendation()
to determine whichRecommendation
from the ArrayListrecommendatios
should be editied. -
RecommendationList
then calls itself,editRecommendationFields
. Similar to adding a recommendation, edit will take in eithertitle
,category
,price range
,recommendedby
andlocation
String attributes for that specificRecommendation
class and replace previous String stored with new user input. After checking for duplicates, the violation of any constraints for each attribute will print an error message fromUi
and prompt for a valid input.
4.3.4 Delete a Recommendation Feature
This feature allows the user to remove a specific Recommendation
from the ArrayList recommendations
.
The mechanism to remove a recommendation is facilitated by the RecommendationList
class. The user is able to delete in an existing recommendation using delete [TITLE]
command.
The following Figure 16 is the Sequence diagram to delete a recommendation
.
Figure 16. Sequence Diagram for delete recommendations
A general explanation of how this feature works:
Commands
calls forRecommendationList#deleteRecommendation()
, Connoisseur will check if the title given exists.- If title exists, Connoisseur will remove it from the ArrayList
recommendations
.
4.3.5 Review a Recommendation Feature
This feature allows the user to change a specific Recommendation
to a Review
class, removing it from the ArrayList recommendations
and adding it to the ArrayList reviws
.
The mechanism to review a recommendation is facilitated by the RecommendationList
class. The user is able to review in an existing recommendation using done [TITLE]
command.
The following Figure 17 is the Sequence diagram to review a recommendation
.
Figure 17. Sequence Diagram for review recommendations
A general explanation of how this feature works:
Commands
calls forRecommendationList#convertRecommendation()
, which retrieves fields from theRecommendation
that is required by and creates a newReview
Object.RecommendationList
then calls forReviewList#receiveConvert()
with the newReview
and inserts it into the ArrayListreviews
.RecommendationList#convertRecommendation()
continues with the chosenRecommendation
object and removes it from the ArrayListrecommendations
.
4.4 Storage
The Storage
class is responsible for loading data from memory and saving data to memory. The location of this data can be found at ./data/connoisseur.json and serves to retain all the information of the user after the application has exited. Other than the reviews and recommendations, it also saves the preferences of the user such as the sorting method as well as the display type.
4.4.1 Storage Format
The information is saved as a JSON Object in the data file. It consists of two strings, the sort method and display type, as well as two JSON Arrays which hold the reviews and recommendations.
To facilitate easier conversion between the raw data and JSON object, a ConnoisseurData
class was created to store all the data as a single object before conversion.
4.4.2 Implementation
The following is a Sequence diagram to illustrate how Connoisseur saves data on exit.
Figure 18. Sequence Diagram for saving data
- When the
Commands#exit()
method is called,Storage#saveConnoisseurData()
will be called to save the data before exiting. Storage#saveReviews()
is called to convert the reviews to a JSON Array.Storage#saveRecommendations()
is called to convert the recommendations to a JSON Array.- These are then combined with the sort method and display type and written to connoisseur.json.
- If there is an error writing to the file, an exception will be raised and the user will be notified.
- Finally, the exit message will be printed and connoisseur will exit.
4.5 Error Handling
Connoisseur provides default error handling. The default error handling system handles invalid input format and invalid file errors with exceptions. Connoisseur also has a customized exception, the duplicate exception. You can also choose to define your own custom error handling by creating custom exceptions.
Duplicate Exception The Duplicate Exception is used to handle titles of reviews or recommendations that are input by the user. If the title input is found, duplicate exception will be thrown.
The Duplicate Exception is thrown in addRecommendationDetails()
, if the checkAndPrintDuplicateRecommendation(title)
returns true. This error will be caught in the addRecommendation()
method.
5 Appendix
Appendix A: Product Scope
Target User Profile
- is a university student
- has a desire to record a significant number of experiences
- wants to manage a bucket list
- can type fast and prefers typing to mouse interactions
- is comfortable using the command line interface
Value Proposition
- Connoisseur helps users to consolidate their experiences,
review
and bucket lists,recommendation
in an organised way. The user just needs to input their experiences or what they wish to experience, and Connoisseur will help to consolidate them. - These
review
andrecommendation
can be edited or deleted as the user wishes. - A
recommendation
can be turned into areview
once the user marks it as done, making it convenient for the user to record their experiences. - Connoisseur also allows users to have a consolidated view
review
andrecommendation
lists. Connoisseur even offers the option to sortreview
lists according to the user preference, namely by date earliest, date latest, ratings and category.
Appendix B: User Stories
Version | As a … | I want to … | So that I can … |
---|---|---|---|
v1.0 | new user | see usage instructions | refer to them when I forget how to use the application |
v1.0 | user | see the number of recommendations I have | keep track of the number of reviews I’ve made |
v1.0 | user | be able to save my previous recommendations | refer to the old entries that I have |
v1.0 | busy user | be able to do quick ratings | save time |
v1.0 | user | delete selected items that I no longer wish to recommend | edit my list according to my liking |
v1.0 | busy user | have a template to guide my reviews | input my reviews quickly |
v1.0 | forgetful user | remember the places I have visited and my feelings towards them | avoid visiting those places I dislike again |
v1.0 | user who values convenience | do quick ratings by entering the number of stars | I can rate the experience I had |
v1.0 | user who values privacy | access my person reviews of places private | keep them safe on my device offline |
v1.0 | user | be able to see the number of reviews or recommendations I have in my inventory | have a consolidation of my experiences and what I want to experience |
v2.0 | indecisive user | change my review and opinions on things | record my opinions accurately at all times |
v2.0 | forgetful user | be prompted of an existing review | avoid duplicates in my list |
v2.0 | lazy user | have my sorting preferences saved | avoid having to input my preferred sorting method all the time |
v2.0 | user | store my files in JSON format | they can be exported as other file formats easily if required |
v2.0 | adventurous user | have a recommendation feature (bucket list equivalent) | track my list and convert them to reviews when accomplished |
Appendix C: Non-Functional Requirements
- Should work on any mainstream OS as long as it has
Java 11
installed. - A user with above average typing speed for regular English text should be able to use the features of Connoisseur faster than by using the mouse.
- A user who wants to modify the save file can do so by using an application that is able to edit JSON files.
Appendix D: Instructions for manual testing
Given below are instructions to test the app manually.
Launch and Shutdown
-
Initial launch
i. Ensure that you have Java 11 or above installed.
ii. Download the latest version of Connoisseur here.
iii. Copy the downloaded Connoisseur.jar into your Desktop.
iv. Open terminal and enter
cd Desktop
.v. Then, enter
java -jar Connoisseur.jar
.Expected: Shows the command line interface with welcome message.
-
Shutdown Connoisseur
i. Enter
exit
orbye
into terminal while Connoisseur is running.
Expected: A farewell message by Connoisseur will be shown.
Mode Switch
Switch between review and recommendation modes to manage reviews and recommendations respectively.
-
Test Case:
reco
Expected:
You are now in recommendation mode.
-
Test Case:
review
Expected:
You are now in review mode.
-
Test Case:
aaaa
Problem: Invalid Command. Unable to switch modes.
Expected:
Invalid command, please try again.
Adding a Review or Recommendation
Allow user to add a review or recommendation, depending on whether they are in review or recommendation mode respectively.
User is in review mode
-
Test Case:
new
oradd
Expected: Connoisseur will ask user if user wants to add a quick review, followed by prompting user to add in details of review.
-
Test Case:
new quick
oradd quick
Expected: Connoisseur will prompt user to add in details of review, excluding the description.
-
Test Case:
new full
oradd full
Expected: Connoisseur will prompt user to add in details of review, including the description.
-
Test Case: Rating given is not an integer between 0 and 5 inclusive.
-1
Expected:
Invalid number. Please add in a valid rating!
User is in recommendation mode
-
Test Case:
new
oradd
Expected: Connoisseur will prompt user to add details of recommendation.
Duplicate review or recommendation title, (case-insensitive)
-
Test Case:
Avengers
Expected: Prints details of existing review or recommendation, followed by
Please try again with a unique title!
Empty Inputs
-
Test Case e.g. title: null input or ` `
Expected:
This field should not be empty!
Longer than expected inputs
-
Test Case e.g. title:
abcdefghijklmnopqrstuvwxyz
Expected:
Please enter an input with less than 20 characters.
Editing a Review or Recommendation
Allow user to edit a review or recommendation, depending on whether they are in review or recommendation mode respectively.
-
Test Case:
edit <review/ recommendation tite>
, review or recommendation title existsExpected: Connoisseur will ask user what the user wants to edit, until the user is satisfied with edits.
-
Test Case:
edit <review/ recommendation tite>
, review or recommendation title does not exist.Expected:
Specified review/ recommendation does not exist!
Duplicate review or recommendation title, case-insensitive)
-
Test Case:
Avengers
Expected: Prints details of existing review or recommendation, followed by
Please try again with a unique title!
Empty Inputs
-
Test Case e.g. title: null input or ` `
Expected:
This field should not be empty!
Longer than expected inputs
-
Test Case e.g. title:
abcdefghijklmnopqrstuvwxyz
Expected:
Please enter an input with less than 20 characters.
User is in review mode
-
Test Case: Rating given is not an integer between 0 and 5 inclusive.
-1
Expected:
Invalid number. Please add in a valid rating!
User is in recommendation mode
-
Test Case:
new
oradd
Expected: Connoisseur will prompt user to add details of recommendation.
Setting preferred sorting method for reviews
Sets sort method as preferred sorting method for reviews.
Prerequisite: Connoisseur is in review
mode.
-
Test Case:
sort <preferred sorting method>
Expected:
Success! Your preferred sorting method has been saved: <preferred sorting method in caps>
-
Test Case:
sort
Expected: Displays how to use the sort function.
-
Test Case:
sort aaaa
Expected:
aaaa is not a valid sorting method, please try again.
List stored reviews or recommendations
Provide a consolidated view of reviews or recommendations, depending on which mode Connoisseur is in.
-
Test Case:
list
Expected: Provides list of reviews in preferred sorting method if user is in review mode. Provides list of recommendations if user is in recommendation mode.
-
Test Case:
list abc
Expected:
Invalid Command. Please do not enter extra parameters or less parameters than required.
Marking a recommendation as done
Mark a recommendation as done and convert it to a review.
Prerequisite: Connoisseur must be in reco
mode. Type reco
to switch to reco
mode.
-
Test case:
done <recommendation title>
(case-insensitive, recommendation exist)Expected: Prompts to enter rating and option to enter description of review. This is followed by
<recommendation title> has been made a review!
. -
Test case:
done <recommendation title>
(recommendation does not exist)Problem: An attempt at marking a recommendation that does not exist as done.
Expected :
Specified recommendation does not exist!
Viewing the full details of a review
Viewing a review details with review descriptions.
Prerequisite: Connoisseur is in reco
mode. This can be accomplished with the command reco
.
-
Test case:
view <review title>
(case-insensitive)Expected: Details of the task with the title in the review list is shown.
-
Test case:
view <review title that does not exist in list>
Problem: An attempt at viewing a title that does not exist.
Expected:
Specified review does not exist!
Data Storage
Storage of user data (reviews and recommendations)
Test if Connoisseur is able to handle corrupted data files.
Prerequisite: Open connoisseur.json located at data\
.
-
Test case: Remove all the contents in the JSON file, leaving it blank.
Problem: File is corrupted and not in JSON format.
Expected: The error is handled by a program. The commandline interface with welcome message will be shown.
-
Test case: Remove one of the commas (
,
) from the file if connoisseur.json is not empty.Problem: File is corrupted and not in JSON format.
Expected: The error message
Data file corrupted. Please remove the corrupted data file and try again.
is shown.
Help
Guide on the use of Connoisseur
-
Test case:
help
Expected: A guide on how to use Connoisseur will be shown.
-
Test case:
help aaaa
Expected:
Invalid help command!
-
Test case:
help <command>
Expected: A guide on how to use specific commands on Connoisseur will be shown.
Appendix E: Other Guides: Documentation, Testing, Dev-ops
This section contains links to other relevant guides that may be of use.
Appendix F: Glossary
- Mainstream OS: Windows, Linux, Unix, OS-X
- Review: An experience a user has experienced, and intends to record. It could be a movie, restaurant, activity, etc.
- Recommendation: An experience a user wishes to experience, and wishes to record. It could be a movie, restaurant, activity, etc. It can be converted to a review after a user marks it as done.
- Command: An instruction meant to update the ReviewList or RecommendationList in a certain way.