kohkaijie / pe

0 stars 0 forks source link

Misleading error message when entering invalid index for delete command #4

Open kohkaijie opened 11 months ago

kohkaijie commented 11 months ago

Expected result: Invalid index provided

Actual result: Invalid command format! delete: Deletes the person identified by the index number used in the displayed person list. Parameters: INDEX (must be a positive integer) Example: delete 1

The error message returned should have been about a wrong index entered as the command format used was correct.

image.png

soc-se-bot commented 11 months ago

Team's Response

The error message is correct.

For INDEX values 0, the index provided is not a positive integer and thus does not follow the command format specified. The command format clearly specifies that

INDEX (must be a positive integer)

and the exact command format is also seen in your screenshot. This INDEX value clearly fails the constraints specified in the command format. Therefore, the command has invalid formats.

With reference to the course website,

if a date input is required to be in YYYY-MM-DD format, 2021-13-28 is a format error (reason: MM should be in 1..12)

Similarly, for the delete command, it has to be in delete INDEX format. delete 0 is a format error (reason: INDEX should be 1...MAX_INT).

Please also refer to the UG, where we stated that INDEX has to be an unsigned positive integer.

Screenshot 2023-11-20 at 5.58.18 PM.png

This INDEX value clearly fails the constraints specified in the command format. Therefore, the command has an invalid format.

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: [replace this with your explanation]