shaunlxw / pe

0 stars 0 forks source link

markp: inaccurate error message #11

Open shaunlxw opened 4 months ago

shaunlxw commented 4 months ago

Input: markp 1 a

All fields are provided with invalid week, but command error message says invalid command format.

image.png

soc-se-bot commented 4 months ago

Team's Response

No details provided by team.

The 'Original' Bug

[The team marked this bug as a duplicate of the following bug]

marka, unmarka: inaccurate error message

Similar to #11,

Input:

  1. marka/unmarka 1 a
  2. marka/unmarka 1 0

image.png


[original: nus-cs2103-AY2324S2/pe-interim#2517] [original labels: type.FunctionalityBug severity.Medium]

Their Response to the 'Original' Bug

[This is the team's response to the above 'original' bug]

The input provided is clearly invalid and does not follow the correct command format that is described in the UG. Furthermore, the error message shown also displays the correct command format that should be provided. In this case, since a character was provided for the WEEK_NUMBER parameter instead of an integer, it is indeed an incorrect command format.

Severity changed to Low since it does not affect normal operations of our product, and the error would not be encountered at all if the user followed our UG closely.

Items for the Tester to Verify

:question: Issue duplicate status

Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)

Reason for disagreement: While it is a similar bug to the "original", it is not the exact same bug, and can be fixed independently by looking at the code.

image.png

Referring to screenshot below, the bug is due to catching the ParseException thrown from ParseUtil::parseIndexes(...), which can be fixed independently for each command's parser. i.e. this bug can exist here, while not existing in the "original" bug.

image.png


## :question: Issue response Team chose [`response.Rejected`] - [x] I disagree **Reason for disagreement:** Similar to the "original" bug. Replicated below (with tweaks to fit this bug): Command format refers to the number and order of parameters, while input validation refers to whether the given value of input is within the valid constraints. This issue introduces invalid inputs instead of invalid command format. >The input provided is clearly invalid and does not follow the correct command format that is described in the UG. In the example inputs given above, the input is invalid, but the command format is in fact correct. The command format for markp is given as `markp INDEX WEEK_NUMBER` in which the example input given above satisfy. The error message in this case is inaccurate as it says invalid command format when format is valid. Comparing this output with the command `markp 1 1`, it should output a similar error message of "The week provided is invalid". ![image.png](https://raw.githubusercontent.com/shaunlxw/pe/main/files/b1cd90d7-572a-4d40-8e3c-1e35a7ab826f.png)
## :question: Issue severity Team chose [`severity.Low`] Originally [`severity.Medium`] - [x] I disagree **Reason for disagreement:** Similar to the "original" bug. Replicated below: This bug causes more than minor inconvenience to users, as it does not aid user in recovering from erroneous inputs. Showing "Invalid command format" when command format is valid can confuse users and cause them to spend time figuring out what is wrong with their command format. Further, the solution for "Invalid command format" in the UG states "Ensure that all required fields are provided", which user already did provide.