ThawTunZan / pe

0 stars 0 forks source link

Wrong input can be added #7

Open ThawTunZan opened 7 months ago

ThawTunZan commented 7 months ago

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

nus-pe-bot commented 7 months ago

Team's Response

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 severity

Team chose [severity.Medium] Originally [severity.High]

Reason for disagreement: [replace this with your explanation]