ThawTunZan / pe

0 stars 0 forks source link

Wrong error message #5

Open ThawTunZan opened 5 months ago

ThawTunZan commented 5 months ago

image.png

The error message says quantity has to be whole number even though it already is. The real error is the flag being written wrongly.

soc-se-bot commented 5 months ago

Team's Response

Accepted for same reason as #649.

The 'Original' Bug

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

Wrong input can be added

image.png

Can have a wrong user input and the program will not identify it.

This could be a problem because if the user had a typo and wanted to add let's say oranges anges as an item but the program identifies it as oranges instead and sells the wrong one as seen below

image.png


[original: nus-cs2113-AY2324S2/pe-interim#742] [original labels: type.FunctionalityBug severity.High]

Their Response to the 'Original' Bug

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

Thank you for bringing this to our attention. We are able to reproduce the bug as shown.

In our investigation, it came to light that our command parser handles option flag arguments even without a trailing whitespace. This means

$ sell -noranges -q1

$ sell -n oranges -q 1

are parsed no differently. Values "oranges" and "1" are assigned to options -n and -q respectively in both commands.

The behaviour you're witnessing is when on top of this, arguments themselves are intended to contain a whitespace. Then something like

$ sell -noranges anges -q1

$ sell -n oranges anges -q 1

would be parsed differently. Value "oranges" is assigned to the -n in the first command while "oranges anges" is assigned to the -n in the second command. That is why "oranges" get sold and not "oranges anges" as intended.

We recognize this as problematic behaviour users can encounter by mistake, and are of the opinion that this is of Severity.Medium for the following reasons:

  1. The likelihood of occurrence is low. Not only do users have to commit the typo in the first place, they have to have an item with the exact name of the mistaken input to be sold.
  2. The scope of the bug is low. Only -n flag of sell is materially affected (since that is the only one configured to take arguments with whitespaces).
  3. Our UG details the intended way of specifying options and flags, following which none of the above issues will be encountered.
  4. The consequences of a mistaken sell in no way renders our product "almost unusable for most users" as is the criteria for a Severity.High.

    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: [replace this with your explanation]