PROJECT: NUS Hangs


Overview

NUS Hangs is a desktop Schedule Manager application. It has a GUI but most of the user interactions happen using a CLI (Command Line Interface). It is a Java application written by developers of F11-4, to target small/mid-size interest/sttudy groups in NUS.k application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC.

Summary of contributions

  • Major enhancement: added the ability to find the time slots at which the members of a group are available at

    • What it does: allows the user to easily find a suitable timing for a gathering or meeting with his or her group members in two intuitive methods.

      • view_slots_all : finds all of the time slots at which every person in a group is available at.

      • view_slots_ranked : ranks all of the time slots in terms of the number of people available, with a minimum required number of people.

    • Justification: This feature improves the product significantly because finding a suitable timing to organise meetings is the key aspect of the application.

    • Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of efficient algorithms. The implementation too was challenging as it required a comprehensive understanding of the implementation of both the timetable and group feature and integration between the two.

  • Code contributed: [Functional and Test code]

  • Other contributions:

    • Project management:

      • Managed releases v1.1 - v1.4 (3 releases) on GitHub

    • Enhancements to existing features:

      • Wrote additional tests for existing features to increase coverage from 83.5% to 87.5% (Pull requests #231)

    • Documentation:

      • Edited the Developer Guide to include the implementation of the time slots methods: #250

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.

Time slots (Nigel)

List all time slots at which everyone of a group is available : view_slots_all

Short form/Alias: va

List all of the time slots at which everyone in the group is available
Format: `view_slots_all n/GROUP_NAME `

  • List all time slots at which all persons in a group is available, for the group with specified`GROUP_NAME`

  • Will indicate accordingly if the input is invalid, if there are no members in the groups and if there are no time slots at which everyone is available.

Examples:

  • view_slots_all n/happyfriends

List all time slots in order in terms of number of people available within the group: view_slots_ranked

Short form/Alias: vr

List all time slots of a group in descending order in terms of the number of people available, and then in ascending order in terms of timing. The additional parameter specifies the required minimum number of people available
Format: view_slots_ranked n/GROUP_NAME num/NUM_REQ

  • List all time slots of a group in descending order of availability, for the group with specified GROUP_NAME, and with a specified 'NUM_REQ' of people available.

  • NUM_REQ has to be an unsigned positive integer, but can be larger than the number of members in the group

  • Will indicate accordingly if the input is invalid, if there are no members in the groups and if there are no time slots with at least the required number of people available

Examples:

  • view_slots_ranked n/happyfriends num/4

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.

Time slot Feature

The time slot feature makes use of the Timetable and Group classes each Person class is associated with to find the common time slots within the members of a group for easier planning of events and outings.

Current Implementation

The current time slot commands added are:

  • view_slots_all/va — lists all time slots at which every member of a specfied group is free at

  • view_slots_ranked/vr — sorts and lists all time slots in terms of number of members available, for a specified group and specified required minimum number of people

The activity diagram is as follows.

timeslotactivitydiagram

These methods and their parsers are handled in Logic, and compares the Timetable associated with each Person in a specified Group during execution. Given below is the Sequence Diagram illustrating the interactions between the various classes when finding the aforementioned slots.

timeslotsequencediagram

Design Considerations

Aspect: How should time tables be compared when view_slots_all is executed
  • Alternative 1 (current choice): Get a 2d boolean array based on the 2d string array data in the Timetable associated with each Person to determine if the Person is free at a particular time slot.

Pros: The true/false nature of a 2d boolean array is intuitive when determining if a person is free. No strings have to be parsed during the method call, which allows for faster comparisons.

Cons: It will be harder to implement additional features based on the 2d boolean array as its entries can only be true or false.

  • Alternative 2: Directly compare the 2d string array of the Timetable class associcated with each Person

Pros: Less code needed and debugging would be easier. Furthermore, implementation would also be more direct.

Cons: If there are many Person in a group, it will take a longer time to find the available slots as every string entry in the 2d string array has to be parsed to check if the Person is free at a particular time slot.

Aspect: How should time slots be sorted when view_slots_ranked is executed
  • Alternative 1 (current choice): Store the available time slots in a treemap with the key being the slots in integer form, and the value being the number of people available at the that slot.

Pros: Very fast and can be easily sorted in terms of number of people available using a custom comparator while collecting the elements in a linkedhashmap. This preserves the order of the elements so that they are first sorted in number of people available and then in terms of timing. While iterating through the linkedhashmap, it can return immediately when a slot has less people available than required.

Cons: Complex implementation as it requires the use of lambda functions, streams and various data structures.

  • Alternative 2: Store the available time slots with its corresponding number of people available in an arraylist as an integerdouble and sorting at the end with collections.sort and a custom comparator.

Pros: Very easy to implement.

Cons: Very slow due to O(n) find and deletion.

Aspect: How should the results be returned
  • Alternative 1 (current choice): Return the results in a form of a string

Pros: Relatively fast due to stringbuilder and easy to implement.

Cons: Harder to use and manipulate the results for implementation of other features.

  • Alternative 2: Return the results in a form of a Timetable

Pros: Can be used in various ways due to the available timetable methods and can also be downloaded as an excel file.

Cons: Harder to implement and debug.