Open ThawTunZan opened 7 months ago
Caused by same reason as #649.
[The team marked this bug as a duplicate of the following bug]
Wrong input can be added
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
[original: nus-cs2113-AY2324S2/pe-interim#742] [original labels: type.FunctionalityBug severity.High]
[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:
- 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.
- The scope of the bug is low. Only
-n
flag ofsell
is materially affected (since that is the only one configured to take arguments with whitespaces).- Our UG details the intended way of specifying options and flags, following which none of the above issues will be encountered.
- The consequences of a mistaken
sell
in no way renders our product "almost unusable for most users" as is the criteria for aSeverity.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]
The name flag was written wrongly but the program still tries to detect it as an item and could not identify that error