PROJECT: AlgoBase


Overview

AlgoBase is a desktop algorithmic problem manager. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 20 kLoC.

AlgoBaseLayout
Figure 1. Layout of AlgoBase

About this portfolio

This project portfolio details my individual contributions to the AlgoBase project. It includes a summary of the enhancements and other contributions I made throughout the duration of the project. Additionally, portions of my contribution to the User Guide and Developer Guide have also been included.

Summary of contributions

  • Major enhancement: added the ability to tag problems

    • What it does: allows the user to manage tag about problems and tasks.

    • Justification: This feature improves the product significantly because users need to categorise problems by themselves.

    • Highlights: This enhancement creates the new features about tag and. It required to make . The implementation too was challenging as it required changes to existing commands.

    • Relevant pull requests: #67 #93 #108 #145 #165 #201 #214 #216 #241

  • Minor enhancement: added a tag feature called tag color that allows the user to change the tag color displayed in UI.

  • Code contributed: code contributed

  • Other contributions:

    • Refactors the AddressBook project: #24 #47

    • Enhancements to existing features:

      • Updated the GUI tag display style (Pull requests #214, #241)

      • Wrote integration tests for some existing features to increase coverage from 40% to 52% ( Pull requests #207, #214)

    • Community:

      • PRs reviewed (with non-trivial review comments): #117

      • Reported bugs and suggestions for other teams in the class:

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Tags

Creating new tags: addtag

Generates a new tag.
Format: addtag t/NAME [c/COLOR]

Examples:

  • addtag t/graph

  • addtag t/sssp c/BLUE

Tag color can only be "RED" "ORANGE" "YELLOW" "GREEN" "BLUE" "PURPLE" "TEAL" "BLACK" or "DEFAULT".

Listing tags: listtag

Displays a list of all existing tags.
Format: listtag

Deleting current tags: deletetag

Deletes an existing tag.
Format: deletetag INDEX

Examples:

  • deletetag 1

Editing tags: edittag

Edits an existing tag.
Format: edittag INDEX [t/NAME] [c/COLOR]

Examples:

  • edittag 1 t/difficult c/BLUE

  • Tags

    • New Tag : addtag t/NAME [c/COLOR]
      e.g. addtag t/sssp c/BLUE

    • List Tags : listtag

    • Delete Tag : deletetag INDEX
      e.g. deletetag 3

    • Edit tag : edittag INDEX [t/TAGNAME] [c/COLOR]
      e.g. edittag 1 t/sort c/BLUE

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Tag feature

Implementation

The tag mechanism is facilitated by UniqueTagList. It creates a list of Tag, stored internally as an uniqueTagList. Additionally, it implements the following operations:

  • AddTag - creates a new tag in AlgoBase’s uniqueTagList in the algobase history.

  • DeleteTag - deletes a current tag which have already in the uniqueTagList.

  • EditTag - edits the current tag name which have already been in the uniqueTagList.

  • ListTag - shows the tags in the uniqueTagList in the algobase GUI for users.

TagClassDiagram
Figure 2. Class Diagram for Tag

These operations are exposed in the Model interface as Model#addTag(), Model#deleteTag(), Model#listTag() and Model#editTag() respectively.

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

Step 1. The user launches the application for the first time. The UniqueTagList will be initialized with the initial algobase state

Step 2. The user executes addtag t/easy to add a tag named [easy] with default color which have not applied in any problems. The addtag command calls Model#addtag(), causing the taglist added a tag after the ‘addtag t/easy’ command executes to be saved in the uniqueTagList.

The following sequence diagram shows how the addtag operation works:

AddTagSequenceDiagram
Figure 3. Sequence Diagram for AddTagCommand

Step 3. The user decides to execute the command listtag to show a tag list in the GUI of algobase. The listtag command calls Model#listtag(), causing the taglist shows the current components of uniqueTagList. Commands that do not modify the data, such as listtag, will not call Model#addTag(), Model#deleteTag() or Model#editTag(). Thus the uniqueTagList remains unchanged.

Step 4.The user executes edittag 1 t/hard c/BLUE to edit the current tag [easy] to [hard] in the uniqueTagList. The edittag 1 t/hard c/BLUE Command executes edittag, causing the taglist find the tag with index 1 in the tag list and change tag [easy] into [hard] and change tag color from default color to blue, and change all [easy] tag into [hard] in blue color in all problems.

Step 5. The user executes deletetag t/hard to delete the current tag [easy] in the uniqueTagList. The deletetag t/hard command executes deletetag, causing the taglist delete the [hard] tag in uniqueTagList and [hard] tag in all problems. (diagram)

The following activity diagram summarizes what happens when a user executes a new tag modifying command

TagCommandActivityDiagram
Figure 4. Activity Diagram for tag commands

Design considerations

Aspect: Data structure to support the tag commands.
  • Alternative 1 (current choice): Use a list in current AlgoBase to save the content of different tags which used in tagging different problems. While problems create new tags for problems, it will also add into tag-list in AlgoBase. While the tag in problems changes, the tag in tag-list will not change and add a new tag into the tag-list in AlgoBase. While modifying tag in tag-list will change the tag for all related problem.

    • Pros: Users can manage the tags conveniently.

    • Cons: May lead to many tags do not combine with problems.

  • Alternative 2: Simply keep tags as a part of problems. While execute the tag command will search for all tags in problems for every times it execute.

    • Pros: No need to save the tag separately in the storage, all tags are under problems.

    • Cons: Difficult to manage tags in different problems. Waste time for computer to execute.

Tag

Adding a tag

  1. Test case: addtag t/test c/BLUE
    Expected: New Tag [test] added to AlgoBase.

  2. Test case: type in addtag t/test c/BLUE for twice
    Expected: Tag [test] already exists in AlgoBase.

Deleting a tag

  1. Test case: deletetag 1
    Expected: Tag [test] deleted.

  2. Test case: deletetag 9999
    Expected: The Tag index provided is invalid

Editing a tag

  1. Test case: edittag 1 t/edited c/RED
    Expected: Tag [edited] edited.

  2. Test case: edittag t/edited c/RED
    Expected: An error is thrown and the user is informed that the format of command is invalid.

Listing a tag

  1. Test case: listtag
    Expected: All tags listed.