By: T13-4      Since: Aug 2018      Licence: MIT

1. Setting up

1.1. Prerequisites

  1. JDK 10 or later

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

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

1.2. Setting up the project in your computer

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

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

  3. Set up the correct JDK version for Gradle

    1. Click Configure > Project Defaults > Project Structure

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

  4. Click Import Project

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

  6. Click Open as Project

  7. Click OK to accept the default settings

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

1.3. Verifying the setup

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

  2. Run the tests to ensure they all pass.

1.4. Configurations to do before writing code

1.4.1. Configuring the coding style

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

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

  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 have the SE-EDU branding and refer to the se-edu/addressbook-level4 repo.

If you plan to develop this fork as a separate product (i.e. instead of contributing to se-edu/addressbook-level4), you should do the following:

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

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

1.4.3. Setting up CI

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

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

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

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

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

1.4.4. Getting started with coding

When you are ready to start coding,

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

  2. Take a look at Appendix A, Target User Profile.

2. Design

tag::architecture[]

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

image::[width="800"]

Events-Driven nature of the design

The Sequence Diagram below shows how the components interact for the scenario where the user issues the command delete -t CS2103 -e 4 -z 2.

SDforDeleteModule
Figure 3. Component interactions for delete -t CS2103 -e 4 -z 2 command (part 1)
Note how the Model simply raises a TranscriptChangedEvent when the Transcript 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 panels of the UI being updated to reflect the latest modules in the system.

SDforDeleteModuleEventHandling
Figure 4. Component interactions for delete -t CS2103 -e 4 -z 2 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. end::architecture[]

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, StatusBarFooter, BrowserPanel, 'ModuleListPanel' 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 uses JavaFX UI 'DarkTheme' to draw different text, sizes, fonts, and colours from. The actual data displayed in the UI is called using a sample transcript which is created through the Module and Transcript classes. The values themselves are abstracted from the '.fxml' files so the UI display can be easily updated.

  • Executes user 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. UI component

  • The bottom two thirds of the UI is seperated into 2 panels to clearly identify the different outputs from commands entered by the user.

  • The first panel on the left is for Modules that have already been completed; this is shown by the GREEN circles which surround the grades which indicate this grade is "set" and of no concern to the user anymore.

  • The second panel on the right is for Modules that have not yet been completed by the user; this is shown by the RED circles which surround the grades to indicate that this is a grade the user should be aware of. The red indicates an urgency towards that module as it’s outcome will affect the users predicted CAP goal.

  • The top third of the UI is seperated into four distinct rows;

    1. The first row contains the title and drop down menu’s for File and Help options.

    2. The second row is the command line and how the user interacts with the application. Notice there is no button for the user to click when they are ready to enter their command; it is expected the user is familiar with Command Line Interface and will know to use the enter button on their keyboard when ready to submit a command to the app.

    3. The third row is where replies from the application to the user will be displayed. When the commands become too big for the box, a scroll down option becomes available for the user to continue reading the message.

    4. The fourth row displays the summary of the users current CAP goal and their target CAP.

2.4. Logic component

LogicClassDiagram
Figure 6. Structure of the Logic Component

API : Logic.java

  1. Logic uses the TranscriptParser class to parse the user command.

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

  3. The command execution can affect the Model (e.g. adding a module) 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 -t CS1231") API call.

DeleteModuleForLogic
Figure 7. Interactions Inside the Logic Component for the delete -t CS1231 Command

2.5. Model component

ModelClassDiagram Transcript
Figure 8. Structure of the Model Component

API : Model.java

The Model,

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

  • stores the Transcript data.

  • exposes an unmodifiable ObservableList<Module> 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.

  • provides filter function to filter Module with different kind of Grade

2.6. Storage component

StorageClassDiagram
Figure 9. Structure of the Storage Component

API : Storage.java

The Storage interface defines a component which

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

  • can save Transcript data in JSON format and read it back.

The StorageManager implements the Storage interface, and updates the transcript JSON file when the TranscriptChangedEvent is fired (see Figure 4). It also logs the reading and saving of transcript data.

2.7. Common classes

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

3. Implementation

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

3.1. CAP & Target Grades Calculation

The two calculations are triggered upon an change to the list of modules in Transcript i.e. add/update/delete.

SDTranscriptModulesUpdate
Figure 10. Sequence Diagram of updating modules in Transcript

3.1.1. CAP Calculation

The CAP calculation is handled by Transcript.

The pseudo-code for CAP is the following:

all_points <- sum(credits(m) * points(m) for all completed modules m)
all_credits <- sum(credits(m) for all completed modules m)

CAP <- all_points/all_credits
SDTranscriptCalculateCap
Figure 11. Sequence Diagram of CAP calculation

CAP Calculation is triggered by:

3.1.2. Target Grades Calculation

The target Grade calculation is facilitated by Transcript. The returned list of modules with target Grade assures the following properties:

  • Reducing the Grade of any proposed target will result in the increase of another.

  • If x is the minimum Grade required when assigned to all modules to obtain the desired CAP Goal, none of the proposed target Grade will be greater than x

    i.e. if assigning B+ to all module is the minimal requirement to obtain the desired CAP Goal, none of the proposed target Grade will be A- or above.

Below is the pseudo-code for Target Grade Calculation:

CG <- CAP goal of user.
TC <- total credit of completed and incomplete modules.
PO <- total points achieved from completed and adjusted modules.
P <- CG * TC - PO // total points needed to achieve from incomplete modules.

mc_remaining <- sum of module credit of all incomplete modules
accumulated_points <- 0
for every incomplete Module m:
    avg_point_per_mc <- (P - accumulated_points) / mc_remaining
    target(m) <- ceiling(avg_point_per_mc)
    mc_remaining <- mc_remaining - credits(m)
    accumulated_points <- accumulated_points + (credits(m) * target(m))

This sequence diagram shows the interaction of the different classes involved in the process of creating a new Module with updated target grade

SDTranscriptTargetCalculation
Figure 12. Sequence Diagram of Target Grade calculation

And below the activity diagram to further illustrate several exceptional cases.

activityDiagramTargetGradeCalculationWhenChanged
Figure 13. Activity Diagram of High level view of Target Grade Calculation
activityDiagramTargetGradeCalculationActualCalculation
Figure 14. Activity Diagram of Calculate New Target Grade

3.2. Transcript Storage: Reading and Writing

Whenever the in-memory Transcript object is changed, the transcript data file is updated. When the app initializes, it will look for an existing data file from which to load the transcript.+ If the file is not found, the app will initialize with an empty Transcript.+ If the file is found but the data is an incorrect format or there is some problem reading from the file, the app will initialize with an empty Transcript as well.+

When the app initializes, it looks for the file name provided by data/preferences.json under the transcriptFilePath key - by default this is data/transcript_demo.json. This file stores all transcript data including modules data and cap Goal information, such as its value, whether it is set, and whether it is impossible. The transcriptFilePath may be changed manually by the user.+

By using the Jackson library to store the Transcript data as a JSON file instead of an XML file, we avoid having to write XMLSerializableTranscript and XMLAdaptedModule classes. Instead, we simply register a custom JSONTranscriptDeserializer on the ReadOnlyTranscript class so that when we read from the JSON file, Jackson’s ObjectMapper is able to use the values to reconstruct the saved object.

3.3. 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.4, “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.4. 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 15. Saving documentation as PDF files in Chrome

4.4. Site-wide Documentation Settings

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

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

site-name

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

not set

site-githuburl

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

not set

site-seedu

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

not set

4.5. Per-file Documentation Settings

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

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

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

site-section

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

* Official SE-EDU projects only

not set

no-site-header

Set this attribute to remove the site navigation bar.

not set

4.6. Site Template

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

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

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

5. Testing

5.1. Running Tests

There are three ways to run tests.

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

Method 1: Using IntelliJ JUnit test runner

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

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

Method 2: Using Gradle

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

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

Method 3: Using Gradle (headless)

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

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

5.2. Types of tests

We have two types of tests:

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

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

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

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

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

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

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

5.3. Troubleshooting Testing

Problem: HelpWindowTest fails with a NullPointerException.

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

  • Solution: Execute Gradle task processResources.

6. Dev Ops

6.1. Build Automation

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

6.2. Continuous Integration

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

6.3. Coverage Reporting

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

6.4. Documentation Previews

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

6.5. Making a Release

Here are the steps to create a new release.

  1. Update the version number in MainApp.java.

  2. Generate a JAR file using Gradle.

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

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

6.6. Managing Dependencies

A project often depends on third-party libraries. For example, Address Book 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: Target User Profile

  • An NUS Student who has a need to keep track of current CAP, calculate expected CAP, and grades required to achieve desired CAP.

  • Prefer desktop apps over other types.

  • Can type fast.

  • Prefers typing over mouse input.

  • Is reasonably comfortable using CLI apps.

Appendix B: Value Proposition

Helps students manage their CAP and predict what grades they need to reach their CAP goal.

Appendix C: User Stories

Must-Have

  1. As a user, I can add all the modules I have taken (module code, module title, MCs, grade, semester taken) so that I can calculate average mark I need to graduate with desired CAP.

  2. As a user I can delete modules so if I change my mind or fail a module I can re-calculate my average.

  3. As a user I can delete modules so that if i entered a wrong module or failed it, I can remove it.

  4. As a user I can edit the marks I’ve entered previously so that I can update my CAP.

  5. As a user, I can enter a CAP goal so that I can keep track of the progress of my course

  6. As a user, I can calculate the average mark I need across the modules I’ve entered so I can see what mark I need for each module to achieve my CAP goal.

  7. As a user, I can enter in predicted grades for modules so I can see what CAP I would get if I got these grades in my modules.

  8. As a user, I can close the app and return to modify my entries so I can enter my entries incrementally.

Nice-To-Have

  1. As a user, I can add a module without having to add the code, MCs, or semester taken so that I can quickly calculate CAP without worrying about the modules.

  2. As a user, I can still enter the same modules but get warned first so that I would not mistakenly enter the same module again

  3. As a user, I can import all modules for this semester with NUSMods link so that my data can be consistent with NUSMods.

  4. As a user I can search for a module via keyword or module title, and select it for entering my grade so that I don’t have to remember the module code.

  5. As a user, I can adjust what marks I need for each module to achieve my CAP so I can put more emphasis on certain modules instead of expecting the same grade across all modules.

  6. As a user, I can view my current semester’s module goals and use a GUI to adjust projected grade for each module, and other modules will automatically adjust to compensate, so that I can see easily modify my data to see what grades I need for other modules.

  7. As a user, I can view total current MCs so that i can check if I meet the number of mc I need to graduate

  8. As a user I can see if my CAP Goal is possible so I can check whether it is achievable.

  9. As a user, I can list modules taken by level as an alternative listing mode, so that it is easier to track graduation requirements.

  10. As a user, I can see what the highest possible CAP I can achieve with my current grades is so that I can set an appropriate goal.

  11. As a user, I can see what the minimum grades I need per module is to pass the year with my current grades so that I can see what the minimum about of work I need to do is.

Not-Useful

  1. As a user, I can view the module descriptions so that I know what modules I should take

  2. As a user I can enter the MCs for exchange I can keep track of modules that may not be mapped to our database of modules codes or isn’t the default number of MCs.

  3. As a user, I can export my timetable so that I can share it with my friend.

Appendix D: Use Cases

D.1. Use case: [UC1] Calculating current CAP

MSS

  1. User enter modules

  2. System recalculates CAP

  3. System displays CAP

    Use case ends.

Extensions

  • 1a. User enters invalid parameters

    • 1a1. System shows an Invalid entry error message

      Use case ends.

  • 1b. User enters duplicate Module

    • 1b1. System shows an Duplicate Module error message

      Use case ends

D.2. Use case: [UC2] View grades needed to achieve CAP goal

MSS

  1. User enters completed Modules

  2. User enters incomplete Modules

    Step 1-2 are repeated until user is satisfied.

  3. User enter CAP goal

  4. System calculated target grades

  5. System displays target grades for ungraded modules

    Use case ends.

Extensions

  • 3a. CAP goal is invalid

    • 3a1. System shows an Invalid CAP Goal error message

      Use case ends.

  • 4a. There are no incomplete Modules and current CAP is lesser than CAP Goal

    • 4a1. Go to step 5a

      Use case ends.

  • 5a. CAP goal is not achievable

    • 5a1. System inform that it is not achievable

      Use case ends.

D.3. Use case: [UC3] Updating target grades

Pre-condition: [UC2] completed

MSS

  1. User modify modules entries

  2. System recalculates target grades for ungraded modules

  3. System displays new target grades for ungraded modules

    Use case ends.

Extensions

  • 2a. CAP goal is not achievable with new set of modules

    • 2a1. System inform that it is not achievable

      Use case ends.

D.4. Use case: [UC4] Save entered module

MSS

  1. User enters module

  2. System saves the modules

    Use case ends.

D.5. Use case: [UC5] Loading saved modules

Pre-conditions: [UC4] completed

MSS

  1. User restarts the application

  2. User list entered modules

  3. System displays saved modules

    Use case ends

D.6. Use case: [UC6] Adjusting target grades

Pre-conditions:

  • [UC2] completed

  • There are targets given to incomplete modules

MSS

  1. User adjust target

  2. System recalculates target grades for remaining ungraded modules

  3. System displays new target grades for remaining ungraded modules

Extensions

  • 2a. CAP goal is not achievable with new set of modules

    • 2a1. System inform that it is not achievable

      Use case ends.

Appendix E: Non Functional Requirements

  1. Should work on any [mainstream OS](https://github.com/nus-cs2103-AY1819S1/addressbook-level4/blob/master/docs/DeveloperGuide.adoc#mainstream-os) as long as it has Java 10 or higher installed.

  2. Should be able to hold up to 100 modules without a noticeable sluggishness in performance for typical usage.

  3. 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.

  4. Should calculate prediction/expected CAP in 1 seconds

Appendix F: Glossary

Mainstream OS

Windows, Linux, Unix, OS-X

Private contact detail

A contact detail that is not meant to be shared with others

Appendix G: Instructions for Manual Testing

Given below are instructions to test the app manually.

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

G.1. Launch and Shutdown

  1. Initial launch

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

    2. Double-click the jar file
      Expected: Shows the GUI with 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.

  3. Saving transcript data

    1. Add some modules, set a CAP goal, and close the app.

    2. Re-launch the app by double-clicking the jar file.
      Expected: The added modules and CAP goal are retained.

  4. Changing the transcript data file path

    1. Add some modules, set a CAP goal, and close the app.

    2. Change the value of transcriptFilePath in the file data/preferences.json (found in the same directory as the jar file) to some non-existent file such as data/transcript_test.json.

    3. Re-launch the app by double-clicking the jar file.+ Expected: The app will initialize with an empty transcript (no modules or CAP goal). On further change, the app will save the transcript data to the new file data/transcript_test..json.

  5. Importing transcript data

    1. Add some modules, set a CAP goal, and close the app.

    2. Save another copy of the jar file in another directory and open and close this second app.

    3. Replace the data/transcript.json of the second app with the data/transcript.json from the first app.

    4. Relaunch the new app.
      Expected: The app will initialize with the added modules and CAP goal from the first app.+

G.2. CAP Calculation

To further test the Correctness of CAP Calculation you can input your own combination of modules and verify it with This URL
  1. Initial CAP should be 0

    1. Launch the application

    2. Delete any Completed Modules already added

      Expected: Current CAP should be 0

  2. CAP should increase/decrease correctly while Adding modules

    1. CAP score of 1 Module

      1. Add a module(4MC, Grade B+) with the following command
        add -m CS1010 -y 1 -s 1 -c 4 -g B+

      2. Observe the current CAP

        Expected: Current CAP should be 4.0

    2. CAP score of 4 Module

      1. Add another module(4MC, Grade A-) with the following command
        add -m CS1020 -y 1 -s 2 -c 4 -g A-

      2. Observe the current CAP

        Expected: Current CAP should be 4.25

      3. Add another module(5MC, Grade C+) with the following command
        add -m CS2010 -y 2 -s 1 -c 5 -g C+

      4. Observe the current CAP

        Expected: Current CAP should be 3.58

      5. Add another module(5MC, Grade CS) with the following command
        add -m CS2020 -y 2 -s 1 -c 5 -g CS

      6. Observe the current CAP

        Expected: Current CAP should be 3.58

  3. CAP should increase/decrease correctly while Editing modules

    1. Edit one of the CS module with the following command
      edit -t CS2020 -g B+

    2. Observe the current CAP

      Expected: Current CAP should be 3.69

    3. Edit one of the 5MC module with the following command
      edit -t CS2010 -c 4

    4. Observe the current CAP

      Expected: Current CAP should be 3.76

  4. CAP should increase/decrease correctly while Deleting modules

    1. Delete one of the module with the following command
      delete -t CS2020

    2. Observe the current CAP

      Expected: Current CAP should be 3.67

    3. Delete another one of the module with the following command
      delete -t CS1020

    4. Observe the current CAP

      Expected: Current CAP should be 3.25

G.3. Target Grade Calculation

To follow this guide, ensure the there are only the following 2 modules:
Completed Modules: CS1010 year 1 sem 1 credits 4 grade B+
add -m cs1010 -y 1 -s 1 -c 4 -g B+
CS1020 year 2 sem 1 credits 4 grade C+
add -m cs2010 -y 2 -s 1 -c 4 -g C+
You can also further verify that the given target grades together with the adjusted grades and completed grades indeed provide a CAP greater to or equal to your CAP Goal if it is possible with This URL
  1. Target Grade should not be calculated when there is no CAP Goal

    1. Remove any CAP Goal with the following command
      goal 0

    2. Add 2 incomplete module with the following command (One after another)
      add -m CS4234 -y 4 -s 1 -c 4
      add -m CS4226 -y 4 -s 1 -c 4

      Expected: Both module should have grade NIL

  2. Target Grade should not update upon entering an impossible CAP Goal

    1. Add an impossible CAP Goal with the following command
      goal 5.0

    2. Observe the CAP Goal field

      Expected: CAP Goal should be 5.0 (Impossible) and both modules should still have grade NIL

  3. Target Grade should update upon entering an achievable CAP Goal

    1. Change the CAP Goal to something achievable with the following command
      goal 4.0

    2. Observe the Target Grades of CS4234 and CS4226

      Expected: CS4234 → A CS4226 → A-

  4. Target Grade should update upon entering an unachievable CAP Goal

    1. Change the CAP Goal to something achievable with the following command
      goal 5.0

    2. Observe the Target Grades of CS4234 and CS4226

      Expected: both modules should have grade NIL

  5. Target Grade should update upon modifying the list of modules

    1. Adding another completed module with good grade

      1. Set a goal to something achievable with the following command
        goal 4.0

      2. Add a module with good grade with the following command:
        add -m CS2100 -y 1 -s 2 -c 4 -g A

      3. Observe that the Target Grades of CS4234 and CS4226 have dropped

        Expected: CS4234 → A- CS4226 → B+

    2. Adding another completed module with bad grade

      1. Add a module with bad grade with the following command:
        add -m CS2105 -y 2 -s 1 -c 4 -g C+

      2. Observe that the Target Grades of CS4234 and CS4226 have increased

        Expected: CS4234 → A CS4226 → A

    3. Adding another incomplete

      1. Add another incomplete module with the following command:
        add -m CS4231 -y 4 -s 2 -c 4

      2. Observe that the Target Grades of CS4234 and CS4226 have dropped

        Expected: CS4234 → A CS4226 → A- CS4231 → A-

  6. Adjusting target grade

    1. Increasing a target grade should reduce another

      1. Adjust CS4226 with the following command
        adjust cs4226 A

      2. Observe the Target Grade of CS4234

        Expected: CS4234 → A- CS4231 → A-

    2. Decreasing a target grade should reduce another

      1. Adjust CS4226 with the following command
        adjust cs4226 A-

      2. Observe the Target Grade of CS4234

        Expected: CS4234 → A CS4231 → A-

    3. Decreasing a target grade causing goal to be impossible will not recalculate target grade

      1. Adjust CS4226 with the following command
        adjust cs4226 C+

      2. Observe the CAP Goal field

        Expected: CAP Goal should be 4.0 (Impossible) CS4234 → NIL CS4231 → NIL

  7. Adjusting multiple modules

    1. Adjusting all modules to grades above what was target will be ok adjust cs4226 A
      adjust cs4234 A
      adjust cs4231 A

    2. Observe the CAP Goal field

      Expected: CAP Goal should still be 4.0

    3. Adjusting all modules to grades below what was target will result in impossible CAP Goal c_adjust cs4226 A-
      c_adjust cs4234 A-
      c_adjust cs4231 A-

    4. Observe the CAP Goal field

      Expected: CAP Goal should be 4.0 (Impossible)