Bug 476

Summary: Program crashed upon incorrect inputs on MacOS Mojave
Product: Group 4 Reporter: kykao2-c
Component: MainAssignee: sharitsang97
Status: CONFIRMED ---    
Severity: critical    
Priority: Highest    
Version: unspecified   
Hardware: Macintosh   
OS: Mac OS   
Deadline: 2020-11-27   

Description kykao2-c 2020-11-26 12:25:20 HKT
The program is immediately crashed upon an incorrect input on my 2017 13-ich
Macbook Pro (OS: macOS Mojave; version 10.14.6). This error causes the program
unable to operate properly for normal usage.

Severity: Critical. 

Specification of the device which encountered this problem:
MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)
Processor: 2.3 GHz Intel Core i5
Memory: 16 GB 2133 MHz LPDDR3
Graphics: Intel Iris Plus Graphics 640 1536 MB

The inputs leading to program crash are as follows:
1. "ListMember" (incorrect command - correct: "listMember")
2. "makePurchase 10" (incorrect input arguments)
3. "randomCommand" (command that does not exist)

Observation:
The program crashes if the input does not match the correct ones coded in the
program; the failure-causing inputs passed to parameters cannot be executed
correctly and lead to an exception.

Expectation:
The program should ask the user to enter another command in a non-stop manner instead of breaking a program.

Solution:
An input checking mechanism can be implemented for avoiding failure-causing
input to break the program. For example, check if the input fulfils the size of
arguments to be passed as well as to ensure it returns a error message to the
user without passing such input for retry instead.