timothysashimi / pe

0 stars 0 forks source link

Different error message for invalid index values #3

Open timothysashimi opened 5 months ago

timothysashimi commented 5 months ago

Description: For return book, if an invalid index value of 0 is given, error message is Invalid command format! return: Edits the book list of the person identified by the index number used in the last person listing. If book exists in the person's book list, it will be removed. Parameters: INDEX (must be a positive integer) b/[borrow] Example: return 1 b/Likes to swim.

If there is only 1 person and an index value of 3 is given, error message is: The person index provided is invalid

Given that the user guide did not specify what is the parameter limitations of index, eg. index must be a positive integer greater than or equals to 1, i would assume that 0 can be a valid input with 0 based indexing. Hence I would be confused if my return 0 b/hello command is not working due to an invalid index error or a formatting error

Steps to reproduce:

  1. return 0 b/hello 2.return 3 b/hello

image.png

image.png

soc-pe-bot commented 5 months ago

Team's Response

Thank you for pointing this out.

After discussions within the team, we have decided to reject this bug.

Reasons: As stated in the user guide, we mentioned 0 is not acceptable as indicated in the words highlighted in bold, stating that INDEX only takes in positive integers. And by definition, 0 is not a positive integer! image.png

Besides in our future enhancement section, the third bullet point in the screenshot below, the error message will be improved to account for the fields, such as INDEX in the future. image.png

Items for the Tester to Verify

:question: Issue response

Team chose [response.Rejected]

Reason for disagreement: In many programming contexts, including some libraries and frameworks, indexing often begins at zero rather than one. This practice, known as zero-based indexing, is familiar to many developers and users, particularly those with experience in programming languages like Python or JavaScript.

Given that the user guide does not explicitly state the starting index or provide a specific range of acceptable values for INDEX, users may reasonably assume that zero-based indexing is applicable, especially if they are familiar with this convention from other software or programming contexts.

Furthermore, the absence of clear guidance on the starting index or acceptable range in the user guide leaves room for interpretation and ambiguity. Without explicit clarification, users may encounter confusion when encountering errors related to zero-based indexing, such as the reported issue with the command "return 0 b/hello."

Considering these factors, I respectfully suggest that revisiting the user guide to provide explicit clarification on the starting index and acceptable range eg.[1, 3000] for INDEX would help mitigate confusion and ensure a more consistent user experience.

It is also unfair to assume that everyone knows whether 0 is positive or not positive, hence it would be better to explicitly state the acceptable range.