nus-cs2113-AY2324S2 / pe-dev-response

0 stars 0 forks source link

Invalid expiry date #1795

Open nus-pe-bot opened 2 months ago

nus-pe-bot commented 2 months ago

image.png

input an invalid expiry date for an inventory item but managed to add, item added with a different expiry date


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

YHWong20 commented 2 months ago

Team's Response

This is an interesting catch. I was able to reproduce this bug using different dates, such as 31-02-2025 (which is resolved to 28-02-2025), or 31-06-2024 (which is resolved to 30-06-2024).

I have done a bit of research on this, and this appears to be an odd quirk of the java.time.format.DateTimeFormatter class.

This was an oversight on my part, as I wasn't aware of the different types of year formatters that can be used.

I thus accept that this is a valid bug, however, I do not agree with the bug severity.

In most cases, invalid dates are appropriately handled by the application (i.e., if I were to pass in something like 30-30-2030, the application correctly recognizes that this is seriously invalid and will reject the user's input).

In this case, while the provided date is invalid, the resolved date is valid. The application does not crash or become unusable due to this bug, and hence a High severity is unjustified here.

Furthermore, I also believe that this issue does not hamper the user's ability to use the product. In such cases, if a user were to input a date like 31-04-2024, it is extremely likely that they were simply mistaken, with respect to the number of days in a month.

Assuming that they intended to input the last day of the month as the item's expiration date, our application will correctly resolve the date accordingly (to the correct date). No usability issues are created for the user, and to reiterate on my previous point, this is a rare occurrence. Thus, Medium severity is not justified as well.

Therefore, I believe, and accept, that this bug is of a Low severity.

Duplicate status (if any):

--