Punpun1643 / pe

0 stars 0 forks source link

Wrong error thrown for invalid index in `persondelete` #10

Open Punpun1643 opened 2 years ago

Punpun1643 commented 2 years ago

Explanation:

C8F1A8B1-0F6D-4745-B345-C09BC5A6ED5F_4_5005_c.jpeg

It is correct format just that index is invalid.

Severity: Low

Justification: Not verylow because it is wrong information and not cosmetic issue.

soc-se-bot commented 2 years ago

Team's Response

No details provided by team.

The 'Original' Bug

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

Wrong error message for large index

When input an index that is larger than Integer.MAX_VALUE, the error message shown is not correct. Would expect to have both error messages be the same since both values provided are valid indices.

Within range:

image.png

Out of range:

image.png


[original: nus-cs2103-AY2122S2/pe-interim#1314] [original labels: severity.Low type.FeatureFlaw]

Their Response to the 'Original' Bug

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

While we agree that this issue is reproducible, we also believe this issue is caused by "extreme user behaviors", as defined in the PE admin guide:

Problems caused by extreme user behaviors:

If the problems can only happen in case of deliberate sabotage (e.g., user entered a 30-digit telephone number), in which case it should not be considered a bug.
However, if such input can be entered by a user mistake, they should not cause harm e.g., such mistakes should not crash the app, corrupt the data, or make it unusable.

We do not expect users to have more than 222 million jobs, as that is beyond the capabilities of our application. Such an input is not expected to occur in normal use.

Additionally, if it does somehow occur (e.g. by a "user mistake"):

  • it does not cause app crashes, or data corruption/loss, or an inability to use the program (since you can simply run some other command immediately)
  • the user will almost immediately notice that their index input is invalid, as it's likely that they will notice the abnormally large number used for the index.

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: My bug report and the 'original' bug report are not duplicates of each other. This is because they cannot be fixed independently. Fixing the error message when the integer overflows does not mean that it would be fixed for the case where the the input index is zero. They are two different cases that could be handled separately. Hence, they are not duplicates. Please also refer to the module policy on duplicates bugs based on what prof has answered in this issue:

45AA9E30-85CE-48EB-9DB2-6E534D43F1A4_4_5005_c.jpeg


:question: Issue response

Team chose [response.NotInScope]

Reason for disagreement: Firstly, I just want to point out that the team's response to the 'original' bug report does not explain why my bug report would be invalid because it is not an extreme user behaviour case as the team has replied to the 'original' report. They are two different cases.

Moreover, I believe that the error message is a bug. This issue is even covered in the module policy on specificity of error message. Please refer to the module policy here:

C9A4EA18-CAAE-48C0-AA93-F5F91B1217FA.jpeg

In the screenshot that I have provided above, it is clearly stated that the command format is persondelete INDEX in which persondelete 0 definitely follows the format correctly. However, the INDEX is an invalid value. Hence, to say that it is an invalid command format is not correct, it should be "index is invalid and should be non-zero positive integer not exceeding the size of the person list" for example.

Moreover, I do not think that this could qualify for NotInScope either.

Based on the module policy on NotInScope, it should not satisfy because the error message is not suitable (pointer 2):

6D312D17-EA67-46B9-9A82-87EDC4B89025_4_5005_c.jpeg

Based on the module policy on what cannot be considered as NotInScope:

C3D85540-8E49-4CD3-9E3C-E67C7BE8CF15_4_5005_c.jpeg

I believe that fixing this error message does not require much additional effort. The most it would take is 5 to 10 minutes.