PROJECT: Student Schedule Planner


1. Overview

This portfolio showcases the software engineering skills I acquired during my time of study in National University of Singapore (NUS).

Student Schedule Planner (SSP) is a desktop application created by my team T12-3 for CS2103T module. SSP aimed to aid university students to manage their tasks effectively. It is morphed from an existing product called Address Book (Level 4), with constraints such as command-line interface must be the main mode of user input.

My contributions to the project included adding task monitoring system which consists of firstday, listday and listweek commands to aid the users in better monitoring of their tasks.

2. Summary of Contributions

  • Major enhancement: Added task monitoring system

    • What it does: This feature allows user to know what is the current academic week whenever they launch the application within the academic semester. It also allow users to know what tasks they have that are due on the current date or from the current date until the closest Sunday.

    • Justification: This feature allows user to monitor their tasks easier as they may know that they have certain tasks due on a particular week and could use this to plan their remaining time properly. Users could also easily know what tasks they have on the current week.

    • Highlights: This implementation was challenging as it required creating a new model and storage for saving and retrieving the data. It was also tedious and time consuming to conduct both system and manual tests for different dates due to the need to manipulate my device’s system date.

    • Credits to Stack Overflow and The Java™ Tutorials - Oracle Docs: #1, #2, #3, #4, #5

  • Code contributed: RepoSense

  • Other contributions:

    • Project management:

      • Morphed and transformed portions of Address Book (Level 4) into current product Student Schedule Planner : #23, #31, #37, #44

      • Managed releases mid-v1.3 - v1.3 (2 releases) on GitHub

    • Documentation:

      • Morphed existing diagrams of the Developer Guide: #81

      • Added Target User Profile, User Stories, Use Cases of the Developer Guide: #1, #20

      • Removed portion of SE-EDU related contents: #17

    • Community:

      • Contributed to forum discussions: #132, #146

      • Some parts of listweek command and ListWeekCommandTest test cases I added was adopted by a classmate: #125, #212

      • Some parts of ListDayCommandTest test cases I added was adopted by a classmate: #201

      • Some parts of DateSamePredicateTest test cases I added was adopted by a classmate: #229

      • Reported bugs and suggestions for other teams in the class: #220, #224, #235, #238, #242, #248

    • Tools:

      • Integrated two Github plugins (AppVeyor, Coveralls) to the team repo

3. Contributions to the User Guide

Given below are sections I contributed to the User Guide to aid the user in using the application.

3.1. Generating Academic Calendar

Generate the entire academic calendar based on the first academic day and stores it in storage.

Currently, the generated academic calendar is based on the academic calender of National University of Singapore (NUS). It may not be compatible with academic calendars from other institutions.

Whenever the application is launched within the academic calendar’s dates, the application title will append that particular week’s description to the title of the application.

firstday DDMMYY

Example:

firstday 130818

The following diagram illustrates when you execute firstday 130818, and launch the application within 121118 - 181118 (Week 13 for NUS academic year 18/19 semester 1), the application title will be appended with "Week 13".

FirstDayCommand UG Before After
There would not be any visible changes upon using the command. The changes are only reflected after relaunching the application.

DDMMYY refers to the date format of day, month and year. It must fulfil the following criteria:

  1. DDMMYY must only be one set of value such as 130818. Value such as 130818 200818 or 130818 20 will be rejected as they are considered as more than one set of date.

  2. DDMMYY must be a valid date within 21st century.

  3. DDMMYY must be a Monday.

3.2. Viewing Tasks Due Today

List tasks due on the current date.

listday

3.3. Viewing Tasks Due This Week

List tasks due from current date till the end of the current week.

listweek

Example:

The following diagram illustrates the SSP when listweek is executed on the date 021118. Only tasks until 041118, which is the closest Sunday, will be displayed.

ListWeekCommand UG Before After

4. Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide that includes my technical documentation and depth to aid developer to understand how the application functions.

4.1. Generate Academic Calendar Weeks

In order to enable users to better monitor their tasks in the schedule planner by knowing what is the current academic week, firstday command was added.

firstday command will generate the weeks referencing to NUS academic calendar, and will append the week description to the application title if the user launches the application within the academic calendar dates. This allows the user to know the current academic week.

Only 17 weeks are referenced from NUS academic calendar. More details at glossary.

4.1.1. Current Implementation

firstday mechanism is facilitated by FirstDayCommand and implements the following operations:

  • FirstDayCommand#computeRangeOfWeek(firstDay) — It generate the academic calendar weeks data based on firstDay parameter.

  • FirstDayCommand#addDescriptionForWeeks — It appends description for each academic calendar weeks.

  • FirstDayCommand#saveRangeOfWeeks(rangeOfWeek) — It save the academic calendar weeks data into rangeofweek.xml

  • FirstDayCommand#createDefaultFileIfNotExist() — It creates the default rangeofweek.xml if it does not exist.

  • FirstDayCommand#createDefaultFileIfUnableConvert() — It creates the default rangeofweek.xml if data is unable to convert to be used.

  • FirstDayCommand#createDefaultFileIfSizeDiff() — It creates the default rangeofweek.xml if the number of entries differ from the expected academic number of weeks.

  • FirstDayCommand#createDefaultFileIfNull() — It creates the default rangeofweek.xml if any data is null.

  • FirstDayCommand#createDefaultFileIfInvalidDateOrRange() — It creates the default rangeofweek.xml if date data in modified to be an invalid date or date range format.

  • FirstDayCommand#computeAppTitle() — It computes the corresponding application title after checking if current system date is within academic calendar dates.

  • FirstDayCommand#retrieveRangeOfWeeks(storeRangeOfWeeks) — It retrieves the saved academic calendar weeks data from rangeofweek.xml

  • FirstDayCommand#isWithinDateRange(firstDayOfSem, lastDayOfSem) — Check if current system date is within firstDayOfSem and lastDayOfSem and return true or false.

  • FirstDayCommand#retrieveWeekDescription(rangeOfWeek) — It return the description of a particular week

  • FirstDayCommand#isMonday(inputDate) — It checks if inputDate is Monday and return true or false.

Given below is an example usage scenario and how firstday mechanism behaves at each steps:

Step 1. The user enter the command firstday 130818

Step 2. The command word firstday invoke LogicManager to invoke SchedulePlannerParser. SchedulePlannerParser then invoke FirstDayCommandParser#parse(130818) which will then trim the argument 130818 into trimmedArgs.

Step 3. Methods onlyOneSetArgument(trimmedArgs), Date#isValidDate(trimmedArgs) and isMonday(trimmedArgs) are used in sequential order to check if trimmedArgs is valid.

If either method in Step 3 failed, ParseException with respective message will be thrown to inform user what had gone wrong. FirstDayCommand would then not be called.

Step 4. FirstDayCommandParser return a FirstDayCommand with the validated trimmedArgs as its parameter.

Step 5. LogicManager then invoke FirstDayCommand#execute().

Step 6. FirstDayCommand#computeRangeOfWeeks(trimmedArgs) will be activated and generate the academic calendar weeks . This method will further call FirstDayCommand#addDescriptionForWeeks to add description for each of the academic calendar weeks. The academic calendar weeks will be stored in a 2D String array named rangeOfWeek.

Step 7. FirstDayCommand#saveRangeOfWeeks(rangeOfWeek) will be activated. It will create a XmlSerializableRangeOfWeek object with rangeOfWeek as its parameter to allow rangeOfWeek data to be converted into Xml format to be easily saved. Next, this method would call XmlFileStorage#saveWeekDataToFile to save XmlSerializableRangeOfWeek object data into Xml format in rangeofweek.xml

CommandException will be thrown if rangeofweek.xml does not exist.

Step 8. After the data had been saved properly, should the current system date lies within the academic calendar weeks, UI would display the corresponding week description to the user.

FirstDayCommand UG Bef

Step 9. When user launch the application,MainApp will create a FirstDayCommand object named fdc to utilise the methods fdc#createDefaultFileIfNotExist, fdc#createDefaultFileIfUnableConvert, fdc#createDefaultFileIfDiffSize, fdc#createDefaultFileIfNull and fdc#createDefaultFileIfInvalidDateOrRange.

If it is the first time the user launches the application or if user deleted rangeofweek.xml or invalidated data in rangeofweek.xml, the application will record the log message and create a default rangeofweek.xml.

The following code snippet shows that with the extra layer of data verification and rectification, the user do not need to worry when they accidentally invalidated the storage file.

FirstDayCommand DG MainAppLaunchSnippet

Step 10. MainApp will create a Config object named as updateConfig and then calls the method updateConfig.setAppTitle(fdc.computeAppTitle()). fdc.computeAppTitle() would create a 2D String Array called retrieveData for storing academic semester dates to operate FirstDayCommand#retrieveRangeOfWeeks(retrieveData) to retrieve saved data.

It then check if system date is within the retrieveData by using FirstDayCommand#isWithinDateRange(x,y) where x and y stands for the first academic and last academic day respectively. If it is within, it then generate the corresponding application title by using FirstDayCommand#retrieveWeekDescription(retrieveData). Else it uses the default application title. It would then return the result into updateConfig.setAppTitle() to update the application title.

Step 11. MainApp then calls ConfigUtil#saveConfig(updateConfig, configFilePathUsed) to save the updated configuration into the path configFilePathUsed where config.json is.

Step 12. MainApp would then retrieve the application title from config.json and display on UI.

FirstDayCommand UG Aft
CommandException will be thrown if data from rangeofweek.xml could not be converted or if rangeofweek.xml does not exist.

The following sequence diagrams illustrates how the mechanism works:

FirstDayCommand DG SequenceDiagram
Figure 1. Sequence diagram of FirstDay Command
LaunchMainApp DG SequenceDiagram
Figure 2. Sequence diagram of launching MainApp

4.1.2. Design Considerations

Aspect: How firstday command functions
  • Alternative 1 (current choice): Generate entire academic calendar weeks by input the first academic Monday date.

    • Pros: It would only need one set of date.

    • Cons: It would require many methods to validate, generate the data.

  • Alternative 2: Allow user to create their own academic calendar such as having customised number of weeks and description for each weeks.

    • Pros: It would allow customisation.

    • Cons: It would be time and effort consuming for the user and also to validate the data.

Aspect: Data structure to support storing of academic calendar weeks data
  • Alternative 1 (current choice): 2D String array is used.

    • Pros: It would allow easy data retrieval for specific index.

    • Cons: It could cause confusion especially if magic numbers were used instead of constant.

  • Alternative 2: ArrayList is used.

    • Pros: It would not require sequential memory for storage.

    • Cons: It would not allow data retrieval at any specific index which requires traversing.

4.2. View Tasks Due Today/This Week

In order to enable users to better monitor their tasks in the schedule planner, Two variations of list command were added.

listday command supports viewing tasks due on the current date, whereas listweek command supports viewing tasks from the current date till the closest Sunday.

4.2.1. Current Implementation

listday/listweek utilises the same implementation used by list command:

  • Model#updateFilteredTaskList() — Takes in a predicate parameter and updates the model according to the predicate.

listday further implements the following operation:

  • DateSamePredicate — takes in a systemDate parameter. systemDate is a String value after converting current system date into DDMMYY format.

listweek further implements the following operations:

  • numDaysTillSunday(dateName) — It compute the number of days from current date until closest Sunday (exclusive of Sunday) using dateName. dateName is the name of the current day.

  • appendDateList(dateList, numDaysTillSunday(dateName)) — It generates sequential DDMMYY values based on the result of numDaysTillSunday(dateName) and inserts them into dateList . dateList is a List<String> object.

  • DateWeekSamePredicate — It takes in a dateList parameter. dateList is a List<String> object that contains the list of dates from current date to closest Sunday date in DDMMYY format.

As both listday/listweek commands are similar, we will only illustrate how listweek works. Given below is an example usage scenario and how listweek mechanism behaves at each steps:

Step 1. The user entered the command listweek.

Step 2. The command word listweek invoke LogicManger to invoke SchedulePlannerParser to return a ListWeekCommand object. LogicManager then invoke ListWeekCommand#execute().

Step 3. ListWeekCommand#appendDateList(datelist, numDaysTillSunday(dateName)) will be activated. It helps to generates values for dateList and the values are sequential dates in DDMMYY format after using the result from numDaysTillSunday() method. numDaysTillSunday() will compute the number of days from current date till Sunday based on dateName, the name of the current day.

Step 4. model.updateFilteredTaskList() will update the task list with DateWeekSamePredicate as the parameter. DateWeekSamePredicate itself would take dateList in Step 3 as the parameter.

Step 5. The updated task list would be reflected on UI to be displayed to the user.

The following sequence diagram illustrates how the mechanism works:

ListWeekCommand DG SequenceDiagram
Figure 3. Sequence Diagram of ListWeek Command

4.2.2. Design Considerations

Aspect: How does listday and listweek function
  • Alternative 1 (current choice): Filter accordingly based on the command itself

    • Pros: It is easy to implement and use.

    • Cons: It restrict to view all tasks from current date or from current date till Sunday only.

  • Alternative 2: Allow the commands to receive argument for which date(s) to filter. E.g listday 130818 to view all tasks for 13 August 2018.

    • Pros: It allows viewing for different date(s).

    • Cons: It would cause inconvenience for entering the date(s) each time the command was to be used.