wx-03 / pe

0 stars 0 forks source link

Uncaught exception when invalid number of calories is parsed from storage #4

Open wx-03 opened 2 weeks ago

wx-03 commented 2 weeks ago

image.png

image.png

Steps to reproduce:

  1. Save a meal option with valid number of calories
  2. Exit the program
  3. Open the data/meal_options.csv file
  4. Edit the calories to a negative number
  5. Run the program

Expected: Program should handle the NumberFormatException thrown and show that the data has been corrupted Actual: Program does not handle the exception

soc-se-bot commented 1 week ago

Team's Response

We thank the bug reporter for bringing this to our attention.

The 'Original' Bug

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

When data is edited from storage, negative number can be saved for calories

image.png

Steps to reproduce:

  1. Save a meal option with valid number of calories
  2. Exit the program
  3. Open the data/meal_options.csv file
  4. Edit the calories to a negative number
  5. Run the program
  6. Execute meal menu command

Expected: Program should show that invalid entry is detected upon loading data Actual: Program loads invalid data


[original: nus-cs2113-AY2425S1/pe-interim#659] [original labels: severity.Low type.FunctionalityBug]

Their Response to the 'Original' Bug

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

No details provided by team.

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: I disagree that this is a duplicate bug because the 'original' bug shows changing an integer to a negative one, while this bug shows changing an integer to a String. Fixing the 'original' bug (by checking that the number of calories is positive) does not solve this bug. In addition, changing an integer to a negative one does not cause any uncaught exceptions, but changing an integer to a String causes the program to crash due to the uncaught exception.


## :question: Issue severity Team chose [`severity.Low`] Originally [`severity.Medium`] - [x] I disagree **Reason for disagreement:** This uncaught exception makes the program unable to run, and users cannot continue using the program, which by definition is considered high severity. But given that this occurs only rarely when the user edits the file, I think the severity can be lowered from high to medium. In addition, for a bug to be considered of low severity, it has to be unlikely to affect normal operations of the product, but this bug makes the program unusable, so it should not be of low severity.