By: CS2103-AY1819S1-W13-4      Since: Aug 2018

1. Setting Up

1.1. Prerequisites

  1. JDK 9 or later

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

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

1.2. Setting Up the Project

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

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

  3. Set up the correct JDK version for Gradle

    1. Click Configure > Project Defaults > Project Structure

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

  4. Click Import Project

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

  6. Click Open as Project

  7. Click OK to accept the default settings

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

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

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

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

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

1.3. Verifying the Setup

  1. Run the tutorhelper.MainApp and try a few commands

  2. Run the tests to ensure they all pass.

1.4. Configurations to Apply before Writing Code

1.4.1. Configuring the Coding Style

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

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

  2. Select Editor > Code Style > Java

  3. Click on the Imports tab to set the order

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

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

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

1.4.2. Updating Documentation to Match your Fork

After forking the repo, the documentation will still refer to the CS2103-AY1819S1-W13-4/main repo.

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

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

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

1.4.3. Setting up CI

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

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

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

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

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

1.4.4. Getting Started with Coding

When you are ready to start coding, get some sense of the overall design by reading Section 2.1, “Architecture”.

2. Design

2.1. Architecture

Architecture
Figure 1. Architecture Diagram

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

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

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

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

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

Commons represents a collection of classes used by multiple other components. Two of those classes play important roles at the architecture level.

  • EventsCenter : This class (written using Google’s Event Bus library) is used by components to communicate with other components using events (i.e. a form of Event Driven design)

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

The rest of the App consists of four components.

  • UI: The UI of the App.

  • Logic: The command executor.

  • Model: Holds the data of the App in-memory.

  • Storage: Reads data from, and writes data to, the hard disk.

Each of the four components

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

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

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

LogicClassDiagram
Figure 2. Class Diagram of the Logic Component

Events-Driven Nature of the Design

The Sequence Diagram below shows how the components interact for the scenario where the tutor issues the command delete 1.

SDforDeleteStudent
Figure 3. Component interactions for delete 1 command (part 1)
Note how the Model simply raises a TutorHelperChangedEvent when the TutorHelper data are changed, instead of asking the Storage to save the updates to the hard disk.

The diagram below shows how the EventsCenter reacts to that event, which eventually results in the updates being saved to the hard disk and the status bar of the UI being updated to reflect the 'Last Updated' time.

SDforDeleteStudentEventHandling
Figure 4. Component interactions for delete 1 command (part 2)
Note how the event is propagated through the EventsCenter to the Storage and UI without Model having to be coupled to either of them. This is an example of how this Event Driven approach helps us reduce direct coupling between components.

The sections below give more details of each component.

2.2. UI Component

UiClassDiagram
Figure 5. Structure of the UI Component

API : Ui.java

The UI consists of a MainWindow that is made up of parts e.g.CommandBox, ResultDisplay, StudentListPanel, StatusBarFooter, BrowserPanel etc. All these, including the MainWindow, inherit from the abstract UiPart class.

The UI component uses JavaFx UI framework. The layout of these UI parts are defined in matching .fxml files that are in the src/main/resources/view folder. For example, the layout of the MainWindow is specified in MainWindow.fxml

The UI component,

  • Executes tutor’s commands using the Logic component.

  • Binds itself to some data in the Model so that the UI can auto-update when data in the Model change.

  • Responds to events raised from various parts of the App and updates the UI accordingly.

2.3. Logic Component

LogicClassDiagram
Figure 6. Structure of the Logic Component

API : Logic.java

  1. Logic uses the TutorHelperParser class to parse the tutor’s command.

  2. This results in a Command object which is executed by the LogicManager.

  3. The command execution can affect the Model (e.g. adding a student) and/or raise events.

  4. The result of the command execution is encapsulated as a CommandResult object which is passed back to the Ui.

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

DeleteStudentSdForLogic
Figure 7. Interactions Inside the Logic Component for the delete 1 Command

2.4. Model Component

ModelClassDiagram
Figure 8. Structure of the Model Component

API : Model.java

The Model,

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

  • stores the TutorHelper data.

  • exposes an unmodifiable ObservableList<Student> that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.

  • does not depend on any of the other three components.

As a more OOP model, we can store a Tag list in TutorHelper, which Student can reference. This would allow TutorHelper to only require one Tag object per unique Tag, instead of each Student needing their own Tag object. An example of how such a model may look like is given below.

ModelClassBetterOopDiagram

2.5. Storage Component

StorageClassDiagram
Figure 9. Structure of the Storage Component

API : Storage.java

The Storage component,

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

  • can save the TutorHelper data in xml format and read it back.

2.6. Common Classes

Classes used by multiple components are in the tutorhelper.commons package.

3. Implementation

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

3.1. Group Students Feature

3.1.1. Current Implementation

Classes related to Group and its functionality is listed below:

  • TutorHelperParser — Creates a GroupCommandParser object and parses the user’s input.

  • GroupCommandParser — Analyses the input, creates a predicate based on the input and returns a GroupCommand object with the predicate as the argument.

  • GroupCommand — Filters the list based on the predicate, sorts the list and displays it to the user.

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

Step 1. The user launches the application for the first time.

Step 2. Assuming that the application isn’t empty, the user executes 'group Monday' command to group all students with a class on Monday. The group command will be called by GroupCommandParser.parse(), parsing the argument to check against. The application will check the list and display all students with classes on Monday, sorted based on the earliest timing.

The user can execute list to re-display the full list of students again.
The user can execute undo to undo the sorting done to the list.
The group command is CASE-SENSITIVE. E.g. Passing MONDAY as an input instead of Monday will throw an error.
Only 12-hr timings are valid.

The following sequence diagram shows how the group operation works for day parameter and time parameter:

GroupSequenceDiagramDay
GroupSequenceDiagramTime

3.2. Record Payment Feature

3.2.1. Current implementation

Classes that are related to Payment and their functionality are as listed below:

  • TutorHelperParser — Creates a PayCommandParser object and calls parse method in object to parse user’s argument input.

  • PayCommandParser — Analyses the input, checks for any violation of syntax and returns a PayCommand object with the Payment object as the para.

  • PayCommand — Calls on methods in VersionedTutorHelper to update new Payments made.

  • Payment — -Contains fields to store student id, amount paid, month of payment and year of payment.

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

Step 1. The tutor launches the application and wants to record a payment for his/her student called Alice.

Step 2. He/she makes a mental note of Alice’s student index as listed in the left side of the application.

Step 3. Lets say, Alice has student id 2. The payment she made was $400 for the month and year of November 2018. He/she proceeds to key in the command in the following format: paid 2 400 11 2018

Step 4. Assuming that each argument given is a valid input, the system will perform the Payment command.

Step 5. The system will locate Alice from the student list and update payment field for Alice.

Step 6. Now, payment details have been updated and the tutor will be able to see a successful payment message under the command box.

Step 7. The tutor may also choose to view the details from browser panel by clicking on Alice tab on the left. Payments will be displayed.

Payment list will keep up to 5 payments at any one time. When the 6th payment is added, the payment list will remove the oldest payment record.
The maximum amount of payment that can be made each time is $10 000.

The diagram below illustrates the sequence diagram.

PaymentSequenceDiagram

3.3. Edit Payment Record Feature

3.3.1. Current implementation

Classes that are related to edit Payment and their functionality are as listed below:

  • TutorHelperParser — Creates a PayCommandParser object and calls parse method in object to parse user’s argument input.

  • PayCommandParser — Analyses the input, checks for any violation of syntax and returns a PayCommand object with the Payment object as the para.

  • PayCommand — Calls on methods in VersionedTutorHelper to update new Payments made.

  • Payment — -Contains fields to store student id, amount paid, month of payment and year of payment.

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

Step 1. The tutor launches the application and wants to edit a payment for his/her student called Alice.

Step 2. He/she makes a mental note of Alice’s student index as listed in the left side of the application.

Step 3. Lets say, Alice has student id 2. The payment that the tutor wants to update is $300 for the month and year of November 2018. He/she proceeds to key in the command in the following format: paid 2 300 11 2018

Step 4. Assuming that each argument given is a valid input, the system will perform the Payment command.

Step 5. The system will locate Alice from the student list.

Step 5a. The system will check that payment for the month and year of November 2018 has been recorded for Alice before, hence it will proceed to update the payment amount instead of creating a new payment entry.

Step 6. Now, payment details have been updated and the tutor will be able to see a successful edit payment message under the command box.

Step 7. The tutor may also choose to view the details from browser panel by clicking on Alice tab on the left. Payments will be displayed.

Payment list will keep up to 5 payments at any one time. When the 6th payment is added, the payment list will remove the oldest payment record.
The maximum amount of payment that can be made each time is $10 000.

The diagram below illustrates the sequence diagram.

EditPaymentSequenceDiagram

3.4. Display Earnings Feature

3.4.1. Current implementation

The classes related to Earnings are EarningsCommand, EarningsCommandParser.

  • TutorHelperParser — Creates a PayCommandParser object and calls parse method in object to parse user’s argument input.

  • EarningsCommandParser --Takes in users' input and checks if it adheres to the required format. Returns a EarningsCommand with the month and year passed in.

  • EarningsCommand — Takes in month and year as inputs in its constructor. In Execute() method, it performs the checking of all recorded payments and returns the total payments received for that specified month and year.

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

Step 1. The tutor launches the application and wants to view his/her earnings for the month of November 2018.

Step 2. He/she enters input in the format of: earnings 11 2018

Step 3. Assuming arguments are correct, the system executes Earnings command.

Step 4. The list of students from the model is obtained and the system proceeds to search for Payment records made for that requested month and year.

Step 5. The tutor will then see a message below the command text box, showing the earnings for the requested month and year.

The diagram below illustrates the sequence diagram.

Default value for earnings of an unrecorded month and year will be $0.

EarningsSequenceDiagram

3.5. Copy Subject Feature

3.5.1. Current Implementation

The copy subject command operates by making a duplicate of the selected subject of the student and adds it the other student.

If the other student already has the same subject, append the content of the subject instead. State of each syllabus is also copied. Duplicate syllabus will not be added.

Classes related to copy command and its functionality are listed below:

  • TutorHelperParser — Creates CopySubCommandParser which parses the input from user.

  • CopySubCommandParser — Parses user’s input into proper argument and creates CopySubCommand

  • CopySubCommand — Updates the target student based on the argument

  • SubjectsUtil — Manage the finding and copying aspect of copysub command.

Given below is an example usage scenario with 2 possible outcomes and how to copy function addresses each case.

Step 1. The user launches the application for the first time.

Step 2. Assuming that the application isn’t empty, the user executes copysub 1 2 4.

Step 3. Assuming that each argument given is a valid input, the system will perform the copysub command.

Step 4. The system will locate the first student from the student list, and make a separate copy of the second subject stored under the student data.

Step 5. The system will locate the fourth student from the student list, and make a decision.

  • Step 5a. If the same subject as second subject in Step 4, system will append the content of subject of second subject into the fourth student.

  • Step 5b. If there is no subject same as second subject in Step 4, system will add the second subject as a new subject under the fourth student.

The process is described with sequence diagram below:

CopySubSequenceDiagrams

3.6. Add / Delete Subject Feature

3.6.1. Implementation

The add / delete subject mechanism is facilitated with TutorHelperParser. Classes related to the functionality of the mechanism are listed below:

  • TutorHelperParser — Creates a AddSubCommandParser / DeleteSubCommandParser object and parses the user’s input.

  • AddSubCommandParser / DeleteSubCommandParser — Analyses user input to create a corresponding Command object.

  • AddSubCommand / DeleteSubCommand — Execution results in addition / deletion of a subject for a specified student index.

Given below is an example usage scenario of how the add / delete subject mechanism behaves at each step.

Add Subject

Step 1. The user launches the application.

Step 2. The tutor executes a command of the format addsub STUDENT_INDEX s/SUBJECT on the CLI.

Step 3. The arguments are parsed by AddSubCommandParser, which produces an instance of AddSubCommand.

Step 4. AddSubCommand.execute() is called, and the supplied subject is added for the student at the specified student index by TutorHelper.

Delete Subject

Step 1. The user launches the application.

Step 2. The tutor executes a command of the format deletesub STUDENT_INDEX SUBJECT_INDEX on the CLI.

Step 3. The arguments are parsed by DeleteSubCommandParser, which produces an instance of DeleteSubCommand.

Step 4. DeleteSubCommand.execute() is called, and the subject at the specified subject index of the student at the specified student index is deleted by TutorHelper.

The TutorHelper has to have at least 1 student as a precondition for both addsub and deletesub.
deletesub requires the student at the specified student index to have at least two subjects. After deletion, a student cannot have 0 subjects.

The following sequence diagram shows how the addsub operation works:

AddSubSequenceDiagram

The following sequence diagram shows how the deletesub operation works:

DeleteSubSequenceDiagram

3.7. Edit Syllabus Topic Feature

3.7.1. Current Implementation

Classes that are related to edit syllabus and their functionality are as listed below: * TutorHelperParser — Creates a EditSyllCommandParser object and calls parse method in object to parse user’s argument input. * EditSyllCommandParser — Analyses the input, checks for any violation of syntax and returns a EditSyllCommand object with the student,subject,syllabus index object as well as the new Syllabus object as the argument. * EditSyllCommand — Locates the corresponding syllabus to update and calls corresponding subject to edit syllabus. * Subject — Locates and edits existing syllabus entry with new syllabus entry

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

Step 1. The tutor launches the application.

Step 2. He/she executes the command in the format editsyll STUDENT_INDEX SUBJECT_INDEX SYLLABUS_INDEX sy/SYLLABUS on the CLI.

Step 3. The arguments are parsed by EditSyllCommandParser, which produces an instance of EditSyllCommand.

Step 4. EditSyllCommand.execute() is called, and the syllabus at the specified subject index and syllabus index of the student at the specified student index is edited by TutorHelper.

The TutorHelper has to have at least 1 student as a precondition for editsyll.

The diagram below shows how the editsyll operation works:

EditSyllSequenceDiagram

3.8. Logging

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

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

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

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

Logging Levels

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

  • WARNING : Can continue, but with caution

  • INFO : Information showing the noteworthy actions by the App

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

3.9. Configuration

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

4. Documentation

We use asciidoc for writing documentation.

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

4.1. Editing Documentation

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

4.2. Publishing Documentation

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

4.3. Converting Documentation to PDF format

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

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

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

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

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

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

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

4.4. Site-wide Documentation Settings

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

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

site-name

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

not set

site-githuburl

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

not set

4.5. Per-file Documentation Settings

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

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

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

site-section

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

not set

no-site-header

Set this attribute to remove the site navigation bar.

not set

4.6. Site Template

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

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

Modifying the template files in docs/templates requires some knowledge and experience with Ruby and Asciidoctor’s API. You should only modify them if you need greater control over the site’s layout than what stylesheets can provide.

5. Testing

5.1. Running Tests

There are three ways to run tests.

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

Method 1: Using IntelliJ JUnit test runner

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

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

Method 2: Using Gradle

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

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

Method 3: Using Gradle (headless)

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

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

5.2. Types of Tests

We have two types of tests:

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

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

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

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

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

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

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

5.3. Troubleshooting Testing

Problem: HelpWindowTest fails with a NullPointerException.

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

  • Solution: Execute Gradle task processResources.

6. Dev Ops

6.1. Build Automation

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

6.2. Continuous Integration

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

6.3. Coverage Reporting

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

6.4. Documentation Previews

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

6.5. Making a Release

Here are the steps to create a new release.

  1. Update the version number in MainApp.java.

  2. Generate a JAR file using Gradle.

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

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

6.6. Managing Dependencies

A project often depends on third-party libraries. For example, TutorHelper depends on the Jackson library for XML parsing. Managing these dependencies can be automated using Gradle. For example, Gradle can download the dependencies automatically, which is better than these alternatives.
a. Include those libraries in the repo (this bloats the repo size)
b. Require developers to download those libraries manually (this creates extra work for developers)

Appendix A: Product Scope

Current:

  • Tutors use reminder applications to keep track of lessons.

  • Tutors use physical diaries or notepads to keep track of current lesson progress.

Value Proposition:

  • Tutors have a platform where they can keep track of all their students' details, their progress across different subjects and the syllabus topics they intend to cover.

Appendix B: User Stories

  1. As a busy tutor, I want to be able to manage my students' schedules individually, so that I can plan my time properly.

  2. As a tutor, I want to be able to find out where my students live and what time I should be there for tuition.

  3. As a tutor, I want to know my students' individual progress so that I know what topics I need to cover for the next tuition session.

  4. As a tutor, I want to keep track of my students' payments so that i know who to collect fees from.

  5. As a tutor, I want to keep track of my monthly earnings so that i can manage my financial accounts.

  6. As a tutor, I want to be able to edit teaching data such as editing my syllabus to keep up with changes in school’s curriculum or updating payments made by students.

Appendix C: Use Cases

  1. Add Student

    System: TutorHelper
    Actor: Tutor
    MSS:
      1. Tutor inputs to add a student and his/her details.
      2. System adds student details into the database.
      Use case ends.
    Extensions:
      2a. Tutor did not key in all mandatory fields.
        2a1. System displays error message informing tutor of invalid index.
        2b1. Resume step 1.
  2. Edit Student

    System: TutorHelper
    Actor: Tutor
    MSS:
      1. Tutor inputs to edit a student's details.
      2. System edits student details into the database.
      Use case ends.
    Extensions:
      2a. Index is out of bounds
        2a1. System displays error message informing tutor of invalid index.
        2b1. Resume step 1.
  3. Delete Student

    System: TutorHelper
    Actor: Tutor
    MSS:
      1. Tutor inputs student's index to delete.
      2. System deletes student details from the database.
      Use case ends.
    Extensions:
      2a. Index is out of bounds
       2a1. System displays error message informing tutor of invalid index.
       2b1. Resume step 1.
  4. List Students

    System: TutorHelper
    Actor: Tutor
    MSS:
      1. Tutor requests to list students.
      2. System displays current list of students.
      Use case ends.
  5. Group Students

    System: TutorHelper
    Actor: Tutor
    Precondition: Current list of students is not empty.
    MSS:
      1. Tutor requests to group students by day or timing.
      2. System filters the current list of students based on the timing entered.
      3. System sorts the filtered list of students in order of timing.
      4. System displays filtered and sorted list to Tutor.
      Use case ends.
    Extensions:
      2a. Input is invalid
        2a1. System displays examples of valid input to Tutor.
        Use case ends.
  6. Record students' payments

    System: TutorHelper
    Actor: Tutor
    Precondition: Current list of students is not empty.
    MSS:
      1. Tutor request to add in payment for a student.
      2. System searches for that student according to index entered.
      3. System adds Payment amount, month and year to student's record.
      4. System displays payment record in browser panel.
      5. System displays successful recording of payment message under command box.
      Use case ends.
    Extensions:
      2a. Tutor does not enter all the required entries correctly
        2a1. System displays error message
        2a2. System gives tutor an example of a correct entry.
        2a3. Repeat step 1
      2b. Tutor does not enter a valid student index
        2b1. System displays error message telling tutor that index is invalid
        2b2. Repeat step 1.
  7. Edit students' payments

    System: TutorHelper
    Actor: Tutor
    Precondition: Current list of students is not empty.
    Precondition: Payment for the month and year has been recorded for student before.
    MSS:
      1. Tutor request to add in edited payment for a student.
      2. System finds the existing payment entry with same month and year.
      3. System adds new payment entry to existing entry.
      4. System displays payment record in browser panel.
      5. System displays successful editing of payment message under command box.
      Use case ends.
    Extensions:
      2a. Tutor does not enter all the required entries correctly
        2a1. System displays error message
        2a2. System gives tutor an example of a correct entry.
        2a3. Repeat step 1
      2b. Tutor does not enter a valid student index
        2b1. System displays error message telling tutor that index is invalid
        2b2. Repeat step 1.
  8. Display tutor’s earnings for that month and year

    System: TutorHelper
    Actor: Tutor
    Precondition: Current list of students is not empty.
    MSS:
      1. Tutor request for earnings for a specific month and year.
      2. System searches for all the payment records made from all the students for that particular month and year.
      3. System adds up all the payment.
      4. System displays total earnings under the command box.
      Use case end.
    Extensions:
      2a. System does not find any payment recorded for that month and year.
        2a1. System displays $0 as result.
      2b. Tutor does not enter all the required entries correctly
        2b1. System displays error message
        2b2. System gives tutor an example of a correct entry.
        2b3. Repeat step 1.
  9. Edit students' syllabus for that subject

    System: TutorHelper
    Actor: Tutor
    Precondition: Tutor has an existing syllabus entry at the index.
    MSS:
      1. Tutor request to edit syllabus for a specific student, subject and syllabus
      2. System searches for the student and the respective subject and syllabus at specified index.
      3. System edits the syllabus at the specified index with new syllabus
      4. System displays edited syllabus list in browser panel
      5. System displays successful editing of syllabus under command box.
      Use case end.
     Extensions:
      2a. System does not find any student entry at specified index.
        2a1. System displays error message telling tutor that index is invalid
        2a2. Repeat step 1.
      2b. System does not find any subject entry at specified index.
        2b1. System displays error message telling tutor that index is invalid
        2b2. Repeat step 1.
      2c. System does not find any syllabus entry at specified index.
        2c1. System displays error message telling tutor that index is invalid.
        2c2. Repeat step 1.
      2d. System finds same syllabus entry already exists in subject.
        2d1. System displays error message telling tutor that syllabus already exist.
        2d2. Repeat step 1.

Appendix D: Non Functional Requirements

  1. The system should respond in two seconds.

  2. The system should be understandable to a novice in working with computers.

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

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

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

Appendix E: Glossary

Mainstream OS

Windows, Linux, Unix, OS-X

Subject

A branch of knowledge studied by the student

Syllabus

The required topics to be covered under the subject

Appendix F: Instructions for Manual Testing

Given below are instructions to test the app manually.

These instructions only provide a starting point for testers to work on; testers are expected to do more exploratory testing. Commands existing in AddressBook Level 4 are omitted.

F.1. Launch and Shutdown

  1. Initial launch

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

    2. Double-click the jar file
      Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.

  2. Saving window preferences

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

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

F.2. Grouping Students

  1. Grouping by day or time while all persons are listed.

    1. Prerequisites: List all persons using the 'list' command. Multiple persons in the list.

    2. Test case: 'group Monday'
      Expected: X students listed! (X is the number of students meeting the requirement)

    3. Test case: 'group 3:00pm'
      Expected: X students listed!

    4. Test case: 'group Monday 3pm'
      Expected: Invalid command format. Group command message usage is shown.

    5. Other incorrect grouping commands to try 'group', 'group monday', 'group 3pm'
      Expected: Invalid command format. Group command message usage is shown.

F.3. Recording a Payment

  1. Adding a payment while all persons are listed.

    1. Prerequisites: TutorHelper is not empty.

    2. Test case: 'paid 1 200 8 2018'
      Expected: Payment for this student is added: Display student’s details.

    3. Test case: 'paid 0 200 8 2018'
      Expected: Index is not a non-zero unsigned integer.

    4. Test case: 'paid X 200 8 920' (X is a number greater than the list)
      Expected: The student index provided is invalid.

    5. Test case: 'paid 1 -200 8 2018'
      Expected: Amount should only contain zero or positive numbers, and has to be smaller than 10 000.

    6. Test case: 'paid 1 200 16 2018'
      Expected: Month should only contain numbers between 1 to 12, inclusive.

    7. Test case: 'paid 1 200 8 920'
      Expected: Year should only contain 4 digits numbers.

    8. Other incorrect payment commands to try: paid, paid x (where x is any number), 'paid x 8', 'paid x 200 8', 'paid x 200 2018' Expected: Invalid command format. Pay command message usage is shown.

F.4. Editing Payment Records

  1. Editing a payment while all persons are listed.

    1. Prerequisites: TutorHelper is not empty.

    2. Prerequisites: Payment for the month and year must have been added previously.

    3. Test case: 'paid 1 200 8 2018'
      Expected: Payment for this student has been edited: Display student’s details.

    4. Test case: 'paid 0 200 8 2018'
      Expected: Index is not a non-zero unsigned integer.

    5. Test case: 'paid X 200 8 920' (X is a number greater than the list)
      Expected: The student index provided is invalid.

    6. Test case: 'paid 1 -200 8 2018'
      Expected: Amount should only contain zero or positive numbers, and has to be smaller than 10 000.

    7. Test case: 'paid 1 200 16 2018'
      Expected: Month should only contain numbers between 1 to 12, inclusive.

    8. Test case: 'paid 1 200 8 920'
      Expected: Year should only contain 4 digits numbers.

    9. Other incorrect payment commands to try: paid, paid x (where x is any number), 'paid x 8', 'paid x 200 8', 'paid x 200 2018' Expected: Invalid command format. Pay command message usage is shown.

F.5. Displaying Earnings

  1. Display earnings made by the tutor.

    1. Prerequisites: TutorHelper is not empty.

    2. Test case: 'earnings 8 2018'
      Expected: Earnings: $X (X is the total earnings)

    3. Test case: 'earnings 8 299'
      Expected: Year should only contain 4 digits numbers.

    4. Test case: 'earnings 0 2018'
      Expected: Month should only contain numbers between 1 to 12, inclusive.

    5. Other incorrect earnings commands to try: 'earnings', 'earnings 8', 'earnings 2018'
      Expected: Invalid command format. Earnings command message usage is shown.

F.6. Adding a Subject

  1. Adding a subject to an existing student.

    1. Prerequisite: TutorHelper is not empty.

    2. Test case: 'addsub 1 s/Chemistry'
      Expected: Added subject to student: Display student’s details.

    3. Test case: 'addsub X s/Chemistry' (X is an invalid student index)
      Expected: The student index provided is invalid.

    4. Test case: 'addsub 1 s/X' (X is a subject student index 1 is already taking)
      Expected: Subject is already taken by student: Display student index.

    5. Other incorrect addsub commands to try: 'addsub', 'addsub 2', 'addsub 1 Physics', 'addsub Physics'
      Expected: Invalid command format. addsub command message usage is shown.

F.7. Deleting a Subject

  1. Deleting subject from existing student

    1. Prerequisite: TutorHelper is not empty.

    2. Test case: 'deletesub 1 1'
      Expected: Deleted subject from student: Display student’s details.

    3. Test case: 'deletesub 1 X' (X is an invalid subject index)
      Expected: The subject index provided is invalid.

    4. Test case: 'deletesub X 1' (X is an invalid student index)
      Expected: The student index provided is invalid.

    5. Other incorrect deletesub commands to try: 'deletesub', 'deletesub 1'
      Expected: Invalid command format. deletesub command message usage is shown.

F.8. Copying a Subject

  1. Copying a subject from one student profile to another student.

    1. Prerequisites: TutorHelper is not empty.

    2. Test case: 'copysub 1 1 2'
      Expected: Copied syllabus to Student: Display student’s details.

    3. Test case: 'copysub 1 X 2' (X is an invalid subject index of the source student)
      Expected: The subject index provided is invalid.

    4. Test case: 'copysub 1 1 X' (X is an invalid student index)
      Expected: The student index provided is invalid.

    5. Test case: 'copysub X 1 1' (X is in invalid student index)
      Expected: The student index provided is invalid.

    6. Test case: 'copysub 1 1 1'
      Expected: Copying subject to the same student is not allowed: Display student’s details.

    7. Test case: 'copysub 1 X 3' (X is an existing subject in student 3)
      Expected: Copied syllabus to Student: Display destination student details

    8. Other incorrect copysub commands to try: 'copysub', 'copysub 1', 'copysub 1 1'
      Expected: Invalid command format. copysub command message usage is shown.

F.9. Adding a Syllabus Topic

  1. Adds a new syllabus topic for a specified student and subject

    1. Prerequisite: TutorHelper must not be empty.

    2. Test case: 'addsyll 1 1 sy/Integration'
      Expected: Added syllabus to Student: Display destination student’s details

    3. Test case: 'addsyll X 1 sy/Integration' (X is an invalid student index)
      Expected: The student index provided is invalid.

    4. Test case: 'addsyll 1 X sy/Integration' (X is an invalid subject index)
      Expected: The subject index provided is invalid.

    5. Test case: 'addsyll 1 1 sy/X' (X is a syllabus already in student)
      Expected: Syllabus is already in Student: Display student’s details.

    6. Other incorrect addsyll commands to try: 'addsyll', 'addsyll 1', 'addsyll 1 1', 'addsyll 1 1 sy/'
      Expected: Invalid command format. addsyll command message usage is shown.

F.10. Deleting a Syllabus Topic

  1. Deletes a syllabus from an existing student

    1. Prerequisite: TutorHelper must not be empty.

    2. Test case: 'deletesyll 1 1 1'
      Expected: Removed selected syllabus from Student: Display student’s details.

    3. Test case: 'deletesyll X 1 1' (X is an invalid student index)
      Expected: The student index provided is invalid.

    4. Test case: 'deletesyll 1 X 1' (X is an invalid subject index)
      Expected: The subject index provided is invalid.

    5. Test case: 'deletesyll 1 1 X' (X is an invalid syllabus index)
      Expected: The syllabus index provided is invalid.

    6. Other incorrect deletesyll commands to try: 'deletesyll', 'deletesyll 1', 'deletesyll 1 1'
      Expected: Invalid command format. deletesyll command message usage is shown.

F.11. Editing a Syllabus Topic

  1. Edits a syllabus from an existing student

    1. Prerequisite: TutorHelper must not be empty.

    2. Test case: 'editsyll 1 1 1 sy/Integration'
      Expected: Edited syllabus to Student: Display student’s details.

    3. Test case: 'editsyll X 1 1 sy/Integration' (X is an invalid student index)
      Expected: The student index provided is invalid.

    4. Test case: 'editsyll 1 X 1 sy/Integration' (X is an invalid subject index)
      Expected: The subject index provided is invalid.

    5. Test case: 'editsyll 1 1 X sy/Integration' (X is an invalid syllabus index)
      Expected: The syllabus index provided is invalid.

    6. Test case: 'editsyll 1 1 X sy/' (X is an invalid syllabus index)
      Expected: Syllabus can take any values, and it should not be blank or preceded by white space.

    7. Other incorrect editsyll commands to try: 'editsyll', 'editsyll 1', 'editsyll 1 1', 'editsyll 1 1 1'
      Expected: Invalid command format. editsyll command message usage is shown.

F.12. Marking a Syllabus Topic

  1. Toggles the state of a specified syllabus topic for a specified student and subject.

    1. Prerequisite: TutorHelper must not be empty.

    2. Test case: 'mark 1 1 1'
      Expected: Changed selected syllabus from Student: Display student’s details

    3. Test case: 'mark X 1 1 ' (X is an invalid student index)
      Expected: The student index provided is invalid.

    4. Test case: 'mark 1 X 1 ' (X is an invalid subject index)
      Expected: The subject index provided is invalid.

    5. Test case: 'mark 1 1 X ' (X is an invalid syllabus index)
      Expected: The syllabus index provided is invalid.

    6. Other incorrect mark commands to try: 'mark', 'mark 1', 'mark 1 1'
      Expected: Invalid command format. marksyll command message usage is shown.