1. PROJECT: Police Records and Intelligent System (PRISM)


2. Overview

The Addressbook is morphed to a police records system called PRISM with two types of users, Police Officers (PO) & Headquarter Personnel (HQP). Users have their own access levels with HQP having higher authorization compared to PO. Police officers can screen civilians during duty with their respective NRIC, their criminal history and status would be shown to the police officers. POs can also request for backup when needed, HQP would dispatch other POs at their discretion based on estimated time of arrival. Refer to Quick Start guide to get started.

3. Summary of contributions

  • Role: Team Leader

  • Responsibility : Deadlines

  • Major enhancements: added log in ability using only passwords & the ability for HQP to update any password

    • Password Accessibility : allows HQP and PO to log into their respective profiles using just a password and without username. Once logged in, PO is not allowed to perform certain commands.

    • Update Password : allows HQP to update any password, including PO passwords to new alphanumeric passwords with minimum length 5 characters.

    • Justification: Since we don’t want POs to alter the records, certain commands are disabled for them. The ability to update passwords regularly allows for greater security. The ability to lock anytime also helps to increase security in times of emergencies. Together, the features ensure a secure information-sensitive product.

    • Highlights: Passwords had to be stored with encryption, and only allows user to enter incorrect passwords 5 times before shutting down.

  • Minor enhancement: added a lock command that allows any user to lock (log out) the device immediately at any time.

3.2. Other Contributions:

  • Project management:

    • Managed project pre-releases v1.1 - v1.2 and project release 'v1.3-1.4' on GitHub

    • Managed all versions of product, and disseminated almost all issues to team members

  • Enhancements to existing features:

    • Updated the GUI color scheme (Pull requests #98)

    • Wrote additional tests for implemented features to increase coverage from 30% to 33% (Pull request #129)

  • Documentation:

    • Did cosmetic tweaks to existing contents of the User Guide: #14

    • Added use cases and implementation for implemented features in Developer Guide : Pull requests #129 , #23

  • Community:

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

  • The text box is located at the bottom of the screen, and is grey in colour

  • Throughout the list of features, each command will indicate if its available for HQP, PO or both

  1. Type the password in the text box below and press Enter to enter system as a specific user.

  2. Defaults passwords for the users (Passwords are Case Sensitive):

    1. HQP: papa123

    2. PO1: popo1

    3. PO2: popo2

    4. PO3: popo3

    5. PO4: popo4

    6. PO5: popo5

  3. Type a command in the same text box and press Enter to excecute it.

  4. To display the full list of commands and a summary of their functions in the application, type 'help' and press Enter.

  5. Refer to Section 3, “Features” for details of each feature.

4.1. Logout : logout (HQP & PO)

Logs the user out from the system.

Format: 'logout'

Examples:

  • logout

  • Any user must enter their respective password to log in

4.2. Update Password : update password (HQP)

Updates password of any existing user - only HQP can change the user’s password

Format: 'update password'

Examples:

  • update password

  • Please enter a password to change

  • User then has to enter existing password and new alphanumeric password of minimum length 5

4.3. Shutdown program : shutdown (HQP & PO)

Shutdown the system

Format: 'shutdown'

Examples: * shutdown * Police Records System shuts down

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

5.1. 1a. Password feature

Password

Current Implementation

This feature provides different access levels of commands to the user, depending on the password entered.

  1. unlockDevice() - attempts to match a hashcoded user input with an existing password in the passwordStorage.txt file.

The following is an example usage scenario of the password feature.

Step 1: User enters password for HQP.

Step 2: decipherUserCommandText() in MainWindow class identifies command as a password input, through the use of isLocked() method in the Password class.

Step 3: unlockDevice() in Password class is called.

Step 4: The user input, userCommandText, is then hashcoded using userCommandText.hashCode().

Step 5: Using a Buffered reader from the ReaderAndWriter class, a loop through passwordStorage.txt tries to match the hashcoded input with an existing password.

Step 6: The user and password are stored in passwordStorage.txt in this format : "userID (hashcoded)password".

Step 7: When matched, the userID is returned and a welcome message is displayed for the particular user.

5.1.1. Design Considerations

Aspect: How password feature is implemented
  • Alternative 1 (current choice): Using a password with no need for username

    • Pros: Reduce user’s keyboard input

    • Cons: Slow buffered reader has to loop through all passwords in the text file

  • Alternative 2: Using username and password

    • Pros: Can use a hashmap for quick look up, with the userID as key and hashcoded password as the value

    • Cons: More input from user, and difficult to store in an external text file

5.2. 1b. Update Password Feature

updatePassword

Current Implementation

This feature enables only HQP to update any existing password.

  1. updatePassword() - user enters existing password to update.

  2. updatePasswordFinal() - user enters new alphanumeric password to replace existing password.

The following is an example usage scenario of the update password feature.

Step 1: User enters password for HQP.

Step 2: User enters "update password" command.

Step 3: decipherUserCommandText() in MainWindow class identifies the command as "update password" and begins update password sequence.

Step 4: User enters password for HQP.

Step 5: Similar to the password feature, the process of the user input to match the existing HQP password maintains.

Step 6: User enters new 5-character long alphanumeric password.

Step 7: The new entered password runs through passwordValidityChecker() to check if the password is at least 5 characters long and at least alphanumeric. This password is stored as oneTimePassword String.

Step 8: The user enters the same new password. It matches with the oneTimePassword.

Step 9: The Buffered reader then reads reads through passwordStorage.txt, and a Print writer from the ReaderAndWriter class writes existing passwords to a temporary file, while writing the new password in place of the old password that has been requested to be updated.

Step 10: The temporary file is renamed to passwordStorage.txt and deleting the old passwordStorage.txt file.

Step 11: The System returns a message that update password is successful.

5.2.1. Design Considerations

Aspect: How update password feature is implemented
  • Alternative 1 (current choice): writing to a temporary file then renaming

    • Pros: No conflicts when writing to a new file

    • Cons: Space is required for the new file before deleting original file

  • Alternative 2: Overwriting current passwordStorage.txt file

    • Pros: Maintain space usage

    • Cons: Many errors when overwriting

5.3. 5. "logout" command

Current Implementation

This command logs the current user out of the System.

  1. execute() - executes the "logout" command , all boolean flags related to passwords are set to false and clears the message inboxes.

The following is an example usage scenario of the "logout" command:

Step 1: User executes "logout".

Step 2: decipherUserCommandText() in MainWindow class identifies command as "logout".

Step 3: Boolean flags for isHQP, isPO1, isPO2, isPO3, isPO4, isPO5 in the Password class is set to false. This is done using the lockIsHqp() and lockIsPo() methods in the Password class.

Step 4: isUpdatePasswordConfirm and isUpdatingPassword flags are also set to false through lockUpdatePasswordConfirm() and lockUpdatingPassword() in the Password class is also set to false.

Step 5: resetInboxWhenLogout() in the Inbox class clears all records of displayed messages and resets the number of unread messages to default value of -1.

Step 6: A CommandResult object is created and displays a message that the user is logged out of the System and prompts for a password.

5.3.1. Design Considerations

Aspect: How logout command is implemented
  • Alternative 1 (current choice): Logout extends command.

    • Pros: Easy to implement.

    • Cons: Using MainWindow instead of parser to detect that it is the logout command.

  • Alternative 2: Logout as a method in password class.

    • Pros: Can access boolean flags privately in the same class.

    • Cons: Not using abstract class of command.

5.4. 7. "shutdown" command

Current Implementation

This command shuts down the System.

  1. execute() - executes the "shutdown" command and returns all boolean flags related to passwords are set to false.

The following is an example usage scenario of the "logout" command:

Step 1: User executes "shutdown".

Step 2: Boolean flags for isHQP, isPO1, isPO2, isPO3, isPO4, isPO5 in the Password class is set to false. This is done using the lockIsHqp() and lockIsPo() methods in the Password class.

Step 3: isUpdatePasswordConfirm and isUpdatingPassword flags are also set to false through lockUpdatePasswordConfirm() and lockUpdatingPassword() in the Password class is also set to false.

Step 4: mainApp.stop() in MainWindow class shuts down the system

5.5. Use case: Enter Headquarters Personnel password

MSS

  1. User opens System.

  2. System prompts User to enter his password.

  3. User enters HQP password.

  4. System displays message "Welcome Headquarters Personnel" and System prompts User for a command. Only HQP commands are set to accessible.

    Use case ends.

Extensions

  • 3a. User enters invalid password.

    • 3a1. System displays an error message and allows one less attempt for User at entering a correct password, with a maximum of 5 attempts.

      Use case resumes at step 1.

  • 3b. The number of attempts reaches zero.

    • 3b1. System shuts down.

      Use case ends.

5.6. Use case: Enter Police Officer password

MSS

  1. User opens System.

  2. System prompts User to enter his password.

  3. User enters Police Officer password.

  4. Only Police Officer commands are set to accessible, System displays message "Welcome Police Officer" and System prompts User for a command.

    Use case ends.

Extensions

  • 3a. User enters invalid password.

    • 3a1. System displays an error message and allows one less attempt for User at entering a correct password, with a maximum of 5 attempts.

      Use case resumes at step 1.

  • 3b. The number of attempts reaches zero.

    • 3b1. System shuts down.

      Use case ends.

5.7. Use case: Logout

MSS

  1. User logs out of the System at any point.

  2. System sets all commands to inaccessible, displays System logout message and prompts User for password.

Use case ends.

5.8. Use case: Update any password

MSS

  1. User requests to update password.

  2. System prompts User for current password to change.

  3. User enters existing password.

  4. System prompts User to enter new password.

  5. User enters new alphanumeric password.

  6. System prompts User to enter new password again.

  7. User enters same new alphanumeric password.

  8. System updates password to change to the new alphanumeric password and displays update password success message.

    Use case ends.

Extensions

  • 3a. User enters invalid password.

    • 3a1. System displays an error message and allows one less attempt for User at entering a correct password, with a a maximum of 5 attempts.

      Use case resumes at step 2.

  • 3b. The number of attempts reaches zero.

    • 3b1. System shuts down.

      Use case ends.

  • 5a or 7a. User enters new password without a number.

  • 5a1 or 7a1. System shows error message to include at least one number and prompts User to enter new alphanumeric password again.

    Use case resumes at step 5.

  • 5b or 7b. User enters new password without a letter.

  • 5b1 or 7b1. System shows error message to include at least one letter and prompts User to enter new alphanumeric password again.

    Use case resumes at step 5.

  • 5c or 7c. User enters new password without a letter nor a number.

  • 5c1 or 7c1. System shows error message for invalid new password.

    Use case resumes at step 5.